[][src]Trait lol_core::storage::RaftStorage

pub trait RaftStorage: Sync + Send + 'static {
#[must_use]    pub fn delete_before<'life0, 'async_trait>(
        &'life0 self,
        r: Index
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn insert_snapshot<'life0, 'async_trait>(
        &'life0 self,
        i: Index,
        e: Entry
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn insert_entry<'life0, 'async_trait>(
        &'life0 self,
        i: Index,
        e: Entry
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn get_entry<'life0, 'async_trait>(
        &'life0 self,
        i: Index
    ) -> Pin<Box<dyn Future<Output = Result<Option<Entry>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn get_snapshot_index<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn get_last_index<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn save_ballot<'life0, 'async_trait>(
        &'life0 self,
        v: Ballot
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn load_ballot<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Ballot>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn put_tag<'life0, 'async_trait>(
        &'life0 self,
        i: Index,
        snapshot: SnapshotTag
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn delete_tag<'life0, 'async_trait>(
        &'life0 self,
        i: Index
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn get_tag<'life0, 'async_trait>(
        &'life0 self,
        i: Index
    ) -> Pin<Box<dyn Future<Output = Result<Option<SnapshotTag>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn list_tags<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<BTreeSet<Index>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

The abstraction for the backing storage. Conceptually it is considered as a sequence of log entries and the recent vote.

Required methods

#[must_use]pub fn delete_before<'life0, 'async_trait>(
    &'life0 self,
    r: Index
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Delete range ..r

#[must_use]pub fn insert_snapshot<'life0, 'async_trait>(
    &'life0 self,
    i: Index,
    e: Entry
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Save the snapshot entry so snapshot index always advance.

#[must_use]pub fn insert_entry<'life0, 'async_trait>(
    &'life0 self,
    i: Index,
    e: Entry
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn get_entry<'life0, 'async_trait>(
    &'life0 self,
    i: Index
) -> Pin<Box<dyn Future<Output = Result<Option<Entry>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn get_snapshot_index<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn get_last_index<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Index>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn save_ballot<'life0, 'async_trait>(
    &'life0 self,
    v: Ballot
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn load_ballot<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Ballot>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn put_tag<'life0, 'async_trait>(
    &'life0 self,
    i: Index,
    snapshot: SnapshotTag
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn delete_tag<'life0, 'async_trait>(
    &'life0 self,
    i: Index
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn get_tag<'life0, 'async_trait>(
    &'life0 self,
    i: Index
) -> Pin<Box<dyn Future<Output = Result<Option<SnapshotTag>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

#[must_use]pub fn list_tags<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<BTreeSet<Index>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Loading content...

Implementors

impl RaftStorage for lol_core::storage::disk::Storage[src]

This is supported on crate feature persistency only.

impl RaftStorage for lol_core::storage::memory::Storage[src]

Loading content...