pub trait EventRestarter: UsesState {
    // Provided methods
    fn on_restart(&mut self, _state: &mut Self::State) -> Result<(), Error> { ... }
    fn send_exiting(&mut self) -> Result<(), Error> { ... }
    fn await_restart_safe(&mut self) { ... }
}
Expand description

Restartable trait

Provided Methods§

source

fn on_restart(&mut self, _state: &mut Self::State) -> Result<(), Error>

For restarting event managers, implement a way to forward state to their next peers.

source

fn send_exiting(&mut self) -> Result<(), Error>

Send information that this client is exiting. No need to restart us any longer, and no need to print an error, either.

source

fn await_restart_safe(&mut self)

Block until we are safe to exit, usually called inside on_restart.

Implementors§