Trait GenericWriteStorage

Source
pub trait GenericWriteStorage {
    type Component: Component;

    // Required methods
    fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>;
    fn insert(
        &mut self,
        entity: Entity,
        comp: Self::Component,
    ) -> Result<Option<Self::Component>, Error>;
    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§

Source

type Component: Component

The component type of the storage

Required Methods§

Source

fn get_mut(&mut self, entity: Entity) -> Option<&mut Self::Component>

Get mutable access to an Entitys component

Source

fn insert( &mut self, entity: Entity, comp: Self::Component, ) -> Result<Option<Self::Component>, Error>

Insert a component for an Entity

Source

fn remove(&mut self, entity: Entity)

Remove the component for an Entity

Source

fn _private() -> Seal

Private function to seal the trait

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, 'b, T> GenericWriteStorage for &'b mut Storage<'a, T, FetchMut<'a, MaskedStorage<T>>>
where 'a: 'b, T: Component,

Source§

impl<'a, T> GenericWriteStorage for Storage<'a, T, FetchMut<'a, MaskedStorage<T>>>
where T: Component,