pub struct MCardFileSystem { /* private fields */ }Expand description
The universal immutable filesystem engine mapping URIs to content-addressed MCards.
Implementations§
Source§impl MCardFileSystem
impl MCardFileSystem
Sourcepub fn new_in_memory() -> Result<Self>
pub fn new_in_memory() -> Result<Self>
Initializes an isolated, zero-disk in-memory MCard filesystem (INV-09).
Sourcepub fn new_in_memory_scoped(prefix: &str) -> Result<Self>
pub fn new_in_memory_scoped(prefix: &str) -> Result<Self>
Initializes an in-memory MCard filesystem scoped to a specific context prefix.
Sourcepub fn new(conn: Arc<Mutex<Connection>>, context_prefix: &str) -> Self
pub fn new(conn: Arc<Mutex<Connection>>, context_prefix: &str) -> Self
Wraps an existing SQLite connection manager or shared connection with an optional context prefix.
Sourcepub fn with_connection(conn: Arc<Mutex<Connection>>) -> Result<Self>
pub fn with_connection(conn: Arc<Mutex<Connection>>) -> Result<Self>
Wraps an existing SQLite connection manager or shared connection (root prefix).
Sourcepub fn with_prefix(&self, prefix: &str) -> Self
pub fn with_prefix(&self, prefix: &str) -> Self
Returns a new MCardFileSystem handle sharing the same storage but isolated to prefix.
Sourcepub fn context_prefix(&self) -> &str
pub fn context_prefix(&self) -> &str
Returns the active context prefix for this filesystem handle.
Sourcepub fn canonicalize_uri(&self, path: &str) -> String
pub fn canonicalize_uri(&self, path: &str) -> String
Resolves canonical URI with context prefix scoping (DOD-191-04).
Sourcepub fn ephemeral_mount(&self, fiber: &Fiber, prefix: &str) -> Result<Self>
pub fn ephemeral_mount(&self, fiber: &Fiber, prefix: &str) -> Result<Self>
Ephemerally mounts a scoped MCardFileSystem on a Fiber, registering a LIFO unmount callback on the fiber’s DisposableList that cleans up all transient handles on disposal (DOD-191-07).
Sourcepub fn write_file(
&self,
uri: &str,
payload: MCardPayload,
author: AgentDid,
) -> Result<MCard>
pub fn write_file( &self, uri: &str, payload: MCardPayload, author: AgentDid, ) -> Result<MCard>
Writes an MCard into the filesystem, content-addressing the payload and updating the handle registry.
Sourcepub fn read_file(&self, uri: &str) -> Result<MCard>
pub fn read_file(&self, uri: &str) -> Result<MCard>
Reads and cryptographically verifies an MCard by its URI handle (INV-02, INV-04).
Sourcepub fn stat_file(&self, uri: &str) -> Result<MCardStat>
pub fn stat_file(&self, uri: &str) -> Result<MCardStat>
Returns stat metadata for a virtual file.
Sourcepub fn list_dir(&self, prefix: &str) -> Result<Vec<String>>
pub fn list_dir(&self, prefix: &str) -> Result<Vec<String>>
Lists all MCard handles sharing the specified URI prefix.
Sourcepub fn delete_file(&self, uri: &str) -> Result<()>
pub fn delete_file(&self, uri: &str) -> Result<()>
Deregisters an MCard handle, preserving the underlying immutable CAS blob (INV-04).