Trait StateMachine
Source pub trait StateMachine: Send + Sync {
type State: Clone + Send + Sync;
// Required methods
fn apply_command<'life0, 'life1, 'async_trait>(
&'life0 mut self,
command: &'life1 Command,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Snapshot>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn restore_snapshot<'life0, 'life1, 'async_trait>(
&'life0 mut self,
snapshot: &'life1 Snapshot,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Self::State> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn apply_commands<'life0, 'life1, 'async_trait>(
&'life0 mut self,
commands: &'life1 [Command],
) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn is_deterministic(&self) -> bool { ... }
}