Skip to main content

Formatter

Trait Formatter 

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

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)

Source

fn pop_label(&mut self)

Source

fn maybe_color(&self) -> bool

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Formatter + ?Sized> Formatter for &mut T

Source§

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

Source§

fn push_label(&mut self, label: &str)

Source§

fn pop_label(&mut self)

Source§

fn maybe_color(&self) -> bool

Source§

impl<T: Formatter + ?Sized> Formatter for Box<T>

Source§

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

Source§

fn push_label(&mut self, label: &str)

Source§

fn pop_label(&mut self)

Source§

fn maybe_color(&self) -> bool

Implementors§