Enum specs::StorageEntry [] [src]

pub enum StorageEntry<'a, 'b: 'a, T: 'a, D: 'a> {
    Occupied(OccupiedEntry<'a, 'b, T, D>),
    Vacant(VacantEntry<'a, 'b, T, D>),
}

Entry to a storage for convenient filling of components or removal based on whether the entity has a component.

Variants

Entry variant that is returned if the entity does has a component.

Entry variant that is returned if the entity does not have a component.

Methods

impl<'a, 'b, T, D> StorageEntry<'a, 'b, T, D> where
    T: Component,
    D: DerefMut<Target = MaskedStorage<T>>, 
[src]

[src]

Inserts a component if the entity does not contain a component.

[src]

Inserts a component using a lazily called function that is only called when inserting the component.