pub struct LazyLock<T, F = fn() -> T> { /* private fields */ }Expand description
A synchronization primitive for lazy initialization.
Wraps OnceLock<T> and stores the initialization function in a
Mutex<Option<F>>.
Implementations§
Trait Implementations§
impl<T: Send, F: Send> Send for LazyLock<T, F>
impl<T: Send + 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
T: UnsafeUnpin,
F: UnsafeUnpin,
impl<T, F> UnwindSafe for LazyLock<T, F>where
T: UnwindSafe,
F: 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