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 Fmt
s 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
sourceimpl<F> Fmt for AdHocOpts<F>where
F: FnMut(&[String], &[String], &HashMap<String, String>) -> Result<String, SingleFmtError>,
impl<F> Fmt for AdHocOpts<F>where
F: FnMut(&[String], &[String], &HashMap<String, String>) -> Result<String, SingleFmtError>,
sourcefn format(
&self,
full_name: &[String],
name: &[String],
_args: &[String],
_flags: &[char],
options: &HashMap<String, String>
) -> Result<String, SingleFmtError>
fn format(
&self,
full_name: &[String],
name: &[String],
_args: &[String],
_flags: &[char],
options: &HashMap<String, String>
) -> Result<String, SingleFmtError>
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
impl<F> !RefUnwindSafe for AdHocOpts<F>
impl<F> Send for AdHocOpts<F>where
F: Send,
impl<F> !Sync for AdHocOpts<F>
impl<F> Unpin for AdHocOpts<F>where
F: Unpin,
impl<F> UnwindSafe for AdHocOpts<F>where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more