pub struct StateSet(_);
Expand description

Store and retrieve values by TypeId. This allows storing arbitrary data that implements Sync + Send + 'static.

Implementations

Create an empty StateSet.

Insert a value into this StateSet.

If a value of this type already exists, it will be returned.

Check if container contains value for type

Get a reference to a value previously inserted on this StateSet.

Get a mutable reference to a value previously inserted on this StateSet.

Remove a value from this StateSet.

If a value of this type exists, it will be returned.

Gets a value from this StateSet or populates it with the provided default.

Gets a value from this StateSet or populates it with the provided default function.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Returns the argument unchanged.

Calls U::from(self).

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

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.