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§

source

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,

source

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,

source

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,

Implementors§