pub struct OnceLockBrand;Expand description
Brand for std::sync::OnceLock.
Trait Implementations§
Source§impl Clone for OnceLockBrand
impl Clone for OnceLockBrand
Source§fn clone(&self) -> OnceLockBrand
fn clone(&self) -> OnceLockBrand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OnceLockBrand
impl Debug for OnceLockBrand
Source§impl Default for OnceLockBrand
impl Default for OnceLockBrand
Source§fn default() -> OnceLockBrand
fn default() -> OnceLockBrand
Returns the “default value” for a type. Read more
Source§impl Hash for OnceLockBrand
impl Hash for OnceLockBrand
Source§impl Once for OnceLockBrand
impl Once for OnceLockBrand
Source§fn new<A>() -> ApplyOnce<Self, A>
fn new<A>() -> ApplyOnce<Self, A>
Creates a new, uninitialized OnceLock.
§Type Signature
forall a. Once OnceLockBrand => () -> OnceLock a
§Returns
A new, empty OnceLock.
§Examples
use fp_library::classes::once::Once;
use fp_library::brands::OnceLockBrand;
let cell = <OnceLockBrand as Once>::new::<i32>();
assert_eq!(<OnceLockBrand as Once>::get(&cell), None);Source§fn set<A>(a: &ApplyOnce<Self, A>, value: A) -> Result<(), A>
fn set<A>(a: &ApplyOnce<Self, A>, value: A) -> Result<(), A>
Sets the value of the OnceLock.
Returns Ok(()) if the value was set, or Err(value) if the cell was already initialized.
§Type Signature
forall a. Once OnceLockBrand => (OnceLock a, a) -> Result<(), a>
§Parameters
a: TheOnceLock.value: The value to set.
§Returns
Ok(()) on success, or Err(value) if already initialized.
Source§fn into_inner<A>(a: ApplyOnce<Self, A>) -> Option<A>
fn into_inner<A>(a: ApplyOnce<Self, A>) -> Option<A>
type Output<A> = <OnceLockBrand as Kind0L1T>::Output<A>
Source§impl Ord for OnceLockBrand
impl Ord for OnceLockBrand
Source§fn cmp(&self, other: &OnceLockBrand) -> Ordering
fn cmp(&self, other: &OnceLockBrand) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OnceLockBrand
impl PartialEq for OnceLockBrand
Source§impl PartialOrd for OnceLockBrand
impl PartialOrd for OnceLockBrand
impl Copy for OnceLockBrand
impl Eq for OnceLockBrand
impl StructuralPartialEq for OnceLockBrand
Auto Trait Implementations§
impl Freeze for OnceLockBrand
impl RefUnwindSafe for OnceLockBrand
impl Send for OnceLockBrand
impl Sync for OnceLockBrand
impl Unpin for OnceLockBrand
impl UnwindSafe for OnceLockBrand
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