pub fn write<W, F>(writer: W, f: F) -> Result<()>where
W: Write,
F: FnOnce(&mut Writer<W>) -> Result,
Expand description
Converts given io::Write
r to fmt::Write
r
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.