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>,
        memory: RetainedMemory,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RecoverySnapshot>, Error>> + Send + '_>>;
    fn write_snapshot(
        &self,
        snapshot: StorageBatch<RecoverySnapshot>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>;
    fn read_entries<'a>(
        &'a self,
        after: &'a RecoveryPosition,
        through: &'a RecoveryPosition,
        limits: ReadLimits,
        memory: RetainedMemory,
    ) -> Pin<Box<dyn Future<Output = Result<RecoveryPage, Error>> + Send + 'a>>;
    fn write_entries(
        &self,
        entries: StorageBatch<RecoveryEntry>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>;
    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>, memory: RetainedMemory, ) -> Pin<Box<dyn Future<Output = Result<Option<RecoverySnapshot>, Error>> + Send + '_>>

Source

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

Source

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

Source

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

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§