Struct std::sys::common::thread_local::lazy::LazyKeyInner
source · pub struct LazyKeyInner<T> {
inner: UnsafeCell<Option<T>>,
}
🔬This is a nightly-only experimental API. (
thread_local_internals
)Fields§
§inner: UnsafeCell<Option<T>>
🔬This is a nightly-only experimental API. (
thread_local_internals
)Implementations§
source§impl<T> LazyKeyInner<T>
impl<T> LazyKeyInner<T>
pub const fn new() -> LazyKeyInner<T>
🔬This is a nightly-only experimental API. (
thread_local_internals
)pub unsafe fn get(&self) -> Option<&'static T>
🔬This is a nightly-only experimental API. (
thread_local_internals
)sourcepub unsafe fn initialize<F: FnOnce() -> T>(&self, init: F) -> &'static T
🔬This is a nightly-only experimental API. (thread_local_internals
)
pub unsafe fn initialize<F: FnOnce() -> T>(&self, init: F) -> &'static T
thread_local_internals
)The caller must ensure that no reference is active: this method needs unique access.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for LazyKeyInner<T>
impl<T> Send for LazyKeyInner<T>where T: Send,
impl<T> !Sync for LazyKeyInner<T>
impl<T> Unpin for LazyKeyInner<T>where T: Unpin,
impl<T> UnwindSafe for LazyKeyInner<T>where 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