Enum OnceState
pub enum OnceState
Current state of a Once.
Variants
-
New A closure has not been executed yet
-
Poisoned A closure was executed but panicked.
-
InProgress A thread is currently executing a closure.
-
Done A closure has completed successfully.
Implementations
impl OnceState
fn poisoned(self) -> boolReturns whether the associated
Oncehas been poisoned.Once an initialization routine for a
Oncehas panicked it will forever indicate to future forced initialization routines that it is poisoned.fn done(self) -> boolReturns whether the associated
Oncehas successfully executed a closure.
Trait Implementations
impl Clone for OnceState
fn clone(&self) -> OnceState
impl Copy for OnceState
impl Debug for OnceState
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for OnceState
impl PartialEq for OnceState
fn eq(&self, other: &OnceState) -> bool
impl StructuralPartialEq for OnceState
Auto Trait Implementations
impl Freeze for OnceState
impl RefUnwindSafe for OnceState
impl Send for OnceState
impl Sync for OnceState
impl Unpin for OnceState
impl UnsafeUnpin for OnceState
impl UnwindSafe for OnceState
Blanket Implementations
impl<T> Any for OnceState
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for OnceState
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for OnceState
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for OnceState
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for OnceState
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for OnceState
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for OnceState
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for OnceState
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for OnceState
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>