Trait Formatter

Source
pub trait Formatter: Write {
    // Required methods
    fn raw(&mut self) -> Result<Box<dyn Write + '_>>;
    fn push_label(&mut self, label: &str) -> Result<()>;
    fn pop_label(&mut self) -> Result<()>;
}

Required Methods§

Source

fn raw(&mut self) -> Result<Box<dyn Write + '_>>

Returns the backing Write. This is useful for writing data that is already formatted, such as in the graphical log.

Source

fn push_label(&mut self, label: &str) -> Result<()>

Source

fn pop_label(&mut self) -> Result<()>

Implementations§

Source§

impl dyn Formatter + '_

Source

pub fn labeled<S: AsRef<str>>( &mut self, label: S, ) -> LabeledWriter<&mut Self, S>

Source

pub fn with_label<E: From<Error>>( &mut self, label: &str, write_inner: impl FnOnce(&mut dyn Formatter) -> Result<(), E>, ) -> Result<(), E>

Trait Implementations§

Source§

impl<'a> AsMut<dyn Formatter + 'a> for TemplateFormatter<'a>

Source§

fn as_mut(&mut self) -> &mut (dyn Formatter + 'a)

Converts this type into a mutable reference of the (usually inferred) input type.

Implementors§