Trait StorageMutExt

Source
pub trait StorageMutExt<C: Mirrored>: StorageExt<C> {
    // Required methods
    fn modify(
        &mut self,
        entity: Entity,
    ) -> Option<(&mut C, &mut EventChannel<C::Event>)>;
    fn event_channel(&mut self) -> &mut EventChannel<C::Event>;

    // Provided method
    fn register_reader(&mut self) -> ReaderId<C::Event> { ... }
}
Expand description

Extension methods for Storage to help read events from MirroredStorage.

Required Methods§

Source

fn modify( &mut self, entity: Entity, ) -> Option<(&mut C, &mut EventChannel<C::Event>)>

Get a mutable reference to the component and the event channel for update events.

Source

fn event_channel(&mut self) -> &mut EventChannel<C::Event>

Get a mutable reference to the event channel for update events.

Provided Methods§

Source

fn register_reader(&mut self) -> ReaderId<C::Event>

Register a new reader of insertion and removal events.

Implementations on Foreign Types§

Source§

impl<'a, C, S, D> StorageMutExt<C> for Storage<'a, C, D>
where C: Mirrored + Component<Storage = MirroredStorage<C, S>>, S: UnprotectedStorage<C> + Any + Send + Sync, D: DerefMut<Target = MaskedStorage<C>>,

Source§

fn modify( &mut self, entity: Entity, ) -> Option<(&mut C, &mut EventChannel<C::Event>)>

Source§

fn event_channel(&mut self) -> &mut EventChannel<C::Event>

Implementors§