pub struct Lazy<T> { /* private fields */ }
Expand description

Stores an operation which can be evaluated when required.

Implementations

Constructs a new Lazy<T> from a closure implementing FnOnce() -> T.

Forces evaluation of the underlying function.

Forces evaluation of the underlying function and returns the inside value, consuming the Lazy<T>.

Returns an immutable reference to the result of the function.

Trait Implementations

Returns a mutable reference to the result of the function.

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.