pub enum Tokens {
ProductionToken(Productions),
MathToken(Math),
MetadataToken(Metadata),
}
Expand description
An enum that holds the different types of tokens for the different lexers.
Variants§
ProductionToken(Productions)
Tokens created by the Productions lexer.
MathToken(Math)
Tokens created by the Math lexer.
MetadataToken(Metadata)
Tokens created by the Metadata lexer.
Trait Implementations§
Source§impl<'source> ResultNext<Tokens, LexingError> for LexerBridge<'source>
impl<'source> ResultNext<Tokens, LexingError> for LexerBridge<'source>
Source§fn next_result(&mut self) -> Result<Tokens, LexingError>
fn next_result(&mut self) -> Result<Tokens, LexingError>
If you have an iterator that holds
Result
items, you start having to deal with nested Some(Ok(...))
patterns,
which gets annoying quickly. This trait is intended so that the iterator always returns some sort of Result
, which can then be unwrapped as needed (probably using ?
). Read moreSource§impl<'source> ResultPeek<Tokens, LexingError> for LexerBridge<'source>
impl<'source> ResultPeek<Tokens, LexingError> for LexerBridge<'source>
Source§fn peek_result(&mut self) -> Result<&Tokens, LexingError>
fn peek_result(&mut self) -> Result<&Tokens, LexingError>
See
next_result
. Read moreimpl StructuralPartialEq for Tokens
Auto Trait Implementations§
impl Freeze for Tokens
impl RefUnwindSafe for Tokens
impl Send for Tokens
impl Sync for Tokens
impl Unpin for Tokens
impl UnwindSafe for Tokens
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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