pub trait RecursiveHashTrait {
    type Error: Debug;

    // Required method
    fn try_hash(&self) -> Result<ByteArray, Self::Error>;

    // Provided methods
    fn hash(&self) -> ByteArray { ... }
    fn try_to_hashed_hashable_message(
        &self
    ) -> Result<HashableMessage<'_>, Self::Error> { ... }
    fn to_hashed_hashable_message(&self) -> HashableMessage<'_> { ... }
}
Expand description

Trait implementing defining an interface for objects implementing a recursive hash function.

The enum HashableMessage implements the trait.

Required Associated Types§

source

type Error: Debug

The type of the error in [try_hash]

Required Methods§

source

fn try_hash(&self) -> Result<ByteArray, Self::Error>

Try recursive hash

Return Self::Error if an error appears during the calculation

Provided Methods§

source

fn hash(&self) -> ByteArray

Recursive hash

Panic if an error appears during the calculation

source

fn try_to_hashed_hashable_message( &self ) -> Result<HashableMessage<'_>, Self::Error>

Try recursive hash and return a variant HashableMessage::Hashed containing the hashed value

Return Self::Error if an error appears during the calculation

source

fn to_hashed_hashable_message(&self) -> HashableMessage<'_>

Recursive hash and return a variant HashableMessage::Hashed containing the hashed value

Panic if an error appears during the calculation

Implementors§