Function fmt2io::write

source ·
pub fn write<W, F>(writer: W, f: F) -> Result<()>where
    W: Write,
    F: FnOnce(&mut Writer<W>) -> Result,
Expand description

Converts given io::Writer to fmt::Writer

The Writer is constructed from your writer which you can use to write UTF-8 data to. The function returns underlying io Error, if there has been one.

This function uses closure instead of directly exposing Writer in order to make error handling ergonomic/idiomatic.