[][src]Struct nitric_component::storage::Storage

pub struct Storage<ID, C> where
    ID: SparseLinear
{ /* fields omitted */ }

A component storage implementation, providing a mapping from IDs to components using two Vecs.

(short: "Triple Vec Storage")

The first Vec is a sparse vector which maps an ID to a data index. The second Vec is a dense vector which maps a data index to a component.

This turned out to be a good default and outperforms other implementations in most benchmarks.

For the case where the component is not greater than a usize, no indirection will be used (and data_indices stays empty).

Generics

Methods

impl<ID, C> Storage<ID, C> where
    ID: SparseLinear
[src]

Creates a new, empty component storage.

impl<ID, C> Storage<ID, C> where
    ID: SparseLinear
[src]

Retrieves the component associated with id.

Retrieves the component associated with id.

Inserts component and associates it with id.

Returns the previous component that was associated with id if there was any.

Removes the component associated with id.

Returns the previous component that was associated with id if there was any.

Trait Implementations

impl<ID, C> Default for Storage<ID, C> where
    ID: SparseLinear
[src]

impl<ID, C> Debug for Storage<ID, C> where
    ID: SparseLinear,
    C: Debug
[src]

Auto Trait Implementations

impl<ID, C> Send for Storage<ID, C> where
    C: Send

impl<ID, C> Sync for Storage<ID, C> where
    C: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]