Struct LeafNode
pub struct LeafNode { /* private fields */ }
Expand description
Store information about taproot leaf node.
Implementations§
§impl LeafNode
impl LeafNode
pub fn new_script(script: ScriptBuf, ver: LeafVersion) -> LeafNode
pub fn new_script(script: ScriptBuf, ver: LeafVersion) -> LeafNode
Creates an new ScriptLeaf
from script
and ver
and no merkle branch.
Creates an new ScriptLeaf
from hash
and no merkle branch.
pub fn leaf_hash(&self) -> Option<TapLeafHash>
pub fn leaf_hash(&self) -> Option<TapLeafHash>
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.
pub fn node_hash(&self) -> TapNodeHash
pub fn node_hash(&self) -> TapNodeHash
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, LeafNode::leaf_hash
.
pub fn leaf_version(&self) -> Option<LeafVersion>
pub fn leaf_version(&self) -> Option<LeafVersion>
Returns leaf version of the script if the leaf is known.
pub fn merkle_branch(&self) -> &TaprootMerkleBranch
pub fn merkle_branch(&self) -> &TaprootMerkleBranch
Returns reference to the merkle proof (hashing partners) to get this
node in form of TaprootMerkleBranch
.
pub fn leaf(&self) -> &TapLeaf
pub fn leaf(&self) -> &TapLeaf
Returns a reference to the leaf of this ScriptLeaf
.
Trait Implementations§
§impl From<&LeafNode> for TapNodeHash
impl From<&LeafNode> for TapNodeHash
§fn from(leaf: &LeafNode) -> TapNodeHash
fn from(leaf: &LeafNode) -> TapNodeHash
§impl From<LeafNode> for TapNodeHash
impl From<LeafNode> for TapNodeHash
§fn from(leaf: LeafNode) -> TapNodeHash
fn from(leaf: LeafNode) -> TapNodeHash
§impl Ord for LeafNode
impl Ord for LeafNode
§impl PartialOrd for LeafNode
impl PartialOrd for LeafNode
impl Eq for LeafNode
impl StructuralPartialEq for LeafNode
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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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
§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
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request