Enum specs::storage::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
Occupied(OccupiedEntry<'a, 'b, T, D>)
Entry variant that is returned if the entity does has a component.
Vacant(VacantEntry<'a, 'b, T, D>)
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]
T: Component,
D: DerefMut<Target = MaskedStorage<T>>,
ⓘImportant traits for &'a mut Wpub fn or_insert(self, component: T) -> &'a mut T
[src]
ⓘImportant traits for &'a mut W
Inserts a component if the entity does not contain a component.
ⓘImportant traits for &'a mut Wpub fn or_insert_with<F>(self, default: F) -> &'a mut T where
F: FnOnce() -> T,
[src]
ⓘImportant traits for &'a mut W
F: FnOnce() -> T,
Inserts a component using a lazily called function that is only called when inserting the component.
Trait Implementations
Auto Trait Implementations
impl<'a, 'b, T, D> Send for StorageEntry<'a, 'b, T, D> where
D: Send,
T: Send,
D: Send,
T: Send,
impl<'a, 'b, T, D> Sync for StorageEntry<'a, 'b, T, D> where
D: Sync,
T: Sync,
D: Sync,
T: Sync,