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:
MemWriter::write_entity— upsert raw bytes at a mem-relative path.MemWriter::delete_entity— remove a mem-relative path.MemWriter::move_entity— rename within the mem.MemWriter::commit— flush pending mutations into a single commit.
§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.memzip 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§
- MemWriter
Error - Errors surfaced by
MemWriter.
Traits§
- MemWriter
- Write-side abstraction for mem content. Implementations are
Send + Syncso the engine can hold aBox<dyn MemWriter>on eachMemStateand reach it from any caller.
Type Aliases§
- Commit
Id - 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’sHashMismatch.currentenvelope when the adapter detects a CAS conflict.