Function rmp::encode::write_nil[][src]

pub fn write_nil<W: Write>(wr: &mut W) -> Result<(), Error>

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);