[][src]Enum abi_stable::external_types::parking_lot::once::ROnceState

#[repr(u8)]pub enum ROnceState {
    New,
    Poisoned,
    InProgress,
    Done,
}

Describes the running state of an ROnce.

Variants

New

An ROnce that hasn't started running

Poisoned

An ROnce that panicked inside call_once*

InProgress

An ROnce that is the middle of calling call_once*

Done

An ROnce that has already run.

Implementations

impl ROnceState[src]

pub fn poisoned(&self) -> bool[src]

Whether the ROnce is poisoned,requiring call_once_force to run.

Example

use abi_stable::external_types::ROnce;

use std::panic::AssertUnwindSafe;

let once=ROnce::new();

let _=std::panic::catch_unwind(AssertUnwindSafe(||{
    once.call_once(|| panic!() );
}));

assert!(once.state().poisoned());

pub fn done(&self) -> bool[src]

Whether the ROnce has already finished running.

Example

use abi_stable::external_types::ROnce;

let once=ROnce::new();

once.call_once(|| () );

assert!(once.state().done());

Trait Implementations

impl Clone for ROnceState[src]

impl Copy for ROnceState[src]

impl Debug for ROnceState[src]

impl Eq for ROnceState[src]

impl From<OnceState> for ROnceState[src]

impl GetStaticEquivalent_ for ROnceState[src]

type StaticEquivalent = _static_ROnceState

impl Into<OnceState> for ROnceState[src]

impl IntoReprRust for ROnceState[src]

type ReprRust = OnceState

The #[repr(Rust)] equivalent.

impl PartialEq<ROnceState> for ROnceState[src]

impl StableAbi for ROnceState[src]

type IsNonZeroType = False

Whether this type has a single invalid bit-pattern. Read more

impl StructuralEq for ROnceState[src]

impl StructuralPartialEq for ROnceState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> BorrowOwned<'a> for T where
    T: 'a + Clone
[src]

type ROwned = T

The owned type, stored in RCow::Owned

type RBorrowed = &'a T

The borrowed type, stored in RCow::Borrowed

impl<T> From<T> for T[src]

impl<T> GetWithMetadata for T[src]

type ForSelf = WithMetadata_<T, T>

This is always WithMetadata_<Self, Self>

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The error type returned when the conversion fails.

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more

impl<This> ValidTag_Bounds for This where
    This: Debug + Clone + PartialEq<This>, 
[src]