Crate flashkit_compression
Expand description
Decompression of blocks into caller buffers, for flash filesystems.
Decompressors decompresses whole blocks, such as the blocks of a
squashfs or UBIFS image. The caller enables each Algorithm at runtime.
A feature only adds the method that enables an algorithm, so enabling a
feature alone doesn’t change which input is accepted. Without the zstd
feature, the crate works without std and an allocator.
use flashkit_compression::{Algorithm, Decompressors};
let mut decompressors = Decompressors::new();
decompressors.enable_lz4();
let mut out = [0; 16];
let len = decompressors.decompress(Algorithm::Lz4, b"\x50hello", &mut out)?;
assert_eq!(&out[..len], b"hello");§Features
deflate: addsDecompressors::enable_deflateandDecompressors::enable_zlib, withminiz_oxide.lz4: addsDecompressors::enable_lz4, withlz4_flex.lzo: addsDecompressors::enable_lzo, withlzo.xz: addsDecompressors::enable_xz, withxz4rust. It supports the BCJ filters that Linux supports.zstd: addsDecompressors::enable_zstd, withruzstd. Needs an allocator.
Modules§
Structs§
- Decompressors
- Algorithms that the caller allows, with their working memory.
Enums§
- Algorithm
- Compression algorithm and format of a block.
- Decompress
Error - Failure to decompress a block.