Trait valence::ecs::system::SystemBuffer

pub trait SystemBuffer:
    FromWorld
    + Send
    + 'static {
    // Required method
    fn apply(&mut self, system_meta: &SystemMeta, world: &mut World);

    // Provided method
    fn queue(&mut self, _system_meta: &SystemMeta, _world: DeferredWorld<'_>) { ... }
}
Expand description

Types that can be used with Deferred<T> in systems. This allows storing system-local data which is used to defer World mutations.

Types that implement SystemBuffer should take care to perform as many computations up-front as possible. Buffers cannot be applied in parallel, so you should try to minimize the time spent in SystemBuffer::apply.

Required Methods§

fn apply(&mut self, system_meta: &SystemMeta, world: &mut World)

Applies any deferred mutations to the World.

Provided Methods§

fn queue(&mut self, _system_meta: &SystemMeta, _world: DeferredWorld<'_>)

Queues any deferred mutations to be applied at the next apply_deferred.

Object Safety§

This trait is not object safe.

Implementors§