pub struct TapLeafHash(/* private fields */);Expand description
Taproot-tagged hash for elements tapscript Merkle tree leafs.
Implementations§
Source§impl TapLeafHash
impl TapLeafHash
Sourcepub fn from_raw_hash(inner: Hash<TapLeafTag>) -> TapLeafHash
pub fn from_raw_hash(inner: Hash<TapLeafTag>) -> TapLeafHash
Creates this wrapper type from the inner hash type.
Sourcepub fn to_raw_hash(self) -> Hash<TapLeafTag>
pub fn to_raw_hash(self) -> Hash<TapLeafTag>
Returns the inner hash (sha256, sh256d etc.).
Sourcepub fn as_raw_hash(&self) -> &Hash<TapLeafTag>
pub fn as_raw_hash(&self) -> &Hash<TapLeafTag>
Returns a reference to the inner hash (sha256, sh256d etc.).
Source§impl TapLeafHash
impl TapLeafHash
Sourcepub fn from_script(script: &Script, ver: LeafVersion) -> TapLeafHash
pub fn from_script(script: &Script, ver: LeafVersion) -> TapLeafHash
function to compute leaf hash from components
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 Decodable for TapLeafHash
impl Decodable for TapLeafHash
Source§impl Deserialize for TapLeafHash
impl Deserialize for TapLeafHash
Source§impl Display for TapLeafHash
impl Display for TapLeafHash
Source§impl Encodable for TapLeafHash
impl Encodable 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<'s> From<ScriptPath<'s>> for TapLeafHash
impl<'s> From<ScriptPath<'s>> for TapLeafHash
Source§fn from(script_path: ScriptPath<'s>) -> TapLeafHash
fn from(script_path: ScriptPath<'s>) -> 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 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. For some reason Satoshi decided this should be
true for
Sha256dHash, so here we are.Source§type Engine = <Hash<TapLeafTag> as Hash>::Engine
type Engine = <Hash<TapLeafTag> as Hash>::Engine
A hashing engine which bytes can be serialized into. It is expected
to implement the
io::Write trait, and to never return errors under
any conditions.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_engine(e: Self::Engine) -> Self
fn from_engine(e: Self::Engine) -> Self
Produces a hash from the current state of a given engine.
Source§fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
Copies a byte slice into a hash object.
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 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§fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
Source§impl<I: SliceIndex<[u8]>> Index<I> for TapLeafHash
impl<I: SliceIndex<[u8]>> Index<I> for TapLeafHash
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