pub struct LeafNode(/* private fields */);Expand description
Store information about taproot leaf node.
Implementations§
Source§impl LeafNode
impl LeafNode
Sourcepub fn leaf_hash(&self) -> Option<String>
pub fn leaf_hash(&self) -> Option<String>
Computes a leaf hash for this ScriptLeaf if the leaf is known. This TapLeafHash is useful while signing taproot script spends. See LeafNode::node_hash for computing the TapNodeHash which returns the hidden node hash if the node is hidden.
Sourcepub fn node_hash(&self) -> String
pub fn node_hash(&self) -> String
Computes the [TapNodeHash] for this [ScriptLeaf]. This returns the
leaf hash if the leaf is known and the hidden node hash if the leaf is
hidden.
See also, [bdk_electrum::bdk_core::bitcoin::taproot::LeafNode::leaf_hash].
Sourcepub fn script(&self) -> Option<Arc<Script>>
pub fn script(&self) -> Option<Arc<Script>>
Returns reference to the leaf script if the leaf is known.
Sourcepub fn leaf_version(&self) -> Option<u8>
pub fn leaf_version(&self) -> Option<u8>
Returns leaf version of the script if the leaf is known.
Sourcepub fn merkle_branch(&self) -> Vec<String>
pub fn merkle_branch(&self) -> Vec<String>
Returns reference to the merkle proof (hashing partners) to get this
node in form of [TaprootMerkleBranch].
Trait Implementations§
Source§impl<UT> LowerError<UT> for LeafNode
impl<UT> LowerError<UT> for LeafNode
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for LeafNode
impl<UT> LowerReturn<UT> for LeafNode
Source§type ReturnType = <Arc<LeafNode> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<LeafNode> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Auto Trait Implementations§
impl Freeze for LeafNode
impl RefUnwindSafe for LeafNode
impl Send for LeafNode
impl Sync for LeafNode
impl Unpin for LeafNode
impl UnwindSafe for LeafNode
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<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more