Skip to main content

Module bulk

Module bulk 

Source
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§

DecodeIter
Iterator over the values in an encoded stream. See decode_iter.
DecodeIterI32
Run-accelerated iterator over i32 values. See decode_iter_i32.
DecodeIterI64
Run-accelerated iterator over i64 values. See decode_iter_i64.
DecodeIterU32
Run-accelerated iterator over u32 values. See decode_iter_u32.
DecodeIterU64
Run-accelerated iterator over u64 values. See decode_iter_u64.

Functions§

bulk_decode
Decodes exactly out.len() values from buf, returning the number of bytes consumed.
bulk_decode_i32
Decodes exactly out.len() i32 values from buf, returning the number of bytes consumed.
bulk_decode_i64
Decodes exactly out.len() i64 values from buf, returning the number of bytes consumed.
bulk_decode_u32
Decodes exactly out.len() u32 values from buf, returning the number of bytes consumed.
bulk_decode_u64
Decodes exactly out.len() u64 values from buf, 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 i32 values into buf, returning the total encoded length.
bulk_encode_i64
Encodes a slice of i64 values into buf, returning the total encoded length.
bulk_encode_u32
Encodes a slice of u32 values into buf, returning the total encoded length.
bulk_encode_u64
Encodes a slice of u64 values into buf, 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 i32 values from buf.
decode_iter_i64
Returns a run-accelerated iterator decoding consecutive i64 values from buf.
decode_iter_u32
Returns a run-accelerated iterator decoding consecutive u32 values from buf.
decode_iter_u64
Returns a run-accelerated iterator decoding consecutive u64 values from buf.