use async_trait::async_trait;
use serde::de::DeserializeOwned;
#[async_trait]
pub trait StorageBackend: Send + Sized + Sync + 'static {
type ConfigBuilder: Default + DeserializeOwned + Into<Self::Config>;
type Config: Clone + Send + Sync;
type Error: std::error::Error + Send;
async fn start(config: Self::Config) -> Result<Self, Self::Error>;
async fn shutdown(self) -> Result<(), Self::Error>;
async fn size(&self) -> Result<Option<usize>, Self::Error>;
}