pub(super) struct ComposerParser<'a> {
composer_state: &'a ComposerState,
iter: TextIter,
end: TextIter,
}
Expand description
A message composer parser.
Fields§
§composer_state: &'a ComposerState
The composer state associated with the buffer.
iter: TextIter
The current position of the iterator in the buffer.
end: TextIter
The position of the end of the buffer.
Implementations§
Source§impl<'a> ComposerParser<'a>
impl<'a> ComposerParser<'a>
Sourcepub(super) fn new(
composer_state: &'a ComposerState,
bounds: Option<(TextIter, TextIter)>,
) -> Self
pub(super) fn new( composer_state: &'a ComposerState, bounds: Option<(TextIter, TextIter)>, ) -> Self
Construct a ComposerParser
to parse the message composer with the
given state, and between the given bounds.
If no bounds are provided, the whole content of the composer will be parsed.
Sourcefn message_len(&self) -> usize
fn message_len(&self) -> usize
The length of the message between the two iterators.
Sourcefn next_chunk(&mut self) -> Option<ComposerChunk>
fn next_chunk(&mut self) -> Option<ComposerChunk>
Get the next chunk of the composer and update the iterator position.
Sourcepub(super) async fn into_message_event_content(
self,
markdown_enabled: bool,
) -> Option<RoomMessageEventContentWithoutRelation>
pub(super) async fn into_message_event_content( self, markdown_enabled: bool, ) -> Option<RoomMessageEventContentWithoutRelation>
Parse the content of the message composer into the content of a message event.
Sourcepub(super) fn into_plain_text(self) -> String
pub(super) fn into_plain_text(self) -> String
Parse the content of the message composer into a string.
Sourcepub(super) fn into_composer_draft(self) -> Option<ComposerDraft>
pub(super) fn into_composer_draft(self) -> Option<ComposerDraft>
Parse the content of the message composer into a ComposerDraft
.
Auto Trait Implementations§
impl<'a> Freeze for ComposerParser<'a>
impl<'a> !RefUnwindSafe for ComposerParser<'a>
impl<'a> !Send for ComposerParser<'a>
impl<'a> !Sync for ComposerParser<'a>
impl<'a> Unpin for ComposerParser<'a>
impl<'a> !UnwindSafe for ComposerParser<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more