Trait manyfmt::Fmt

source ·
pub trait Fmt<F: ?Sized> {
    // Required method
    fn fmt(&self, fmt: &mut Formatter<'_>, fopt: &F) -> Result;
}
Expand description

Implement this trait to provide a new kind of formatting, F, for values of type Self.

The type F may be used to carry formatting options, or it may be a simple unit struct which merely serves to select the implementation. See the crate documentation for examples.

Required Methods§

source

fn fmt(&self, fmt: &mut Formatter<'_>, fopt: &F) -> Result

Formats self as specified by fopt into destination fmt.

Errors

Returns Err if and only if fmt returns Err. Implementations should never return an error in any other circumstance, as this would, for example, cause uses of ToString or format! to panic.

Implementations on Foreign Types§

source§

impl Fmt<Unquote> for str

source§

fn fmt(&self, fmt: &mut Formatter<'_>, _: &Unquote) -> Result

source§

impl<F, T: Fmt<F>> Fmt<F> for &T

Forwards to the referent.

source§

fn fmt(&self, fmt: &mut Formatter<'_>, fopt: &F) -> Result

source§

impl<F, T: Fmt<F>> Fmt<F> for &mut T

Forwards to the referent.

source§

fn fmt(&self, fmt: &mut Formatter<'_>, fopt: &F) -> Result

Implementors§