pub trait WriteStr {
// Required methods
fn write_str(&mut self, s: &str) -> Result<()>;
fn write_str_flush(&mut self) -> Result<()>;
// Provided methods
fn write_char(&mut self, c: char) -> Result<()> { ... }
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()> { ... }
}
Expand description
A trait that abstracts over writing strings to a writer.
For more, see the module-level documentation.
Required Methods§
sourcefn write_str_flush(&mut self) -> Result<()>
fn write_str_flush(&mut self) -> Result<()>
Flushes the writer, ensuring that all intermediately buffered contents reach their destination.
Provided Methods§
sourcefn write_char(&mut self, c: char) -> Result<()>
fn write_char(&mut self, c: char) -> Result<()>
Writes a single character to the writer.