WriterExt

Trait WriterExt 

Source
pub trait WriterExt {
    type Error: Error;

    // Required methods
    fn write<E: Display>(&mut self, input: E) -> Result<(), Self::Error>;
    fn write_str(&mut self, input: &str) -> Result<(), Self::Error>;
    fn write_char(&mut self, input: char) -> Result<(), Self::Error>;
}
Expand description

Abstraction layer allowing not only to write to std::fmt::Write but also to std::io::Write.

Required Associated Types§

Required Methods§

Source

fn write<E: Display>(&mut self, input: E) -> Result<(), Self::Error>

Function that will write any element that implement std::fmt::Display.

Source

fn write_str(&mut self, input: &str) -> Result<(), Self::Error>

Source

fn write_char(&mut self, input: char) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§