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 par-schedule 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§
Source§impl Executor
impl Executor
Sourcepub fn new(systems: Vec<Box<dyn Schedulable>>) -> Self
pub fn new(systems: Vec<Box<dyn Schedulable>>) -> 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 Schedulable>>
pub fn into_vec(self) -> Vec<Box<dyn Schedulable>>
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: &mut Resources)
pub fn run_systems(&mut self, world: &mut World, resources: &mut Resources)
Executes all systems sequentially.
Only enabled with par-schedule is disabled
Sourcepub fn flush_command_buffers(&mut self, world: &mut World)
pub fn flush_command_buffers(&mut self, world: &mut World)
Flushes the recorded command buffers for all systems.
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl !UnwindSafe for Executor
impl Freeze for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Component for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more