Trait Writer

Source
pub trait Writer {
    // Required method
    fn write(&self, f: &mut Formatter<'_>) -> Result;
}
Expand description

A trait for types that can be written into a string.

This works very similarly to Debug, and is automatically implemented if Debug is implemented for a type. It is also implemented for any writable type inside a Mutex.

The derived implementation of Debug may change between Rust versions, so if stability is key for your use case, please implement Writer explicitly instead.

Required Methods§

Source

fn write(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Implementors§

Source§

impl<T: Debug> Writer for T

Source§

impl<T: Writer> Writer for Mutex<T>