pub enum InitializationState<T, U = ()> {
Initializing(HashMap<&'static str, Option<Box<dyn Any>>>, U),
Partial,
Initialized(Rc<T>),
}
Expand description
The state of the factory. Only one state can be active at a time because once
the DeviceStorage
is created, there’s no way to change the keys, so there’s
no need to keep the set of keys anymore.
Variants§
Initializing(HashMap<&'static str, Option<Box<dyn Any>>>, U)
This represents the state of the factory before the first request to get
DeviceStorage
. It maintains a list of all keys that might be used for
storage.
Partial
A temporary state used to help in the conversion from [Initializing] to [Initialized]. This value is never intended to be read, but is necessary to keep the memory valid while ownership is taken of the values in [Initializing], but before the values in [Initialized] are ready.
Initialized(Rc<T>)
This represents the initialized state. When this is active, it is no longer
possible to add new storage keys to DeviceStorage
.
Implementations§
Source§impl<T> InitializationState<T, ()>
impl<T> InitializationState<T, ()>
Source§impl<T> InitializationState<T, DirectoryProxy>
impl<T> InitializationState<T, DirectoryProxy>
Sourcepub fn with_storage_dir(storage_dir: DirectoryProxy) -> Self
pub fn with_storage_dir(storage_dir: DirectoryProxy) -> Self
Construct the default InitializationState
.