[][src]Trait growthring::wal::WALStore

pub trait WALStore {
    type FileNameIter: Iterator<Item = String>;
#[must_use]    fn open_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filename: &'life1 str,
        touch: bool
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn WALFile>, ()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn remove_file<'life0, 'async_trait>(
        &'life0 self,
        filename: String
    ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn enumerate_files(&self) -> Result<Self::FileNameIter, ()>;
fn apply_payload(
        &self,
        payload: WALBytes,
        ringid: WALRingId
    ) -> Result<(), ()>; }

Associated Types

Loading content...

Required methods

#[must_use]fn open_file<'life0, 'life1, 'async_trait>(
    &'life0 self,
    filename: &'life1 str,
    touch: bool
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WALFile>, ()>> + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Open a file given the filename, create the file if not exists when touch is true.

#[must_use]fn remove_file<'life0, 'async_trait>(
    &'life0 self,
    filename: String
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Unlink a file given the filename.

fn enumerate_files(&self) -> Result<Self::FileNameIter, ()>

Enumerate all WAL filenames. It should include all WAL files that are previously opened (created) but not removed. The list could be unordered.

fn apply_payload(&self, payload: WALBytes, ringid: WALRingId) -> Result<(), ()>

Apply the payload during recovery. An invocation of the callback waits the application for redoing the given operation to ensure its state is consistent. We assume the necessary changes by the payload has already been persistent when the callback returns.

Loading content...

Implementors

impl<F: FnMut(WALBytes, WALRingId) -> Result<(), ()>> WALStore for WALStoreAIO<F>[src]

type FileNameIter = IntoIter<String>

Loading content...