Skip to main content

Module operations

Module operations 

Source

Functions§

get_after_hash_blobs
Get only afterHash blobs referenced by a manifest. Used for apply operations – we only need the patched file content, not the original. This saves disk space since beforeHash blobs are not needed for applying patches.
get_before_hash_blobs
Get only beforeHash blobs referenced by a manifest. Used for rollback operations – we need the original file content to restore.
read_manifest
Read and parse a manifest from the filesystem. Returns Ok(None) if the file does not exist. Returns Err for I/O errors, JSON parse errors, or validation errors.
resolve_manifest_path
Resolve a manifest path: absolute paths are returned as-is, relative paths are joined to cwd. Centralizes the duplicate block previously inlined in apply/rollback/list/remove/repair commands.
validate_manifest
Validate a parsed JSON value as a PatchManifest. Returns Ok(manifest) if valid, or Err(message) if invalid.
write_manifest
Write a manifest to the filesystem with pretty-printed JSON.