Skip to main content

Module storage

Module storage 

Source
Expand description

Mem write-side trait. The MemWriter surface is backend-neutral: it deals in mem-relative paths, raw bytes, and opaque CommitId strings. Two adapters live in the workspace today: the git-tree adapter in memstead_git_branch::storage::git_tree (mem-repo writes) and filesystem::FilesystemMemWriter in this crate (filesystem-only writes — no gix, no commit history).

§Trait surface

Four operations cover today’s mutation surface:

§Errors

All four methods return MemWriterError. Engine-layer code in memstead-git-branch wraps this into its EngineError::MemWriter (a #[from] conversion) and the MCP layer wraps it as a MEM_WRITER_ERROR-coded envelope.

Re-exports§

pub use archive::ArchiveBackend;
pub use filesystem::FilesystemMemWriter;
pub use in_memory::InMemoryBackend;

Modules§

archive
Archive [MemBackend] — a sealed .mem zip mem, read-only.
filesystem
Filesystem-backed MemWriter — the gix-free companion to [memstead_git_branch::storage::git_tree::GitTreeMemWriter]. Used by filesystem mems, where entities live as plain files under a workspace root and there is no commit history.
in_memory
In-memory MemBackend — the writable, filesystem- and git-free companion to the folder backend.

Enums§

MemWriterError
Errors surfaced by MemWriter.

Traits§

MemWriter
Write-side abstraction for mem content. Implementations are Send + Sync so the engine can hold a Box<dyn MemWriter> on each MemState and reach it from any caller.

Type Aliases§

CommitId
Opaque commit identifier returned by MemWriter::commit. Backend-defined string — the git-tree adapter formats it as a hex-encoded object id (40 chars for sha-1, 64 for sha-256), but the trait surface treats it as opaque. Callers carry it back into the engine’s HashMismatch.current envelope when the adapter detects a CAS conflict.