pub struct Transition {
pub start: u8,
pub end: u8,
pub next: StateID,
}
nfa-thompson
only.Expand description
A single transition to another state.
This transition may only be followed if the current byte in the haystack falls in the inclusive range of bytes specified.
Fields§
§start: u8
The inclusive start of the byte range.
end: u8
The inclusive end of the byte range.
next: StateID
The identifier of the state to transition to.
Implementations§
Source§impl Transition
impl Transition
Sourcepub fn matches(&self, haystack: &[u8], at: usize) -> bool
pub fn matches(&self, haystack: &[u8], at: usize) -> bool
Returns true if the position at
in haystack
falls in this
transition’s range of bytes.
If at >= haystack.len()
, then this returns false
.
Sourcepub fn matches_unit(&self, unit: Unit) -> bool
pub fn matches_unit(&self, unit: Unit) -> bool
Returns true if the given alphabet unit falls in this transition’s
range of bytes. If the given unit is EOI
, then
this returns false
.
Sourcepub fn matches_byte(&self, byte: u8) -> bool
pub fn matches_byte(&self, byte: u8) -> bool
Returns true if the given byte falls in this transition’s range of bytes.
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
Source§fn clone(&self) -> Transition
fn clone(&self) -> Transition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Transition
impl Debug for Transition
Source§impl Hash for Transition
impl Hash for Transition
Source§impl PartialEq for Transition
impl PartialEq for Transition
impl Copy for Transition
impl Eq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnwindSafe for Transition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes