Struct stacks_common::types::chainstate::BlockHeaderHash
source · pub struct BlockHeaderHash(pub [u8; 32]);
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl BlockHeaderHash
impl BlockHeaderHash
source§impl BlockHeaderHash
impl BlockHeaderHash
sourcepub fn from_hex(hex_str: &str) -> Result<BlockHeaderHash, HexError>
pub fn from_hex(hex_str: &str) -> Result<BlockHeaderHash, HexError>
Instantiates from a hex string
sourcepub fn from_bytes(inp: &[u8]) -> Option<BlockHeaderHash>
pub fn from_bytes(inp: &[u8]) -> Option<BlockHeaderHash>
Instantiates from a slice of bytes
sourcepub fn from_bytes_be(inp: &[u8]) -> Option<BlockHeaderHash>
pub fn from_bytes_be(inp: &[u8]) -> Option<BlockHeaderHash>
Instantiates from a slice of bytes, converting to host byte order
sourcepub fn from_vec_be(b: &Vec<u8>) -> Option<BlockHeaderHash>
pub fn from_vec_be(b: &Vec<u8>) -> Option<BlockHeaderHash>
Instantiates from a big-endian vector of bytes, converting to host byte order
source§impl BlockHeaderHash
impl BlockHeaderHash
pub fn to_hash160(&self) -> Hash160
pub fn from_serialized_header(buf: &[u8]) -> BlockHeaderHash
Trait Implementations§
source§impl AsRef<[u8]> for BlockHeaderHash
impl AsRef<[u8]> for BlockHeaderHash
source§impl Clone for BlockHeaderHash
impl Clone for BlockHeaderHash
source§fn clone(&self) -> BlockHeaderHash
fn clone(&self) -> BlockHeaderHash
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 BlockHeaderHash
impl Debug for BlockHeaderHash
source§impl<'de> Deserialize<'de> for BlockHeaderHash
impl<'de> Deserialize<'de> for BlockHeaderHash
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<BlockHeaderHash, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<BlockHeaderHash, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for BlockHeaderHash
impl Display for BlockHeaderHash
source§impl<'a> From<&'a [u8]> for BlockHeaderHash
impl<'a> From<&'a [u8]> for BlockHeaderHash
source§fn from(data: &'a [u8]) -> BlockHeaderHash
fn from(data: &'a [u8]) -> BlockHeaderHash
Converts to this type from the input type.
source§impl FromSql for BlockHeaderHash
impl FromSql for BlockHeaderHash
source§fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>
Converts SQLite value into Rust value.
source§impl Hash for BlockHeaderHash
impl Hash for BlockHeaderHash
source§impl Index<RangeFull> for BlockHeaderHash
impl Index<RangeFull> for BlockHeaderHash
source§impl Index<usize> for BlockHeaderHash
impl Index<usize> for BlockHeaderHash
source§impl Ord for BlockHeaderHash
impl Ord for BlockHeaderHash
source§fn cmp(&self, other: &BlockHeaderHash) -> Ordering
fn cmp(&self, other: &BlockHeaderHash) -> 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<BlockHeaderHash> for BlockHeaderHash
impl PartialEq<BlockHeaderHash> for BlockHeaderHash
source§fn eq(&self, other: &BlockHeaderHash) -> bool
fn eq(&self, other: &BlockHeaderHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<BlockHeaderHash> for BlockHeaderHash
impl PartialOrd<BlockHeaderHash> for BlockHeaderHash
source§fn partial_cmp(&self, other: &BlockHeaderHash) -> Option<Ordering>
fn partial_cmp(&self, other: &BlockHeaderHash) -> 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 Serialize for BlockHeaderHash
impl Serialize for BlockHeaderHash
source§impl StacksMessageCodec for BlockHeaderHash
impl StacksMessageCodec for BlockHeaderHash
source§impl ToSql for BlockHeaderHash
impl ToSql for BlockHeaderHash
source§fn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Converts Rust value to SQLite value
impl Copy for BlockHeaderHash
impl Eq for BlockHeaderHash
Auto Trait Implementations§
impl RefUnwindSafe for BlockHeaderHash
impl Send for BlockHeaderHash
impl Sync for BlockHeaderHash
impl Unpin for BlockHeaderHash
impl UnwindSafe for BlockHeaderHash
Blanket Implementations§
source§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
source§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<T> ToBase32 for Twhere
T: AsRef<[u8]>,
impl<T> ToBase32 for Twhere T: AsRef<[u8]>,
source§fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where
W: WriteBase32,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>where W: WriteBase32,
Encode as base32 and write it to the supplied writer
Implementations shouldn’t allocate.