Expand description
Bulk encoding and decoding of many values.
All functions here produce and consume the canonical vlen byte
stream — output is byte-for-byte identical to encoding each value
individually, and any mix of the bulk and per-value APIs
interoperates. The specialized functions for u32, u64, i32,
and i64 add SWAR fast paths that process runs of equal-length
encodings several values at a time; they are portable safe Rust,
active on every architecture. Prefer them whenever the data has
runs of similarly-sized values (the signed variants shine on
delta-encoded streams); for adversarially mixed sizes the generic
functions are a few percent faster because they skip the run
detection.
Structs§
- Decode
Iter - Iterator over the values in an encoded stream. See
decode_iter. - Decode
Iter I32 - Run-accelerated iterator over
i32values. Seedecode_iter_i32. - Decode
Iter I64 - Run-accelerated iterator over
i64values. Seedecode_iter_i64. - Decode
Iter U32 - Run-accelerated iterator over
u32values. Seedecode_iter_u32. - Decode
Iter U64 - Run-accelerated iterator over
u64values. Seedecode_iter_u64.
Functions§
- bulk_
decode - Decodes exactly
out.len()values frombuf, returning the number of bytes consumed. - bulk_
decode_ i32 - Decodes exactly
out.len()i32values frombuf, returning the number of bytes consumed. - bulk_
decode_ i64 - Decodes exactly
out.len()i64values frombuf, returning the number of bytes consumed. - bulk_
decode_ u32 - Decodes exactly
out.len()u32values frombuf, returning the number of bytes consumed. - bulk_
decode_ u64 - Decodes exactly
out.len()u64values frombuf, returning the number of bytes consumed. - bulk_
encode - Encodes a slice of values into
buf, returning the total encoded length. - bulk_
encode_ i32 - Encodes a slice of
i32values intobuf, returning the total encoded length. - bulk_
encode_ i64 - Encodes a slice of
i64values intobuf, returning the total encoded length. - bulk_
encode_ u32 - Encodes a slice of
u32values intobuf, returning the total encoded length. - bulk_
encode_ u64 - Encodes a slice of
u64values intobuf, returning the total encoded length. - decode_
iter - Returns an iterator that decodes consecutive values from
buf. - decode_
iter_ i32 - Returns a run-accelerated iterator decoding consecutive
i32values frombuf. - decode_
iter_ i64 - Returns a run-accelerated iterator decoding consecutive
i64values frombuf. - decode_
iter_ u32 - Returns a run-accelerated iterator decoding consecutive
u32values frombuf. - decode_
iter_ u64 - Returns a run-accelerated iterator decoding consecutive
u64values frombuf.