Struct clarity_repl::codec::CoinbasePayload
source · pub struct CoinbasePayload(pub [u8; 32]);Expand description
A coinbase commits to 32 bytes of control-plane information
Tuple Fields§
§0: [u8; 32]Implementations§
source§impl CoinbasePayload
impl CoinbasePayload
source§impl CoinbasePayload
impl CoinbasePayload
sourcepub fn from_hex(hex_str: &str) -> Result<CoinbasePayload, HexError>
pub fn from_hex(hex_str: &str) -> Result<CoinbasePayload, HexError>
Instantiates from a hex string
sourcepub fn from_bytes(inp: &[u8]) -> Option<CoinbasePayload>
pub fn from_bytes(inp: &[u8]) -> Option<CoinbasePayload>
Instantiates from a slice of bytes
sourcepub fn from_bytes_be(inp: &[u8]) -> Option<CoinbasePayload>
pub fn from_bytes_be(inp: &[u8]) -> Option<CoinbasePayload>
Instantiates from a slice of bytes, converting to host byte order
sourcepub fn from_vec_be(b: &Vec<u8>) -> Option<CoinbasePayload>
pub fn from_vec_be(b: &Vec<u8>) -> Option<CoinbasePayload>
Instantiates from a big-endian vector of bytes, converting to host byte order
Trait Implementations§
source§impl AsRef<[u8]> for CoinbasePayload
impl AsRef<[u8]> for CoinbasePayload
source§impl Clone for CoinbasePayload
impl Clone for CoinbasePayload
source§fn clone(&self) -> CoinbasePayload
fn clone(&self) -> CoinbasePayload
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 CoinbasePayload
impl Debug for CoinbasePayload
source§impl<'de> Deserialize<'de> for CoinbasePayload
impl<'de> Deserialize<'de> for CoinbasePayload
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<CoinbasePayload, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<CoinbasePayload, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for CoinbasePayload
impl Display for CoinbasePayload
source§impl<'a> From<&'a [u8]> for CoinbasePayload
impl<'a> From<&'a [u8]> for CoinbasePayload
source§fn from(data: &'a [u8]) -> CoinbasePayload
fn from(data: &'a [u8]) -> CoinbasePayload
Converts to this type from the input type.
source§impl Hash for CoinbasePayload
impl Hash for CoinbasePayload
source§impl Index<RangeFull> for CoinbasePayload
impl Index<RangeFull> for CoinbasePayload
source§impl Index<usize> for CoinbasePayload
impl Index<usize> for CoinbasePayload
source§impl Ord for CoinbasePayload
impl Ord for CoinbasePayload
source§fn cmp(&self, other: &CoinbasePayload) -> Ordering
fn cmp(&self, other: &CoinbasePayload) -> 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 for CoinbasePayload
impl PartialEq for CoinbasePayload
source§fn eq(&self, other: &CoinbasePayload) -> bool
fn eq(&self, other: &CoinbasePayload) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for CoinbasePayload
impl PartialOrd for CoinbasePayload
source§fn partial_cmp(&self, other: &CoinbasePayload) -> Option<Ordering>
fn partial_cmp(&self, other: &CoinbasePayload) -> 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 CoinbasePayload
impl Serialize for CoinbasePayload
source§impl StacksMessageCodec for CoinbasePayload
impl StacksMessageCodec for CoinbasePayload
impl Copy for CoinbasePayload
impl Eq for CoinbasePayload
Auto Trait Implementations§
impl RefUnwindSafe for CoinbasePayload
impl Send for CoinbasePayload
impl Sync for CoinbasePayload
impl Unpin for CoinbasePayload
impl UnwindSafe for CoinbasePayload
Blanket Implementations§
§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
§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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<S> SliceExt for Swhere
S: Index<RangeFull> + ?Sized,
impl<S> SliceExt for Swhere S: Index<RangeFull> + ?Sized,
§impl<T> ToBase32 for Twhere
T: AsRef<[u8]>,
impl<T> ToBase32 for Twhere T: AsRef<[u8]>,
§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.