Trait rmp::encode::RmpWrite

source ·
pub trait RmpWrite: Sealed {
    type Error: RmpWriteErr;

    // Required method
    fn write_bytes(&mut self, buf: &[u8]) -> Result<(), Self::Error>;

    // Provided method
    fn write_u8(&mut self, val: u8) -> Result<(), Self::Error> { ... }
}
Expand description

A type that rmp supports writing into.

The methods of this trait should be considered an implementation detail (for now). It is currently sealed (can not be implemented by the user).

See also std::io::Write and byteorder::WriteBytesExt

Its primary implementations are std::io::Write and ByteBuf.

Required Associated Types§

Required Methods§

source

fn write_bytes(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write a slice of bytes to the underlying stream

This will either write all the bytes or return an error. See also std::io::Write::write_all

Provided Methods§

source

fn write_u8(&mut self, val: u8) -> Result<(), Self::Error>

Write a single byte to this stream

Implementors§