Expand description
lz4r — a pure-Rust implementation of the LZ4 compression algorithms and
command-line programs (equivalent to the programs/ tree of LZ4 v1.10.0).
§Crate layout
| Module | Contents |
|---|---|
block | Low-level block compression and decompression (LZ4 spec §§ 1–3). |
frame | LZ4 Frame format (magic number, header, content checksum). |
hc | High-compression (lz4hc) encoder variants. |
io | File-level I/O: compress / decompress single and multiple files. |
file | Streaming Read/Write wrappers over the Frame API. |
cli | Command-line argument parsing and dispatch. |
bench | Throughput benchmarking infrastructure. |
xxhash | XXH32 content-checksum wrapper. |
lorem | Deterministic lorem ipsum generator (benchmark corpus). |
timefn | Monotonic high-resolution timer. |
threadpool | Fixed-size work-stealing thread pool. |
config | Compile-time configuration constants. |
util | File enumeration and sizing utilities. |
Re-exports§
pub use block::compress::compress_default as lz4_compress_default;pub use block::decompress_api::decompress_safe as lz4_decompress_safe;pub use block::compress_bound;pub use block::compress_dest_size;pub use block::compress_fast;pub use block::decompress_safe_partial;pub use block::decompress_safe_using_dict;pub use block::Lz4Error;pub use block::LZ4_ACCELERATION_DEFAULT;pub use block::LZ4_ACCELERATION_MAX;pub use block::LZ4_MAX_INPUT_SIZE;pub use block::decompress_core::DecompressError;pub use frame::lz4f_compress_frame;pub use frame::lz4f_decompress;
Modules§
- bench
- Benchmark entry points for lz4r.
- block
- LZ4 block compression and decompression.
- cli
- Command-line interface for the
lz4binary. - config
- Compile-time configuration constants for the
lz4rprograms layer. - file
- LZ4 file-level streaming I/O — Rust port of lz4file.c / lz4file.h v1.10.0.
- frame
- LZ4 Frame format — streaming compression and decompression.
- hc
- LZ4 HC (high-compression) block codec.
- io
- Public API surface for LZ4 file I/O operations.
- lorem
- Deterministic lorem ipsum text generator.
- threadpool
- Fixed-size work-stealing thread pool.
- timefn
- Portable high-resolution monotonic timer.
- util
- Cross-cutting utility functions used by the CLI and I/O layers.
- xxhash
- Thin wrapper around the
xxhash-rustcrate providing the XXH32 API used by the rest of this crate (mirrorsxxhash.c/xxhash.hfrom LZ4 v1.10.0).
Macros§
- debugoutput
- Write a formatted message to stderr in debug builds only.
- display
- Write a formatted message to stderr unconditionally.
- displaylevel
- Write a formatted message to stderr if the current verbosity level is
at least
level. - displayout
- Write a formatted message to stdout.
- end_
process - Print an error diagnostic and exit the process with the given code.
Constants§
- COMPRESS_
INPLACE_ MARGIN - LZ4_
DISTANCE_ MAX - LZ4_
GIT_ COMMIT_ STRING - Git commit hash string injected at build time via the
LZ4_GIT_COMMITenvironment variable. Empty when the variable is not set. - LZ4_
VERSION_ MAJOR - LZ4_
VERSION_ MINOR - LZ4_
VERSION_ NUMBER - LZ4_
VERSION_ RELEASE - LZ4_
VERSION_ STRING
Functions§
- compress_
inplace_ buffer_ size - Minimum buffer size for in-place compression (lz4.h line 678).
- decompress_
inplace_ buffer_ size - Minimum buffer size for in-place decompression (lz4.h line 672).
- decompress_
inplace_ margin - Margin required for in-place decompression (lz4.h line 670).
- size_
of_ state - Returns the size in bytes of the internal stream state (LZ4_sizeofState()).
- version_
number - Returns the runtime version number (equivalent to LZ4_versionNumber()).
- version_
string - Returns the runtime version string (equivalent to LZ4_versionString()).