pub struct SystemStages { /* private fields */ }Expand description
An ordered collection of SystemStages.
Implementations§
Source§impl SystemStages
impl SystemStages
Sourcepub fn with_core_stages() -> Self
pub fn with_core_stages() -> Self
Create a SystemStages collection, initialized with a stage for each CoreStage.
Sourcepub fn add_system_to_stage<Args, S>(
&mut self,
label: impl StageLabel,
system: S,
) -> &mut Self
pub fn add_system_to_stage<Args, S>( &mut self, label: impl StageLabel, system: S, ) -> &mut Self
Add a System to the stage with the given label.
Sourcepub fn insert_stage_before<L: StageLabel, S: SystemStage + 'static>(
&mut self,
label: L,
stage: S,
) -> &mut Self
pub fn insert_stage_before<L: StageLabel, S: SystemStage + 'static>( &mut self, label: L, stage: S, ) -> &mut Self
Insert a new stage, before another existing stage
Sourcepub fn insert_stage_after<L: StageLabel, S: SystemStage + 'static>(
&mut self,
label: L,
stage: S,
) -> &mut Self
pub fn insert_stage_after<L: StageLabel, S: SystemStage + 'static>( &mut self, label: L, stage: S, ) -> &mut Self
Insert a new stage, after another existing stage
Sourcepub fn add_startup_system<Args, S>(&mut self, system: S) -> &mut Self
👎Deprecated: use .add_system_to_stage(CoreStage::Startup, your_system) instead
pub fn add_startup_system<Args, S>(&mut self, system: S) -> &mut Self
.add_system_to_stage(CoreStage::Startup, your_system) insteadAdd a system to the CoreStage::Startup stage which specially runs
only once, before all other core stages. Inserting CoreStageStartupSystemsRan
into the world prevents systems in the startup stage from running.
Sourcepub fn add_single_success_system<Args, S>(&mut self, system: S) -> &mut Self
👎Deprecated: use `.add_system_to_stage(First, single_success_system(your_system)
pub fn add_single_success_system<Args, S>(&mut self, system: S) -> &mut Self
Convenience method. Adds a system that will run each frame until it succeeds (returns Some).
Uses Option to allow for easy usage of ?. System is added to
CoreStage::First.
See also the wrapper function used inside single_success_system.
Sourcepub fn init_startup_resource<R: HasSchema + FromWorld>(&mut self) -> &mut Self
pub fn init_startup_resource<R: HasSchema + FromWorld>(&mut self) -> &mut Self
Adds a system to CoreStage::Startup that inserts the default value
of a resource into the World if it doesn’t already exist.
Sourcepub fn add_startup_resource<R: HasSchema>(&mut self, resource: R) -> &mut Self
pub fn add_startup_resource<R: HasSchema>(&mut self, resource: R) -> &mut Self
Adds a system to CoreStage::StartupResource that inserts the given
resource into the World if it doesn’t already exist. The resource
type is required to have a HasSchema clone implementation to
re-insert the resource into the world after the first startup.
§Clone Requirement Details
If the type being added implements HasSchema with the derive like
so:
#[derive(HasSchema, Default)]
#[schema(no_clone)] // This bypasses HasSchema clone requirements.
struct ResourceBeingInserted;Then the system being added to the StartupResource system stage will
panic when inserting a second time. The startup resource stage only runs
once so it is therefore safe to use a type like the example above as
long as you don’t plan on removing from the World the
StartupSystemStage tag which in this case is
CoreStageStartupResourceSystemsRan.
Trait Implementations§
Source§impl Debug for SystemStages
impl Debug for SystemStages
Auto Trait Implementations§
impl Freeze for SystemStages
impl !RefUnwindSafe for SystemStages
impl Send for SystemStages
impl Sync for SystemStages
impl Unpin for SystemStages
impl !UnwindSafe for SystemStages
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> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Self using data from the given World.