rmp::decode

Function read_str_len

Source
pub fn read_str_len<R: RmpRead>(
    rd: &mut R,
) -> Result<u32, ValueReadError<R::Error>>
Expand description

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.

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