Trait fast_fmt::Fmt [] [src]

pub trait Fmt<S = Display> {
    fn fmt<W: Write>(
        &self,
        writer: &mut W,
        strategy: &S
    ) -> Result<(), W::Error>; fn size_hint(&self, strategy: &S) -> usize; fn transformed<T: Transform>(
        self,
        transformation: T
    ) -> Transformed<Self, T>
    where
        Self: Sized
, { ... } }

The formatting trait. Represents types that can be formated.

This trait is much like core::fmt::Display, core::fmt::Debug and other similar traits from core::fmt, but instead of many traits it is a single parametrized trait.

The S type parameter is formatting strategy and it defaults to Display.

Required Methods

The implementor should write itself into writer inside this function.

The implementor should estimate how many bytes would it's representation have in UTF-8 if formated using specific strategy.

If the implementor knows maximum possible size, it should return it. If the implementor doesn't know maximum possible size, it should return minimum possible size. (0 is always valid minimum)

Provided Methods

Combinator for transforming the value,

Implementors