Struct bdk_chain::bitcoin::TapLeafHash
pub struct TapLeafHash(/* private fields */);
Expand description
Taproot-tagged hash with tag "TapLeaf".
This is used for computing tapscript script spend hash.
Implementations§
§impl TapLeafHash
impl TapLeafHash
pub 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.
pub fn to_raw_hash(self) -> Hash<TapLeafTag>
pub fn to_raw_hash(self) -> Hash<TapLeafTag>
Returns the inner hash (sha256, sh256d etc.).
pub 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.).
§impl TapLeafHash
impl TapLeafHash
pub fn from_script(script: &Script, ver: LeafVersion) -> TapLeafHash
pub fn from_script(script: &Script, ver: LeafVersion) -> TapLeafHash
Computes the leaf hash from components.
Trait Implementations§
§impl AsRef<[u8]> for TapLeafHash
impl AsRef<[u8]> for TapLeafHash
§impl AsRef<[u8; 32]> for TapLeafHash
impl AsRef<[u8; 32]> for TapLeafHash
§impl Borrow<[u8]> for TapLeafHash
impl Borrow<[u8]> for TapLeafHash
§impl Clone for TapLeafHash
impl Clone for TapLeafHash
§fn clone(&self) -> TapLeafHash
fn clone(&self) -> TapLeafHash
Returns a copy 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 more§impl Debug for TapLeafHash
impl Debug for TapLeafHash
§impl Decodable for TapLeafHash
impl Decodable for TapLeafHash
§impl<'de> Deserialize<'de> for TapLeafHash
impl<'de> Deserialize<'de> for TapLeafHash
§fn deserialize<D>(d: D) -> Result<TapLeafHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<TapLeafHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for TapLeafHash
impl Display for TapLeafHash
§impl Encodable for TapLeafHash
impl Encodable for TapLeafHash
§impl From<Hash<TapLeafTag>> for TapLeafHash
impl From<Hash<TapLeafTag>> for TapLeafHash
§fn from(inner: Hash<TapLeafTag>) -> TapLeafHash
fn from(inner: Hash<TapLeafTag>) -> TapLeafHash
Converts to this type from the input type.
§impl<'s> From<ScriptPath<'s>> for TapLeafHash
impl<'s> From<ScriptPath<'s>> for TapLeafHash
§fn from(script_path: ScriptPath<'s>) -> TapLeafHash
fn from(script_path: ScriptPath<'s>) -> TapLeafHash
Converts to this type from the input type.
§impl From<TapLeafHash> for Hash<TapLeafTag>
impl From<TapLeafHash> for Hash<TapLeafTag>
§fn from(hashtype: TapLeafHash) -> Hash<TapLeafTag>
fn from(hashtype: TapLeafHash) -> Hash<TapLeafTag>
Converts to this type from the input type.
§impl From<TapLeafHash> for TapNodeHash
impl From<TapLeafHash> for TapNodeHash
§fn from(leaf: TapLeafHash) -> TapNodeHash
fn from(leaf: TapLeafHash) -> TapNodeHash
Converts to this type from the input type.
§impl FromStr for TapLeafHash
impl FromStr for TapLeafHash
§type Err = HexToArrayError
type Err = HexToArrayError
The associated error which can be returned from parsing.
§fn from_str(s: &str) -> Result<TapLeafHash, <TapLeafHash as FromStr>::Err>
fn from_str(s: &str) -> Result<TapLeafHash, <TapLeafHash as FromStr>::Err>
Parses a string
s
to return a value of this type. Read more§impl Hash for TapLeafHash
impl Hash for TapLeafHash
§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.§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.§fn engine() -> <TapLeafHash as Hash>::Engine
fn engine() -> <TapLeafHash as Hash>::Engine
Constructs a new engine.
§fn from_engine(e: <TapLeafHash as Hash>::Engine) -> TapLeafHash
fn from_engine(e: <TapLeafHash as Hash>::Engine) -> TapLeafHash
Produces a hash from the current state of a given engine.
§fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
Copies a byte slice into a hash object.
§fn from_byte_array(bytes: <TapLeafHash as Hash>::Bytes) -> TapLeafHash
fn from_byte_array(bytes: <TapLeafHash as Hash>::Bytes) -> TapLeafHash
Constructs a hash from the underlying byte array.
§fn to_byte_array(self) -> <TapLeafHash as Hash>::Bytes
fn to_byte_array(self) -> <TapLeafHash as Hash>::Bytes
Returns the underlying byte array.
§fn as_byte_array(&self) -> &<TapLeafHash as Hash>::Bytes
fn as_byte_array(&self) -> &<TapLeafHash as Hash>::Bytes
Returns a reference to the underlying byte array.
§fn all_zeros() -> TapLeafHash
fn all_zeros() -> TapLeafHash
Returns an all zero hash. Read more
§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.
§impl Hash for TapLeafHash
impl Hash for TapLeafHash
§impl<I> Index<I> for TapLeafHashwhere
I: SliceIndex<[u8]>,
impl<I> Index<I> for TapLeafHashwhere
I: SliceIndex<[u8]>,
§impl LowerHex for TapLeafHash
impl LowerHex for TapLeafHash
§impl Ord for TapLeafHash
impl Ord for TapLeafHash
§impl PartialEq for TapLeafHash
impl PartialEq for TapLeafHash
§fn eq(&self, other: &TapLeafHash) -> bool
fn eq(&self, other: &TapLeafHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for TapLeafHash
impl PartialOrd for TapLeafHash
§fn partial_cmp(&self, other: &TapLeafHash) -> Option<Ordering>
fn partial_cmp(&self, other: &TapLeafHash) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl SerdeHash for TapLeafHash
impl SerdeHash for TapLeafHash
§fn from_slice_delegated(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<TapLeafHash, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
§fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Do serde serialization.
§fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Do serde deserialization.
§impl Serialize for TapLeafHash
impl Serialize for TapLeafHash
§fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§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
§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
Checks if this value is equivalent to the given key. Read more