pub struct Once<T> { /* private fields */ }Expand description
A minimal, spin-based Once initializer.
This type is useful for global singletons in no_std environments.
It supports one-time initialization with call_once.
§State machine
0: uninitialized1: initialization in progress2: initialized
Implementations§
Trait Implementations§
impl<T: Send> Send for Once<T>
impl<T: Send + Sync> Sync for Once<T>
Auto Trait Implementations§
impl<T> !Freeze for Once<T>
impl<T> !RefUnwindSafe for Once<T>
impl<T> Unpin for Once<T>where
T: Unpin,
impl<T> UnsafeUnpin for Once<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Once<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more