Struct stacks_common::types::chainstate::BurnchainHeaderHash
source · pub struct BurnchainHeaderHash(pub [u8; 32]);
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl BurnchainHeaderHash
impl BurnchainHeaderHash
source§impl BurnchainHeaderHash
impl BurnchainHeaderHash
sourcepub fn from_hex(hex_str: &str) -> Result<BurnchainHeaderHash, HexError>
pub fn from_hex(hex_str: &str) -> Result<BurnchainHeaderHash, HexError>
Instantiates from a hex string
sourcepub fn from_bytes(inp: &[u8]) -> Option<BurnchainHeaderHash>
pub fn from_bytes(inp: &[u8]) -> Option<BurnchainHeaderHash>
Instantiates from a slice of bytes
sourcepub fn from_bytes_be(inp: &[u8]) -> Option<BurnchainHeaderHash>
pub fn from_bytes_be(inp: &[u8]) -> Option<BurnchainHeaderHash>
Instantiates from a slice of bytes, converting to host byte order
sourcepub fn from_vec(inp: &Vec<u8>) -> Option<BurnchainHeaderHash>
pub fn from_vec(inp: &Vec<u8>) -> Option<BurnchainHeaderHash>
Instantiates from a vector of bytes
sourcepub fn from_vec_be(b: &Vec<u8>) -> Option<BurnchainHeaderHash>
pub fn from_vec_be(b: &Vec<u8>) -> Option<BurnchainHeaderHash>
Instantiates from a big-endian vector of bytes, converting to host byte order
source§impl BurnchainHeaderHash
impl BurnchainHeaderHash
sourcepub fn from_bitcoin_hash(bitcoin_hash: &Sha256dHash) -> BurnchainHeaderHash
pub fn from_bitcoin_hash(bitcoin_hash: &Sha256dHash) -> BurnchainHeaderHash
Instantiate a burnchain block hash from a Bitcoin block header
pub fn to_bitcoin_hash(&self) -> Sha256dHash
pub fn zero() -> BurnchainHeaderHash
Trait Implementations§
source§impl AsRef<[u8]> for BurnchainHeaderHash
impl AsRef<[u8]> for BurnchainHeaderHash
source§impl Clone for BurnchainHeaderHash
impl Clone for BurnchainHeaderHash
source§fn clone(&self) -> BurnchainHeaderHash
fn clone(&self) -> BurnchainHeaderHash
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 BurnchainHeaderHash
impl Debug for BurnchainHeaderHash
source§impl<'de> Deserialize<'de> for BurnchainHeaderHash
impl<'de> Deserialize<'de> for BurnchainHeaderHash
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for BurnchainHeaderHash
impl Display for BurnchainHeaderHash
source§impl<'a> From<&'a [u8]> for BurnchainHeaderHash
impl<'a> From<&'a [u8]> for BurnchainHeaderHash
source§fn from(data: &'a [u8]) -> BurnchainHeaderHash
fn from(data: &'a [u8]) -> BurnchainHeaderHash
Converts to this type from the input type.
source§impl FromSql for BurnchainHeaderHash
impl FromSql for BurnchainHeaderHash
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 BurnchainHeaderHash
impl Hash for BurnchainHeaderHash
source§impl Index<RangeFull> for BurnchainHeaderHash
impl Index<RangeFull> for BurnchainHeaderHash
source§impl Index<usize> for BurnchainHeaderHash
impl Index<usize> for BurnchainHeaderHash
source§impl Ord for BurnchainHeaderHash
impl Ord for BurnchainHeaderHash
source§fn cmp(&self, other: &BurnchainHeaderHash) -> Ordering
fn cmp(&self, other: &BurnchainHeaderHash) -> 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<BurnchainHeaderHash> for BurnchainHeaderHash
impl PartialEq<BurnchainHeaderHash> for BurnchainHeaderHash
source§fn eq(&self, other: &BurnchainHeaderHash) -> bool
fn eq(&self, other: &BurnchainHeaderHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<BurnchainHeaderHash> for BurnchainHeaderHash
impl PartialOrd<BurnchainHeaderHash> for BurnchainHeaderHash
source§fn partial_cmp(&self, other: &BurnchainHeaderHash) -> Option<Ordering>
fn partial_cmp(&self, other: &BurnchainHeaderHash) -> 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 BurnchainHeaderHash
impl Serialize for BurnchainHeaderHash
source§impl StacksMessageCodec for BurnchainHeaderHash
impl StacksMessageCodec for BurnchainHeaderHash
source§impl ToSql for BurnchainHeaderHash
impl ToSql for BurnchainHeaderHash
source§fn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Converts Rust value to SQLite value
impl Copy for BurnchainHeaderHash
impl Eq for BurnchainHeaderHash
Auto Trait Implementations§
impl RefUnwindSafe for BurnchainHeaderHash
impl Send for BurnchainHeaderHash
impl Sync for BurnchainHeaderHash
impl Unpin for BurnchainHeaderHash
impl UnwindSafe for BurnchainHeaderHash
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.