Documentation / Rust
Use the filesystem contract directly.
The core crate exposes the observable contract. The loopback helper normalizes paths and forwards operations to an FsDriverwithout requiring a kernel mount.
use mount_rs::{Loopback, MemoryFs, MemoryOptions};
let fs = Loopback::new(MemoryFs::new(MemoryOptions::default()));
fs.write_file("/hello", b"hello").await?;
assert_eq!(fs.read_file("/hello").await?, b"hello");The public contract
| Type | Role | Source |
|---|---|---|
FsDriver | Filesystem-wide operations and capability reporting. | driver.rs ↗ |
FileHandle | Read, write, stat, truncate, sync, and close. | driver.rs ↗ |
MetadataStore | Load, lease, fenced publication, and metadata flush. | storage.rs ↗ |
BlockStore | Immutable block put/get/delete and byte flush. | storage.rs ↗ |
Split storage with fixed-size chunks
ChunkedFs composes independent stores. A write publishes block references only after new blocks are flushed; the chunker configuration is persisted with the namespace and file layout.
use mount_rs_chunked::{ChunkedFs, ChunkedOptions};
use mount_rs_memory::{MemoryBlockStore, MemoryMetadataStore};
let fs = ChunkedFs::open(
MemoryMetadataStore::new(),
MemoryBlockStore::new(),
ChunkedOptions::fixed("demo", 64 * 1024)?,
).await?;
fs.shutdown().await?; // release the provider writer leaseDurability is a capability, not an adjective.
Memory stores are intentionally volatile. Durable providers must implement their own flush and fencing semantics; this page does not turn a local round trip into crash or power-loss evidence.
Related source: ChunkedFs integration and chunking contract.