use super::{Entry, Index};
use crate::error::Result;
pub trait State: Send {
fn get_applied_index(&self) -> Index;
fn apply(&mut self, entry: Entry) -> Result<Vec<u8>>;
fn read(&self, command: Vec<u8>) -> Result<Vec<u8>>;
fn snapshot(&self) -> Result<Vec<u8>> {
Ok(Vec::new())
}
fn restore(&mut self, _snapshot: &[u8], _index: Index) -> Result<()> {
Ok(())
}
}