Skip to main content

lz4/
lib.rs

1//! Pure-Rust translation of the LZ4 compression library, exposing the same
2//! public API as the `lz4-rs` crate so it can be used as a drop-in replacement
3//! (`use lz4::...`).
4//!
5//! The crate provides:
6//! - [`Encoder`] / [`EncoderBuilder`] and [`Decoder`] — `Write`/`Read` streaming
7//!   wrappers around the LZ4 frame format.
8//! - [`block`] — a safe block-mode API (`compress` / `decompress`) modelled on
9//!   `python-lz4`, with optional uncompressed-size prefix.
10//! - [`liblz4`] — error helpers and the re-exported low-level `sys` surface.
11//! - [`sys`] — the C-shaped LZ4 block, HC, frame, and streaming functions
12//!   translated into Rust.
13//!
14//! See the crate README for the full design rationale and parity status.
15#![doc = include_str!("../README.md")]
16
17pub mod sys;
18
19pub mod liblz4;
20
21mod decoder;
22mod encoder;
23
24pub mod block;
25
26pub use crate::decoder::Decoder;
27pub use crate::encoder::Encoder;
28pub use crate::encoder::EncoderBuilder;
29pub use crate::liblz4::version;
30pub use crate::liblz4::BlockMode;
31pub use crate::liblz4::BlockSize;
32pub use crate::liblz4::ContentChecksum;
33
34use crate::sys::{c_char, size_t};