Trait grin_core::ser::PMMRable

source ·
pub trait PMMRable: Writeable + Clone + Debug + DefaultHashable {
    type E: Readable + Writeable + Debug;

    // Required methods
    fn as_elmt(&self) -> Self::E;
    fn elmt_size() -> Option<u16>;
}
Expand description

Trait for types that can be added to a PMMR.

Required Associated Types§

source

type E: Readable + Writeable + Debug

The type of element actually stored in the MMR data file. This allows us to store Hash elements in the header MMR for variable size BlockHeaders.

Required Methods§

source

fn as_elmt(&self) -> Self::E

Convert the pmmrable into the element to be stored in the MMR data file.

source

fn elmt_size() -> Option<u16>

Size of each element if “fixed” size. Elements are “variable” size if None.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl PMMRable for RangeProof

§

type E = RangeProof

source§

fn as_elmt(&self) -> Self::E

source§

fn elmt_size() -> Option<u16>

Implementors§

source§

impl PMMRable for BlockHeader

source§

impl PMMRable for OutputIdentifier

source§

impl PMMRable for TxKernel

We store kernels in the kernel MMR. Note: These are “variable size” to support different kernel feature variants.

§

type E = TxKernel