Stateful

Trait Stateful 

Source
pub trait Stateful {
    type State: Clone;

    // Required methods
    fn state(&self) -> Self::State;
    fn set_state(&mut self, state: Self::State) -> Result<()>;
    fn restore_state(&mut self, state: Self::State) -> Result<()>;
}
Expand description

Stateful trait for objects with state

Required Associated Types§

Source

type State: Clone

State type

Required Methods§

Source

fn state(&self) -> Self::State

Get current state

Source

fn set_state(&mut self, state: Self::State) -> Result<()>

Set state

Source

fn restore_state(&mut self, state: Self::State) -> Result<()>

Restore state

Implementors§