Expand description
Core types and traits for gravityfile.
This crate provides the fundamental data structures used throughout the gravityfile ecosystem, including file nodes, trees, and configuration.
§Overview
gravityfile-core is the foundation crate containing shared types:
FileNode- Represents files, directories, and symlinksFileTree- Container for scanned directory treesScanConfig- Configuration for scanning operationsTreeStats- Summary statistics for a scanned treeContentHash- BLAKE3 content hash for duplicate detection
§Example
use gravityfile_core::{FileNode, NodeId, Timestamps, ScanConfig};
use std::time::SystemTime;
// Create a file node
let file = FileNode::new_file(
NodeId::new(1),
"example.txt",
1024,
2,
Timestamps::with_modified(SystemTime::now()),
false,
);
// Create scan configuration
let config = ScanConfig::builder()
.root("/path/to/scan")
.max_depth(Some(10))
.include_hidden(false)
.build()
.unwrap();Structs§
- Content
Hash - BLAKE3 content hash for duplicate detection.
- File
Node - A single file or directory in the tree.
- File
Tree - Complete scanned file tree with metadata.
- Inode
Info - Inode information for hardlink detection.
- NodeId
- Unique identifier for a node within a tree.
- Scan
Config - Configuration for scanning operations.
- Scan
Config Builder - Builder for
ScanConfig. - Scan
Warning - Non-fatal warning encountered during scan.
- Timestamps
- File metadata timestamps.
- Tree
Stats - Summary statistics for a scanned tree.
Enums§
- GitStatus
- Git status for a file or directory.
- Node
Kind - Type of file system node.
- Scan
Error - Errors that can occur during scanning.
- Warning
Kind - Kind of scan warning.