Struct ScanMatch
pub struct ScanMatch {
pub rank: usize,
pub token_id: TokenId,
pub len_bytes: usize,
}Expand description
A match starting exactly at the scan position.
Fields§
§rank: usizeIndex into the ranked spec list (smaller = higher rank).
token_id: TokenId§len_bytes: usizeMatch length in bytes from the scan position (the caller’s line tracker
converts to code points when it feeds the matched slice). Can be 0 for
a nullable spec (e.g. a* at a non-matching position) — Scanner does
not reject nullable patterns; the front-ends (basic lexer, dynamic
Earley) reject zero-width TERMINALS at grammar-build time, so a real
parse never lexes a zero-width match.
Trait Implementations§
impl Copy for ScanMatch
impl Eq for ScanMatch
impl StructuralPartialEq for ScanMatch
Auto Trait Implementations§
impl Freeze for ScanMatch
impl RefUnwindSafe for ScanMatch
impl Send for ScanMatch
impl Sync for ScanMatch
impl Unpin for ScanMatch
impl UnsafeUnpin for ScanMatch
impl UnwindSafe for ScanMatch
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