pub struct Transition {
pub start: u8,
pub end: u8,
pub next: StateID,
}
Available on crate feature
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
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
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
)