Struct commit_verify::merkle::MerkleNode
source · pub struct MerkleNode(/* private fields */);
Expand description
Source data for creation of multi-message commitments according to LNPBP-4 procedure.
Implementations§
source§impl MerkleNode
impl MerkleNode
source§impl MerkleNode
impl MerkleNode
sourcepub fn merklize(tag: [u8; 16], leaves: &impl MerkleLeaves) -> Self
pub fn merklize(tag: [u8; 16], leaves: &impl MerkleLeaves) -> Self
Merklization procedure that uses tagged hashes with depth commitments according to LNPBP-81 standard of client-side-validation merklization.
pub fn _merklize( tag: [u8; 16], iter: impl ExactSizeIterator<Item = MerkleNode>, depth: u5, width: u32 ) -> Self
Methods from Deref<Target = Bytes32>§
sourcepub fn iter(&self) -> Iter<'_, T>
pub fn iter(&self) -> Iter<'_, T>
Returns an iterator over the array items.
The iterator yields all items from start to end.
sourcepub fn to_byte_array(&self) -> [u8; LEN]
pub fn to_byte_array(&self) -> [u8; LEN]
Returns a byte array representation stored in the wrapped type.
Trait Implementations§
source§impl Borrow<[u8]> for MerkleNode
impl Borrow<[u8]> for MerkleNode
source§impl Clone for MerkleNode
impl Clone for MerkleNode
source§fn clone(&self) -> MerkleNode
fn clone(&self) -> MerkleNode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CommitStrategy for MerkleNode
impl CommitStrategy for MerkleNode
source§impl CommitmentId for MerkleNode
impl CommitmentId for MerkleNode
source§impl Debug for MerkleNode
impl Debug for MerkleNode
source§impl Deref for MerkleNode
impl Deref for MerkleNode
source§impl<'de> Deserialize<'de> for MerkleNode
impl<'de> Deserialize<'de> for MerkleNode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for MerkleNode
impl Display for MerkleNode
source§impl From<MerkleNode> for Bytes32
impl From<MerkleNode> for Bytes32
source§fn from(wrapped: MerkleNode) -> Self
fn from(wrapped: MerkleNode) -> Self
Converts to this type from the input type.
source§impl FromHex for MerkleNode
impl FromHex for MerkleNode
source§fn from_byte_iter<I>(iter: I) -> Result<Self, Error>
fn from_byte_iter<I>(iter: I) -> Result<Self, Error>
Produce an object from a byte iterator
source§impl FromStr for MerkleNode
impl FromStr for MerkleNode
source§impl Hash for MerkleNode
impl Hash for MerkleNode
source§impl Index<RangeFull> for MerkleNode
impl Index<RangeFull> for MerkleNode
source§impl Index<RangeInclusive<usize>> for MerkleNode
impl Index<RangeInclusive<usize>> for MerkleNode
source§impl Index<RangeToInclusive<usize>> for MerkleNode
impl Index<RangeToInclusive<usize>> for MerkleNode
source§impl Index<usize> for MerkleNode
impl Index<usize> for MerkleNode
source§impl LowerHex for MerkleNode
impl LowerHex for MerkleNode
source§impl Ord for MerkleNode
impl Ord for MerkleNode
source§fn cmp(&self, other: &MerkleNode) -> Ordering
fn cmp(&self, other: &MerkleNode) -> Ordering
1.21.0 · 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
source§impl PartialEq for MerkleNode
impl PartialEq for MerkleNode
source§fn eq(&self, other: &MerkleNode) -> bool
fn eq(&self, other: &MerkleNode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MerkleNode
impl PartialOrd for MerkleNode
source§fn partial_cmp(&self, other: &MerkleNode) -> Option<Ordering>
fn partial_cmp(&self, other: &MerkleNode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for MerkleNode
impl Serialize for MerkleNode
source§impl StrictDecode for MerkleNode
impl StrictDecode for MerkleNode
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
source§impl StrictDumb for MerkleNode
impl StrictDumb for MerkleNode
fn strict_dumb() -> Self
source§impl StrictEncode for MerkleNode
impl StrictEncode for MerkleNode
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
source§impl StrictTuple for MerkleNode
impl StrictTuple for MerkleNode
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for MerkleNode
impl StrictType for MerkleNode
const STRICT_LIB_NAME: &'static str = LIB_NAME_COMMIT_VERIFY
fn strict_name() -> Option<TypeName>
source§impl UpperHex for MerkleNode
impl UpperHex for MerkleNode
source§impl Wrapper for MerkleNode
impl Wrapper for MerkleNode
source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
impl Copy for MerkleNode
impl Eq for MerkleNode
impl StrictProduct for MerkleNode
impl StructuralEq for MerkleNode
impl StructuralPartialEq for MerkleNode
Auto Trait Implementations§
impl RefUnwindSafe for MerkleNode
impl Send for MerkleNode
impl Sync for MerkleNode
impl Unpin for MerkleNode
impl UnwindSafe for MerkleNode
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<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
impl<Id, const LEN: usize, const REVERSE_STR: bool> ByteArray<LEN> for Id
source§fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
fn from_byte_array(val: impl Into<[u8; LEN]>) -> Id
Constructs a wrapper type around a byte array.
source§fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
fn from_slice(slice: impl AsRef<[u8]>) -> Result<Id, FromSliceError>
Constructs a byte array from the slice. Errors if the slice length
doesn’t match
LEN
constant generic.source§fn from_slice_unsafe(slice: impl AsRef<[u8]>) -> Id
fn from_slice_unsafe(slice: impl AsRef<[u8]>) -> Id
Constructs a byte array from the slice. Expects the slice length
doesn’t match
LEN
constant generic. Read moresource§fn to_byte_array(&self) -> [u8; LEN]
fn to_byte_array(&self) -> [u8; LEN]
Returns a byte array representation stored in the wrapped type.
source§impl<T> CommitEncode for T
impl<T> CommitEncode for T
source§fn commit_encode(&self, e: &mut impl Write)
fn commit_encode(&self, e: &mut impl Write)
Encodes the data for the commitment by writing them directly into a
io::Write
writer instance§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.