Trait ToMsgPack

Source
pub trait ToMsgPack: Serialize {
    // Provided methods
    fn to_msgpack_file<P: AsRef<Path>>(&self, path: P) -> Result<()> { ... }
    fn to_msgpack_writer<W: Write>(&self, writer: W) -> Result<()> { ... }
    fn to_msgpack_vec(&self) -> Result<Vec<u8>> { ... }
}
Expand description

This trait allows to convert serializable values to MessagePack binaries.

Provided Methods§

Source

fn to_msgpack_file<P: AsRef<Path>>(&self, path: P) -> Result<()>

Converts this to a MessagePack bytes and writes it to the speficied file.

Source

fn to_msgpack_writer<W: Write>(&self, writer: W) -> Result<()>

Converts this to a MessagePack bytes and writes it to the writer.

Source

fn to_msgpack_vec(&self) -> Result<Vec<u8>>

Converts this to a MessagePack bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§