Struct Transition

struct Transition { ... }

A single transition to another state.

This transition may only be followed if the current byte in the haystack falls in the inclusive range of bytes specified.

Fields

start: u8

The inclusive start of the byte range.

end: u8

The inclusive end of the byte range.

next: StateID

The identifier of the state to transition to.

Implementations

impl Transition

fn matches(self: &Self, haystack: &[u8], at: usize) -> bool

Returns true if the position at in haystack falls in this transition's range of bytes.

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

fn matches_unit(self: &Self, unit: Unit) -> bool

Returns true if the given alphabet unit falls in this transition's range of bytes. If the given unit is EOI, then this returns false.

fn matches_byte(self: &Self, byte: u8) -> bool

Returns true if the given byte falls in this transition's range of bytes.

impl Clone for Transition

fn clone(self: &Self) -> Transition

impl Copy for Transition

impl Debug for Transition

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

impl Eq for Transition

impl Freeze for Transition

impl Hash for Transition

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl PartialEq for Transition

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

impl RefUnwindSafe for Transition

impl Send for Transition

impl StructuralPartialEq for Transition

impl Sync for Transition

impl Unpin for Transition

impl UnsafeUnpin for Transition

impl UnwindSafe for Transition

impl<T> Any for Transition

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Transition

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

impl<T> BorrowMut for Transition

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

impl<T> CloneToUninit for Transition

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

impl<T> From for Transition

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Transition

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

impl<T, U> Into for Transition

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 Transition

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

impl<T, U> TryInto for Transition

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