Skip to main content

StdOut

Trait StdOut 

Source
pub trait StdOut: Send + 'static {
    // Required methods
    fn write_bytes(&self, bytes: &[u8]) -> Result;
    fn write_str(&self, s: &str) -> Result;
    fn write_fmt(&self, args: Arguments<'_>) -> Result;
    fn flush(&self) -> Result;
}
Expand description

A trait describes common operations with the stdout.

Required Methods§

Source

fn write_bytes(&self, bytes: &[u8]) -> Result

Writes a bytes slice into the stdout, returning whether write succeeded.

Source

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

Writes a string slice.

Source

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

Writes a formatted string.

Source

fn flush(&self) -> Result

Ensures that none of the previously written bytes are still buffered.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§