Struct casper_types::TransferAddr
source · pub struct TransferAddr(/* private fields */);
Expand description
A newtype wrapping a [u8; TRANSFER_ADDR_LENGTH]
which is the raw bytes of the
transfer address.
Implementations§
source§impl TransferAddr
impl TransferAddr
sourcepub const fn new(value: [u8; 32]) -> TransferAddr
pub const fn new(value: [u8; 32]) -> TransferAddr
Constructs a new TransferAddr
instance from the raw bytes.
sourcepub fn to_formatted_string(self) -> String
pub fn to_formatted_string(self) -> String
Formats the TransferAddr
as a prefixed, hex-encoded string.
sourcepub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
pub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
Parses a string formatted as per Self::to_formatted_string()
into a TransferAddr
.
Trait Implementations§
source§impl AsRef<[u8]> for TransferAddr
impl AsRef<[u8]> for TransferAddr
source§impl Clone for TransferAddr
impl Clone for TransferAddr
source§fn clone(&self) -> TransferAddr
fn clone(&self) -> TransferAddr
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 TransferAddr
impl Debug for TransferAddr
source§impl Default for TransferAddr
impl Default for TransferAddr
source§fn default() -> TransferAddr
fn default() -> TransferAddr
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TransferAddr
impl<'de> Deserialize<'de> for TransferAddr
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for TransferAddr
impl Display for TransferAddr
source§impl Distribution<TransferAddr> for Standard
impl Distribution<TransferAddr> for Standard
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> TransferAddr
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> TransferAddr
Generate a random value of
T
, using rng
as the source of randomness.source§impl From<TransferAddr> for Key
impl From<TransferAddr> for Key
source§fn from(transfer_addr: TransferAddr) -> Key
fn from(transfer_addr: TransferAddr) -> Key
Converts to this type from the input type.
source§impl FromBytes for TransferAddr
impl FromBytes for TransferAddr
source§impl Hash for TransferAddr
impl Hash for TransferAddr
source§impl Ord for TransferAddr
impl Ord for TransferAddr
source§fn cmp(&self, other: &TransferAddr) -> Ordering
fn cmp(&self, other: &TransferAddr) -> 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 TransferAddr
impl PartialEq for TransferAddr
source§fn eq(&self, other: &TransferAddr) -> bool
fn eq(&self, other: &TransferAddr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TransferAddr
impl PartialOrd for TransferAddr
source§fn partial_cmp(&self, other: &TransferAddr) -> Option<Ordering>
fn partial_cmp(&self, other: &TransferAddr) -> 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 TransferAddr
impl Serialize for TransferAddr
source§impl ToBytes for TransferAddr
impl ToBytes for TransferAddr
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Copy for TransferAddr
impl Eq for TransferAddr
impl StructuralEq for TransferAddr
impl StructuralPartialEq for TransferAddr
Auto Trait Implementations§
impl RefUnwindSafe for TransferAddr
impl Send for TransferAddr
impl Sync for TransferAddr
impl Unpin for TransferAddr
impl UnwindSafe for TransferAddr
Blanket Implementations§
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> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)