haagenti_core/lib.rs
1// Test modules have minor lints that don't affect production code
2#![cfg_attr(test, allow(unused_variables))]
3#![cfg_attr(test, allow(unused_mut))]
4#![cfg_attr(test, allow(clippy::needless_range_loop))]
5#![cfg_attr(test, allow(clippy::manual_repeat_n))]
6#![cfg_attr(test, allow(clippy::useless_vec))]
7
8//! # Haagenti Core
9//!
10//! Core traits, types, and streaming API for the Haagenti compression library.
11//!
12//! Haagenti is named after the 48th demon of the Ars Goetia, who transmutes
13//! substances into more valuable forms - just as compression transforms data
14//! into denser representations.
15//!
16//! ## Design Philosophy
17//!
18//! - **Zero-copy where possible**: Minimize allocations and memory copies
19//! - **Streaming-first**: All operations support incremental processing
20//! - **SIMD-ready**: Types designed for vectorized operations
21//! - **No-std compatible**: Core traits work without standard library
22//!
23//! ## Core Traits
24//!
25//! - [`Compressor`] - One-shot compression operations
26//! - [`Decompressor`] - One-shot decompression operations
27//! - [`Codec`] - Combined compress/decompress capability
28//! - [`StreamingCompressor`] - Incremental compression
29//! - [`StreamingDecompressor`] - Incremental decompression
30//!
31//! ## Example
32//!
33//! ```ignore
34//! use haagenti_core::{Codec, CompressionLevel};
35//! use haagenti_lz4::Lz4Codec;
36//!
37//! let codec = Lz4Codec::with_level(CompressionLevel::Fast);
38//! let compressed = codec.compress(data)?;
39//! let original = codec.decompress(&compressed)?;
40//! ```
41
42#![cfg_attr(not(feature = "std"), no_std)]
43
44#[cfg(feature = "alloc")]
45extern crate alloc;
46
47pub mod error;
48pub mod stats;
49pub mod stream;
50pub mod traits;
51pub mod types;
52
53#[cfg(feature = "dct")]
54pub mod dct;
55
56pub use error::{Error, Result};
57pub use stats::{CompressionStats, Metrics};
58pub use stream::{Flush, StreamConfig, StreamState};
59pub use traits::{
60 Codec, Compressor, Decompressor, DictionaryCompressor, DictionaryDecompressor,
61 ParallelCompressor, SimdCompressor, StreamingCompressor, StreamingDecompressor,
62};
63pub use types::{Algorithm, Checksum, CompressionLevel, CompressionRatio, WindowSize};