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§
sourcefn to_msgpack_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
fn to_msgpack_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Converts this to a MessagePack bytes and writes it to the speficied file.
sourcefn to_msgpack_writer<W: Write>(&self, writer: W) -> Result<()>
fn to_msgpack_writer<W: Write>(&self, writer: W) -> Result<()>
Converts this to a MessagePack bytes and writes it to the writer.
sourcefn to_msgpack_vec(&self) -> Result<Vec<u8>>
fn to_msgpack_vec(&self) -> Result<Vec<u8>>
Converts this to a MessagePack bytes.