Trait lol_core::storage::RaftStorage
source · pub trait RaftStorage: Sync + Send + 'static {
fn insert_entry<'life0, 'async_trait>(
&'life0 self,
i: Index,
e: Entry
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn delete_entry<'life0, 'async_trait>(
&'life0 self,
i: Index
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn get_entry<'life0, 'async_trait>(
&'life0 self,
i: Index
) -> Pin<Box<dyn Future<Output = Result<Option<Entry>>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn get_head_index<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn get_last_index<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn save_ballot<'life0, 'async_trait>(
&'life0 self,
v: Ballot
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn load_ballot<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Ballot>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The abstraction of the log storage. Conceptually it is considered as a sequence of log entries and the recent vote.
Required Methods§
fn insert_entry<'life0, 'async_trait>(
&'life0 self,
i: Index,
e: Entry
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_entry<'life0, 'async_trait>(
&'life0 self,
i: Index
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_entry<'life0, 'async_trait>(
&'life0 self,
i: Index
) -> Pin<Box<dyn Future<Output = Result<Option<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_head_index<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_index<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_ballot<'life0, 'async_trait>(
&'life0 self,
v: Ballot
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_ballot<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Ballot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implementors§
impl RaftStorage for lol_core::storage::file::Storage
impl RaftStorage for lol_core::storage::memory::Storage
impl RaftStorage for lol_core::storage::rocksdb::Storage
Available on crate feature
rocksdb-backend
only.