pub enum SystemStage {
PreUpdate,
Update,
PostUpdate,
PreRender,
AssetSync,
AssetSyncDeps,
Render,
PostRender,
}Expand description
Determines when during a frame a system is executed.
There’s no dedicated “run once at startup” stage — instead, any system on
any stage can be made to run at most once with .once(),
which turns “have I already done this” into the function’s own return
value (Some(()) = done, retire; None = not ready, try again next
tick) instead of a special stage with its own rules. A .once() system
naturally waits as many ticks as it needs to (an async GPU backend, a
LazyResource that isn’t built yet) using the exact same requirement
checks as every other system on its stage.
AssetSync/AssetSyncDeps
are prioritized: they’re re-run to convergence (repeated until a full
pass produces no new resources) at the front of every tick and again
after every other stage, so newly queued asset/resource work is drained
before gameplay stages continue rather than waiting for the next tick’s
front pass. All other stages run once per App::update tick, in the
order declared below.
Variants§
PreUpdate
Before the main update.
Update
Main game-logic update.
PostUpdate
After the main update.
PreRender
Prepare rendering data and poll for the GPU backend. The backend resource becomes available here on the tick it finishes initialising, making it visible to the asset sync stages.
AssetSync
Upload CPU-side source assets to the GPU backend.
AssetSyncDeps
Construct lazy GPU resources and upload assets that depend on other processed assets. Runs in a convergence loop so dependency chains (e.g. LazyResource A → LazyResource B) resolve within a single tick.
Render
Issue draw calls.
PostRender
Cleanup or post-processing after rendering.
Implementations§
Source§impl SystemStage
impl SystemStage
Sourcepub fn is_convergent(self) -> bool
pub fn is_convergent(self) -> bool
Returns true for stages that are prioritized and re-run until a
full pass produces no new resources, instead of running once in
their declared position in the tick order. See the type-level docs
on SystemStage.
Trait Implementations§
Source§impl Clone for SystemStage
impl Clone for SystemStage
Source§fn clone(&self) -> SystemStage
fn clone(&self) -> SystemStage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SystemStage
Source§impl Debug for SystemStage
impl Debug for SystemStage
impl Eq for SystemStage
Source§impl Hash for SystemStage
impl Hash for SystemStage
Source§impl Ord for SystemStage
impl Ord for SystemStage
Source§fn cmp(&self, other: &SystemStage) -> Ordering
fn cmp(&self, other: &SystemStage) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SystemStage
impl PartialEq for SystemStage
Source§impl PartialOrd for SystemStage
impl PartialOrd for SystemStage
impl StructuralPartialEq for SystemStage
Auto Trait Implementations§
impl Freeze for SystemStage
impl RefUnwindSafe for SystemStage
impl Send for SystemStage
impl Sync for SystemStage
impl Unpin for SystemStage
impl UnsafeUnpin for SystemStage
impl UnwindSafe for SystemStage
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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