Struct Transition

pub struct Transition { pub start: u8, pub end: u8, pub next: StateID }

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, 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, 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, byte: u8) -> bool

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

Trait Implementations

impl Clone for Transition

fn clone(&self) -> Self

impl Copy for Transition

impl Debug for Transition

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

impl Eq for Transition

impl Hash for Transition

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

impl PartialEq for Transition

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

impl StructuralPartialEq for Transition

Auto Trait Implementations

impl Freeze for Transition

impl RefUnwindSafe for Transition

impl Send for Transition

impl Sync for Transition

impl Unpin for Transition

impl UnsafeUnpin for Transition

impl UnwindSafe for Transition

Blanket Implementations

impl<T> Any for Transition where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Transition where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Transition where T: ?Sized,

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

impl<T> CloneToUninit for Transition where T: Clone,

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

impl<T> From<T> for Transition

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Transition where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Transition where U: From<T>,

fn into(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<U> for Transition where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Transition where U: TryFrom<T>,

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