pub struct LexedStream<'lexer, 'stream> { /* private fields */ }Expand description
§Summary
LexedStream is the interface used to tokenize a stream. To do
so, you first create a Lexer which defines the lexing grammar.
You then create the LexedStream with an exclusive reference to
a [StringStream][beans::stream::StringStream]. Then, you get the
tokens through LexedStream, which will consume the stream but
only for as much as you require. This allows you to use a Lexer
for many [StringStream][beans::stream::StringStream], and
conversely to tokenize a single
[StringStream][beans::stream::StringStream] with different
Lexer.
Implementations§
Source§impl<'lexer, 'stream> LexedStream<'lexer, 'stream>
impl<'lexer, 'stream> LexedStream<'lexer, 'stream>
Sourcepub fn new(lexer: &'lexer Lexer, stream: &'stream mut StringStream) -> Self
pub fn new(lexer: &'lexer Lexer, stream: &'stream mut StringStream) -> Self
Create a new LexedStream instance.
Trait Implementations§
Auto Trait Implementations§
impl<'lexer, 'stream> Freeze for LexedStream<'lexer, 'stream>
impl<'lexer, 'stream> RefUnwindSafe for LexedStream<'lexer, 'stream>
impl<'lexer, 'stream> !Send for LexedStream<'lexer, 'stream>
impl<'lexer, 'stream> !Sync for LexedStream<'lexer, 'stream>
impl<'lexer, 'stream> Unpin for LexedStream<'lexer, 'stream>
impl<'lexer, 'stream> !UnwindSafe for LexedStream<'lexer, 'stream>
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> 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