Trait parse_display::DisplayFormat

source ·
pub trait DisplayFormat<T: ?Sized> {
    // Required method
    fn write(&self, f: &mut Formatter<'_>, value: &T) -> Result;
}
Expand description

A trait to customize the formatting method.

You can customize the field format by specifying a value that implements this trait with #[display(with = ...)].

The expression specified for #[display(with = ...)] must be lightweight because the expression specified for #[display(with = ...)] is evaluated each time the field is formatted.

Required Methods§

source

fn write(&self, f: &mut Formatter<'_>, value: &T) -> Result

Format the specified value.

Implementors§