pub struct LazyLock<T, F = fn() -> T> {
cell: OnceCell<T>,
init: UnsafeCell<Option<F>>,
}Expand description
A lazily initialized value.
Fields§
§cell: OnceCell<T>§init: UnsafeCell<Option<F>>Implementations§
Trait Implementations§
impl<T: Send, F: Send> Send for LazyLock<T, F>
impl<T: Sync, 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> Unpin for LazyLock<T, F>
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§
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