pub enum AdviceSet {
    MerkleTree(MerkleTree),
    SparseMerkleTree(SparseMerkleTree),
    MerklePathSet(MerklePathSet),
}
Expand description

TODO: add docs

Variants

MerkleTree(MerkleTree)

SparseMerkleTree(SparseMerkleTree)

MerklePathSet(MerklePathSet)

Implementations

Returns a new AdviceSet instantiated as a Merkle tree from the provided leaves.

Errors

Returns an error if the number of leaves is smaller than two or is not a power of two.

Returns a new AdviceSet instantiated as a Sparse Merkle tree from the provided leaves.

Errors

Returns an error if the number of leaves is smaller than two or is not a power of two.

Returns a root of this advice set.

Returns the maximum depth of this advice set.

Returns a node located at the specified depth and index.

Errors

Returns an error if:

  • The specified depth is greater than the depth of this advice set.
  • The specified index is invalid in the context of the specified depth.
  • This advice set does not contain a node at the specified index and depth.

Returns a Merkle path to a node located at the specified depth and index. The node itself is not included in the path.

Errors

Returns an error if:

  • The specified depth is greater than the depth of this advice set.
  • The specified index is invalid in the context of the specified depth.
  • This advice set does not contain a node at the specified index and depth.

Replaces the leaf at the specified index with the provided value.

Errors

Returns an error if:

  • The specified index is not a valid leaf index for this advice set.
  • This advice set does not contain a leaf at the specified index.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.