pub struct MmrPeaks<const MAX_N: u64, H>where
H: MerkleHasher,{
pub num_leaves: u64,
pub peaks: [[u8; <H as MerkleHasher>::OUT_LEN]; _],
}Expand description
MMR peaks for MerkleMountainRange.
Primarily intended to be used with MerkleMountainRange::from_peaks(), can be sent over the
network, etc.
Fields§
§num_leaves: u64Number of leaves in MMR
peaks: [[u8; <H as MerkleHasher>::OUT_LEN]; _]MMR peaks, first Self::num_peaks() elements are occupied by values, the rest are
ignored and do not need to be retained.
Implementations§
Source§impl<const MAX_N: u64, H> MmrPeaks<MAX_N, H>where
H: MerkleHasher,
impl<const MAX_N: u64, H> MmrPeaks<MAX_N, H>where
H: MerkleHasher,
Sourcepub fn num_peaks(&self) -> u8
pub fn num_peaks(&self) -> u8
Number of peaks stored in Self::peaks that are occupied by actual values
Trait Implementations§
impl<const MAX_N: u64, H> Copy for MmrPeaks<MAX_N, H>where
H: MerkleHasher + Copy,
impl<const MAX_N: u64, H> Eq for MmrPeaks<MAX_N, H>where
H: MerkleHasher + Eq,
Source§impl<const MAX_N: u64, H> Ord for MmrPeaks<MAX_N, H>where
H: MerkleHasher + Ord,
impl<const MAX_N: u64, H> Ord for MmrPeaks<MAX_N, H>where
H: MerkleHasher + Ord,
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<const MAX_N: u64, H> PartialOrd for MmrPeaks<MAX_N, H>where
H: MerkleHasher + PartialOrd,
impl<const MAX_N: u64, H> PartialOrd for MmrPeaks<MAX_N, H>where
H: MerkleHasher + PartialOrd,
impl<const MAX_N: u64, H> StructuralPartialEq for MmrPeaks<MAX_N, H>where
H: MerkleHasher + PartialEq,
Auto Trait Implementations§
impl<const MAX_N: u64, H> Forget for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> Freeze for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> RefUnwindSafe for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> Send for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> Sync for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> Unpin for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> UnsafeUnpin for MmrPeaks<MAX_N, H>
impl<const MAX_N: u64, H> UnwindSafe for MmrPeaks<MAX_N, H>
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