Struct stacks_rpc_client::clarity::codec::StacksPublicKeyBuffer
source · pub struct StacksPublicKeyBuffer(pub [u8; 33]);
Expand description
A container for public keys (compressed secp256k1 public keys)
Tuple Fields§
§0: [u8; 33]
Implementations§
source§impl StacksPublicKeyBuffer
impl StacksPublicKeyBuffer
source§impl StacksPublicKeyBuffer
impl StacksPublicKeyBuffer
sourcepub fn from_hex(hex_str: &str) -> Result<StacksPublicKeyBuffer, HexError>
pub fn from_hex(hex_str: &str) -> Result<StacksPublicKeyBuffer, HexError>
Instantiates from a hex string
sourcepub fn from_bytes(inp: &[u8]) -> Option<StacksPublicKeyBuffer>
pub fn from_bytes(inp: &[u8]) -> Option<StacksPublicKeyBuffer>
Instantiates from a slice of bytes
sourcepub fn from_bytes_be(inp: &[u8]) -> Option<StacksPublicKeyBuffer>
pub fn from_bytes_be(inp: &[u8]) -> Option<StacksPublicKeyBuffer>
Instantiates from a slice of bytes, converting to host byte order
sourcepub fn from_vec(inp: &Vec<u8>) -> Option<StacksPublicKeyBuffer>
pub fn from_vec(inp: &Vec<u8>) -> Option<StacksPublicKeyBuffer>
Instantiates from a vector of bytes
sourcepub fn from_vec_be(b: &Vec<u8>) -> Option<StacksPublicKeyBuffer>
pub fn from_vec_be(b: &Vec<u8>) -> Option<StacksPublicKeyBuffer>
Instantiates from a big-endian vector of bytes, converting to host byte order
source§impl StacksPublicKeyBuffer
impl StacksPublicKeyBuffer
pub fn from_public_key(pubkey: &Secp256k1PublicKey) -> StacksPublicKeyBuffer
pub fn to_public_key(&self) -> Result<Secp256k1PublicKey, Error>
Trait Implementations§
source§impl AsRef<[u8]> for StacksPublicKeyBuffer
impl AsRef<[u8]> for StacksPublicKeyBuffer
source§impl Clone for StacksPublicKeyBuffer
impl Clone for StacksPublicKeyBuffer
source§fn clone(&self) -> StacksPublicKeyBuffer
fn clone(&self) -> StacksPublicKeyBuffer
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 StacksPublicKeyBuffer
impl Debug for StacksPublicKeyBuffer
source§impl Display for StacksPublicKeyBuffer
impl Display for StacksPublicKeyBuffer
source§impl<'a> From<&'a [u8]> for StacksPublicKeyBuffer
impl<'a> From<&'a [u8]> for StacksPublicKeyBuffer
source§fn from(data: &'a [u8]) -> StacksPublicKeyBuffer
fn from(data: &'a [u8]) -> StacksPublicKeyBuffer
Converts to this type from the input type.
source§impl Hash for StacksPublicKeyBuffer
impl Hash for StacksPublicKeyBuffer
source§impl Index<RangeFull> for StacksPublicKeyBuffer
impl Index<RangeFull> for StacksPublicKeyBuffer
source§impl Index<usize> for StacksPublicKeyBuffer
impl Index<usize> for StacksPublicKeyBuffer
source§impl Ord for StacksPublicKeyBuffer
impl Ord for StacksPublicKeyBuffer
source§fn cmp(&self, other: &StacksPublicKeyBuffer) -> Ordering
fn cmp(&self, other: &StacksPublicKeyBuffer) -> 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 StacksPublicKeyBuffer
impl PartialEq for StacksPublicKeyBuffer
source§fn eq(&self, other: &StacksPublicKeyBuffer) -> bool
fn eq(&self, other: &StacksPublicKeyBuffer) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for StacksPublicKeyBuffer
impl PartialOrd for StacksPublicKeyBuffer
source§fn partial_cmp(&self, other: &StacksPublicKeyBuffer) -> Option<Ordering>
fn partial_cmp(&self, other: &StacksPublicKeyBuffer) -> 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 StacksMessageCodec for StacksPublicKeyBuffer
impl StacksMessageCodec for StacksPublicKeyBuffer
source§fn consensus_serialize<W>(&self, fd: &mut W) -> Result<(), Error>where
W: Write,
fn consensus_serialize<W>(&self, fd: &mut W) -> Result<(), Error>where W: Write,
serialize implementors should never error unless there is an underlying
failure in writing to the
fd
fn consensus_deserialize<R>(fd: &mut R) -> Result<StacksPublicKeyBuffer, Error>where R: Read,
impl Copy for StacksPublicKeyBuffer
impl Eq for StacksPublicKeyBuffer
Auto Trait Implementations§
impl RefUnwindSafe for StacksPublicKeyBuffer
impl Send for StacksPublicKeyBuffer
impl Sync for StacksPublicKeyBuffer
impl Unpin for StacksPublicKeyBuffer
impl UnwindSafe for StacksPublicKeyBuffer
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
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.