pub struct Schedule { /* private fields */ }
Expand description
A schedule of systems to execute with automatic parallelization.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty schedule, prefer Self::builder
Sourcepub fn builder() -> ScheduleBuilder
pub fn builder() -> ScheduleBuilder
Creates a new schedule builder
Sourcepub fn execute_seq(&mut self, world: &mut World) -> Result<()>
pub fn execute_seq(&mut self, world: &mut World) -> Result<()>
Execute all systems in the schedule sequentially on the world. Returns the first error and aborts if the execution fails.
Sourcepub fn execute_par(&mut self, world: &mut World) -> Result<()>
Available on crate feature rayon
only.
pub fn execute_par(&mut self, world: &mut World) -> Result<()>
rayon
only.Executes the systems in the schedule in parallel.
Systems will run in an order such that changes and mutable accesses made by systems provided before are observable when the system runs.
Systems with no dependencies between each other may run in any order, but will not run before any previously provided system which it depends on.
A dependency between two systems is given by a side effect, e.g; a component write, which is accessed by the seconds system through a read or other side effect.
Sourcepub fn from_systems(systems: impl Into<Vec<BoxedSystem>>) -> Self
pub fn from_systems(systems: impl Into<Vec<BoxedSystem>>) -> Self
Creates a schedule from a group of existing systems
Sourcepub fn with_system(self, system: impl Into<BoxedSystem>) -> Self
pub fn with_system(self, system: impl Into<BoxedSystem>) -> Self
Add a new system to the schedule. Respects order.
Sourcepub fn batch_info(&mut self, world: &World) -> BatchInfos
pub fn batch_info(&mut self, world: &World) -> BatchInfos
Returns information about the current multithreaded batch partioning and system accesses.
Sourcepub fn execute_seq_with<'a>(
&'a mut self,
world: &'a mut World,
input: impl IntoInput<'a>,
) -> Result<()>
pub fn execute_seq_with<'a>( &'a mut self, world: &'a mut World, input: impl IntoInput<'a>, ) -> Result<()>
Same as Self::execute_seq
but allows supplying short lived input available to the systems
The data can be a mutable reference type, or a tuple of mutable references
Sourcepub fn execute_par_with<'a>(
&'a mut self,
world: &'a mut World,
input: impl IntoInput<'a>,
) -> Result<()>
Available on crate feature rayon
only.
pub fn execute_par_with<'a>( &'a mut self, world: &'a mut World, input: impl IntoInput<'a>, ) -> Result<()>
rayon
only.Same as Self::execute_par
but allows supplying short lived data available to the systems
Trait Implementations§
Source§impl<U> From<U> for Schedulewhere
U: IntoIterator<Item = BoxedSystem>,
impl<U> From<U> for Schedulewhere
U: IntoIterator<Item = BoxedSystem>,
Source§impl FromIterator<BoxedSystem> for Schedule
impl FromIterator<BoxedSystem> for Schedule
Source§fn from_iter<I: IntoIterator<Item = BoxedSystem>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = BoxedSystem>>(iter: I) -> Self
Auto Trait Implementations§
impl Freeze for Schedule
impl !RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl !UnwindSafe for Schedule
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> 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