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>
👎Deprecated since 0.29.0: use try_from instead
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 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl 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
sourcefn cmp(&self, other: &TaprootMerkleBranch) -> Ordering
fn cmp(&self, other: &TaprootMerkleBranch) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<TaprootMerkleBranch> for TaprootMerkleBranch
impl PartialEq<TaprootMerkleBranch> for TaprootMerkleBranch
sourcefn eq(&self, other: &TaprootMerkleBranch) -> bool
fn eq(&self, other: &TaprootMerkleBranch) -> bool
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>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moresourceimpl Serialize for TaprootMerkleBranch
impl Serialize for TaprootMerkleBranch
sourceimpl TryFrom<&[Hash]> for TaprootMerkleBranch
impl TryFrom<&[Hash]> for TaprootMerkleBranch
sourcefn try_from(v: &[Hash]) -> Result<Self, Self::Error>
fn try_from(v: &[Hash]) -> Result<Self, Self::Error>
Creates a merkle proof from list of hashes.
Errors
If inner proof length is more than TAPROOT_CONTROL_MAX_NODE_COUNT
(128).
type Error = TaprootError
type Error = TaprootError
The type returned in the event of a conversion error.
sourceimpl TryFrom<Box<[Hash], Global>> for TaprootMerkleBranch
impl TryFrom<Box<[Hash], Global>> for TaprootMerkleBranch
sourcefn try_from(v: Box<[Hash]>) -> Result<Self, Self::Error>
fn try_from(v: Box<[Hash]>) -> Result<Self, Self::Error>
Creates a merkle proof from list of hashes.
Errors
If inner proof length is more than TAPROOT_CONTROL_MAX_NODE_COUNT
(128).
type Error = TaprootError
type Error = TaprootError
The type returned in the event of a conversion error.
sourceimpl TryFrom<Vec<Hash, Global>> for TaprootMerkleBranch
impl TryFrom<Vec<Hash, Global>> for TaprootMerkleBranch
sourcefn try_from(v: Vec<Hash>) -> Result<Self, Self::Error>
fn try_from(v: Vec<Hash>) -> Result<Self, Self::Error>
Creates a merkle proof from list of hashes.
Errors
If inner proof length is more than TAPROOT_CONTROL_MAX_NODE_COUNT
(128).
type Error = TaprootError
type Error = TaprootError
The type returned in the event of a conversion error.
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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