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§
Sourcefn write<E: Display>(&mut self, input: E) -> Result<(), Self::Error>
fn write<E: Display>(&mut self, input: E) -> Result<(), Self::Error>
Function that will write any element that implement std::fmt::Display.
fn write_str(&mut self, input: &str) -> Result<(), Self::Error>
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.