pub struct Manifest {
pub entries: BTreeMap<String, ContentHash>,
}Expand description
A per-view manifest body: path -> the content hash of the populating slice.
Backed by a BTreeMap so serialization has deterministic key order — a
manifest with the same entries always hashes identically, which keeps its
record revision stable under content-addressed dedup.
Fields§
§entries: BTreeMap<String, ContentHash>Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn key(repo: impl Into<String>, view_id: impl Into<String>) -> RecordKey
pub fn key(repo: impl Into<String>, view_id: impl Into<String>) -> RecordKey
The stable RecordKey addressing the manifest for (repo, view_id).
A view has exactly one manifest, so this is a pure function of the pair.
Sourcepub fn collection() -> &'static str
pub fn collection() -> &'static str
The collection segment every manifest is addressed under. A
KeyPrefix with this collection and no namespace
lists every view’s manifest across all repos — the set GC must union to
mark live slices.
Sourcepub fn insert(&mut self, path: impl Into<String>, hash: ContentHash)
pub fn insert(&mut self, path: impl Into<String>, hash: ContentHash)
Record that path is populated by the slice with content hash hash.
Sourcepub fn get(&self, path: &str) -> Option<&ContentHash>
pub fn get(&self, path: &str) -> Option<&ContentHash>
The content hash of the slice populating path, if the view has one.
Sourcepub fn from_body(body: &Body) -> Result<Self>
pub fn from_body(body: &Body) -> Result<Self>
Reconstruct a manifest from a record Body. Errors if the body bytes
are not a valid serialized manifest.
Sourcepub fn reconcile(
&self,
desired: &BTreeMap<String, ContentHash>,
) -> Reconciliation
pub fn reconcile( &self, desired: &BTreeMap<String, ContentHash>, ) -> Reconciliation
Reconcile this manifest against the desired path -> content_hash set
of a working tree, returning the change sets and the reconciled manifest.
The A/M/D classification is a pure set difference, so it is robust to
missed events — a full reconcile always converges the manifest onto the
tree regardless of how the desired set was sourced (a git diff stream is
only an optimization for building it). Unchanged paths (present in both
with an equal hash) appear in none of the change sets. Each set is sorted
for deterministic output, and the reconciled manifest equals desired.