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§
Source§impl Executor
impl Executor
Sourcepub fn new(systems: Vec<Box<dyn ParallelRunnable>>) -> Executor
pub fn new(systems: Vec<Box<dyn ParallelRunnable>>) -> Executor
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, potentially in parallel.
Ordering is retained in so far as the order of observed resource and component accesses is maintained.
Call from within rayon::ThreadPool::install()
to execute within a specific thread pool.
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 Freeze for Executor
impl !RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl !UnwindSafe 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
Source§impl<T> Component for T
impl<T> Component for T
Source§type Storage = PackedStorage<T>
type Storage = PackedStorage<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> 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