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 ScriptLeafs.
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 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.