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

Method self_hash

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

Returns the self hash (index 0), if the table is non-empty. # Examples ```rust use atomic_core::change::format_v3::HashDedupTable; let hash = [42u8; 32]; let table = HashDedupTable::new(hash); assert_eq!(table.self_hash(), Some(&hash)); ```

(&self)

Source from the content-addressed store, hash-verified

473 /// assert_eq!(table.self_hash(), Some(&hash));
474 /// ```
475 pub fn self_hash(&self) -> Option<&[u8; 32]> {
476 self.hashes.first()
477 }
478
479 /// Returns an iterator over all (index, hash) pairs in table order.
480 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected