[−][src]Struct ckb_merkle_mountain_range::MMR
Methods
impl<'a, T: Clone + PartialEq + Debug, M: Merge<Item = T>, S: MMRStore<T>> MMR<T, M, S>
[src]
pub fn new(mmr_size: u64, store: S) -> Self
[src]
pub fn mmr_size(&self) -> u64
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn push(&mut self, elem: T) -> Result<u64>
[src]
pub fn get_root(&self) -> Result<T>
[src]
get_root
pub fn gen_proof(&self, pos_list: Vec<u64>) -> Result<MerkleProof<T, M>>
[src]
Generate merkle proof for positions
- sort positions
- push merkle proof to proof by peak from left to right
- push bagged right hand side root
pub fn commit(self) -> Result<()>
[src]
Auto Trait Implementations
impl<T, M, S> RefUnwindSafe for MMR<T, M, S> where
M: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
M: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M, S> Send for MMR<T, M, S> where
M: Send,
S: Send,
T: Send,
M: Send,
S: Send,
T: Send,
impl<T, M, S> Sync for MMR<T, M, S> where
M: Sync,
S: Sync,
T: Sync,
M: Sync,
S: Sync,
T: Sync,
impl<T, M, S> Unpin for MMR<T, M, S> where
M: Unpin,
S: Unpin,
T: Unpin,
M: Unpin,
S: Unpin,
T: Unpin,
impl<T, M, S> UnwindSafe for MMR<T, M, S> where
M: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
M: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,