Skip to main content

get_array_len

Function get_array_len 

Source
pub fn get_array_len<B: Buf>(
    buf: &mut B,
    flexible: bool,
) -> Result<usize, ProtocolError>
Expand description

Reads a non-nullable array length. Returns an error if the encoded value is null, which is −1 or 0.

§Errors

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

§Panics

Panics if a value previously validated by the protocol type no longer satisfies its encoded-length or field-range invariant.