pub fn decode_string(buf: &mut impl Buf) -> Result<String, DecodeError>Expand description
Decode a string value: read a varint length prefix, then that many bytes,
and validate that the bytes are valid UTF-8.
ยงErrors
DecodeError::UnexpectedEofif the buffer has fewer bytes than the declared length.DecodeError::MessageTooLargeif the declared length overflowsusize.DecodeError::InvalidUtf8if the bytes are not valid UTF-8.