Struct StackRecognizer
pub struct StackRecognizer<S, R>where
S: Copy,
R: FunctionalRecognizer<S>,{ /* private fields */ }
Implementations§
§impl<S, R> StackRecognizer<S, R>where
S: Copy,
R: FunctionalRecognizer<S>,
impl<S, R> StackRecognizer<S, R>where
S: Copy,
R: FunctionalRecognizer<S>,
pub fn from(rec: R) -> StackRecognizer<S, R>
pub fn reset(&mut self)
pub fn recognizer(&self) -> &R
pub fn recognizer_mut(&mut self) -> &mut R
Trait Implementations§
§impl<S, R> Clone for StackRecognizer<S, R>
impl<S, R> Clone for StackRecognizer<S, R>
§fn clone(&self) -> StackRecognizer<S, R>
fn clone(&self) -> StackRecognizer<S, R>
Returns a copy 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 more§impl<S, R> Debug for StackRecognizer<S, R>
impl<S, R> Debug for StackRecognizer<S, R>
§impl<S, R> Recognizer for StackRecognizer<S, R>
impl<S, R> Recognizer for StackRecognizer<S, R>
§fn trie_finished(&mut self)
fn trie_finished(&mut self)
Called when iteration over the trie is finished
Stack has exactly one element then, except when iteration started from non-root node.
In that case, the stack may have more than one element, and trie_finished() needs to pop the excessive elements.
§fn collapse(&mut self)
fn collapse(&mut self)
“Collapse” the stack so that it consists only of its former
top element.
X = stack.top(); stack.empty(); stack.push(X)
§fn special_allowed(&mut self, tok: SpecialToken) -> bool
fn special_allowed(&mut self, tok: SpecialToken) -> bool
check if stack.top() transitions via tok to a viable state
§fn try_push_byte(&mut self, byte: u8) -> bool
fn try_push_byte(&mut self, byte: u8) -> bool
This combines
push_byte
and byte_allowed
into one function for performance.§fn byte_allowed(&mut self, byte: u8) -> bool
fn byte_allowed(&mut self, byte: u8) -> bool
check if stack.top() transitions via byte to a viable state
§fn trie_started(&mut self)
fn trie_started(&mut self)
Called when iteration over the trie is started
Auto Trait Implementations§
impl<S, R> Freeze for StackRecognizer<S, R>where
R: Freeze,
impl<S, R> RefUnwindSafe for StackRecognizer<S, R>where
R: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, R> Send for StackRecognizer<S, R>
impl<S, R> Sync for StackRecognizer<S, R>
impl<S, R> Unpin for StackRecognizer<S, R>
impl<S, R> UnwindSafe for StackRecognizer<S, R>where
R: UnwindSafe,
S: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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