gravityfile_core/lib.rs
1//! Core types and traits for gravityfile.
2//!
3//! This crate provides the fundamental data structures used throughout
4//! the gravityfile ecosystem, including file nodes, trees, and configuration.
5//!
6//! # Overview
7//!
8//! `gravityfile-core` is the foundation crate containing shared types:
9//!
10//! - [`FileNode`] - Represents files, directories, and symlinks
11//! - [`FileTree`] - Container for scanned directory trees
12//! - [`ScanConfig`] - Configuration for scanning operations
13//! - [`TreeStats`] - Summary statistics for a scanned tree
14//! - [`ContentHash`] - BLAKE3 content hash for duplicate detection
15//!
16//! # Example
17//!
18//! ```rust
19//! use gravityfile_core::{FileNode, NodeId, Timestamps, ScanConfig};
20//! use std::time::SystemTime;
21//!
22//! // Create a file node
23//! let file = FileNode::new_file(
24//! NodeId::new(1),
25//! "example.txt",
26//! 1024,
27//! 2,
28//! Timestamps::with_modified(SystemTime::now()),
29//! false,
30//! );
31//!
32//! // Create scan configuration
33//! let config = ScanConfig::builder()
34//! .root("/path/to/scan")
35//! .max_depth(Some(10))
36//! .include_hidden(false)
37//! .build()
38//! .unwrap();
39//! ```
40
41mod config;
42mod error;
43mod node;
44mod tree;
45
46pub use config::{ScanConfig, ScanConfigBuilder};
47pub use error::{ScanError, ScanWarning, WarningKind};
48pub use node::{ContentHash, FileNode, GitStatus, InodeInfo, NodeId, NodeKind, Timestamps};
49pub use tree::{FileTree, TreeStats};