Skip to main content

validate_node

Function validate_node 

Source
pub fn validate_node(node: &Node, index: usize) -> Result<(), Error>
Expand description

Well-formedness of a single node (SPEC §9), independent of any snapshot: a non-empty path with no empty segment, no empty attribute name, and no empty value set. index is used only for error reporting (pass 0 for a bare node). Called by validate per node, and by Node::identity_key / Node::content_hash themselves, so an ill-formed node is never hashed no matter how the caller reaches the hash (SPEC §9: an implementation MUST NOT hash an ill-formed Snapshot).