pub struct Once<T> { /* private fields */ }Expand description
Single-writer, multi-reader Once cell. set may be called at most
once (a second call returns Err with the value back); get returns
None until then and Some(&T) forever after.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Once<T>
impl<T> !RefUnwindSafe for Once<T>
impl<T> Send for Once<T>where
T: Send,
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