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