Skip to main content

HashableContent

Trait HashableContent 

Source
pub trait HashableContent: Sized {
    type HashType: HashType;

    // Required methods
    fn hash_type(&self) -> Self::HashType;
    fn hashable_content(&self) -> HashableContentBytes;
}
Expand description

Any implementor of HashableContent may be used in a HoloHashed to pair data with its HoloHash representation. It also has an associated HashType.

Required Associated Types§

Source

type HashType: HashType

The HashType which this content will be hashed to

Required Methods§

Source

fn hash_type(&self) -> Self::HashType

The HashType which this content will be hashed to

Source

fn hashable_content(&self) -> HashableContentBytes

Return a subset of the content, either as SerializedBytes “content”, which will be used to compute the hash, or as an already precomputed hash which will be used directly

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl HashableContent for Action

Source§

impl HashableContent for Entry

Source§

impl HashableContent for EntryCreationAction

Allows a EntryCreationAction to hash the same bytes as the equivalent Action variant without needing to clone the action.

Source§

impl HashableContent for AgentValidationPkg

Source§

impl HashableContent for CloseChain

Source§

impl HashableContent for Create

Source§

impl HashableContent for Delete

Source§

impl HashableContent for Dna

Source§

impl HashableContent for InitZomesComplete

Source§

impl HashableContent for OpenChain

Source§

impl HashableContent for Signed<Action>

Source§

impl HashableContent for Update

Source§

impl HashableContent for Warrant

Source§

impl<C> HashableContent for HoloHashed<C>
where C: HashableContent,

Source§

impl<C, T> HashableContent for SignedHashed<C>
where C: HashableContent<HashType = T>, T: PrimitiveHashType,