Struct throne::State[][src]

pub struct State { /* fields omitted */ }
Expand description

Stores a set of Phrases.

Implementations

Removes a phrase by PhraseId.

Removes the first occurrence of phrase from the state.

Returns false if the phrase could not be found.

Removes any phrases matching the provided pattern.

If match_pattern_length is true, only phrases matching the exact length of the provided pattern will be removed. Otherwise, phrases longer than the provided pattern may be removed, if their beginning subset matches the pattern.

Adds a new phrase to the State and returns a PhraseId referencing the newly added phrase.

Returns the number of phrases in the State.

Returns an iterator of references to phrases in the State.

Returns the Phrase referenced by the provided PhraseId.

Constructs and returns a Vec of all phrases in the State.

Returns an iterator of references to phrases matching the provided pattern.

If match_pattern_length is true, only phrases matching the exact length of the provided pattern will be returned. Otherwise, phrases longer than the provided pattern may be returned, if their beginning subset matches the pattern.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.