Struct elements::taproot::TaprootMerkleBranch
source · pub struct TaprootMerkleBranch(/* private fields */);
Expand description
The Merkle proof for inclusion of a tree in a taptree hash
Implementations§
source§impl TaprootMerkleBranch
impl TaprootMerkleBranch
sourcepub fn from_slice(sl: &[u8]) -> Result<Self, TaprootError>
pub fn from_slice(sl: &[u8]) -> Result<Self, TaprootError>
Create a merkle proof from slice
sourcepub fn encode<Write: Write>(&self, writer: Write) -> Result<usize>
pub fn encode<Write: Write>(&self, writer: Write) -> Result<usize>
Serialize to a writer. Returns the number of bytes written
sourcepub fn from_inner(inner: Vec<Hash>) -> Result<Self, TaprootError>
pub fn from_inner(inner: Vec<Hash>) -> Result<Self, TaprootError>
Create a MerkleProof from Vec<[sha256::Hash
]>. Returns an error when
inner proof len is more than TAPROOT_CONTROL_MAX_NODE_COUNT (128)
sourcepub fn into_inner(self) -> Vec<Hash>
pub fn into_inner(self) -> Vec<Hash>
Consume Self to get Vec<[sha256::Hash
]>
Trait Implementations§
source§impl Clone for TaprootMerkleBranch
impl Clone for TaprootMerkleBranch
source§fn clone(&self) -> TaprootMerkleBranch
fn clone(&self) -> TaprootMerkleBranch
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 Debug for TaprootMerkleBranch
impl Debug for TaprootMerkleBranch
source§impl Default for TaprootMerkleBranch
impl Default for TaprootMerkleBranch
source§fn default() -> TaprootMerkleBranch
fn default() -> TaprootMerkleBranch
Returns the “default value” for a type. Read more
source§impl Hash for TaprootMerkleBranch
impl Hash for TaprootMerkleBranch
source§impl Ord for TaprootMerkleBranch
impl Ord for TaprootMerkleBranch
source§fn cmp(&self, other: &TaprootMerkleBranch) -> Ordering
fn cmp(&self, other: &TaprootMerkleBranch) -> 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 TaprootMerkleBranch
impl PartialEq for TaprootMerkleBranch
source§fn eq(&self, other: &TaprootMerkleBranch) -> bool
fn eq(&self, other: &TaprootMerkleBranch) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TaprootMerkleBranch
impl PartialOrd for TaprootMerkleBranch
source§fn partial_cmp(&self, other: &TaprootMerkleBranch) -> Option<Ordering>
fn partial_cmp(&self, other: &TaprootMerkleBranch) -> 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 moreimpl Eq for TaprootMerkleBranch
impl StructuralPartialEq for TaprootMerkleBranch
Auto Trait Implementations§
impl RefUnwindSafe for TaprootMerkleBranch
impl Send for TaprootMerkleBranch
impl Sync for TaprootMerkleBranch
impl Unpin for TaprootMerkleBranch
impl UnwindSafe for TaprootMerkleBranch
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