Struct bitcoin::sighash::LegacySighash
source · pub struct LegacySighash(/* private fields */);
Expand description
Hash of a transaction according to the legacy signature algorithm.
Implementations§
source§impl LegacySighash
impl LegacySighash
sourcepub fn from_raw_hash(inner: Hash) -> LegacySighash
pub fn from_raw_hash(inner: Hash) -> LegacySighash
Creates this wrapper type from the inner hash type.
sourcepub fn to_raw_hash(self) -> Hash
pub fn to_raw_hash(self) -> Hash
Returns the inner hash (sha256, sh256d etc.).
sourcepub fn as_raw_hash(&self) -> &Hash
pub fn as_raw_hash(&self) -> &Hash
Returns a reference to the inner hash (sha256, sh256d etc.).
Trait Implementations§
source§impl AsRef<[u8]> for LegacySighash
impl AsRef<[u8]> for LegacySighash
source§impl Borrow<[u8]> for LegacySighash
impl Borrow<[u8]> for LegacySighash
source§impl Clone for LegacySighash
impl Clone for LegacySighash
source§fn clone(&self) -> LegacySighash
fn clone(&self) -> LegacySighash
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 LegacySighash
impl Debug for LegacySighash
source§impl<'de> Deserialize<'de> for LegacySighash
impl<'de> Deserialize<'de> for LegacySighash
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<LegacySighash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<LegacySighash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for LegacySighash
impl Display for LegacySighash
source§impl From<Hash> for LegacySighash
impl From<Hash> for LegacySighash
source§fn from(inner: Hash) -> LegacySighash
fn from(inner: Hash) -> LegacySighash
Converts to this type from the input type.
source§impl From<LegacySighash> for Hash
impl From<LegacySighash> for Hash
source§fn from(hashtype: LegacySighash) -> Hash
fn from(hashtype: LegacySighash) -> Hash
Converts to this type from the input type.
source§impl From<LegacySighash> for Message
impl From<LegacySighash> for Message
source§fn from(hash: LegacySighash) -> Message
fn from(hash: LegacySighash) -> Message
Converts to this type from the input type.
source§impl FromStr for LegacySighash
impl FromStr for LegacySighash
source§impl Hash for LegacySighash
impl Hash for LegacySighash
§type Engine = <Hash as Hash>::Engine
type Engine = <Hash 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§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<LegacySighash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<LegacySighash, 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 Hash for LegacySighash
impl Hash for LegacySighash
source§impl<I: SliceIndex<[u8]>> Index<I> for LegacySighash
impl<I: SliceIndex<[u8]>> Index<I> for LegacySighash
source§impl LowerHex for LegacySighash
impl LowerHex for LegacySighash
source§impl Ord for LegacySighash
impl Ord for LegacySighash
source§fn cmp(&self, other: &LegacySighash) -> Ordering
fn cmp(&self, other: &LegacySighash) -> 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<LegacySighash> for LegacySighash
impl PartialEq<LegacySighash> for LegacySighash
source§fn eq(&self, other: &LegacySighash) -> bool
fn eq(&self, other: &LegacySighash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<LegacySighash> for LegacySighash
impl PartialOrd<LegacySighash> for LegacySighash
source§fn partial_cmp(&self, other: &LegacySighash) -> Option<Ordering>
fn partial_cmp(&self, other: &LegacySighash) -> 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 LegacySighash
impl SerdeHash for LegacySighash
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 LegacySighash
impl Serialize for LegacySighash
source§impl UpperHex for LegacySighash
impl UpperHex for LegacySighash
impl Copy for LegacySighash
impl Eq for LegacySighash
impl StructuralEq for LegacySighash
impl StructuralPartialEq for LegacySighash
Auto Trait Implementations§
impl RefUnwindSafe for LegacySighash
impl Send for LegacySighash
impl Sync for LegacySighash
impl Unpin for LegacySighash
impl UnwindSafe for LegacySighash
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