pub enum ManifestNode {
Leaf(ManifestLeaf),
Branch(ManifestBranch),
}Variants§
Leaf(ManifestLeaf)
Branch(ManifestBranch)
Implementations§
Source§impl ManifestNode
impl ManifestNode
Sourcepub fn empty() -> ManifestNode
pub fn empty() -> ManifestNode
The canonical empty-set root: a leaf with no entries.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode to the single canonical byte string for this logical node.
Sourcepub fn address(&self) -> ContentHash
pub fn address(&self) -> ContentHash
The node’s content address — BLAKE3 of its canonical bytes.
Sourcepub fn decode(bytes: &[u8]) -> Result<ManifestNode, ManifestDecodeError>
pub fn decode(bytes: &[u8]) -> Result<ManifestNode, ManifestDecodeError>
Decode strictly.
Rejects a bad magic, an unknown version or tag, an unknown object kind, truncation, trailing bytes, out-of-order or duplicated entries, an empty branch bitmap, and — as a final backstop — any input whose re-encoding differs from the input. A node that decodes here is canonical, so its address is meaningful.
Sourcepub fn decode_addressed(
bytes: &[u8],
expected: &ContentHash,
) -> Result<ManifestNode, ManifestDecodeError>
pub fn decode_addressed( bytes: &[u8], expected: &ContentHash, ) -> Result<ManifestNode, ManifestDecodeError>
Decode and verify the node addresses to expected.
Sourcepub fn leaf_entries(&self) -> &[ManifestObject]
pub fn leaf_entries(&self) -> &[ManifestObject]
Objects named directly by this node (empty for a branch).
Trait Implementations§
Source§impl Clone for ManifestNode
impl Clone for ManifestNode
Source§fn clone(&self) -> ManifestNode
fn clone(&self) -> ManifestNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ManifestNode
impl Debug for ManifestNode
impl Eq for ManifestNode
Source§impl PartialEq for ManifestNode
impl PartialEq for ManifestNode
impl StructuralPartialEq for ManifestNode
Auto Trait Implementations§
impl Freeze for ManifestNode
impl RefUnwindSafe for ManifestNode
impl Send for ManifestNode
impl Sync for ManifestNode
impl Unpin for ManifestNode
impl UnsafeUnpin for ManifestNode
impl UnwindSafe for ManifestNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more