pub struct Lazy<T, F = Box<dyn Future<Output = T> + Send>> { /* fields omitted */ }Expand description
A value which is initialized on the first access.
Note: unlike OnceCell, dropping the Future that is running an unfinished initializer function
will not discard the pending state.
Creates a new lazy value with the given initializing future.
Gets the value without blocking or starting the initialization.
Gets the value without blocking or starting the initialization.
Gets the value if it was set.
Forces the evaluation of this lazy value and returns a reference to the result. This is
equivalent to the Future impl on &Lazy, but is explicit and may be simpler to call.
The type of value produced on completion.
Attempt to resolve the future to a final value, registering
the current task for wakeup if the value is not yet available. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.