holo_hash 0.7.0-dev.8

hashing helpers supporting dht sharding
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Definition of the HasHash trait

use crate::HashType;
use crate::HoloHash;

/// Anything which has an owned HoloHashOf.
pub trait HasHash {
    /// The type of the hash which is had.
    type HashType: HashType;

    /// Get the hash by reference
    fn as_hash(&self) -> &HoloHash<Self::HashType>;

    /// Convert to the owned hash
    fn into_hash(self) -> HoloHash<Self::HashType>;
}