pub struct InventoryRecord { /* private fields */ }Expand description
Immutable v1 declared forest with canonical unique principals and closed parent links.
No root is assigned a privileged role. A parentless entry may be any selected physical canister; multiple disconnected roots are allowed. Membership, permissions, current module state and application consistency stay integration-owned.
Implementations§
Source§impl InventoryRecord
impl InventoryRecord
Sourcepub fn new(
targets: Vec<InventoryTargetRecord>,
) -> Result<Self, InventoryRecordError>
pub fn new( targets: Vec<InventoryTargetRecord>, ) -> Result<Self, InventoryRecordError>
Validate and sort a nonempty exact declared forest without IO.
§Errors
Rejects excessive counts, duplicate identities, missing parents and cycles.
Sourcepub fn targets(&self) -> &[InventoryTargetRecord]
pub fn targets(&self) -> &[InventoryTargetRecord]
Read targets in canonical ASCII principal order; this is not an effect order.
Sourcepub fn target(
&self,
canister_id: &str,
) -> Result<&InventoryTargetRecord, InventoryRecordError>
pub fn target( &self, canister_id: &str, ) -> Result<&InventoryTargetRecord, InventoryRecordError>
Resolve an exact principal through canonical inventory identity admission.
§Errors
Rejects malformed principals or absent exact physical targets.
Sourcepub fn digest(&self) -> ArtifactChecksumRecord
pub fn digest(&self) -> ArtifactChecksumRecord
Hash exact canonical declared fields using the documented v1 binary encoding.
Equivalent input order/case has one digest. Optional fields have explicit tags, so null, empty strings and the text “null” remain distinct. This hash proves declared equality only, without fresh membership or authority.