Enum wagon_lexer::Tokens
source · 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 PartialEq for Tokens
impl PartialEq for Tokens
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