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
.
Trait Implementations§
Auto Trait Implementations§
impl<T, U> Freeze for InitializationState<T, U>where
U: Freeze,
impl<T, U = ()> !RefUnwindSafe for InitializationState<T, U>
impl<T, U = ()> !Send for InitializationState<T, U>
impl<T, U = ()> !Sync for InitializationState<T, U>
impl<T, U> Unpin for InitializationState<T, U>where
U: Unpin,
impl<T, U = ()> !UnwindSafe for InitializationState<T, U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more