pub trait HashType: Copy + Clone + Debug + Clone + Hash + PartialEq + Eq + PartialOrd + Ord {
    fn get_prefix(self) -> &'static [u8] ;
    fn try_from_prefix(prefix: &[u8]) -> HoloHashResult<Self>;
    fn hash_name(self) -> &'static str;
}
Expand description

Every HoloHash is generic over HashType. Additionally, every HashableContent has an associated HashType. The HashType is the glue that binds together HashableContent with its hash.

Required Methods§

Get the 3-byte prefix for the underlying primitive hash type

Given a 3-byte prefix, return the corresponding HashType, or error if mismatched. Trivial for PrimitiveHashType, but useful for composite types

Get a Display-worthy name for this hash type

Implementors§