pub struct TokenMatch {
pub token_type: TokenType,
pub close: Option<Vec<u8>>,
pub advance: usize,
}Expand description
Result of a successful trie match.
Note: advance is set automatically by TokenTrie::insert() based on
the pattern length. Any value provided by the caller will be overwritten.
Fields§
§token_type: TokenType§close: Option<Vec<u8>>Closing byte sequence (e.g., */ for block comments, " for strings).
None for line comments (they end at newline).
advance: usizeHow many bytes to advance past the matched token (set by insert).
Trait Implementations§
Source§impl Clone for TokenMatch
impl Clone for TokenMatch
Source§fn clone(&self) -> TokenMatch
fn clone(&self) -> TokenMatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenMatch
impl Debug for TokenMatch
Source§impl PartialEq for TokenMatch
impl PartialEq for TokenMatch
impl Eq for TokenMatch
impl StructuralPartialEq for TokenMatch
Auto Trait Implementations§
impl Freeze for TokenMatch
impl RefUnwindSafe for TokenMatch
impl Send for TokenMatch
impl Sync for TokenMatch
impl Unpin for TokenMatch
impl UnsafeUnpin for TokenMatch
impl UnwindSafe for TokenMatch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.