Struct esplora_client::api::BlockHash
source · pub struct BlockHash(_);
Expand description
A bitcoin block hash.
Implementations§
source§impl BlockHash
impl BlockHash
sourcepub fn from_raw_hash(inner: Hash) -> BlockHash
pub fn from_raw_hash(inner: Hash) -> BlockHash
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 Decodable for BlockHash
impl Decodable for BlockHash
source§impl<'de> Deserialize<'de> for BlockHash
impl<'de> Deserialize<'de> for BlockHash
source§fn deserialize<D>(d: D) -> Result<BlockHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<BlockHash, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for BlockHash
impl Hash for BlockHash
§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 = true
const DISPLAY_BACKWARD: bool = true
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: <BlockHash as Hash>::Engine) -> BlockHash
fn from_engine(e: <BlockHash as Hash>::Engine) -> BlockHash
Produces a hash from the current state of a given engine.
source§fn from_byte_array(bytes: <BlockHash as Hash>::Bytes) -> BlockHash
fn from_byte_array(bytes: <BlockHash as Hash>::Bytes) -> BlockHash
Constructs a hash from the underlying byte array.
source§fn to_byte_array(self) -> <BlockHash as Hash>::Bytes
fn to_byte_array(self) -> <BlockHash as Hash>::Bytes
Returns the underlying byte array.
source§fn as_byte_array(&self) -> &<BlockHash as Hash>::Bytes
fn as_byte_array(&self) -> &<BlockHash as Hash>::Bytes
Returns a reference to the underlying byte array.
source§impl Ord for BlockHash
impl Ord for BlockHash
source§impl PartialEq<BlockHash> for BlockHash
impl PartialEq<BlockHash> for BlockHash
source§impl PartialOrd<BlockHash> for BlockHash
impl PartialOrd<BlockHash> for BlockHash
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 BlockHash
impl SerdeHash for BlockHash
source§fn from_slice_delegated(sl: &[u8]) -> Result<BlockHash, Error>
fn from_slice_delegated(sl: &[u8]) -> Result<BlockHash, Error>
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 BlockHash
impl Serialize for BlockHash
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,
Serialize this value into the given Serde serializer. Read more
impl Copy for BlockHash
impl Eq for BlockHash
impl StructuralEq for BlockHash
impl StructuralPartialEq for BlockHash
Auto Trait Implementations§
impl RefUnwindSafe for BlockHash
impl Send for BlockHash
impl Sync for BlockHash
impl Unpin for BlockHash
impl UnwindSafe for BlockHash
Blanket Implementations§
§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.