Trait specs::storage::GenericWriteStorage
source · pub trait GenericWriteStorage {
type Component: Component;
type AccessMut<'a>: AccessMut<Target = Self::Component>
where Self: 'a;
// Required methods
fn get_mut(
&mut self,
entity: Entity
) -> Option<<<Self::Component as Component>::Storage as UnprotectedStorage<Self::Component>>::AccessMut<'_>>;
fn get_mut_or_default(
&mut self,
entity: Entity
) -> Option<<<Self::Component as Component>::Storage as UnprotectedStorage<Self::Component>>::AccessMut<'_>>
where Self::Component: Default;
fn insert(
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>;
fn remove(&mut self, entity: Entity);
fn _private() -> Seal;
}
Expand description
Provides generic write access to WriteStorage
, both as a value and a
mutable reference.
Required Associated Types§
Required Methods§
sourcefn get_mut(
&mut self,
entity: Entity
) -> Option<<<Self::Component as Component>::Storage as UnprotectedStorage<Self::Component>>::AccessMut<'_>>
fn get_mut( &mut self, entity: Entity ) -> Option<<<Self::Component as Component>::Storage as UnprotectedStorage<Self::Component>>::AccessMut<'_>>
Get mutable access to an Entity
s component
sourcefn get_mut_or_default(
&mut self,
entity: Entity
) -> Option<<<Self::Component as Component>::Storage as UnprotectedStorage<Self::Component>>::AccessMut<'_>>where
Self::Component: Default,
fn get_mut_or_default( &mut self, entity: Entity ) -> Option<<<Self::Component as Component>::Storage as UnprotectedStorage<Self::Component>>::AccessMut<'_>>where Self::Component: Default,
Get mutable access to an Entity
s component. If the component does not
exist, it is automatically created using Default::default()
.
Returns None if the entity is dead.