Function varu64::decode_non_zero_u64[][src]

pub fn decode_non_zero_u64(
    input: &[u8]
) -> Result<(NonZeroU64, &[u8]), (DecodeError, &[u8])>
Expand description

Decode a NonZeroU64 from the input buffer, returning the number and the remaining bytes.

Errors

On error, this also returns how many bytes were read (including the erroneous byte). In case of noncanonical data (encodings that are valid except they are not the smallest possible encoding), the full data is parsed, even if the non-canonicty could be detected early on.

If there is not enough input data, an UnexpectedEndOfInput error is returned, never a NonCanonical error (even if the partial input could already be detected to be noncanonical).