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