Skip to main content

fxcp_core/
lib.rs

1#![cfg_attr(feature = "nightly", feature(stdarch_x86_avx512))]
2// SPDX-License-Identifier: GPL-2.0-or-later
3// Copyright (C) 2025 Joel Wirāmu Pauling <aenertia@aenertia.net>
4//
5// fxcp-core/src/lib.rs  --  Core copy engine library  --  re-exports and module declarations
6
7//! Core copy engine shared by fxcp and foxingd. Provides SmartCopier (io_uring),
8//! BLAKE3 Merkle hashing, xattr/sidecar metadata, and adaptive I/O strategies.
9
10#[cfg(all(feature = "tls", feature = "rdma"))]
11compile_error!("features `tls` and `rdma` are mutually exclusive per RFC 9289 S5.1.3");
12
13/// Error types  --  `FxcpError`, `CopyErrorKind`, and `Result` alias.
14pub mod error;
15/// Compile-time and runtime constants for tuning, timeouts, and thresholds.
16pub mod constants;
17/// Prometheus metric counters and gauges for copy operations and I/O stats.
18pub mod metrics;
19/// Memory-aligned buffer pool for io_uring fixed-buffer operations.
20pub mod buffer;
21/// BLAKE3 Merkle tree construction, adaptive chunk sizing, and directory hashing.
22pub mod hashing;
23/// xattr/sidecar metadata  --  `SyncSignature`, dirty flags, JSON fallback.
24pub mod sidecar;
25/// Metadata sync, permissions, ownership, ACL, and xattr operations.
26pub mod security;
27/// io_uring pipeline, reflink/CoW, sendfile, and copy tier selection.
28pub mod operations;
29/// PSI-based system stress management with QoS floor.
30pub mod governor;
31/// MARS reflink snapshots with epoch-based version management and retention.
32pub mod versioning;
33/// Crash consistency subsystem  --  WAL, event journal, and sequence generation.
34pub mod consistency;
35/// Path filtering with include/exclude glob patterns.
36pub mod filter;
37/// Hybrid point-in-time version store with JSON manifest and browsable trees.
38pub mod version_store;
39/// Midnight Commander-inspired TUI for browsing filesystems and snapshots.
40#[cfg(feature = "tui")]
41pub mod browser;
42/// Unified mount enumeration via statmount(2) with /proc/self/mountinfo fallback.
43pub mod mount_info;
44/// Shared copy/sync engine  --  recursive directory copy, delta sync, stdin pipe.
45pub mod sync;
46/// Append-only JSONL tombstone journal for delete propagation across restarts.
47pub mod tombstone;
48/// Per-target consolidated Merkle signature index for large files (>256MB).
49pub mod merkle_index;
50/// Gear-hash variable-size content-defined chunking for FXAR v2 archives.
51pub mod chunker;
52/// FXAR v2 archive format  --  gear-hash chunking, BLAKE3 CAS, binary index.
53pub mod fxar;
54/// Content-addressable chunk store with crash-safe atomic writes.
55pub mod cas_store;
56/// Content-defined chunk diff algorithm for delta transfer.
57pub mod chunk_delta;
58/// Chunk-level I/O abstraction for delta upsert across transport underlays.
59pub mod chunk_transport;
60/// Userspace NFSv4.2 compound RPC client bypassing VFS per-file overhead.
61#[cfg(feature = "nfs-bypass")]
62pub mod nfs;
63/// S3 chunk profile presets and target configuration for cloud CAS replication.
64#[cfg(feature = "cloud")]
65pub mod s3_cas_config;
66/// S3-compatible CAS store with epoch-based JSONL manifest.
67#[cfg(feature = "cloud")]
68pub mod s3_cas;
69/// FXAR <-> S3 bridge  --  export/import archives to/from S3CasStore.
70#[cfg(feature = "cloud")]
71pub mod s3_fxar;
72/// Remote FXAR access  --  open archives from local path or S3 URI for update.
73pub mod fxar_remote;
74/// Stratis D-Bus integration for pool-aware replication and snapshots.
75pub mod stratis;
76/// fs-verity integration for tamper-evident snapshot sealing.
77pub mod fsverity;
78/// Pure-Rust qcow2 metadata parser for format-aware replication optimization.
79pub mod qcow2;
80/// BLAKE3 multicodec CID encoding for content-addressed interoperability.
81pub mod cid;
82/// Shared formatting utilities for human-readable byte sizes.
83pub mod fmt;
84/// SimHash/MinHash similarity fingerprinting for near-deduplication.
85#[cfg(feature = "similarity")]
86pub mod similarity;
87
88pub use error::{FxcpError, CopyErrorKind, Result};