Function rmp::decode::read_str_len [] [src]

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

Attempts to read up to 9 bytes from the given reader and to decode them as a string u32 size value.

According to the MessagePack specification, the string format family stores an byte array in 1, 2, 3, or 5 bytes of extra bytes in addition to the size of the byte array.

Errors

This function will return ValueReadError on any I/O error while reading either the marker or the data, 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.