gravityfile_scan/lib.rs
1//! File system scanning engine for gravityfile.
2//!
3//! This crate provides high-performance parallel directory scanning
4//! using jwalk for traversal.
5//!
6//! # Overview
7//!
8//! `gravityfile-scan` is responsible for traversing directories and building
9//! the file tree structure. Key features:
10//!
11//! - **Parallel traversal** via jwalk/rayon
12//! - **Progress updates** via broadcast channels
13//! - **Hardlink detection** to avoid double-counting
14//! - **Configurable** depth limits, ignore patterns, etc.
15//!
16//! # Example
17//!
18//! ```rust,no_run
19//! use gravityfile_scan::{JwalkScanner, ScanConfig};
20//!
21//! let config = ScanConfig::new("/path/to/scan");
22//! let scanner = JwalkScanner::new();
23//! let tree = scanner.scan(&config).unwrap();
24//!
25//! println!("Total size: {} bytes", tree.total_size());
26//! println!("Total files: {}", tree.total_files());
27//! ```
28//!
29//! # Progress Monitoring
30//!
31//! Subscribe to real-time progress updates:
32//!
33//! ```rust,no_run
34//! use gravityfile_scan::{JwalkScanner, ScanConfig};
35//!
36//! let scanner = JwalkScanner::new();
37//! let mut progress_rx = scanner.subscribe();
38//!
39//! // Handle progress in a separate task
40//! tokio::spawn(async move {
41//! while let Ok(progress) = progress_rx.recv().await {
42//! println!("Scanned {} files", progress.files_scanned);
43//! }
44//! });
45//! ```
46
47mod git;
48mod inode;
49mod progress;
50mod scanner;
51
52pub use git::{GitStatusCache, apply_git_status};
53pub use inode::InodeTracker;
54pub use progress::ScanProgress;
55pub use scanner::{JwalkScanner, quick_list};
56
57// Re-export core types for convenience
58pub use gravityfile_core::{
59 FileNode, FileTree, NodeId, NodeKind, ScanConfig, ScanError, ScanWarning, Timestamps,
60 TreeStats, WarningKind,
61};