pub trait NodeMethod<T: AsRef<[u8]>> { // Required methods fn get_hash(&self) -> Hash; fn verify(&self) -> Result<(), (Hash, Hash)>; }
Trait for running methods on any abstract kind of node, such as hash verification or just getting the hash
Gets the blake3-based [Hash] for trait implementation, just call on any Node, Data or NodeType like so: item.get_hash(). Typically all this method will do is get the self.hash but this can be used to adapt a broader NodeType
item.get_hash()
self.hash
Verifies the node down through recursion, providing a high-level checking/verification method
If this fails, it will return the expected hash and the found hash where this hash failed at; this is formatted as (expected_hash, found_node)
(expected_hash, found_node)