Skip to main content

export_entries_to_bytes

Function export_entries_to_bytes 

Source
pub fn export_entries_to_bytes(
    config: &MemConfig,
    workspace_root: Option<&Path>,
    workspace_schemas_dir: Option<&Path>,
    explicit_name: &str,
    md_entries: Vec<(PathBuf, Vec<u8>)>,
    provenance: Option<&ArchiveProvenance>,
    anchors_bytes: Option<&[u8]>,
) -> Result<MemExportBytes, MemExportError>
Expand description

Seal already-collected entity bytes into a portable .mem archive — the storage-agnostic core shared by the folder exporter (export_mem_to_bytes, which walks a directory) and the in-memory exporter (which lists entities from a crate::backend::MemBackend holding them in RAM). Same wire format either way: whitelist config projection, embedded schema source, deterministic path-sorted entries, fixed mtime, and the same pre-write lenient validation pass.

md_entries are (mem-relative path, bytes) pairs; paths are posix-normalised for the archive. Entries need not be pre-sorted — the archive sort makes the output deterministic regardless of input order.