Struct regex_automata::hybrid::dfa::LazyRef

source ·
struct LazyRef<'i, 'c> {
    dfa: &'i DFA,
    cache: &'c Cache,
}
Expand description

A type that groups methods that require the base NFA/DFA and read-only access to the cache.

Fields§

§dfa: &'i DFA§cache: &'c Cache

Implementations§

source§

impl<'i, 'c> LazyRef<'i, 'c>

source

fn new(dfa: &'i DFA, cache: &'c Cache) -> LazyRef<'i, 'c>

Creates a new ‘Lazy’ wrapper for a DFA and its corresponding cache.

source

fn get_cached_start_id( &self, anchored: Anchored, start: Start, ) -> Result<LazyStateID, StartError>

Return the ID of the start state for the given configuration.

If the start state has not yet been computed, then this returns an unknown lazy state ID.

source

fn get_cached_state(&self, sid: LazyStateID) -> &State

Return the cached NFA/DFA powerset state for the given ID.

This panics if the given ID does not address a valid state.

source

fn is_sentinel(&self, id: LazyStateID) -> bool

Returns true if and only if the given ID corresponds to a “sentinel” state.

A sentinel state is a state that signifies a special condition of search, and where every transition maps back to itself. See LazyStateID for more details. Note that start and match states are not sentinels since they may otherwise be real states with non-trivial transitions. The purposes of sentinel states is purely to indicate something. Their transitions are not meant to be followed.

source

fn unknown_id(&self) -> LazyStateID

Returns the ID of the unknown state for this lazy DFA.

source

fn dead_id(&self) -> LazyStateID

Returns the ID of the dead state for this lazy DFA.

source

fn quit_id(&self) -> LazyStateID

Returns the ID of the quit state for this lazy DFA.

source

fn is_valid(&self, id: LazyStateID) -> bool

Returns true if and only if the given ID is valid.

An ID is valid if it is both a valid index into the transition table and is a multiple of the DFA’s stride.

source

fn state_fits_in_cache(&self, state: &State) -> bool

Returns true if adding the state given would fit in this cache.

source

fn state_builder_fits_in_cache(&self, state: &StateBuilderNFA) -> bool

Returns true if adding the state to be built by the given builder would fit in this cache.

source

fn memory_usage_for_one_more_state(&self, state_heap_size: usize) -> usize

Returns the additional memory usage, in bytes, required to add one more state to this cache. The given size should be the heap size, in bytes, that would be used by the new state being added.

Trait Implementations§

source§

impl<'i, 'c> Debug for LazyRef<'i, 'c>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'i, 'c> Freeze for LazyRef<'i, 'c>

§

impl<'i, 'c> RefUnwindSafe for LazyRef<'i, 'c>

§

impl<'i, 'c> Send for LazyRef<'i, 'c>

§

impl<'i, 'c> Sync for LazyRef<'i, 'c>

§

impl<'i, 'c> Unpin for LazyRef<'i, 'c>

§

impl<'i, 'c> UnwindSafe for LazyRef<'i, 'c>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.