Struct DenseTransitions

struct DenseTransitions { ... }

A sequence of transitions used to represent a dense state.

This is the primary representation of a Dense state. It provides constant time matching. That is, given a byte in a haystack and a DenseTransitions, one can determine if the state matches in constant time.

This is in contrast to SparseTransitions, whose time complexity is necessarily bigger than constant time. Also in contrast, DenseTransitions usually requires (much) more heap memory.

Fields

transitions: Box<[StateID]>

A dense representation of this state's transitions on the heap. This always has length 256.

Implementations

impl DenseTransitions

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 transition that doesn't correspond to StateID::ZERO for the byte at the given position 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 transition that doesn't correspond to StateID::ZERO for the given byte.

If at >= haystack.len(), then this returns None.

impl Clone for DenseTransitions

fn clone(self: &Self) -> DenseTransitions

impl Debug for DenseTransitions

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

impl Eq for DenseTransitions

impl Freeze for DenseTransitions

impl PartialEq for DenseTransitions

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

impl RefUnwindSafe for DenseTransitions

impl Send for DenseTransitions

impl StructuralPartialEq for DenseTransitions

impl Sync for DenseTransitions

impl Unpin for DenseTransitions

impl UnsafeUnpin for DenseTransitions

impl UnwindSafe for DenseTransitions

impl<T> Any for DenseTransitions

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for DenseTransitions

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

impl<T> BorrowMut for DenseTransitions

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

impl<T> CloneToUninit for DenseTransitions

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

impl<T> From for DenseTransitions

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for DenseTransitions

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

impl<T, U> Into for DenseTransitions

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 DenseTransitions

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

impl<T, U> TryInto for DenseTransitions

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