Skip to main content

embeddenator_fs/
lib.rs

1//! # embeddenator-fs
2//!
3//! EmbrFS: FUSE-based holographic filesystem.
4//!
5//! Extracted from embeddenator core as part of Phase 2A component decomposition.
6//!
7//! # Feature Flags
8//!
9//! - **`fuse`**: Enable FUSE filesystem support (requires `fuser` crate)
10//! - **`disk-image`**: Enable QCOW2/raw disk image encoding (Linux with io_uring)
11//! - **`disk-image-portable`**: Disk image support without io_uring (cross-platform)
12//!
13//! # Architecture
14//!
15//! ```text
16//! ┌─────────────────────────────────────────────────────────────────────────┐
17//! │                          embeddenator-fs                                │
18//! ├─────────────────────────────────────────────────────────────────────────┤
19//! │                                                                         │
20//! │  ┌───────────────────────┐  ┌───────────────────────┐                  │
21//! │  │       EmbrFS          │  │      disk module      │                  │
22//! │  │  (Directory/File      │  │  (QCOW2/Raw image     │                  │
23//! │  │   encoding)           │  │   encoding)           │                  │
24//! │  └───────────┬───────────┘  └───────────┬───────────┘                  │
25//! │              │                          │                               │
26//! │              ▼                          ▼                               │
27//! │  ┌─────────────────────────────────────────────────────────────────┐   │
28//! │  │                     embeddenator-vsa                            │   │
29//! │  │  (Sparse ternary vectors, VSA encoding/decoding)                │   │
30//! │  └─────────────────────────────────────────────────────────────────┘   │
31//! │              │                                                          │
32//! │              ▼                                                          │
33//! │  ┌─────────────────────────────────────────────────────────────────┐   │
34//! │  │                     embeddenator-io                             │   │
35//! │  │  (Compression profiles: zstd, lz4)                              │   │
36//! │  └─────────────────────────────────────────────────────────────────┘   │
37//! │                                                                         │
38//! └─────────────────────────────────────────────────────────────────────────┘
39//! ```
40
41pub mod fs;
42pub use fs::*;
43
44/// Disk image support (QCOW2, raw images, partition tables, filesystem traversal)
45///
46/// # Why a Separate Module?
47///
48/// Disk image handling is optional and adds significant dependencies:
49/// - `qcow2-rs` for QCOW2 format
50/// - `tokio` + `tokio-uring` for async I/O
51/// - `gpt`, `mbrman` for partition tables
52/// - `ext4` for filesystem traversal
53///
54/// Users who only need directory encoding can avoid these dependencies.
55#[cfg(any(feature = "disk-image", feature = "disk-image-portable"))]
56pub mod disk;
57
58// Re-export common types from vsa and retrieval for convenience
59pub use embeddenator_retrieval::resonator::Resonator;
60pub use embeddenator_vsa::{ReversibleVSAConfig, ReversibleVSAEncoder, SparseVec};
61
62#[cfg(test)]
63mod tests {
64    use super::*;
65
66    #[test]
67    fn component_loads() {
68        // Verify core types are accessible
69        let fs = EmbrFS::new();
70        assert!(fs.engram.codebook.is_empty());
71    }
72}