pub struct TapLeafHash(/* private fields */);
Expand description
Taproot-tagged hash with tag "TapLeaf".
This is used for computing tapscript script spend hash.
Implementations§
Source§impl TapLeafHash
impl TapLeafHash
Sourcepub const fn from_byte_array(bytes: <Hash<TapLeafTag> as Hash>::Bytes) -> Self
pub const fn from_byte_array(bytes: <Hash<TapLeafTag> as Hash>::Bytes) -> Self
Constructs a hash from the underlying byte array.
Sourcepub fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
👎Deprecated since 0.15.0: use from_byte_array
instead
pub fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
from_byte_array
insteadCopies a byte slice into a hash object.
Sourcepub const fn to_byte_array(self) -> <Hash<TapLeafTag> as Hash>::Bytes
pub const fn to_byte_array(self) -> <Hash<TapLeafTag> as Hash>::Bytes
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &<Hash<TapLeafTag> as Hash>::Bytes
pub const fn as_byte_array(&self) -> &<Hash<TapLeafTag> as Hash>::Bytes
Returns a reference to the underlying byte array.
Trait Implementations§
Source§impl AsRef<[u8]> for TapLeafHash
impl AsRef<[u8]> for TapLeafHash
Source§impl Borrow<[u8]> for TapLeafHash
impl Borrow<[u8]> for TapLeafHash
Source§impl Clone for TapLeafHash
impl Clone for TapLeafHash
Source§fn clone(&self) -> TapLeafHash
fn clone(&self) -> TapLeafHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TapLeafHash
impl Debug for TapLeafHash
Source§impl<'de> Deserialize<'de> for TapLeafHash
impl<'de> Deserialize<'de> for TapLeafHash
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TapLeafHash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TapLeafHash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TapLeafHash
impl Display for TapLeafHash
Source§impl From<Hash<TapLeafTag>> for TapLeafHash
impl From<Hash<TapLeafTag>> for TapLeafHash
Source§fn from(inner: Hash<TapLeafTag>) -> TapLeafHash
fn from(inner: Hash<TapLeafTag>) -> TapLeafHash
Converts to this type from the input type.
Source§impl From<TapLeafHash> for Hash<TapLeafTag>
impl From<TapLeafHash> for Hash<TapLeafTag>
Source§fn from(hashtype: TapLeafHash) -> Hash<TapLeafTag>
fn from(hashtype: TapLeafHash) -> Hash<TapLeafTag>
Converts to this type from the input type.
Source§impl From<TapLeafHash> for TapNodeHash
impl From<TapLeafHash> for TapNodeHash
Source§fn from(leaf: TapLeafHash) -> TapNodeHash
fn from(leaf: TapLeafHash) -> TapNodeHash
Converts to this type from the input type.
Source§impl FromStr for TapLeafHash
impl FromStr for TapLeafHash
Source§impl Hash for TapLeafHash
impl Hash for TapLeafHash
Source§impl Hash for TapLeafHash
impl Hash for TapLeafHash
Source§const DISPLAY_BACKWARD: bool = false
const DISPLAY_BACKWARD: bool = false
Flag indicating whether user-visible serializations of this hash should be backward. Read more
Source§type Bytes = <Hash<TapLeafTag> as Hash>::Bytes
type Bytes = <Hash<TapLeafTag> as Hash>::Bytes
The byte array that represents the hash internally.
Source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a hash from the underlying byte array.
Source§fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
👎Deprecated since 0.15.0: use
from_byte_array
insteadCopies a byte slice into a hash object.
Source§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Returns the underlying byte array.
Source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Returns a reference to the underlying byte array.
Source§impl LowerHex for TapLeafHash
impl LowerHex for TapLeafHash
Source§impl Ord for TapLeafHash
impl Ord for TapLeafHash
Source§fn cmp(&self, other: &TapLeafHash) -> Ordering
fn cmp(&self, other: &TapLeafHash) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TapLeafHash
impl PartialEq for TapLeafHash
Source§impl PartialOrd for TapLeafHash
impl PartialOrd for TapLeafHash
Source§impl Serialize for TapLeafHash
impl Serialize for TapLeafHash
Source§impl UpperHex for TapLeafHash
impl UpperHex for TapLeafHash
impl Copy for TapLeafHash
impl Eq for TapLeafHash
impl StructuralPartialEq for TapLeafHash
Auto Trait Implementations§
impl Freeze for TapLeafHash
impl RefUnwindSafe for TapLeafHash
impl Send for TapLeafHash
impl Sync for TapLeafHash
impl Unpin for TapLeafHash
impl UnwindSafe for TapLeafHash
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