Skip to main content

Sink

Trait Sink 

Source
pub trait Sink {
    // Required methods
    fn literal(&mut self, text: &str) -> Result<()>;
    fn arg(&mut self, name: ArgName, value: &dyn DisplayBytes) -> Result<()>;
}
Expand description

Destination of formatting, which keeps the format string’s text apart from its arguments.

Every std::io::Write is a Sink that writes both as-is.

Required Methods§

Source

fn literal(&mut self, text: &str) -> Result<()>

Text from the format string: written by the programmer, valid UTF-8

Source

fn arg(&mut self, name: ArgName, value: &dyn DisplayBytes) -> Result<()>

A value interpolated into the format string

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<W: Write + ?Sized> Sink for W