Skip to main content

Digestible

Trait Digestible 

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

    // Required method
    fn digest(&self) -> Self::Digest;

    // Provided method
    fn digest_across(&self, _strategy: &impl Strategy) -> Self::Digest { ... }
}
Expand description

An object that can be uniquely represented as a Digest.

Required Associated Types§

Source

type Digest: Digest

The type of digest produced by this object.

Required Methods§

Source

fn digest(&self) -> Self::Digest

Returns a unique representation of the object as a Digest.

If many objects with Digests are related (map to some higher-level group Digest), you should also implement Committable.

Provided Methods§

Source

fn digest_across(&self, _strategy: &impl Strategy) -> Self::Digest

Returns the object’s digest, splitting any work in computing it across strategy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Digestible> Digestible for Arc<T>

Available on neither commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.
Source§

type Digest = <T as Digestible>::Digest

Source§

fn digest(&self) -> Self::Digest

Source§

fn digest_across(&self, strategy: &impl Strategy) -> Self::Digest

Implementors§

Source§

impl<T: Digestible> Digestible for Digested<T>

Available on neither commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.