pub struct BootstrapOnceLock<T> {
data: UnsafeCell<MaybeUninit<T>>,
state: AtomicU8,
}
🔬This is a nightly-only experimental API. (
kernel_sync_once
)Available on non-crate feature
use_std
only.Fields§
§data: UnsafeCell<MaybeUninit<T>>
🔬This is a nightly-only experimental API. (
§kernel_sync_once
)state: AtomicU8
🔬This is a nightly-only experimental API. (
kernel_sync_once
)Implementations§
Source§impl<T> BootstrapOnceLock<T>
impl<T> BootstrapOnceLock<T>
pub const fn new() -> Self
🔬This is a nightly-only experimental API. (
kernel_sync_once
)pub fn get(&self) -> Option<&T>
🔬This is a nightly-only experimental API. (
kernel_sync_once
)pub fn bootstrap(&self, bootstrap_value: T, f: impl FnOnce() -> T) -> &T
🔬This is a nightly-only experimental API. (
kernel_sync_once
)Trait Implementations§
impl<T> Send for BootstrapOnceLock<T>
impl<T> Sync for BootstrapOnceLock<T>
Auto Trait Implementations§
impl<T> !Freeze for BootstrapOnceLock<T>
impl<T> !RefUnwindSafe for BootstrapOnceLock<T>
impl<T> Unpin for BootstrapOnceLock<T>where
T: Unpin,
impl<T> UnwindSafe for BootstrapOnceLock<T>where
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