rmp_serde::encode

Function write

Source
pub fn write<W, T>(wr: &mut W, val: &T) -> Result<(), Error>
where W: Write + ?Sized, T: Serialize + ?Sized,
Expand description

Serialize the given data structure as MessagePack into the I/O stream. This function uses compact representation - structures as arrays

Serialization can fail if T’s implementation of Serialize decides to fail.