pub trait MerklizedState<Types, const ARITY: usize>:
ForgetableMerkleTreeScheme<Commitment = Self::Commit>
+ Send
+ Sync
+ Clone
+ 'staticwhere
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§
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§
Sourcefn state_type() -> &'static str
fn state_type() -> &'static str
Retrieves the name of the state being queried.
Sourcefn header_state_commitment_field() -> &'static str
fn header_state_commitment_field() -> &'static str
Retrieves the field in the header containing the Merkle tree commitment for the state implementing this trait.
Sourcefn tree_height() -> usize
fn tree_height() -> usize
Get the height of 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.