Struct bones_lib::ecs::stage::SystemStagesBuilder
pub struct SystemStagesBuilder { /* private fields */ }
Expand description
Builder for SystemStages
. It is immutable once created,
Implementations§
§impl SystemStagesBuilder
impl SystemStagesBuilder
pub fn with_core_stages() -> SystemStagesBuilder
pub fn with_core_stages() -> SystemStagesBuilder
Create a SystemStagesBuilder
for SystemStages
collection, initialized with a stage for each CoreStage
.
pub fn finish(self) -> SystemStages
pub fn finish(self) -> SystemStages
Finish building and convert to SystemStages
pub fn from_stages(stages: SystemStages) -> SystemStagesBuilder
pub fn from_stages(stages: SystemStages) -> SystemStagesBuilder
Create SystemStagesBuilder
by taking existing SystemStages
.
pub fn add_startup_system<Args, S>(
&mut self,
system: S,
) -> &mut SystemStagesBuilder
pub fn add_startup_system<Args, S>( &mut self, system: S, ) -> &mut SystemStagesBuilder
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.
pub fn add_single_success_system<Args, S>(
&mut self,
system: S,
) -> &mut SystemStagesBuilder
pub fn add_single_success_system<Args, S>( &mut self, system: S, ) -> &mut SystemStagesBuilder
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 ?
.
pub fn add_system_to_stage<Args, S>(
&mut self,
label: impl StageLabel,
system: S,
) -> &mut SystemStagesBuilder
pub fn add_system_to_stage<Args, S>( &mut self, label: impl StageLabel, system: S, ) -> &mut SystemStagesBuilder
Add a System
to the stage with the given label.
pub fn insert_stage_before<L, S>(
&mut self,
label: L,
stage: S,
) -> &mut SystemStagesBuilderwhere
L: StageLabel,
S: SystemStage + 'static,
pub fn insert_stage_before<L, S>(
&mut self,
label: L,
stage: S,
) -> &mut SystemStagesBuilderwhere
L: StageLabel,
S: SystemStage + 'static,
Insert a new stage, before another existing stage
pub fn insert_stage_after<L, S>(
&mut self,
label: L,
stage: S,
) -> &mut SystemStagesBuilderwhere
L: StageLabel,
S: SystemStage + 'static,
pub fn insert_stage_after<L, S>(
&mut self,
label: L,
stage: S,
) -> &mut SystemStagesBuilderwhere
L: StageLabel,
S: SystemStage + 'static,
Insert a new stage, after another existing stage
pub fn insert_startup_resource<T>(&mut self, resource: T)where
T: HasSchema,
pub fn insert_startup_resource<T>(&mut self, resource: T)where
T: HasSchema,
Insert a startup resource. On stage / session startup (first step), will be inserted into World
.
If already exists, will be overwritten.
pub fn init_startup_resource<T>(&mut self) -> RefMut<'_, T>
pub fn init_startup_resource<T>(&mut self) -> RefMut<'_, T>
Init startup resource with default, and return mutable ref for modification. If already exists, returns mutable ref to existing resource.
pub fn startup_resource_mut<T>(&self) -> Option<RefMut<'_, T>>where
T: HasSchema,
pub fn startup_resource_mut<T>(&self) -> Option<RefMut<'_, T>>where
T: HasSchema,
Get mutable reference to startup resource if found.
Trait Implementations§
§impl Default for SystemStagesBuilder
impl Default for SystemStagesBuilder
§fn default() -> SystemStagesBuilder
fn default() -> SystemStagesBuilder
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
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Self
using data from the given World
.