pub trait StorageFactory {
type Storage;
// Required methods
fn initialize<T>(&self) -> impl Future<Output = Result<(), Error>>
where T: StorageAccess<Storage = Self::Storage>;
fn initialize_with_loader<T, L>(
&self,
loader: L,
) -> impl Future<Output = Result<(), Error>>
where T: StorageAccess<Storage = Self::Storage>,
L: DefaultLoader<Result = T::Data> + 'static;
fn get_store(&self) -> impl Future<Output = Rc<Self::Storage>>;
}
Expand description
DeviceStorageFactory
abstracts over how to initialize and retrieve the DeviceStorage
instance.
Required Associated Types§
Required Methods§
Sourcefn initialize<T>(&self) -> impl Future<Output = Result<(), Error>>where
T: StorageAccess<Storage = Self::Storage>,
fn initialize<T>(&self) -> impl Future<Output = Result<(), Error>>where
T: StorageAccess<Storage = Self::Storage>,
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.