[−][src]Trait specs::storage::GenericWriteStorage
Provides generic write access to WriteStorage
, both as a value and a
mutable reference.
Associated Types
Loading content...Required methods
fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>
Get mutable access to an Entity
s component
fn get_mut_or_default(&mut self, entity: Entity) -> Option<&mut Self::Component> where
Self::Component: Default,
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.
fn insert(
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>
Insert a component for an Entity
fn remove(&mut self, entity: Entity)
Remove the component for an Entity
fn _private() -> Seal
Private function to seal the trait
Implementors
impl<'a, T> GenericWriteStorage for WriteStorage<'a, T> where
T: Component,
[src]
T: Component,
type Component = T
fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>
[src]
fn get_mut_or_default(&mut self, entity: Entity) -> Option<&mut Self::Component> where
Self::Component: Default,
[src]
Self::Component: Default,
fn insert(
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>
[src]
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>
fn remove(&mut self, entity: Entity)
[src]
fn _private() -> Seal
[src]
impl<'a: 'b, 'b, T> GenericWriteStorage for &'b mut WriteStorage<'a, T> where
T: Component,
[src]
T: Component,
type Component = T
fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>
[src]
fn get_mut_or_default(&mut self, entity: Entity) -> Option<&mut Self::Component> where
Self::Component: Default,
[src]
Self::Component: Default,
fn insert(
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>
[src]
&mut self,
entity: Entity,
comp: Self::Component
) -> InsertResult<Self::Component>