Trait State Copy item path Source pub trait State<D> {
// Provided methods
fn on_start (&mut self, _data: &mut D ) { ... }
fn on_stop (&mut self, _data: &mut D ) { ... }
fn on_pause (&mut self, _data: &mut D ) { ... }
fn on_resume (&mut self, _data: &mut D ) { ... }
fn on_tick (&mut self, _data: &mut D ) -> Trans <D> { ... }
fn on_shadow_tick (&mut self, _data: &mut D ) -> Trans <D> { ... }
}Expand description Describes an application state.
See the crates docs or the book for more information.
§ Generics
D: Data available to all State s to perform actions to.
Called when this State first enters the stack.
Called when this State is popped from the stack.
Called when this State loses its topmost position in the stack to
another State that has been pushed ontop of it.
Called when this State regains the first position in the stack.
Id est, when other State s above it are popped.
Represents a single tick/update.
It’s called when the Stack ’s .tick() is called.
Your loop logic should call your stack’s tick, not this directly.
Represents a single tick/update independent of this State
position in the stack.
It’s called when the Stack ’s .tick() is called.
NOTE: on_shadow_tick is called BEFORE on_tick.