Skip to main content

State

Trait State 

Source
pub trait State: Send + Sync {
    // Provided methods
    fn on_enter(&mut self, _universe: &mut Universe) { ... }
    fn on_exit(&mut self, _universe: &mut Universe) { ... }
    fn on_pause(&mut self, _universe: &mut Universe) { ... }
    fn on_resume(&mut self, _universe: &mut Universe) { ... }
    fn on_process(&mut self, _universe: &mut Universe) -> StateChange { ... }
    fn on_process_background(&mut self, _universe: &mut Universe) { ... }
}

Provided Methods§

Source

fn on_enter(&mut self, _universe: &mut Universe)

Source

fn on_exit(&mut self, _universe: &mut Universe)

Source

fn on_pause(&mut self, _universe: &mut Universe)

Source

fn on_resume(&mut self, _universe: &mut Universe)

Source

fn on_process(&mut self, _universe: &mut Universe) -> StateChange

Source

fn on_process_background(&mut self, _universe: &mut Universe)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl State for ()

Source§

impl State for bool

Source§

fn on_process(&mut self, _universe: &mut Universe) -> StateChange

Source§

impl State for usize

Source§

fn on_process(&mut self, _universe: &mut Universe) -> StateChange

Implementors§