Struct dusk_merkle::Opening
source · pub struct Opening<T, const H: usize, const A: usize> { /* private fields */ }
Expand description
An opening for a given position in a merkle tree.
Implementations§
source§impl<T, const H: usize, const A: usize> Opening<T, H, A>
impl<T, const H: usize, const A: usize> Opening<T, H, A>
sourcepub fn verify(&self, item: impl Into<T>) -> boolwhere
T: PartialEq,
pub fn verify(&self, item: impl Into<T>) -> boolwhere
T: PartialEq,
Verify the given item is the leaf of the opening, and that the opening is cryptographically correct.
sourcepub fn to_var_bytes<const T_SIZE: usize>(&self) -> Vec<u8>where
T: Serializable<T_SIZE>,
pub fn to_var_bytes<const T_SIZE: usize>(&self) -> Vec<u8>where
T: Serializable<T_SIZE>,
Serialize an Opening
to a vector of bytes.
sourcepub fn from_slice<const T_SIZE: usize>(buf: &[u8]) -> Result<Self, BytesError>where
T: Serializable<T_SIZE>,
<T as Serializable<T_SIZE>>::Error: BadLength,
Error: From<<T as Serializable<T_SIZE>>::Error>,
pub fn from_slice<const T_SIZE: usize>(buf: &[u8]) -> Result<Self, BytesError>where
T: Serializable<T_SIZE>,
<T as Serializable<T_SIZE>>::Error: BadLength,
Error: From<<T as Serializable<T_SIZE>>::Error>,
Deserialize an Opening
from a slice of bytes.
§Errors
Will return dusk_bytes::Error
in case of a deserialization error.
Trait Implementations§
impl<T: Copy, const H: usize, const A: usize> Copy for Opening<T, H, A>
impl<T: Eq, const H: usize, const A: usize> Eq for Opening<T, H, A>
impl<T, const H: usize, const A: usize> StructuralPartialEq for Opening<T, H, A>
Auto Trait Implementations§
impl<T, const H: usize, const A: usize> Freeze for Opening<T, H, A>where
T: Freeze,
impl<T, const H: usize, const A: usize> RefUnwindSafe for Opening<T, H, A>where
T: RefUnwindSafe,
impl<T, const H: usize, const A: usize> Send for Opening<T, H, A>where
T: Send,
impl<T, const H: usize, const A: usize> Sync for Opening<T, H, A>where
T: Sync,
impl<T, const H: usize, const A: usize> Unpin for Opening<T, H, A>where
T: Unpin,
impl<T, const H: usize, const A: usize> UnwindSafe for Opening<T, H, A>where
T: 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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)