Struct zk_kit_imt::imt::IMT
source · pub struct IMT { /* private fields */ }
Implementations§
source§impl IMT
impl IMT
pub fn new( hash: IMTHashFunction, depth: usize, zero_value: IMTNode, arity: usize, leaves: Vec<IMTNode>, ) -> Result<IMT, &'static str>
pub fn root(&mut self) -> Option<IMTNode>
pub fn depth(&self) -> usize
pub fn nodes(&self) -> Vec<Vec<IMTNode>>
pub fn zeroes(&self) -> Vec<IMTNode>
pub fn leaves(&self) -> Vec<IMTNode>
pub fn arity(&self) -> usize
pub fn insert(&mut self, leaf: IMTNode) -> Result<(), &'static str>
pub fn update( &mut self, index: usize, new_leaf: IMTNode, ) -> Result<(), &'static str>
pub fn delete(&mut self, index: usize) -> Result<(), &'static str>
pub fn create_proof(&self, index: usize) -> Result<IMTMerkleProof, &'static str>
pub fn verify_proof(&self, proof: &IMTMerkleProof) -> bool
Auto Trait Implementations§
impl Freeze for IMT
impl RefUnwindSafe for IMT
impl Send for IMT
impl Sync for IMT
impl Unpin for IMT
impl UnwindSafe for IMT
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