pub struct LazyInit<T> { /* private fields */ }
Expand description
Implementations§
source§impl<T> LazyInit<T>
impl<T> LazyInit<T>
sourcepub fn try_get(&self) -> Option<&T>
pub fn try_get(&self) -> Option<&T>
Gets a reference to the value.
Returns None
if the value is not initialized.
sourcepub unsafe fn get_unchecked(&self) -> &T
pub unsafe fn get_unchecked(&self) -> &T
Gets the reference to the value without checking if it is initialized.
Safety
Must be called after initialization.
sourcepub unsafe fn get_mut_unchecked(&mut self) -> &mut T
pub unsafe fn get_mut_unchecked(&mut self) -> &mut T
Get a mutable reference to the value without checking if it is initialized.
Safety
Must be called after initialization.
Trait Implementations§
impl<T: Send> Send for LazyInit<T>
impl<T: Send + Sync> Sync for LazyInit<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for LazyInit<T>
impl<T> Unpin for LazyInit<T>where
T: Unpin,
impl<T> UnwindSafe for LazyInit<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