pub enum TransitionKind {
Epsilon,
Consume,
CounterReset(CounterId),
CounterIncrement(CounterId),
CounterMaxGuard(CounterId),
CounterMinGuard(CounterId),
}Expand description
Type of transition between NFA states
Variants§
Epsilon
Epsilon transition (no input consumed, always available)
Consume
Consuming transition (requires matching the target state’s term)
CounterReset(CounterId)
Reset a counter to 0 (entering a counted region)
CounterIncrement(CounterId)
Increment a counter by 1 (completed one loop iteration)
CounterMaxGuard(CounterId)
Guard: pass only if counter < def.max (loop back)
CounterMinGuard(CounterId)
Guard: pass only if counter >= def.min (exit loop)
Implementations§
Source§impl TransitionKind
impl TransitionKind
Sourcepub fn is_epsilon_like(&self) -> bool
pub fn is_epsilon_like(&self) -> bool
Check if this transition is epsilon-like (does not consume input).
All counter transitions are epsilon-like; only Consume is not.
Sourcepub fn offset_counter(self, offset: CounterId) -> Self
pub fn offset_counter(self, offset: CounterId) -> Self
Offset counter IDs by the given amount (for fragment/table composition). Returns self unchanged for non-counter transitions.
Trait Implementations§
Source§impl Clone for TransitionKind
impl Clone for TransitionKind
Source§fn clone(&self) -> TransitionKind
fn clone(&self) -> TransitionKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TransitionKind
Source§impl Debug for TransitionKind
impl Debug for TransitionKind
impl Eq for TransitionKind
Source§impl Hash for TransitionKind
impl Hash for TransitionKind
Source§impl PartialEq for TransitionKind
impl PartialEq for TransitionKind
Source§fn eq(&self, other: &TransitionKind) -> bool
fn eq(&self, other: &TransitionKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TransitionKind
Auto Trait Implementations§
impl Freeze for TransitionKind
impl RefUnwindSafe for TransitionKind
impl Send for TransitionKind
impl Sync for TransitionKind
impl Unpin for TransitionKind
impl UnsafeUnpin for TransitionKind
impl UnwindSafe for TransitionKind
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