pub fn stage<T: Stage, F: FnOnce(&mut T) -> &mut T>(
        &mut self,
        label: impl StageLabel,
        func: F,
    ) -> &mut Self {
        let stage = self.get_stage_mut::<T>(&label).unwrap_or_else(move || {
            panic!("stage '{:?}' does not exist or is the wrong type", label)
        });
        func(stage);
        self
    }
/// Fetches the [`Stage`] of type `T` marked with `label`, then executes the provided
/// `func` passing the fetched stage to it as an argument.
///
/// The `func` argument should be a function or a closure that accepts a mutable reference
/// to a struct implementing `Stage` and returns the same type. That means that it should
/// also assume that the stage has already been fetched successfully.
///
/// # Example
///
/// ```
/// # use bevy_ecs::prelude::*;
/// #
/// # let mut schedule = Schedule::default();
/// # schedule.add_stage("my_stage", SystemStage::parallel());
/// #
/// schedule.stage("my_stage", |stage: &mut SystemStage| {
///     stage.add_system(my_system)
/// });
/// #
/// # fn my_system() {}
/// ```
///
/// # Panics
///
/// Panics if `label` refers to a non-existing stage, or if it's not of type `T`.


The `func` argument should be a function or a closure that accepts a mutable reference
to a struct implementing `Stage` and returns the same type. That means that it should
also assume that the stage has already been fetched successfully.
The ` func ` argument should be a function or a closure that accepts a mutable reference to a struct implementing ` Stage ` and returns the same type . That means that it should also assume that the stage has already been fetched successfully .
pub fn stage<T: Stage, F: FnOnce(&mut T) -> &mut T>(
        &mut self,
        label: impl StageLabel,
        func: F,
    ) -> &mut Self {
        let stage = self.get_stage_mut::<T>(&label).unwrap_or_else(move || {
            panic!("stage '{:?}' does not exist or is the wrong type", label)
        });
        func(stage);
        self
    }
pub fn stage < T : Stage , F : FnOnce ( & mut T ) -> & mut T > ( & mut self , label : impl StageLabel , func : F , ) -> & mut Self { let stage = self . get_stage_mut :: < T > ( & label ) . unwrap_or_else ( move | | { panic ! ( " " label ) } ) ; func ( stage ) ; self }
Fetches the [`Stage`] of type `T` marked with `label`, then executes the provided
`func` passing the fetched stage to it as an argument.
Fetches the [ ` Stage ` ] of type ` T ` marked with ` label ` then executes the provided ` func ` passing the fetched stage to it as an argument .
&mut self
label
impl StageLabel
func
F
&mut self
label
impl StageLabel
func
F
example
None
use bevy_ecs::prelude::*;
None
let mut schedule = schedule::default();
None
schedule.add_stage("my_stage", systemstage::parallel());
None
fn my_system() {}
None
panics
Panics if `label` refers to a non-existing stage, or if it's not of type `T`.
Panics if ` label ` refers to a non - existing stage or if it ' s not of type ` T ` .