Struct regex_automata::nfa::thompson::SparseTransitions
source · pub struct SparseTransitions {
pub transitions: Box<[Transition]>,
}
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
source§fn eq(&self, other: &SparseTransitions) -> bool
fn eq(&self, other: &SparseTransitions) -> bool
self
and other
values to be equal, and is used
by ==
.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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)