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 initialize_with_loader<'life0, 'async_trait, T>(
&'life0 self,
loader: impl 'async_trait + DefaultLoader<Result = T::Data> + Send + Sync + 'static,
) -> 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§
Required Methods§
sourcefn 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 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.
sourcefn initialize_with_loader<'life0, 'async_trait, T>(
&'life0 self,
loader: impl 'async_trait + DefaultLoader<Result = T::Data> + Send + Sync + 'static,
) -> 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 initialize_with_loader<'life0, 'async_trait, T>(
&'life0 self,
loader: impl 'async_trait + DefaultLoader<Result = T::Data> + Send + Sync + 'static,
) -> 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.
Object Safety§
This trait is not object safe.