Struct Hash
pub struct Hash(/* private fields */);
Expand description
Output of the Bitcoin HASH160 hash function. (RIPEMD160(SHA256))
Implementations§
§impl Hash
impl Hash
pub fn from_bytes_ref(bytes: &[u8; 20]) -> &Hash
pub fn from_bytes_ref(bytes: &[u8; 20]) -> &Hash
Zero cost conversion between a fixed length byte array shared reference and a shared reference to this Hash type.
pub fn from_bytes_mut(bytes: &mut [u8; 20]) -> &mut Hash
pub fn from_bytes_mut(bytes: &mut [u8; 20]) -> &mut Hash
Zero cost conversion between a fixed length byte array exclusive reference and an exclusive reference to this Hash type.
Trait Implementations§
§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
§fn deserialize<D>(d: D) -> Result<Hash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Hash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<Hash> for PubkeyHash
impl From<Hash> for PubkeyHash
§fn from(inner: Hash) -> PubkeyHash
fn from(inner: Hash) -> PubkeyHash
Converts to this type from the input type.
§impl From<Hash> for ScriptHash
impl From<Hash> for ScriptHash
§fn from(inner: Hash) -> ScriptHash
fn from(inner: Hash) -> ScriptHash
Converts to this type from the input type.
§impl From<Hash> for WPubkeyHash
impl From<Hash> for WPubkeyHash
§fn from(inner: Hash) -> WPubkeyHash
fn from(inner: Hash) -> WPubkeyHash
Converts to this type from the input type.
§impl From<Hash> for XKeyIdentifier
impl From<Hash> for XKeyIdentifier
§fn from(inner: Hash) -> XKeyIdentifier
fn from(inner: Hash) -> XKeyIdentifier
Converts to this type from the input type.
§impl From<PubkeyHash> for Hash
impl From<PubkeyHash> for Hash
§fn from(hashtype: PubkeyHash) -> Hash
fn from(hashtype: PubkeyHash) -> Hash
Converts to this type from the input type.
§impl From<ScriptHash> for Hash
impl From<ScriptHash> for Hash
§fn from(hashtype: ScriptHash) -> Hash
fn from(hashtype: ScriptHash) -> Hash
Converts to this type from the input type.
§impl From<WPubkeyHash> for Hash
impl From<WPubkeyHash> for Hash
§fn from(hashtype: WPubkeyHash) -> Hash
fn from(hashtype: WPubkeyHash) -> Hash
Converts to this type from the input type.
§impl From<XKeyIdentifier> for Hash
impl From<XKeyIdentifier> for Hash
§fn from(hashtype: XKeyIdentifier) -> Hash
fn from(hashtype: XKeyIdentifier) -> Hash
Converts to this type from the input type.
§impl Hash for Hash
impl Hash for Hash
§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.§type Engine = HashEngine
type Engine = HashEngine
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.§fn from_engine(e: HashEngine) -> Hash
fn from_engine(e: HashEngine) -> Hash
Produces a hash from the current state of a given engine.
§fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<Hash, FromSliceError>
Copies a byte slice into a hash object.
§fn to_byte_array(self) -> <Hash as Hash>::Bytes
fn to_byte_array(self) -> <Hash as Hash>::Bytes
Returns the underlying byte array.
§fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
Returns a reference to the underlying byte array.
§fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Hash
fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Hash
Constructs a hash from the underlying byte array.
§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<I> Index<I> for Hashwhere
I: SliceIndex<[u8]>,
impl<I> Index<I> for Hashwhere
I: SliceIndex<[u8]>,
§impl IntoAssets for Hash
impl IntoAssets for Hash
§fn into_assets(self) -> Assets
fn into_assets(self) -> Assets
Convert
self
into a Assets
struct§impl Ord for Hash
impl Ord for Hash
§impl PartialOrd for Hash
impl PartialOrd for Hash
§impl SerdeHash for Hash
impl SerdeHash for Hash
§fn from_slice_delegated(sl: &[u8]) -> Result<Hash, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Hash, 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 Hash
impl Serialize for Hash
§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 Copy for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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