Struct sapio_bitcoin::util::taproot::TaprootMerkleBranch
source · [−]pub struct TaprootMerkleBranch(_);
Expand description
The merkle proof for inclusion of a tree in a taptree hash.
Implementations
sourceimpl TaprootMerkleBranch
impl TaprootMerkleBranch
sourcepub fn from_slice(sl: &[u8]) -> Result<Self, TaprootError>
pub fn from_slice(sl: &[u8]) -> Result<Self, TaprootError>
Creates a merkle proof from raw data representing a list of hashes.
sourcepub fn serialize(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn serialize(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Serializes self
as bytes.
sourcepub fn from_inner(inner: Vec<Hash>) -> Result<Self, TaprootError>
pub fn from_inner(inner: Vec<Hash>) -> Result<Self, TaprootError>
Creates a merkle proof from list of hashes.
Errors
If inner proof length is more than TAPROOT_CONTROL_MAX_NODE_COUNT
(128).
Trait Implementations
sourceimpl Clone for TaprootMerkleBranch
impl Clone for TaprootMerkleBranch
sourcefn clone(&self) -> TaprootMerkleBranch
fn clone(&self) -> TaprootMerkleBranch
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TaprootMerkleBranch
impl Debug for TaprootMerkleBranch
sourceimpl Default for TaprootMerkleBranch
impl Default for TaprootMerkleBranch
sourcefn default() -> TaprootMerkleBranch
fn default() -> TaprootMerkleBranch
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for TaprootMerkleBranch
impl<'de> Deserialize<'de> for TaprootMerkleBranch
sourcefn 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
sourceimpl Hash for TaprootMerkleBranch
impl Hash for TaprootMerkleBranch
sourceimpl Ord for TaprootMerkleBranch
impl Ord for TaprootMerkleBranch
sourceimpl PartialEq<TaprootMerkleBranch> for TaprootMerkleBranch
impl PartialEq<TaprootMerkleBranch> for TaprootMerkleBranch
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &TaprootMerkleBranch) -> bool
fn ne(&self, other: &TaprootMerkleBranch) -> bool
This method tests for !=
.
sourceimpl PartialOrd<TaprootMerkleBranch> for TaprootMerkleBranch
impl PartialOrd<TaprootMerkleBranch> for TaprootMerkleBranch
sourcefn partial_cmp(&self, other: &TaprootMerkleBranch) -> Option<Ordering>
fn partial_cmp(&self, other: &TaprootMerkleBranch) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Serialize for TaprootMerkleBranch
impl Serialize for TaprootMerkleBranch
impl Eq for TaprootMerkleBranch
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more