pub struct LazyLock<T, F: FnOnce() -> T = fn() -> T> {
once: OnceLock<T>,
f: MaybeUninit<F>,
}
🔬This is a nightly-only experimental API. (
kernel_sync_once
)Available on non-crate feature
use_std
only.Fields§
§once: OnceLock<T>
🔬This is a nightly-only experimental API. (
§kernel_sync_once
)f: MaybeUninit<F>
🔬This is a nightly-only experimental API. (
kernel_sync_once
)Implementations§
Trait Implementations§
impl<T, F: FnOnce() -> T> Send for LazyLock<T, F>
impl<T, F: FnOnce() -> T> 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>where
F: Unpin,
T: Unpin,
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