pub struct LineTokenizer<'grammar> { /* private fields */ }Expand description
Reusable line tokenizer for one compiled grammar.
The tokenizer keeps runtime scratch that is not part of immutable grammar data, such as dynamically resolved end regexes. Reuse one tokenizer across a blob or visible range to avoid recompiling those regexes unnecessarily.
Implementations§
Source§impl<'grammar> LineTokenizer<'grammar>
impl<'grammar> LineTokenizer<'grammar>
Sourcepub fn clear_caches(&mut self)
pub fn clear_caches(&mut self)
Clears cached dynamic end regexes while retaining allocations.
Trait Implementations§
Auto Trait Implementations§
impl<'grammar> Freeze for LineTokenizer<'grammar>
impl<'grammar> RefUnwindSafe for LineTokenizer<'grammar>
impl<'grammar> Send for LineTokenizer<'grammar>
impl<'grammar> Sync for LineTokenizer<'grammar>
impl<'grammar> Unpin for LineTokenizer<'grammar>
impl<'grammar> UnsafeUnpin for LineTokenizer<'grammar>
impl<'grammar> UnwindSafe for LineTokenizer<'grammar>
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