Function varu64::decode [−][src]
pub fn decode(input: &[u8]) -> Result<(u64, &[u8]), (DecodeError, &[u8])>
Expand description
Decode a u64
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).