pub struct SparseTransitions {
pub transitions: Box<[Transition]>,
}
nfa-thompson
only.Expand description
A sequence of transitions used to represent a sparse state.
This is the primary representation of a Sparse
state.
It corresponds to a sorted sequence of transitions with non-overlapping
byte ranges. If the byte at the current position in the haystack matches
one of the byte ranges, then the finite state machine should take the
corresponding transition.
Fields§
§transitions: Box<[Transition]>
The sorted sequence of non-overlapping transitions.
Implementations§
Source§impl SparseTransitions
impl SparseTransitions
Sourcepub fn matches(&self, haystack: &[u8], at: usize) -> Option<StateID>
pub fn matches(&self, haystack: &[u8], at: usize) -> Option<StateID>
This follows the matching transition for a particular byte.
The matching transition is found by looking for a matching byte
range (there is at most one) corresponding to the position at
in
haystack
.
If at >= haystack.len()
, then this returns None
.
Sourcepub fn matches_byte(&self, byte: u8) -> Option<StateID>
pub fn matches_byte(&self, byte: u8) -> Option<StateID>
This follows the matching transition for a particular byte.
The matching transition is found by looking for a matching byte range (there is at most one) corresponding to the byte given.
Trait Implementations§
Source§impl Clone for SparseTransitions
impl Clone for SparseTransitions
Source§fn clone(&self) -> SparseTransitions
fn clone(&self) -> SparseTransitions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SparseTransitions
impl Debug for SparseTransitions
Source§impl PartialEq for SparseTransitions
impl PartialEq for SparseTransitions
impl Eq for SparseTransitions
impl StructuralPartialEq for SparseTransitions
Auto Trait Implementations§
impl Freeze for SparseTransitions
impl RefUnwindSafe for SparseTransitions
impl Send for SparseTransitions
impl Sync for SparseTransitions
impl Unpin for SparseTransitions
impl UnwindSafe for SparseTransitions
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: 16 bytes