pub struct Once { /* private fields */ }
Expand description
Wrapper around std::sync::Once
.
Refer to the crate-level documentaiton for the differences between this struct and the one it wraps.
Implementations§
Source§impl Once
impl Once
Sourcepub fn call_once<F>(&self, f: F)where
F: FnOnce(),
pub fn call_once<F>(&self, f: F)where
F: FnOnce(),
Wrapper for std::sync::Once::call_once
.
§Panics
In addition to the panics that Once
can cause, this method will panic if calling it
introduces a cycle in the lock dependency graph.
Sourcepub fn call_once_force<F>(&self, f: F)
pub fn call_once_force<F>(&self, f: F)
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Returns true if some call_once
has completed successfully.
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