Struct pfmt::extras::AdHocOpts

source ·
pub struct AdHocOpts<F>where
    F: FnMut(&[String], &[String], &HashMap<String, String>) -> Result<String, SingleFmtError>,
{ /* private fields */ }
Expand description

A wrapper over a closure that accepts full_name, name and options parameters of the format method on Fmt.

Note that the closure can be FnMut, not just Fn. Also note that while it is possible to call other Fmts recursively from the closure, the arguments and flags of the original format call will be lost and will have to be somehow replaced by the closure itself.

Implementations

Trait Implementations

Perform the formatting of a single placeholder. Placeholder’s full name, name segments of child format units, arguments, flags and options will be passed to this method. 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.