Struct aho_corasick::nfa::noncontiguous::QueuedSet

source ·
struct QueuedSet {
    set: Option<BTreeSet<StateID>>,
}
Expand description

A set of state identifiers used to avoid revisiting the same state multiple times when filling in failure transitions.

This set has an “inert” and an “active” mode. When inert, the set never stores anything and always returns false for every member test. This is useful to avoid the performance and memory overhead of maintaining this set when it is not needed.

Fields§

§set: Option<BTreeSet<StateID>>

Implementations§

source§

impl QueuedSet

source

fn inert() -> QueuedSet

Return an inert set that returns false for every state ID membership test.

source

fn active() -> QueuedSet

Return an active set that tracks state ID membership.

source

fn insert(&mut self, state_id: StateID)

Inserts the given state ID into this set. (If the set is inert, then this is a no-op.)

source

fn contains(&self, state_id: StateID) -> bool

Returns true if and only if the given state ID is in this set. If the set is inert, this always returns false.

Trait Implementations§

source§

impl Debug for QueuedSet

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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>,

§

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>,

§

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.