Skip to main content

get_compact_string_borrowed

Function get_compact_string_borrowed 

Source
pub fn get_compact_string_borrowed<'de>(
    buf: &mut &'de [u8],
) -> Result<&'de str, ProtocolError>
Expand description

Decode a COMPACT_STRING that borrows from the input buffer.

This function needs a contiguous buffer, that is, a &[u8].

ยงErrors

Returns the underlying protocol error when input is truncated, contains an invalid length or tag, or cannot be encoded for the selected version.