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>
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Deserialize for TapTree
impl Deserialize for TapTree
Source§impl From<TapTree> for TaprootBuilder
impl From<TapTree> for TaprootBuilder
impl Eq 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