pub struct BlockHash(/* private fields */);
Expand description
A bitcoin block hash.
Implementations§
Source§impl BlockHash
impl BlockHash
Sourcepub const fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Self
pub const fn from_byte_array(bytes: <Hash as Hash>::Bytes) -> Self
Constructs a hash from the underlying byte array.
Sourcepub fn from_slice(sl: &[u8]) -> Result<BlockHash, FromSliceError>
👎Deprecated since 0.15.0: use from_byte_array
instead
pub fn from_slice(sl: &[u8]) -> Result<BlockHash, FromSliceError>
from_byte_array
insteadCopies a byte slice into a hash object.
Sourcepub const fn to_byte_array(self) -> <Hash as Hash>::Bytes
pub const fn to_byte_array(self) -> <Hash as Hash>::Bytes
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
pub const fn as_byte_array(&self) -> &<Hash as Hash>::Bytes
Returns a reference to the underlying byte array.
Source§impl BlockHash
impl BlockHash
Sourcepub const GENESIS_PREVIOUS_BLOCK_HASH: Self
pub const GENESIS_PREVIOUS_BLOCK_HASH: Self
Dummy hash used as the previous blockhash of the genesis block.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BlockHash
impl<'de> Deserialize<'de> for BlockHash
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<BlockHash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<BlockHash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for BlockHash
impl Hash for BlockHash
Source§const DISPLAY_BACKWARD: bool = true
const DISPLAY_BACKWARD: bool = true
Flag indicating whether user-visible serializations of this hash should be backward. Read more
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 from_slice(sl: &[u8]) -> Result<BlockHash, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<BlockHash, FromSliceError>
👎Deprecated since 0.15.0: use
from_byte_array
insteadCopies a byte slice into a hash object.
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 Ord for BlockHash
impl Ord for BlockHash
Source§impl PartialOrd for BlockHash
impl PartialOrd for BlockHash
impl Copy for BlockHash
impl Eq for BlockHash
impl StructuralPartialEq for BlockHash
Auto Trait Implementations§
impl Freeze for BlockHash
impl RefUnwindSafe for BlockHash
impl Send for BlockHash
impl Sync for BlockHash
impl Unpin for BlockHash
impl UnwindSafe for BlockHash
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