pub trait MetaStore:
Send
+ Sync
+ 'static {
// Required methods
fn save_hard_state(&self, state: &HardState) -> Result<(), Error>;
fn load_hard_state(&self) -> Result<Option<HardState>, Error>;
// Provided methods
fn flush(&self) -> Result<(), Error> { ... }
fn flush_async<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Metadata storage operations
Required Methods§
Sourcefn save_hard_state(&self, state: &HardState) -> Result<(), Error>
fn save_hard_state(&self, state: &HardState) -> Result<(), Error>
Atomically persist hard state (current term and votedFor)
Sourcefn load_hard_state(&self) -> Result<Option<HardState>, Error>
fn load_hard_state(&self) -> Result<Option<HardState>, Error>
Load persisted hard state