Trait bee_storage::backend::StorageBackend [−][src]
pub trait StorageBackend: Send + Sized + Sync + 'static { type ConfigBuilder: Default + DeserializeOwned + Into<Self::Config>; type Config: Clone + Send + Sync; type 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>; }
Expand description
Trait to be implemented on a storage backend. Determines how to start and shutdown the backend.
Associated Types
type ConfigBuilder: Default + DeserializeOwned + Into<Self::Config>[src]
type ConfigBuilder: Default + DeserializeOwned + Into<Self::Config>[src]Helps build the associated Config.
Required methods
Returns the size of the database in bytes. Not all backends may be able to provide this operation.
fn get_health(&self) -> Result<Option<StorageHealth>, Self::Error>[src]
fn get_health(&self) -> Result<Option<StorageHealth>, Self::Error>[src]Returns the health status of the database. Not all backends may be able to provide this operation.
fn set_health(&self, health: StorageHealth) -> Result<(), Self::Error>[src]
fn set_health(&self, health: StorageHealth) -> Result<(), Self::Error>[src]Sets the health status of the database. Not all backends may be able to provide this operation.