nextest_runner::write_str

Trait WriteStr

source
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§

source

fn write_str(&mut self, s: &str) -> Result<()>

Writes a string to the writer.

source

fn write_str_flush(&mut self) -> Result<()>

Flushes the writer, ensuring that all intermediately buffered contents reach their destination.

Provided Methods§

source

fn write_char(&mut self, c: char) -> Result<()>

Writes a single character to the writer.

source

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>

Writes a formatted string to the writer.

Implementations on Foreign Types§

source§

impl WriteStr for String

source§

fn write_str(&mut self, s: &str) -> Result<()>

source§

fn write_str_flush(&mut self) -> Result<()>

source§

fn write_char(&mut self, c: char) -> Result<()>

source§

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

source§

fn write_str(&mut self, s: &str) -> Result<()>

source§

fn write_str_flush(&mut self) -> Result<()>

source§

fn write_char(&mut self, c: char) -> Result<()>

source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>

Implementors§

source§

impl<T> WriteStr for Indented<'_, T>
where T: WriteStr + ?Sized,