pub struct LazyLock<T, F = fn() -> T> {
once: OnceLock<T>,
f: MaybeUninit<F>,
}Available on crate feature
full and non-crate feature use_std only.Fields§
§once: OnceLock<T>§f: MaybeUninit<F>Implementations§
Trait Implementations§
impl<T: Sync + Send, F: Send> Sync for LazyLock<T, F>
Auto Trait Implementations§
impl<T, F = fn() -> T> !Freeze for LazyLock<T, F>
impl<T, F = fn() -> T> !RefUnwindSafe for LazyLock<T, F>
impl<T, F> Send for LazyLock<T, F>where
T: Send,
F: Send,
impl<T, F> Unpin for LazyLock<T, F>where
F: Unpin,
T: Unpin,
impl<T, F> UnsafeUnpin for LazyLock<T, F>where
F: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, F> UnwindSafe for LazyLock<T, F>where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more