pub struct Main;Expand description
The schedule that contains the app logic that is evaluated each tick of App::update().
By default, it will run the following schedules in the given order:
On the first run of the schedule (and only on the first run), it will run:
StateTransition1- This means that
OnEnter(MyState::Foo)will be called beforePreStartupifMyStatewas added to the app withMyState::Fooas the initial state, as well asOnEnter(MyComputedState)if itcomputes toSome(Self)inMyState::Foo. - If you want to run systems before any state transitions, regardless of which state is the starting state,
for example, for registering required components, you can add your own custom startup schedule
before
StateTransition. SeeMainScheduleOrder::insert_startup_beforefor more details.
- This means that
PreStartupStartupPostStartup
Then it will run:
FirstPreUpdateStateTransition1RunFixedMainLoop- This will run
FixedMainzero to many times, based on how much time has elapsed.
- This will run
UpdatePostUpdateLast
§Rendering
Note rendering is not executed in the main schedule by default.
Instead, rendering is performed in a separate SubApp
which exchanges data with the main app in between the main schedule runs.
See RenderPlugin and PipelinedRenderingPlugin for more details.
StateTransitionis inserted only if you havebevy_statefeature enabled. It is enabled indefaultfeatures. ↩
Implementations§
Trait Implementations§
Source§impl ScheduleLabel for Main
impl ScheduleLabel for Main
impl Eq for Main
impl StructuralPartialEq for Main
Auto Trait Implementations§
impl Freeze for Main
impl RefUnwindSafe for Main
impl Send for Main
impl Sync for Main
impl Unpin for Main
impl UnwindSafe for Main
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&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> DowncastSend for T
impl<T> DowncastSend for T
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
Compare self to
key and return true if they are equal.Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.