Trait Runner

Source
pub trait Runner<State: 'static + Send + Sync> {
    // Required method
    fn use_state<F: 'static + FnOnce() -> State>(self, init: F) -> Option<Self>
       where Self: Sized;
}
Expand description

Provides the ability to initialize global application state for observation.

Required Methods§

Source

fn use_state<F: 'static + FnOnce() -> State>(self, init: F) -> Option<Self>
where Self: Sized,

Initializes the global state using the given closure. Should be called early in main() before accessing state.

Implementations on Foreign Types§

Source§

impl<State: 'static + Send + Sync> Runner<State> for App

Source§

fn use_state<F: 'static + FnOnce() -> State>(self, init: F) -> Option<Self>
where Self: Sized,

Implementors§