[][src]Trait stringio::StrWrite

pub trait StrWrite: Write {
    fn write(&mut self, buf: &str) -> Result<usize>;
fn flush(&mut self) -> Result<()>; }

This trait is designed to provide a similar interface to io::Write, but is designed to operate on strings. Unlike fmt::Write, it can report partial writes, but it guarantees that a whole number of code points were written with every write. Generally this involves buffering partial code points as necessary.

Required methods

fn write(&mut self, buf: &str) -> Result<usize>

Write a str to the writer. Like io::Write::write, this function returns the number of bytes written; it additionally GUARENTEES that the number of written bytes encompasses a whole number of code points.

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

Loading content...

Implementors

impl<W: Write> StrWrite for WrapIoWrite<W>[src]

Loading content...