Skip to main content

decode_unsigned

Function decode_unsigned 

Source
pub fn decode_unsigned(input: &[u8]) -> Result<(u64, usize), VIntError>
Expand description

Decode an UNSIGNED VInt (Cassandra writeUnsignedVInt) — the ONE canonical read-side VInt bit-assembly (Issue #1638, Epic J / J4).

Mirrors the exemplary write-side storage/serialization/vint.rs: a single u8::leading_ones length computation, continuation bytes loaded with one u64::from_be_bytes on a copied array (no per-byte index loop), slice framing (no nom::take), and #[inline]. No hardcoded single-byte match table and no fixed → zigzag double-decode fallback.

Returns (value, bytes_consumed) where bytes_consumed == leading_ones + 1.