stowr_core/lib.rs
1//! # Stowr Core
2//!
3//! A Rust library for file management with compression, storage, and indexing capabilities.
4//!
5//! ## Quick Start
6//!
7//! ```rust
8//! use stowr_core::{Config, StorageManager, create_index};
9//! use std::path::Path;
10//!
11//! # fn main() -> anyhow::Result<()> {
12//! let config = Config::default();
13//! let index = create_index(&config)?;
14//! let mut storage = StorageManager::new(config, index);
15//!
16//! // Store a file
17//! // storage.store_file(Path::new("example.txt"), false)?;
18//!
19//! // List files
20//! let files = storage.list_files()?;
21//! println!("Stored {} files", files.len());
22//! # Ok(())
23//! # }
24//! ```
25//!
26//! ## Features
27//!
28//! - File compression using gzip
29//! - Dual indexing system (JSON/SQLite)
30//! - Batch operations with glob patterns
31//! - Multi-threaded processing
32//! - Configurable compression levels
33//!
34//! ## Integration
35//!
36//! This library can be easily integrated into:
37//! - Command-line applications
38//! - Desktop applications (e.g., Tauri)
39//! - Web services
40//! - System utilities
41
42pub mod config;
43pub mod storage;
44pub mod index;
45pub mod dedup;
46pub mod delta;
47
48pub use config::{Config, IndexMode, CompressionAlgorithm, DeltaAlgorithm};
49pub use storage::StorageManager;
50pub use index::{FileEntry, IndexStore, create_index};
51pub use dedup::{ContentDeduplicator, DedupInfo, DedupStats};
52pub use delta::{DeltaStorage, DeltaInfo, SimilarityMatch, DeltaStats};
53
54// Re-export commonly used types
55pub use anyhow::Result;
56pub use std::path::{Path, PathBuf};
57
58#[cfg(test)]
59mod tests {
60 use super::*;
61
62 #[test]
63 fn test_lib_exports() {
64 // Basic test to ensure exports work
65 let _config = Config::default();
66 }
67}