pub struct TapTree(/* private fields */);
Expand description
Taproot Tree representing a finalized TaprootBuilder
(a complete binary tree).
Implementations§
source§impl TapTree
impl TapTree
sourcepub fn from_builder(builder: TaprootBuilder) -> Result<Self, IncompleteTapTree>
👎Deprecated since 0.29.0: use try_from instead
pub fn from_builder(builder: TaprootBuilder) -> Result<Self, IncompleteTapTree>
Constructs TapTree
from a TaprootBuilder
if it is complete binary tree.
Returns
A TapTree
iff the builder
is complete, otherwise return IncompleteTapTree
error with the content of incomplete builder
instance.
sourcepub fn into_builder(self) -> TaprootBuilder
pub fn into_builder(self) -> TaprootBuilder
Converts self into builder TaprootBuilder
. The builder is guaranteed to be finalized.
sourcepub fn to_builder(&self) -> TaprootBuilder
pub fn to_builder(&self) -> TaprootBuilder
Constructs TaprootBuilder
by internally cloning the self
. The builder is guaranteed
to be finalized.
sourcepub fn script_leaves(&self) -> TapTreeIter<'_>
pub fn script_leaves(&self) -> TapTreeIter<'_>
Returns [TapTreeIter<'_>
] iterator for a taproot script tree, operating in DFS order over
tree ScriptLeaf
s.
Trait Implementations§
source§impl<'de> Deserialize<'de> for TapTree
impl<'de> Deserialize<'de> for TapTree
source§fn 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>,
source§impl Deserialize for TapTree
impl Deserialize for TapTree
source§impl From<TapTree> for TaprootBuilder
impl From<TapTree> for TaprootBuilder
source§impl PartialEq<TapTree> for TapTree
impl PartialEq<TapTree> for TapTree
source§impl TryFrom<TaprootBuilder> for TapTree
impl TryFrom<TaprootBuilder> for TapTree
source§fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error>
fn try_from(builder: TaprootBuilder) -> Result<Self, Self::Error>
Constructs TapTree
from a TaprootBuilder
if it is complete binary tree.
Returns
A TapTree
iff the builder
is complete, otherwise return IncompleteTapTree
error with the content of incomplete builder
instance.