Expand description
Rust bindings for the C-Blosc block-oriented compression library.
Blosc is a high performance compressor optimized for binary data. It is
especially good at compressing arrays of similar data. For example, floats
that fit a particular statistical distribution, integers from a restricted
range, or pointers that all share the same alignment. It also works well on
arrays of Struct
s with similar content.
Unlike most other compression libraries, Blosc is block-oriented, rather than stream-oriented. This works well when the entire dataset to be compressed/decompressed is available at once.
§Example
let data: Vec<u32> = vec![1, 1, 2, 5, 8, 13, 21, 34, 55, 89, 144];
let ctx = Context::new();
let compressed = ctx.compress(&data[..]);
let decompressed = decompress(&compressed).unwrap();
assert_eq!(data, decompressed);
Structs§
Enums§
- Blosc
Error - An unspecified error from C-Blosc
- Clevel
- The desired compression level. Higher levels mean more compression.
- Compressor
- Compressor selection.
- Shuffle
Mode - Controls Blosc’s shuffle operation.
Functions§
- decompress
- Decompress a
blosc::Buffer
into a newly allocatedVec
- decompress_
bytes ⚠ - Decompress arbitrary data into a newly allocated
Vec
- validate
- Checks that the compressed buffer may contain valid blosc compressed data. On success, returns the size that the uncompressed data would have.