Struct pfmt::extras::Lazy

source ·
pub struct Lazy<T, F>where
    T: Fmt,
    F: FnMut() -> T,
{ /* private fields */ }
Expand description

A wrapper over a closure producing a Fmt.

Note that the closure can be FnMut, not just Fn. Automatically honors any flags, arguments and options the produced Fmt recognizes.

Implementations

Trait Implementations

Call the wrapped closure to get a Fmt, then call format on it.

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.