Struct swiss_army_knife::StaticInitializedOnce[][src]

pub struct StaticInitializedOnce<Value: Sized> { /* fields omitted */ }

A wrapper type to use with mutable static fields where one does not want the overhead and inflexibility of lazy_static!.

Implementations

impl<Value: Sized> StaticInitializedOnce<Value>[src]

pub const fn uninitialized() -> Self[src]

Uninitialized value suitable for use in a static.

pub fn initialize_once(&mut self, value: Value) -> &mut Value[src]

Initialize once.

Not thread safe; indeed, may panic in debug mode.

pub fn value(&self) -> &'static Value[src]

Value.

pub fn value_mut(&mut self) -> &'static mut Value[src]

Value.

Auto Trait Implementations

impl<Value> RefUnwindSafe for StaticInitializedOnce<Value> where
    Value: RefUnwindSafe

impl<Value> Send for StaticInitializedOnce<Value> where
    Value: Send

impl<Value> Sync for StaticInitializedOnce<Value> where
    Value: Sync

impl<Value> Unpin for StaticInitializedOnce<Value> where
    Value: Unpin

impl<Value> UnwindSafe for StaticInitializedOnce<Value> where
    Value: UnwindSafe

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<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.