pub struct OnceLock<T> { /* private fields */ }Expand description
Implementations§
Trait Implementations§
Source§impl<'gc, T: Collect<'gc>> Collect<'gc> for OnceLock<T>
impl<'gc, T: Collect<'gc>> Collect<'gc> for OnceLock<T>
Source§const NEEDS_TRACE: bool = T::NEEDS_TRACE
const NEEDS_TRACE: bool = T::NEEDS_TRACE
As an optimization, if this type can never hold a
Gc pointer and trace is unnecessary
to call, you may set this to false. The default value is true, signaling that
Collect::trace must be called.Source§fn trace<C: Trace<'gc>>(&self, cc: &mut C)
fn trace<C: Trace<'gc>>(&self, cc: &mut C)
Must call
Trace::trace_gc (resp. Trace::trace_gc_weak) on all directly owned
Gc (resp. GcWeak) pointers. If this type holds inner types that implement Collect,
a valid implementation would simply call Trace::trace on all the held values to ensure
this. Read moreimpl<T: Eq> Eq for OnceLock<T>
impl<T: PartialEq> StructuralPartialEq for OnceLock<T>
Auto Trait Implementations§
impl<T> !Freeze for OnceLock<T>
impl<T> !RefUnwindSafe for OnceLock<T>
impl<T> !Sync for OnceLock<T>
impl<T> Send for OnceLock<T>where
T: Send,
impl<T> Unpin for OnceLock<T>where
T: Unpin,
impl<T> UnsafeUnpin for OnceLock<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for OnceLock<T>where
T: UnwindSafe,
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