[][src]Struct grin_util::OneTime

pub struct OneTime<T> { /* fields omitted */ }

Encapsulation of a RwLock<Option> for one-time initialization. This implementation will purposefully fail hard if not used properly, for example if not initialized before being first used (borrowed).

Methods

impl<T> OneTime<T> where
    T: Clone
[src]

Builds a new uninitialized OneTime.

Initializes the OneTime, should only be called once after construction. Will panic (via assert) if called more than once.

Borrows the OneTime, should only be called after initialization. Will panic (via expect) if called before initialization.

Trait Implementations

impl<T: Clone> Clone for OneTime<T>
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T> Send for OneTime<T> where
    T: Send + Sync

impl<T> Sync for OneTime<T> where
    T: Send + Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Erased for T

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any