Enum aho_corasick::nfa::contiguous::StateTrans
source · enum StateTrans<'a> {
Sparse {
classes: &'a [u32],
nexts: &'a [u32],
},
One {
class: u8,
next: u32,
},
Dense {
class_to_next: &'a [u32],
},
}
Expand description
The underlying representation of sparse or dense transitions for a state.
Note that like State
, we don’t typically construct values of this type
during a search since we don’t always need all values and thus would
represent a lot of wasteful work.
Variants§
Sparse
A sparse representation of transitions for a state, where only non-FAIL transitions are explicitly represented.
Fields
One
A “one transition” state that is never a match state.
These are by far the most common state, so we use a specialized and very compact representation for them.
Fields
Dense
A dense representation of transitions for a state, where all transitions are explicitly represented, including transitions to the FAIL state.
Fields
class_to_next: &'a [u32]
A dense set of transitions to other states. The transitions may point to a FAIL state, in which case, the search should try the same transition lookup at ‘fail’.
Note that this is indexed by byte equivalence classes and not byte values. That means ‘class_to_next[byte]’ is wrong and ‘class_to_next[classes.get(byte)]’ is correct. The number of transitions is always equivalent to ‘classes.alphabet_len()’.
Trait Implementations§
source§impl<'a> Clone for StateTrans<'a>
impl<'a> Clone for StateTrans<'a>
source§fn clone(&self) -> StateTrans<'a>
fn clone(&self) -> StateTrans<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for StateTrans<'a>
impl<'a> RefUnwindSafe for StateTrans<'a>
impl<'a> Send for StateTrans<'a>
impl<'a> Sync for StateTrans<'a>
impl<'a> Unpin for StateTrans<'a>
impl<'a> UnwindSafe for StateTrans<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)