Function varu64::decode [−][src]
pub fn decode(input: &[u8]) -> Result<(u64, usize), (DecodeError, usize)>
Decode a u64
from the input
buffer, returning the number and how many bytes were read.
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 can 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).