Trait MerklizedState

Source
pub trait MerklizedState<Types, const ARITY: usize>:
    ForgetableMerkleTreeScheme<Commitment = Self::Commit>
    + Send
    + Sync
    + Clone
    + 'static
where Types: NodeType,
{ type Key: Index + Send + Sync + Serialize + ToTraversalPath<ARITY> + FromStr + DeserializeOwned + Display + CanonicalSerialize + CanonicalDeserialize; type Entry: Element + Send + Sync + Serialize + DeserializeOwned + CanonicalSerialize + CanonicalDeserialize; type T: NodeValue + Send; type Commit: MerkleCommitment<Self::T> + Send + for<'a> TryFrom<&'a TaggedBase64> + Display + Debug + Into<TaggedBase64>; type Digest: DigestAlgorithm<Self::Entry, Self::Key, Self::T>; // Required methods fn state_type() -> &'static str; fn header_state_commitment_field() -> &'static str; fn tree_height() -> usize; fn insert_path( &mut self, key: Self::Key, proof: &MerkleProof<Self::Entry, Self::Key, Self::T, ARITY>, ) -> Result<()>; }
Expand description

This trait should be implemented by the MerkleTree that the module is initialized for. It defines methods utilized by the module.

Required Associated Types§

Source

type Key: Index + Send + Sync + Serialize + ToTraversalPath<ARITY> + FromStr + DeserializeOwned + Display + CanonicalSerialize + CanonicalDeserialize

Source

type Entry: Element + Send + Sync + Serialize + DeserializeOwned + CanonicalSerialize + CanonicalDeserialize

Source

type T: NodeValue + Send

Source

type Commit: MerkleCommitment<Self::T> + Send + for<'a> TryFrom<&'a TaggedBase64> + Display + Debug + Into<TaggedBase64>

Source

type Digest: DigestAlgorithm<Self::Entry, Self::Key, Self::T>

Required Methods§

Source

fn state_type() -> &'static str

Retrieves the name of the state being queried.

Source

fn header_state_commitment_field() -> &'static str

Retrieves the field in the header containing the Merkle tree commitment for the state implementing this trait.

Source

fn tree_height() -> usize

Get the height of the tree

Source

fn insert_path( &mut self, key: Self::Key, proof: &MerkleProof<Self::Entry, Self::Key, Self::T, ARITY>, ) -> Result<()>

Insert a forgotten path into the tree.

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§