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