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