Struct NodeInfo
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.
pub fn node_hash(&self) -> TapNodeHash
pub fn node_hash(&self) -> TapNodeHash
Returns the root TapNodeHash of this node info.
Trait Implementations§
§impl<'de> Deserialize<'de> for NodeInfo
impl<'de> Deserialize<'de> for NodeInfo
§fn deserialize<D>(
deserializer: D,
) -> Result<NodeInfo, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NodeInfo, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for NodeInfo
impl Ord for NodeInfo
§impl PartialOrd for NodeInfo
impl PartialOrd for NodeInfo
§impl Serialize for NodeInfo
impl Serialize for NodeInfo
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<NodeInfo> for TapTree
impl TryFrom<NodeInfo> for TapTree
§impl TryFrom<TaprootBuilder> for NodeInfo
impl TryFrom<TaprootBuilder> for NodeInfo
§type Error = IncompleteBuilderError
type Error = IncompleteBuilderError
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 Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnwindSafe for NodeInfo
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request