pub struct MerkleTree {
pub branch: [HexBinary; 32],
pub count: u128,
}
Fields§
§branch: [HexBinary; 32]
§count: u128
Implementations§
Source§impl MerkleTree
impl MerkleTree
pub fn insert(&mut self, node: HexBinary) -> StdResult<()>
pub fn root_with_ctx(&self, zeroes: [[u8; 32]; 32]) -> StdResult<HexBinary>
pub fn root(&self) -> StdResult<HexBinary>
pub fn branch_root( item: HexBinary, branch: [HexBinary; 32], idx: u128, ) -> HexBinary
pub fn zero() -> StdResult<[u8; 32]>
pub fn zeroes() -> StdResult<[[u8; 32]; 32]>
Trait Implementations§
Source§impl Clone for MerkleTree
impl Clone for MerkleTree
Source§fn clone(&self) -> MerkleTree
fn clone(&self) -> MerkleTree
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MerkleTree
impl Debug for MerkleTree
Source§impl Default for MerkleTree
impl Default for MerkleTree
Source§impl<'de> Deserialize<'de> for MerkleTree
impl<'de> Deserialize<'de> for MerkleTree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for MerkleTree
impl JsonSchema for MerkleTree
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl PartialEq for MerkleTree
impl PartialEq for MerkleTree
Source§impl Serialize for MerkleTree
impl Serialize for MerkleTree
impl StructuralPartialEq for MerkleTree
Auto Trait Implementations§
impl Freeze for MerkleTree
impl RefUnwindSafe for MerkleTree
impl Send for MerkleTree
impl Sync for MerkleTree
impl Unpin for MerkleTree
impl UnwindSafe for MerkleTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more