Skip to main content

Block

Trait Block 

Source
pub trait Block:
    Heightable
    + Digestible
    + Encode {
    // Required method
    fn parent(&self) -> Self::Digest;
}
Expand description

Block is the interface for a block in the blockchain.

A block type that is also decoded, such as an application block received over the wire or read from storage, must use a canonical encoding. Every byte sequence bytes accepted by the decoder must satisfy encode(decode(bytes)) == bytes, and decoders must reject alternate encodings of the same block.

Required Methods§

Source

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

Get the parent block’s digest.

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<B: Block> Block for Arc<B>

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

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

Source§

impl<B: Block> Block for Digested<B>

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

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

Implementors§

Source§

impl<B: Block, C: Scheme, H: Hasher> Block for CodedBlock<B, C, H>

Source§

impl<B: Block, C: Scheme, H: Hasher> Block for StoredCodedBlock<B, C, H>