pub struct Token { /* private fields */ }Expand description
One token with a line-relative UTF-8 byte range and exact ordered scopes.
Implementations§
Source§impl Token
impl Token
Sourcepub fn range(&self) -> Range<usize> ⓘ
pub fn range(&self) -> Range<usize> ⓘ
Returns the line-relative UTF-8 byte range, excluding line terminators.
Sourcepub fn scopes(&self) -> Scopes<'_> ⓘ
pub fn scopes(&self) -> Scopes<'_> ⓘ
Iterates scope names from outermost to innermost without allocating.
Sourcepub fn scope_stack(&self) -> Option<ScopeStackId>
pub fn scope_stack(&self) -> Option<ScopeStackId>
Returns the interned scope-stack key (including incremental output).
Document keys are comparable only within the same document. Incremental keys are comparable across calls to the same tokenizer or session, including after reset, but not with document keys or other tokenizers.
Trait Implementations§
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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