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;
#[must_use]    fn start<'async_trait>(
        config: Self::Config
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
#[must_use] fn shutdown<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
#[must_use] fn size<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Option<usize>, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn get_health<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Option<StorageHealth>, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn set_health<'life0, 'async_trait>(
        &'life0 self,
        health: StorageHealth
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

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]

Helps build the associated Config.

type Config: Clone + Send + Sync[src]

Holds the backend options.

type Error: Error + Send[src]

Returned on failed operations.

Loading content...

Required methods

#[must_use]fn start<'async_trait>(
    config: Self::Config
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Initializes and starts the backend.

#[must_use]fn shutdown<'async_trait>(
    self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Shutdowns the backend.

#[must_use]fn size<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<usize>, Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Returns the size of the database in bytes. Not all backends may be able to provide this operation.

#[must_use]fn get_health<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<StorageHealth>, Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Returns the health status of the database. Not all backends may be able to provide this operation.

#[must_use]fn set_health<'life0, 'async_trait>(
    &'life0 self,
    health: StorageHealth
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Sets the health status of the database. Not all backends may be able to provide this operation.

Loading content...

Implementors

Loading content...