Struct swiss_army_knife::StaticInitializedOnce [−][src]
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,
Value: RefUnwindSafe,
impl<Value> Send for StaticInitializedOnce<Value> where
Value: Send,
Value: Send,
impl<Value> Sync for StaticInitializedOnce<Value> where
Value: Sync,
Value: Sync,
impl<Value> Unpin for StaticInitializedOnce<Value> where
Value: Unpin,
Value: Unpin,
impl<Value> UnwindSafe for StaticInitializedOnce<Value> where
Value: UnwindSafe,
Value: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,