pub struct Executor { /* private fields */ }
Expand description
Executes a sequence of systems, potentially in parallel, and then commits their command buffers.
Systems are provided in execution order. When the parallel
feature is enabled, the Executor
may run some systems in parallel. The order in which side-effects (e.g. writes to resources
or entities) are observed is maintained.
Implementations
sourceimpl Executor
impl Executor
sourcepub fn new(systems: Vec<Box<dyn ParallelRunnable>>) -> Self
pub fn new(systems: Vec<Box<dyn ParallelRunnable>>) -> Self
Constructs a new executor for all systems to be run in a single stage.
Systems are provided in the order in which side-effects (e.g. writes to resources or entities) are to be observed.
sourcepub fn into_vec(self) -> Vec<Box<dyn ParallelRunnable>>
pub fn into_vec(self) -> Vec<Box<dyn ParallelRunnable>>
Converts this executor into a vector of its component systems.
sourcepub fn execute(&mut self, world: &mut World, resources: &mut Resources)
pub fn execute(&mut self, world: &mut World, resources: &mut Resources)
Executes all systems and then flushes their command buffers.
sourcepub fn run_systems(&mut self, world: &mut World, resources: &UnsafeResources)
pub fn run_systems(&mut self, world: &mut World, resources: &UnsafeResources)
Executes all systems sequentially.
Only enabled with parallel is disabled
sourcepub fn flush_command_buffers(
&mut self,
world: &mut World,
resources: &mut Resources
)
pub fn flush_command_buffers(
&mut self,
world: &mut World,
resources: &mut Resources
)
Flushes the recorded command buffers for all systems.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcepub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcepub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcepub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcepub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more