use crate::backend::StorageBackend;
#[async_trait::async_trait]
pub trait BatchBuilder: StorageBackend {
type Batch: Default + Send + Sized;
fn batch_begin() -> Self::Batch {
Self::Batch::default()
}
async fn batch_commit(&self, batch: Self::Batch, durability: bool) -> Result<(), Self::Error>;
}
pub trait Batch<K, V>: BatchBuilder {
fn batch_insert(&self, batch: &mut Self::Batch, key: &K, value: &V) -> Result<(), Self::Error>;
fn batch_delete(&self, batch: &mut Self::Batch, key: &K) -> Result<(), Self::Error>;
}