use serde::de::DeserializeOwned;
use crate::system::StorageHealth;
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;
fn start(config: Self::Config) -> Result<Self, Self::Error>;
fn shutdown(self) -> Result<(), Self::Error>;
fn size(&self) -> Result<Option<usize>, Self::Error>;
fn get_health(&self) -> Result<Option<StorageHealth>, Self::Error>;
fn set_health(&self, health: StorageHealth) -> Result<(), Self::Error>;
}