Skip to main content

StateBackend

Trait StateBackend 

Source
pub trait StateBackend:
    Send
    + Sync
    + 'static {
    // Required methods
    fn history(&self) -> &StoreHistory;
    fn open(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<RecoveryPosition, Error>> + Send + '_>>;
    fn read_snapshot(
        &self,
        max_bytes: NonZero<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RecoverySnapshot>, Error>> + Send + '_>>;
    fn write_snapshot<'a>(
        &'a self,
        snapshot: &'a RecoverySnapshot,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>>;
    fn read_entries<'a>(
        &'a self,
        after: &'a RecoveryPosition,
        through: &'a RecoveryPosition,
        limits: ReadLimits,
    ) -> Pin<Box<dyn Future<Output = Result<RecoveryPage, Error>> + Send + 'a>>;
    fn write_entries<'a>(
        &'a self,
        entries: &'a [RecoveryEntry],
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>>;
    fn flush<'a>(
        &'a self,
        through: &'a RecoveryPosition,
    ) -> Pin<Box<dyn Future<Output = Result<RecoveryPosition, Error>> + Send + 'a>>;
    fn close(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>;
}

Required Methods§

Source

fn history(&self) -> &StoreHistory

Source

fn open( &self, ) -> Pin<Box<dyn Future<Output = Result<RecoveryPosition, Error>> + Send + '_>>

Source

fn read_snapshot( &self, max_bytes: NonZero<usize>, ) -> Pin<Box<dyn Future<Output = Result<Option<RecoverySnapshot>, Error>> + Send + '_>>

Source

fn write_snapshot<'a>( &'a self, snapshot: &'a RecoverySnapshot, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>>

Source

fn read_entries<'a>( &'a self, after: &'a RecoveryPosition, through: &'a RecoveryPosition, limits: ReadLimits, ) -> Pin<Box<dyn Future<Output = Result<RecoveryPage, Error>> + Send + 'a>>

Source

fn write_entries<'a>( &'a self, entries: &'a [RecoveryEntry], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a>>

Source

fn flush<'a>( &'a self, through: &'a RecoveryPosition, ) -> Pin<Box<dyn Future<Output = Result<RecoveryPosition, Error>> + Send + 'a>>

Source

fn close(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§