pub struct Token<K> {
pub kind: K,
pub span: Range<usize>,
}Expand description
Represents a single kind in the source code.
Tokens are the fundamental units of lexical analysis, representing categorized pieces of source text with their position information.
Fields§
§kind: KThe kind/category of this kind (e.g., keyword, identifier, number)
span: Range<usize>The byte range in the source text that this kind occupies
Implementations§
Trait Implementations§
impl<K: Copy> Copy for Token<K>
impl<K: Eq> Eq for Token<K>
impl<K> StructuralPartialEq for Token<K>
Auto Trait Implementations§
impl<K> Freeze for Token<K>where
K: Freeze,
impl<K> RefUnwindSafe for Token<K>where
K: RefUnwindSafe,
impl<K> Send for Token<K>where
K: Send,
impl<K> Sync for Token<K>where
K: Sync,
impl<K> Unpin for Token<K>where
K: Unpin,
impl<K> UnwindSafe for Token<K>where
K: 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