pub trait SystemBuffer:
FromWorld
+ Send
+ 'static {
// Required method
fn queue(&mut self, _system_meta: &SystemMeta, _world: DeferredWorld<'_>);
// Provided method
fn apply(&mut self, system_meta: &SystemMeta, world: &mut World) { ... }
}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§
Sourcefn queue(&mut self, _system_meta: &SystemMeta, _world: DeferredWorld<'_>)
fn queue(&mut self, _system_meta: &SystemMeta, _world: DeferredWorld<'_>)
Queues any deferred mutations to be applied at the next ApplyDeferred.
To queue structural changes to DeferredWorld, a command queue of the DeferredWorld
should be used via commands.
Provided Methods§
Sourcefn apply(&mut self, system_meta: &SystemMeta, world: &mut World)
fn apply(&mut self, system_meta: &SystemMeta, world: &mut World)
Applies any deferred mutations to the World.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".