Struct bitcoin::TapSighash
source · pub struct TapSighash(/* private fields */);
Expand description
Taproot-tagged hash with tag "TapSighash".
This hash type is used for computing taproot signature hash.“
Implementations§
source§impl TapSighash
impl TapSighash
sourcepub fn from_raw_hash(inner: Hash<TapSighashTag>) -> TapSighash
pub fn from_raw_hash(inner: Hash<TapSighashTag>) -> TapSighash
Creates this wrapper type from the inner hash type.
sourcepub fn to_raw_hash(self) -> Hash<TapSighashTag>
pub fn to_raw_hash(self) -> Hash<TapSighashTag>
Returns the inner hash (sha256, sh256d etc.).
sourcepub fn as_raw_hash(&self) -> &Hash<TapSighashTag>
pub fn as_raw_hash(&self) -> &Hash<TapSighashTag>
Returns a reference to the inner hash (sha256, sh256d etc.).
Trait Implementations§
source§impl AsRef<[u8]> for TapSighash
impl AsRef<[u8]> for TapSighash
source§impl Borrow<[u8]> for TapSighash
impl Borrow<[u8]> for TapSighash
source§impl Clone for TapSighash
impl Clone for TapSighash
source§fn clone(&self) -> TapSighash
fn clone(&self) -> TapSighash
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 moresource§impl Debug for TapSighash
impl Debug for TapSighash
source§impl<'de> Deserialize<'de> for TapSighash
impl<'de> Deserialize<'de> for TapSighash
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TapSighash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TapSighash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for TapSighash
impl Display for TapSighash
source§impl From<Hash<TapSighashTag>> for TapSighash
impl From<Hash<TapSighashTag>> for TapSighash
source§fn from(inner: Hash<TapSighashTag>) -> TapSighash
fn from(inner: Hash<TapSighashTag>) -> TapSighash
Converts to this type from the input type.
source§impl From<TapSighash> for Hash<TapSighashTag>
impl From<TapSighash> for Hash<TapSighashTag>
source§fn from(hashtype: TapSighash) -> Hash<TapSighashTag>
fn from(hashtype: TapSighash) -> Hash<TapSighashTag>
Converts to this type from the input type.
source§impl From<TapSighash> for Message
impl From<TapSighash> for Message
source§fn from(hash: TapSighash) -> Message
fn from(hash: TapSighash) -> Message
Converts to this type from the input type.
source§impl FromStr for TapSighash
impl FromStr for TapSighash
source§impl Hash for TapSighash
impl Hash for TapSighash
source§impl Hash for TapSighash
impl Hash for TapSighash
§type Engine = <Hash<TapSighashTag> as Hash>::Engine
type Engine = <Hash<TapSighashTag> 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.§type Bytes = <Hash<TapSighashTag> as Hash>::Bytes
type Bytes = <Hash<TapSighashTag> as Hash>::Bytes
The byte array that represents the hash internally.
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§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<TapSighash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<TapSighash, 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) -> Selfwhere
B: AsRef<[u8]>,
I: IntoIterator<Item = B>,
fn hash_byte_chunks<B, I>(byte_slices: I) -> Selfwhere B: AsRef<[u8]>, I: IntoIterator<Item = B>,
Hashes all the byte slices retrieved from the iterator together.
source§impl<I: SliceIndex<[u8]>> Index<I> for TapSighash
impl<I: SliceIndex<[u8]>> Index<I> for TapSighash
source§impl LowerHex for TapSighash
impl LowerHex for TapSighash
source§impl Ord for TapSighash
impl Ord for TapSighash
source§fn cmp(&self, other: &TapSighash) -> Ordering
fn cmp(&self, other: &TapSighash) -> 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<TapSighash> for TapSighash
impl PartialEq<TapSighash> for TapSighash
source§fn eq(&self, other: &TapSighash) -> bool
fn eq(&self, other: &TapSighash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TapSighash> for TapSighash
impl PartialOrd<TapSighash> for TapSighash
source§fn partial_cmp(&self, other: &TapSighash) -> Option<Ordering>
fn partial_cmp(&self, other: &TapSighash) -> 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 moresource§impl SerdeHash for TapSighash
impl SerdeHash for TapSighash
source§fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
source§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.
source§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.
source§impl Serialize for TapSighash
impl Serialize for TapSighash
source§impl UpperHex for TapSighash
impl UpperHex for TapSighash
impl Copy for TapSighash
impl Eq for TapSighash
impl StructuralEq for TapSighash
impl StructuralPartialEq for TapSighash
Auto Trait Implementations§
impl RefUnwindSafe for TapSighash
impl Send for TapSighash
impl Sync for TapSighash
impl Unpin for TapSighash
impl UnwindSafe for TapSighash
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