pub enum Token<S> {
Word(S),
Num(S),
Str(S, Vec<StrPart<S, Self>>),
Op(S),
Char(S),
Block(S, Vec<Self>),
}Expand description
Token (tree) generic over string type S.
Variants§
Word(S)
keywords such as def, but also identifiers such as map, $x, or @csv
Num(S)
number
Str(S, Vec<StrPart<S, Self>>)
(interpolated) string, surrounded by opening and closing ‘“’
Op(S)
binary operator, such as | or +=
Note that this includes - (negation) also when it is used as unary operator.
Char(S)
punctuation, such as . or ;
Block(S, Vec<Self>)
delimited tokens, e.g. (...) or [...]
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Token<S>where
S: Freeze,
impl<S> RefUnwindSafe for Token<S>where
S: RefUnwindSafe,
impl<S> Send for Token<S>where
S: Send,
impl<S> Sync for Token<S>where
S: Sync,
impl<S> Unpin for Token<S>where
S: Unpin,
impl<S> UnwindSafe for Token<S>where
S: UnwindSafe,
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