pub trait Formatter<T> {
    // Required method
    fn format(&mut self, buf: &mut Buffer, thing: T);
}
Expand description

Format items for printing

Formatter is basically the same as Inline, except that the formatting isn’t implemented by the thing-to-be-printed itself and that this Formatter may mutate itself. This makes the trait very flexible.

Required Methods§

source

fn format(&mut self, buf: &mut Buffer, thing: T)

Format and append the thing into the Buffer

Implementors§

source§

impl<T, F: FnMut(&mut Buffer, T)> Formatter<T> for F

source§

impl<T, F: FnMut(T) -> W, W: Inline> Formatter<T> for WrapFmt<F>

source§

impl<T: Pushable<M>, M> Formatter<T> for PushableFmt<M>