mount/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2//! Heddle's content-addressed mount.
3//!
4//! `mount` is the platform-agnostic core (and Linux FUSE shell) that
5//! exposes a heddle thread as a directory tree. Reads walk the
6//! Merkle DAG lazily; writes (eventually) flow into a per-thread
7//! overlay that drains to a heddle commit on `heddle capture`.
8//!
9//! The architecture is:
10//!
11//! ```text
12//! PlatformShell trait ← thin platform adapters
13//! (FuseShell now; (FSKit/ProjFS/CfAPI later)
14//! ↓
15//! ContentAddressedMount ← pure Rust core
16//! ↓
17//! crates/repo + crates/objects (already exists)
18//! ```
19//!
20//! See [`PlatformShell`] for the trait every adapter implements,
21//! and [`ContentAddressedMount`] for the heddle-aware core.
22
23pub mod core;
24pub mod error;
25pub mod shell;
26
27#[cfg(all(target_os = "linux", feature = "fuse"))]
28pub mod fuse;
29
30#[cfg(all(target_os = "macos", feature = "fskit"))]
31pub mod fskit;
32
33// Re-export the fuser background-session type so callers (notably the
34// CLI's mount lifecycle and daemon registry) don't have to take a
35// direct fuser dep just to hold onto a live mount.
36#[cfg(all(target_os = "linux", feature = "fuse"))]
37pub use fuser::BackgroundSession;
38
39#[cfg(all(target_os = "macos", feature = "fskit"))]
40pub use crate::fskit::{FSKitSession, FSKitShell};
41#[cfg(all(target_os = "linux", feature = "fuse"))]
42pub use crate::fuse::FuseShell;
43pub use crate::{
44 core::{ContentAddressedMount, PromotionPolicy},
45 error::{MountError, Result},
46 shell::{Attrs, Entry, NodeId, NodeKind, PlatformShell},
47};
48
49#[cfg(test)]
50mod tests;