MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / dependency_hashes

Method dependency_hashes

atomic-core/src/change/format_v3/hash_table.rs:534–540  ·  view source on GitHub ↗

Returns the dependency hashes (all entries except index 0). Index 0 is the change's own hash, so dependencies start at index 1. Returns an empty slice if the table has 0 or 1 entries. # Examples ```rust use atomic_core::change::format_v3::HashDedupTable; let self_hash = [0u8; 32]; let dep1 = [1u8; 32]; let dep2 = [2u8; 32]; let mut table = HashDedupTable::new(self_hash); table.insert(dep1).unw

(&self)

Source from the content-addressed store, hash-verified

532 /// assert_eq!(deps[1], dep2);
533 /// ```
534 pub fn dependency_hashes(&self) -> &[[u8; 32]] {
535 if self.hashes.len() <= 1 {
536 &[]
537 } else {
538 &self.hashes[1..]
539 }
540 }
541
542 /// Total serialized size of the hash table in bytes.
543 ///

Callers 1

Calls 1

lenMethod · 0.45

Tested by 1