#[repr(C)]pub struct MerkleTree<H, C>where
H: Hasher,
C: MerkleTreeConfig,{
pub height: u64,
pub filled_subtrees: [[u8; 32]; 18],
pub roots: [[u8; 32]; 20],
pub next_index: u64,
pub current_root_index: u64,
/* private fields */
}
Fields§
§height: u64
Height of the Merkle tree.
filled_subtrees: [[u8; 32]; 18]
Subtree hashes.
roots: [[u8; 32]; 20]
Full history of roots of the Merkle tree (the last one is the current one).
next_index: u64
Next index to insert a leaf.
current_root_index: u64
Current index of the root.
Implementations§
Source§impl<H, C> MerkleTree<H, C>where
H: Hasher,
C: MerkleTreeConfig,
impl<H, C> MerkleTree<H, C>where
H: Hasher,
C: MerkleTreeConfig,
Trait Implementations§
Source§impl<H, C> Clone for MerkleTree<H, C>
impl<H, C> Clone for MerkleTree<H, C>
Source§fn clone(&self) -> MerkleTree<H, C>
fn clone(&self) -> MerkleTree<H, C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<H, C> Debug for MerkleTree<H, C>
impl<H, C> Debug for MerkleTree<H, C>
Source§impl<H, C> PartialEq for MerkleTree<H, C>
impl<H, C> PartialEq for MerkleTree<H, C>
Source§impl<H, C> Zeroable for MerkleTree<H, C>where
H: Hasher,
C: MerkleTreeConfig,
impl<H, C> Zeroable for MerkleTree<H, C>where
H: Hasher,
C: MerkleTreeConfig,
SAFETY: Generic parameters are used only as PhantomData
and they don’t
affect the layout of the struct nor its size or padding. The only reason
why we can’t #[derive(Zeroable)]
is because bytemuck is not aware of that
and it doesn’t allow to derive Zeroable
for structs with generic
parameters.
Would be nice to fix that upstream:
https://github.com/Lokathor/bytemuck/issues/191
impl<H, C> Copy for MerkleTree<H, C>
impl<H, C> Eq for MerkleTree<H, C>
impl<H, C> Pod for MerkleTree<H, C>
SAFETY: Generic parameters are used only as PhantomData
and they don’t
affect the layout of the struct nor its size or padding. The only reason
why we can’t #[derive(Pod)]
is because bytemuck is not aware of that and
it doesn’t allow to derive Pod
for structs with generic parameters.
Would be nice to fix that upstream:
https://github.com/Lokathor/bytemuck/issues/191
impl<H, C> StructuralPartialEq for MerkleTree<H, C>where
H: Hasher,
C: MerkleTreeConfig,
Auto Trait Implementations§
impl<H, C> Freeze for MerkleTree<H, C>
impl<H, C> RefUnwindSafe for MerkleTree<H, C>where
H: RefUnwindSafe,
C: RefUnwindSafe,
impl<H, C> Send for MerkleTree<H, C>
impl<H, C> Sync for MerkleTree<H, C>
impl<H, C> Unpin for MerkleTree<H, C>
impl<H, C> UnwindSafe for MerkleTree<H, C>where
H: UnwindSafe,
C: UnwindSafe,
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more