Struct SparseTransitions

struct SparseTransitions { ... }

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

impl SparseTransitions

fn matches(self: &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.

fn matches_byte(self: &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.

impl Clone for SparseTransitions

fn clone(self: &Self) -> SparseTransitions

impl Debug for SparseTransitions

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for SparseTransitions

impl Freeze for SparseTransitions

impl PartialEq for SparseTransitions

fn eq(self: &Self, other: &SparseTransitions) -> bool

impl RefUnwindSafe for SparseTransitions

impl Send for SparseTransitions

impl StructuralPartialEq for SparseTransitions

impl Sync for SparseTransitions

impl Unpin for SparseTransitions

impl UnsafeUnpin for SparseTransitions

impl UnwindSafe for SparseTransitions

impl<T> Any for SparseTransitions

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for SparseTransitions

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for SparseTransitions

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for SparseTransitions

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for SparseTransitions

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for SparseTransitions

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for SparseTransitions

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for SparseTransitions

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for SparseTransitions

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>