pub struct TapTree(/* private fields */);
Expand description
Taproot Tree representing a complete binary tree without any hidden nodes.
This is in contrast to NodeInfo
, which allows hidden nodes.
The implementations for Eq, PartialEq and Hash compare the merkle root of the tree
Implementations§
§impl TapTree
impl TapTree
pub fn into_node_info(self) -> NodeInfo
pub fn into_node_info(self) -> NodeInfo
Gets the inner NodeInfo
of this tree root.
pub fn script_leaves(&self) -> ScriptLeaves<'_> ⓘ
pub fn script_leaves(&self) -> ScriptLeaves<'_> ⓘ
Returns [TapTreeIter<'_>
] iterator for a taproot script tree, operating in DFS order over
tree ScriptLeaf
s.
pub fn root_hash(&self) -> TapNodeHash
pub fn root_hash(&self) -> TapNodeHash
Returns the root TapNodeHash
of this tree.
Trait Implementations§
§impl<'de> Deserialize<'de> for TapTree
impl<'de> Deserialize<'de> for TapTree
§fn deserialize<__D>(
__deserializer: __D
) -> Result<TapTree, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TapTree, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for TapTree
impl Serialize for TapTree
§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 TapTree
impl TryFrom<TaprootBuilder> for TapTree
§fn try_from(
builder: TaprootBuilder
) -> Result<TapTree, <TapTree as TryFrom<TaprootBuilder>>::Error>
fn try_from( builder: TaprootBuilder ) -> Result<TapTree, <TapTree as TryFrom<TaprootBuilder>>::Error>
Constructs TapTree
from a TaprootBuilder
if it is complete binary tree.
§Returns
A TapTree
iff the builder
is complete, otherwise return IncompleteBuilderError
error with the content of incomplete builder
instance.
§type Error = IncompleteBuilderError
type Error = IncompleteBuilderError
The type returned in the event of a conversion error.
impl Eq for TapTree
impl StructuralPartialEq for TapTree
Auto Trait Implementations§
impl Freeze for TapTree
impl RefUnwindSafe for TapTree
impl Send for TapTree
impl Sync for TapTree
impl Unpin for TapTree
impl UnwindSafe for TapTree
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
§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