Skip to main content

Crate gravityfile_core

Crate gravityfile_core 

Source
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 symlinks
  • FileTree - Container for scanned directory trees
  • ScanConfig - Configuration for scanning operations
  • TreeStats - Summary statistics for a scanned tree
  • ContentHash - 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§

ContentHash
BLAKE3 content hash for duplicate detection.
FileNode
A single file or directory in the tree.
FileTree
Complete scanned file tree with metadata.
InodeInfo
Inode information for hardlink detection.
NodeId
Unique identifier for a node within a tree.
ScanConfig
Configuration for scanning operations.
ScanConfigBuilder
Builder for ScanConfig.
ScanWarning
Non-fatal warning encountered during scan.
Timestamps
File metadata timestamps.
TreeStats
Summary statistics for a scanned tree.

Enums§

GitStatus
Git status for a file or directory.
NodeKind
Type of file system node.
ScanError
Errors that can occur during scanning.
WarningKind
Kind of scan warning.