Struct bones_ecs::stage::SystemStagesBuilder
source · pub struct SystemStagesBuilder { /* private fields */ }
Expand description
Builder for SystemStages
. It is immutable once created,
Implementations§
source§impl SystemStagesBuilder
impl SystemStagesBuilder
sourcepub fn with_core_stages() -> Self
pub fn with_core_stages() -> Self
Create a SystemStagesBuilder
for SystemStages
collection, initialized with a stage for each CoreStage
.
sourcepub fn finish(self) -> SystemStages
pub fn finish(self) -> SystemStages
Finish building and convert to SystemStages
sourcepub fn from_stages(stages: SystemStages) -> Self
pub fn from_stages(stages: SystemStages) -> Self
Create SystemStagesBuilder
by taking existing SystemStages
.
sourcepub fn add_startup_system<Args, S>(&mut self, system: S) -> &mut Self
pub fn add_startup_system<Args, S>(&mut self, system: S) -> &mut Self
Add a system that will run only once, before all of the other non-startup systems.
If wish to reset session and run again, can modify SessionStarted
resource in world.
sourcepub fn add_single_success_system<Args, S>(&mut self, system: S) -> &mut Self
pub fn add_single_success_system<Args, S>(&mut self, system: S) -> &mut Self
Add a system that will run each frame until it succeeds (returns Some). Runs before all stages. Uses Option to allow for easy usage of ?
.
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 insert_startup_resource<T: HasSchema>(&mut self, resource: T)
pub fn insert_startup_resource<T: HasSchema>(&mut self, resource: T)
Insert a startup resource. On stage / session startup (first step), will be inserted into World
.
If already exists, will be overwritten.
sourcepub fn init_startup_resource<T: HasSchema + Default>(&mut self) -> RefMut<'_, T>
pub fn init_startup_resource<T: HasSchema + Default>(&mut self) -> RefMut<'_, T>
Init startup resource with default, and return mutable ref for modification. If already exists, returns mutable ref to existing resource.
sourcepub fn startup_resource_mut<T: HasSchema>(&self) -> Option<RefMut<'_, T>>
pub fn startup_resource_mut<T: HasSchema>(&self) -> Option<RefMut<'_, T>>
Get mutable reference to startup resource if found.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SystemStagesBuilder
impl !RefUnwindSafe for SystemStagesBuilder
impl Send for SystemStagesBuilder
impl Sync for SystemStagesBuilder
impl Unpin for SystemStagesBuilder
impl !UnwindSafe for SystemStagesBuilder
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
.