pub struct LateStatic<T> { /* private fields */ }
Expand description
Static value that is manually initialized at runtime.
Implementations§
Source§impl<T> LateStatic<T>
impl<T> LateStatic<T>
Sourcepub unsafe fn assign(instance: &LateStatic<T>, val: T)
pub unsafe fn assign(instance: &LateStatic<T>, val: T)
Assign a value to the late static.
This only works once. A second call to assign for a given variable will panic.
§Safety
This is completely unsafe if there is even the slightest chance of another thread trying to dereference the variable.
Sourcepub unsafe fn clear(instance: &LateStatic<T>)
pub unsafe fn clear(instance: &LateStatic<T>)
Invalidate the late static by removing its inner value.
§Safety
This is completely unsafe if there is even the slightest chance of another thread trying to dereference the variable.
Sourcepub unsafe fn has_value(instance: &LateStatic<T>) -> bool
pub unsafe fn has_value(instance: &LateStatic<T>) -> bool
Whether a value is assigned to this LateStatic.
§Safety
This is completely unsafe if there is even the slightest chance of another thread trying to dereference the variable.
Trait Implementations§
Source§impl<T> Deref for LateStatic<T>
impl<T> Deref for LateStatic<T>
Source§impl<T> DerefMut for LateStatic<T>
impl<T> DerefMut for LateStatic<T>
impl<T: Send> Send for LateStatic<T>
impl<T: Sync> Sync for LateStatic<T>
Auto Trait Implementations§
impl<T> !Freeze for LateStatic<T>
impl<T> !RefUnwindSafe for LateStatic<T>
impl<T> Unpin for LateStatic<T>where
T: Unpin,
impl<T> UnwindSafe for LateStatic<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