pub struct NodeInfo { /* private fields */ }Expand description
Represents the node information in taproot tree. In contrast to TapTree, this
is allowed to have hidden leaves as children.
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§
§impl NodeInfo
impl NodeInfo
Creates a new NodeInfo with omitted/hidden info.
pub fn new_leaf_with_ver(script: ScriptBuf, ver: LeafVersion) -> NodeInfo
pub fn new_leaf_with_ver(script: ScriptBuf, ver: LeafVersion) -> NodeInfo
Creates a new leaf NodeInfo with given ScriptBuf and LeafVersion.
pub fn combine(
a: NodeInfo,
b: NodeInfo
) -> Result<NodeInfo, TaprootBuilderError>
pub fn combine( a: NodeInfo, b: NodeInfo ) -> Result<NodeInfo, TaprootBuilderError>
Combines two NodeInfo to create a new parent.
pub fn leaf_nodes(&self) -> LeafNodes<'_> ⓘ
pub fn leaf_nodes(&self) -> LeafNodes<'_> ⓘ
Creates an iterator over all leaves (including hidden leaves) in the tree.
Trait Implementations§
§impl Ord for NodeInfo
impl Ord for NodeInfo
§impl PartialOrd<NodeInfo> for NodeInfo
impl PartialOrd<NodeInfo> for NodeInfo
§fn partial_cmp(&self, other: &NodeInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeInfo) -> 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 more§impl TryFrom<NodeInfo> for TapTree
impl TryFrom<NodeInfo> for TapTree
§impl TryFrom<TaprootBuilder> for NodeInfo
impl TryFrom<TaprootBuilder> for NodeInfo
§type Error = IncompleteBuilder
type Error = IncompleteBuilder
The type returned in the event of a conversion error.
§fn try_from(
builder: TaprootBuilder
) -> Result<NodeInfo, <NodeInfo as TryFrom<TaprootBuilder>>::Error>
fn try_from( builder: TaprootBuilder ) -> Result<NodeInfo, <NodeInfo as TryFrom<TaprootBuilder>>::Error>
Performs the conversion.
impl Eq 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§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.