pub struct GrammarMatcher { /* private fields */ }Implementations§
Source§impl GrammarMatcher
impl GrammarMatcher
pub fn new(parser: TokenParser) -> Self
pub fn deep_clone(&self) -> Self
Sourcepub fn compute_mask(&mut self) -> Result<MaskOutcome, GrammarRuntimeError>
pub fn compute_mask(&mut self) -> Result<MaskOutcome, GrammarRuntimeError>
§Errors
Returns GrammarRuntimeError when the parser reaches a genuine error
state (distinct from a benign grammar completion).
Sourcepub fn consume_token(&mut self, token: u32) -> Result<(), GrammarRuntimeError>
pub fn consume_token(&mut self, token: u32) -> Result<(), GrammarRuntimeError>
§Errors
Returns GrammarRuntimeError when consuming the token drives the parser
into a genuine error state. A token that completes the grammar is a
benign stop and yields Ok(()).
Sourcepub fn reset(&mut self) -> Result<(), GrammarRuntimeError>
pub fn reset(&mut self) -> Result<(), GrammarRuntimeError>
§Errors
Returns GrammarRuntimeError when the parser cannot be reset.
Auto Trait Implementations§
impl !RefUnwindSafe for GrammarMatcher
impl !UnwindSafe for GrammarMatcher
impl Freeze for GrammarMatcher
impl Send for GrammarMatcher
impl Sync for GrammarMatcher
impl Unpin for GrammarMatcher
impl UnsafeUnpin for GrammarMatcher
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more