pub trait StorageFactory {
    type Storage;

    // Required methods
    fn initialize<'life0, 'async_trait, T>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where T: StorageAccess<Storage = Self::Storage> + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn get_store<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Arc<Self::Storage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

DeviceStorageFactory abstracts over how to initialize and retrieve the DeviceStorage instance.

Required Associated Types§

source

type Storage

The storage type used to manage persisted data.

Required Methods§

source

fn initialize<'life0, 'async_trait, T>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where T: StorageAccess<Storage = Self::Storage> + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Initialize the storage to be able to manage storage for objects of type T. This will return an Error once get_store is called the first time.

source

fn get_store<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Arc<Self::Storage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the store singleton instance.

Object Safety§

This trait is not object safe.

Implementors§