pub struct OnceCellBrand;Expand description
Brand for std::cell::OnceCell.
Trait Implementations§
Source§impl Clone for OnceCellBrand
impl Clone for OnceCellBrand
Source§fn clone(&self) -> OnceCellBrand
fn clone(&self) -> OnceCellBrand
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 OnceCellBrand
impl Debug for OnceCellBrand
Source§impl Default for OnceCellBrand
impl Default for OnceCellBrand
Source§fn default() -> OnceCellBrand
fn default() -> OnceCellBrand
Returns the “default value” for a type. Read more
Source§impl Hash for OnceCellBrand
impl Hash for OnceCellBrand
Source§impl Once for OnceCellBrand
impl Once for OnceCellBrand
Source§fn new<A>() -> ApplyOnce<Self, A>
fn new<A>() -> ApplyOnce<Self, A>
Creates a new, uninitialized OnceCell.
§Type Signature
forall a. Once OnceCellBrand => () -> OnceCell a
§Returns
A new, empty OnceCell.
§Examples
use fp_library::classes::once::Once;
use fp_library::brands::OnceCellBrand;
let cell = <OnceCellBrand as Once>::new::<i32>();
assert_eq!(<OnceCellBrand 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 OnceCell.
Returns Ok(()) if the value was set, or Err(value) if the cell was already initialized.
§Type Signature
forall a. Once OnceCellBrand => (OnceCell a, a) -> Result<(), a>
§Parameters
a: TheOnceCell.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> = <OnceCellBrand as Kind0L1T>::Output<A>
Source§impl Ord for OnceCellBrand
impl Ord for OnceCellBrand
Source§fn cmp(&self, other: &OnceCellBrand) -> Ordering
fn cmp(&self, other: &OnceCellBrand) -> 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 OnceCellBrand
impl PartialEq for OnceCellBrand
Source§impl PartialOrd for OnceCellBrand
impl PartialOrd for OnceCellBrand
impl Copy for OnceCellBrand
impl Eq for OnceCellBrand
impl StructuralPartialEq for OnceCellBrand
Auto Trait Implementations§
impl Freeze for OnceCellBrand
impl RefUnwindSafe for OnceCellBrand
impl Send for OnceCellBrand
impl Sync for OnceCellBrand
impl Unpin for OnceCellBrand
impl UnwindSafe for OnceCellBrand
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