pub struct Once { /* private fields */ }
Expand description
A dependency-tracking wrapper for parking_lot::Once
.
Implementations§
Source§impl Once
impl Once
Sourcepub fn call_once(&self, f: impl FnOnce())
pub fn call_once(&self, f: impl FnOnce())
This call is considered as “locking this Once
” and it participates in dependency
tracking as such.
§Panics
This method will panic if f
panics, poisoning this Once
. In addition, this function
panics when the lock acquisition order is determined to be inconsistent.
Sourcepub fn call_once_force(&self, f: impl FnOnce(OnceState))
pub fn call_once_force(&self, f: impl FnOnce(OnceState))
Performs the given initialization routine once and only once.
This method is identical to Once::call_once
except it ignores poisoning.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Once
impl RefUnwindSafe for Once
impl Send for Once
impl Sync for Once
impl Unpin for Once
impl UnwindSafe for Once
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