pub struct TapNodeHash(/* private fields */);
Expand description
Tagged hash used in Taproot trees.
See BIP-340 for tagging rules.
Implementations§
Source§impl TapNodeHash
impl TapNodeHash
Sourcepub const fn from_byte_array(bytes: <Hash<TapBranchTag> as Hash>::Bytes) -> Self
pub const fn from_byte_array(bytes: <Hash<TapBranchTag> as Hash>::Bytes) -> Self
Constructs a hash from the underlying byte array.
Sourcepub fn from_slice(sl: &[u8]) -> Result<TapNodeHash, FromSliceError>
👎Deprecated since 0.15.0: use from_byte_array
instead
pub fn from_slice(sl: &[u8]) -> Result<TapNodeHash, FromSliceError>
from_byte_array
insteadCopies a byte slice into a hash object.
Sourcepub const fn to_byte_array(self) -> <Hash<TapBranchTag> as Hash>::Bytes
pub const fn to_byte_array(self) -> <Hash<TapBranchTag> as Hash>::Bytes
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &<Hash<TapBranchTag> as Hash>::Bytes
pub const fn as_byte_array(&self) -> &<Hash<TapBranchTag> as Hash>::Bytes
Returns a reference to the underlying byte array.
Trait Implementations§
Source§impl AsRef<[u8]> for TapNodeHash
impl AsRef<[u8]> for TapNodeHash
Source§impl Borrow<[u8]> for TapNodeHash
impl Borrow<[u8]> for TapNodeHash
Source§impl Clone for TapNodeHash
impl Clone for TapNodeHash
Source§fn clone(&self) -> TapNodeHash
fn clone(&self) -> TapNodeHash
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 TapNodeHash
impl Debug for TapNodeHash
Source§impl<'de> Deserialize<'de> for TapNodeHash
impl<'de> Deserialize<'de> for TapNodeHash
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TapNodeHash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TapNodeHash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TapNodeHash
impl Display for TapNodeHash
Source§impl From<Hash<TapBranchTag>> for TapNodeHash
impl From<Hash<TapBranchTag>> for TapNodeHash
Source§fn from(inner: Hash<TapBranchTag>) -> TapNodeHash
fn from(inner: Hash<TapBranchTag>) -> TapNodeHash
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 From<TapNodeHash> for Hash<TapBranchTag>
impl From<TapNodeHash> for Hash<TapBranchTag>
Source§fn from(hashtype: TapNodeHash) -> Hash<TapBranchTag>
fn from(hashtype: TapNodeHash) -> Hash<TapBranchTag>
Converts to this type from the input type.
Source§impl FromStr for TapNodeHash
impl FromStr for TapNodeHash
Source§impl Hash for TapNodeHash
impl Hash for TapNodeHash
Source§impl Hash for TapNodeHash
impl Hash for TapNodeHash
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<TapBranchTag> as Hash>::Bytes
type Bytes = <Hash<TapBranchTag> 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<TapNodeHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<TapNodeHash, 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 TapNodeHash
impl LowerHex for TapNodeHash
Source§impl Ord for TapNodeHash
impl Ord for TapNodeHash
Source§fn cmp(&self, other: &TapNodeHash) -> Ordering
fn cmp(&self, other: &TapNodeHash) -> 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 TapNodeHash
impl PartialEq for TapNodeHash
Source§impl PartialOrd for TapNodeHash
impl PartialOrd for TapNodeHash
Source§impl Serialize for TapNodeHash
impl Serialize for TapNodeHash
Source§impl UpperHex for TapNodeHash
impl UpperHex for TapNodeHash
impl Copy for TapNodeHash
impl Eq for TapNodeHash
impl StructuralPartialEq for TapNodeHash
Auto Trait Implementations§
impl Freeze for TapNodeHash
impl RefUnwindSafe for TapNodeHash
impl Send for TapNodeHash
impl Sync for TapNodeHash
impl Unpin for TapNodeHash
impl UnwindSafe for TapNodeHash
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