Trait writeable::Writeable[][src]

pub trait Writeable {
    fn write_to<W: Write + ?Sized>(&self, sink: &mut W) -> Result;

    fn write_len(&self) -> LengthHint { ... }
fn writeable_to_string(&self) -> String { ... } }

Writeable is an alternative to std::fmt::Display with the addition of a length function.

Required methods

fn write_to<W: Write + ?Sized>(&self, sink: &mut W) -> Result[src]

Writes bytes to the given sink. Errors from the sink are bubbled up.

Loading content...

Provided methods

fn write_len(&self) -> LengthHint[src]

Returns a hint for the number of bytes that will be written to the sink.

Override this method if it can be computed quickly.

fn writeable_to_string(&self) -> String[src]

Creates a new String with the data from this Writeable. Like ToString, but smaller and faster.

Not intended to be overriden.

Loading content...

Implementors

Loading content...