pub struct Token<'s> {
pub kind: Kind,
pub text: &'s str,
pub span: Range<usize>,
}Expand description
A token with its source text and byte span.
Fields§
§kind: KindThe kind.
text: &'s strThe source text.
span: Range<usize>The byte span in the input.
Trait Implementations§
Source§impl ContainsToken<&Token<'_>> for Kind
impl ContainsToken<&Token<'_>> for Kind
Source§fn contains_token(&self, token: &Token<'_>) -> bool
fn contains_token(&self, token: &Token<'_>) -> bool
Returns true if self contains the token
Source§impl<const LEN: usize> ContainsToken<&Token<'_>> for [Kind; LEN]
impl<const LEN: usize> ContainsToken<&Token<'_>> for [Kind; LEN]
Source§fn contains_token(&self, token: &Token<'_>) -> bool
fn contains_token(&self, token: &Token<'_>) -> bool
Returns true if self contains the token
impl<'s> Eq for Token<'s>
impl<'s> StructuralPartialEq for Token<'s>
Auto Trait Implementations§
impl<'s> Freeze for Token<'s>
impl<'s> RefUnwindSafe for Token<'s>
impl<'s> Send for Token<'s>
impl<'s> Sync for Token<'s>
impl<'s> Unpin for Token<'s>
impl<'s> UnsafeUnpin for Token<'s>
impl<'s> UnwindSafe for Token<'s>
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