pub struct Lazy<T, B, F = fn() -> T> { /* private fields */ }Expand description
A type for lazy initialization of e.g. global static variables, which
provides the same functionality as the lazy_static! macro.
Implementations§
Source§impl<T, B, F> Lazy<T, B, F>
impl<T, B, F> Lazy<T, B, F>
Sourcepub fn is_initialized(lazy: &Self) -> bool
pub fn is_initialized(lazy: &Self) -> bool
Returns true if the Lazy has been successfully initialized.
Sourcepub fn is_poisoned(lazy: &Self) -> bool
pub fn is_poisoned(lazy: &Self) -> bool
Returns true if the Lazy has been poisoned.
Trait Implementations§
Auto Trait Implementations§
impl<T, B, F = fn() -> T> !Freeze for Lazy<T, B, F>
impl<T, B, F = fn() -> T> !RefUnwindSafe for Lazy<T, B, F>
impl<T, B, F> Send for Lazy<T, B, F>
impl<T, B, F> Sync for Lazy<T, B, F>
impl<T, B, F> Unpin for Lazy<T, B, F>
impl<T, B, F> UnwindSafe for Lazy<T, B, F>
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