pub struct NodeInfo { /* private fields */ }
Expand description
Represents the node information in taproot tree.
Helper type used in merkle tree construction allowing one to build sparse merkle trees. The node
represents part of the tree that has information about all of its descendants.
See how TaprootBuilder
works for more details.
You can use TaprootSpendInfo::from_node_info
to a get a TaprootSpendInfo
from the merkle
root NodeInfo
.
Implementations
sourceimpl NodeInfo
impl NodeInfo
Creates a new NodeInfo
with omitted/hidden info.
sourcepub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self
pub fn new_leaf_with_ver(script: Script, ver: LeafVersion) -> Self
Creates a new leaf NodeInfo
with given Script
and LeafVersion
.
sourcepub fn combine(a: Self, b: Self) -> Result<Self, TaprootBuilderError>
pub fn combine(a: Self, b: Self) -> Result<Self, TaprootBuilderError>
Combines two NodeInfo
to create a new parent.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for NodeInfo
impl<'de> Deserialize<'de> for NodeInfo
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 Ord for NodeInfo
impl Ord for NodeInfo
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 PartialOrd<NodeInfo> for NodeInfo
impl PartialOrd<NodeInfo> for NodeInfo
sourcefn partial_cmp(&self, other: &NodeInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeInfo) -> 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 moreimpl Eq for NodeInfo
impl StructuralEq for NodeInfo
impl StructuralPartialEq for NodeInfo
Auto Trait Implementations
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnwindSafe for NodeInfo
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