Struct specs::Storage [] [src]

pub struct Storage<T, A, D> { /* fields omitted */ }

A wrapper around the masked storage and the generations vector. Can be used for safe lookup of components, insertions and removes. This is what World::read/write locks for the user.

Methods

impl<T, A, D> Storage<T, A, D>
[src]

Create a new Storage

impl<T, A, D> Storage<T, A, D> where T: Component,
        A: Deref<Target=Allocator>,
        D: Deref<Target=MaskedStorage<T>>
[src]

Tries to read the data associated with an Entity.

Returns a struct that can iterate over the entities that have it but does not return the contents of the storage.

Useful if you want to check if an entity has a component and then possibly get the component later on in the loop.

impl<T, A, D> Storage<T, A, D> where T: Component,
        A: Deref<Target=Allocator>,
        D: DerefMut<Target=MaskedStorage<T>>
[src]

Tries to mutate the data associated with an Entity.

Inserts new data for a given Entity. Returns the result of the operation as a InsertResult<T>

Removes the data associated with an Entity.

Clears the contents of the storage.

Trait Implementations

impl<'a, T, A, D> Not for &'a Storage<T, A, D> where T: Component,
        D: Deref<Target=MaskedStorage<T>>
[src]

The resulting type after applying the ! operator

The method for the unary ! operator

impl<T, A, D> Gate for Storage<T, A, D>
[src]

Transition destination type.

Actually pass the gate. This may involve waiting on a ticketed lock.

impl<'a, T, A, D> Join for &'a Storage<T, A, D> where T: Component,
        A: Deref<Target=Allocator>,
        D: Deref<Target=MaskedStorage<T>>
[src]

Type of joined components.

Type of joined storages.

Type of joined bit mask.

Open this join by returning the mask and the storages.

Get a joined component value by a given index.

Create a joined iterator over the contents.

impl<'a, T, A, D> Join for &'a mut Storage<T, A, D> where T: Component,
        A: Deref<Target=Allocator>,
        D: DerefMut<Target=MaskedStorage<T>>
[src]

Type of joined components.

Type of joined storages.

Type of joined bit mask.

Open this join by returning the mask and the storages.

Get a joined component value by a given index.

Create a joined iterator over the contents.