[][src]Function rmp::decode::read_nfix

pub fn read_nfix<R: Read>(rd: &mut R) -> Result<i8, ValueReadError>

Attempts to read a single byte from the given reader and to decode it as a negative fixnum value.

According to the MessagePack specification, a negative fixed integer value is represented using a single byte in [0xe0; 0xff] range inclusively, prepended with a special marker mask.

Errors

This function will return ValueReadError on any I/O error while reading the marker, except the EINTR, which is handled internally.

It also returns ValueReadError::TypeMismatch if the actual type is not equal with the expected one, indicating you with the actual type.

Note

This function will silently retry on every EINTR received from the underlying Read until successful read.