Trait Committable

Source
pub trait Committable:
    Digestible
    + Clone
    + Sized
    + Send
    + Sync
    + 'static {
    type Commitment: Digest;

    // Required method
    fn commitment(&self) -> Self::Commitment;
}
Expand description

An object that can produce a commitment of itself.

Required Associated Types§

Source

type Commitment: Digest

The type of commitment produced by this object.

Required Methods§

Source

fn commitment(&self) -> Self::Commitment

Returns the unique commitment of the object as a Digest.

For simple objects (like a block), this is often just the digest of the object itself. For more complex objects, however, this may represent some root or base of a proof structure (where many unique objects map to the same commitment).

§Warning

It must not be possible for two objects with the same Digest to map to different commitments. Primitives assume there is a one-to-one relation between digest and commitment and a one-to-many relation between commitment and digest.

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§