rmp::encode

Function write_nil

Source
pub fn write_nil<W: RmpWrite>(wr: &mut W) -> Result<(), W::Error>
Expand description

Encodes and attempts to write a nil value into the given write.

According to the MessagePack specification, a nil value is represented as a single 0xc0 byte.

§Errors

This function will return Error on any I/O error occurred while writing the nil marker.

§Examples

let mut buf = Vec::new();

rmp::encode::write_nil(&mut buf).unwrap();

assert_eq!(vec![0xc0], buf);