Struct static_init::ThreadLocalLazy
source · pub struct ThreadLocalLazy<T, F = fn() -> T> { /* private fields */ }
Expand description
The type of thread local lazy.
Implementations§
source§impl<T, F> Lazy<T, F>
impl<T, F> Lazy<T, F>
sourcepub const fn as_mut_ptr(this: &Self) -> *mut T
pub const fn as_mut_ptr(this: &Self) -> *mut T
Return a pointer to the value.
The value may be in an uninitialized state.
sourcepub fn __do_init(this: &Self)where
F: FnOnce() -> T,
pub fn __do_init(this: &Self)where
F: FnOnce() -> T,
Ensure the value is initialized
Once this function is called, it is guaranteed that the value is in an initialized state.
This function is always called when the lazy is dereferenced.
sourcepub fn ensure_init(this: &Self)where
F: FnOnce() -> T,
pub fn ensure_init(this: &Self)where
F: FnOnce() -> T,
Ensure the value is initialized
Once this function is called, it is guaranteed that the value is in an initialized state.
This function is always called when the lazy is dereferenced.