pub struct Once { /* private fields */ }
👎Deprecated: The
parkinglot
feature has been renamed parking_lot
Expand description
A dependency-tracking wrapper for ::parking_lot::Once
.
Implementations§
Source§impl Once
impl Once
Sourcepub const fn new() -> Self
👎Deprecated: The parkinglot
feature has been renamed parking_lot
pub const fn new() -> Self
parkinglot
feature has been renamed parking_lot
Create a new Once
value.
Sourcepub fn state(&self) -> OnceState
👎Deprecated: The parkinglot
feature has been renamed parking_lot
pub fn state(&self) -> OnceState
parkinglot
feature has been renamed parking_lot
Returns the current state of this Once
.
Sourcepub fn call_once(&self, f: impl FnOnce())
👎Deprecated: The parkinglot
feature has been renamed parking_lot
pub fn call_once(&self, f: impl FnOnce())
parkinglot
feature has been renamed parking_lot
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))
👎Deprecated: The parkinglot
feature has been renamed parking_lot
pub fn call_once_force(&self, f: impl FnOnce(OnceState))
parkinglot
feature has been renamed parking_lot
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