Struct OnceState
struct OnceState { ... }
State yielded to [Once::call_once_force()]’s closure parameter. The state
can be used to query the poison status of the Once.
Implementations
impl OnceState
fn is_poisoned(self: &Self) -> boolReturns
trueif the associatedOncewas poisoned prior to the invocation of the closure passed to [Once::call_once_force()].Examples
A poisoned [
Once]:use Once; use thread; static INIT: Once = new; // poison the once let handle = spawn; assert!; INIT.call_once_force;An unpoisoned [
Once]:use Once; static INIT: Once = new; INIT.call_once_force;
impl Debug for OnceState
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
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
impl<T> Any for OnceState
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for OnceState
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for OnceState
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for OnceState
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for OnceState
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for OnceState
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for OnceState
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>