Skip to main content

StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn keyspace(
        &self,
        name: &str,
    ) -> Result<(String, Arc<dyn KeyspaceOps>), AppError>;
    fn batch(&self) -> Box<dyn BatchOps>;
    fn persist(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + '_>>;
}
Expand description

Factory: create keyspaces, create batches, persist/flush.

Required Methods§

Source

fn keyspace( &self, name: &str, ) -> Result<(String, Arc<dyn KeyspaceOps>), AppError>

Source

fn batch(&self) -> Box<dyn BatchOps>

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§