1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! Crush Core Library
//!
//! High-performance parallel compression library with pluggable compression algorithms.
//!
//! # Overview
//!
//! Crush provides a flexible plugin-based compression system with:
//! - **Pluggable algorithms**: Add custom compression algorithms via the [`CompressionAlgorithm`] trait
//! - **Intelligent selection**: Automatic plugin selection based on scoring weights
//! - **Timeout protection**: Configurable timeouts prevent runaway compression operations
//! - **Zero-copy design**: Minimal allocations and efficient memory usage
//!
//! # Quick Start
//!
//! ```
//! use crush_core::{init_plugins, compress, decompress};
//!
//! // Initialize plugin registry (call once at startup)
//! init_plugins().expect("Plugin initialization failed");
//!
//! // Compress data
//! let data = b"Hello, Crush!";
//! let compressed = compress(data).expect("Compression failed");
//!
//! // Decompress data
//! let decompressed = decompress(&compressed).expect("Decompression failed");
//! assert_eq!(data.as_slice(), decompressed.data.as_slice());
//! ```
//!
//! # Advanced Usage
//!
//! ## Custom Plugin Selection
//!
//! ```
//! use crush_core::{init_plugins, compress_with_options, CompressionOptions, ScoringWeights};
//! use std::time::Duration;
//!
//! init_plugins().expect("Plugin initialization failed");
//!
//! // Manual plugin override
//! let options = CompressionOptions::default()
//! .with_plugin("deflate")
//! .with_timeout(Duration::from_secs(10));
//! let compressed = compress_with_options(b"data", &options).expect("Compression failed");
//!
//! // Automatic selection with custom weights
//! let weights = ScoringWeights {
//! throughput: 0.8, // Prioritize speed
//! compression_ratio: 0.2, // Less emphasis on compression ratio
//! };
//! let options = CompressionOptions::default().with_weights(weights);
//! let compressed = compress_with_options(b"data", &options).expect("Compression failed");
//! ```
//!
//! ## Plugin Discovery
//!
//! ```
//! use crush_core::{init_plugins, list_plugins};
//!
//! init_plugins().expect("Plugin initialization failed");
//!
//! // List all registered plugins
//! for plugin in list_plugins() {
//! println!("Plugin: {} ({})", plugin.name, plugin.version);
//! println!(" Throughput: {} MB/s", plugin.throughput);
//! println!(" Compression ratio: {:.2}", plugin.compression_ratio);
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;