Struct diem_client::AccountAddress [−]
pub struct AccountAddress(_);Expand description
A struct that represents an account address.
Implementations
impl AccountAddress
impl AccountAddress
pub const fn new(address: [u8; 16]) -> AccountAddress
pub const ZERO: AccountAddress
pub const ZERO: AccountAddress
Hex address: 0x0
pub fn random() -> AccountAddress
pub fn short_str_lossless(&self) -> String
pub fn into_bytes(self) -> [u8; 16]
pub fn from_hex_literal(
literal: &str
) -> Result<AccountAddress, AccountAddressParseError>
pub fn to_hex_literal(&self) -> String
pub fn from_hex<T>(hex: T) -> Result<AccountAddress, AccountAddressParseError> where
T: AsRef<[u8]>,
pub fn from_bytes<T>(
bytes: T
) -> Result<AccountAddress, AccountAddressParseError> where
T: AsRef<[u8]>,
Methods from Deref<Target = [u8; 16]>
🔬 This is a nightly-only experimental API. (array_methods)
array_methods)Returns a slice containing the entire array. Equivalent to &s[..].
🔬 This is a nightly-only experimental API. (array_methods)
array_methods)Borrows each element and returns an array of references with the same
size as self.
Example
#![feature(array_methods)]
let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);This method is particularly useful if combined with other methods, like
map. This way, you can avoid moving the original
array if its elements are not Copy.
#![feature(array_methods)]
let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);
// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);Trait Implementations
impl Arbitrary for AccountAddress
impl Arbitrary for AccountAddress
type Parameters = <[u8; 16] as Arbitrary>::Parameters
type Parameters = <[u8; 16] as Arbitrary>::Parameters
The type of parameters that arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default. Read more
pub fn arbitrary_with(
_top: <AccountAddress as Arbitrary>::Parameters
) -> <AccountAddress as Arbitrary>::Strategy
pub fn arbitrary_with(
_top: <AccountAddress as Arbitrary>::Parameters
) -> <AccountAddress as Arbitrary>::Strategy
impl AsRef<[u8]> for AccountAddress
impl AsRef<[u8]> for AccountAddress
impl Clone for AccountAddress
impl Clone for AccountAddress
pub fn clone(&self) -> AccountAddress
pub fn clone(&self) -> AccountAddress
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
impl Debug for AccountAddress
impl Debug for AccountAddress
impl Deref for AccountAddress
impl Deref for AccountAddress
impl<'de> Deserialize<'de> for AccountAddress
impl<'de> Deserialize<'de> for AccountAddress
pub fn deserialize<D>(
deserializer: D
) -> Result<AccountAddress, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<AccountAddress, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Display for AccountAddress
impl Display for AccountAddress
impl<'_> From<&'_ AccountAddress> for [u8; 16]
impl<'_> From<&'_ AccountAddress> for [u8; 16]
pub fn from(addr: &AccountAddress) -> [u8; 16]
pub fn from(addr: &AccountAddress) -> [u8; 16]
Performs the conversion.
impl From<[u8; 16]> for AccountAddress
impl From<[u8; 16]> for AccountAddress
pub fn from(bytes: [u8; 16]) -> AccountAddress
pub fn from(bytes: [u8; 16]) -> AccountAddress
Performs the conversion.
impl From<AccountAddress> for [u8; 16]
impl From<AccountAddress> for [u8; 16]
pub fn from(addr: AccountAddress) -> [u8; 16]
pub fn from(addr: AccountAddress) -> [u8; 16]
Performs the conversion.
impl FromStr for AccountAddress
impl FromStr for AccountAddress
impl Hash for AccountAddress
impl Hash for AccountAddress
impl LowerHex for AccountAddress
impl LowerHex for AccountAddress
impl Ord for AccountAddress
impl Ord for AccountAddress
pub fn cmp(&self, other: &AccountAddress) -> Ordering
pub fn cmp(&self, other: &AccountAddress) -> Ordering
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
impl PartialEq<AccountAddress> for AccountAddress
impl PartialEq<AccountAddress> for AccountAddress
pub fn eq(&self, other: &AccountAddress) -> bool
pub fn eq(&self, other: &AccountAddress) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
pub fn ne(&self, other: &AccountAddress) -> bool
pub fn ne(&self, other: &AccountAddress) -> bool
This method tests for !=.
impl PartialOrd<AccountAddress> for AccountAddress
impl PartialOrd<AccountAddress> for AccountAddress
pub fn partial_cmp(&self, other: &AccountAddress) -> Option<Ordering>
pub fn partial_cmp(&self, other: &AccountAddress) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
impl Serialize for AccountAddress
impl Serialize for AccountAddress
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'_> TryFrom<&'_ [u8]> for AccountAddress
impl<'_> TryFrom<&'_ [u8]> for AccountAddress
impl TryFrom<String> for AccountAddress
impl TryFrom<String> for AccountAddress
type Error = AccountAddressParseError
type Error = AccountAddressParseError
The type returned in the event of a conversion error.
pub fn try_from(s: String) -> Result<AccountAddress, AccountAddressParseError>
pub fn try_from(s: String) -> Result<AccountAddress, AccountAddressParseError>
Performs the conversion.
impl TryFrom<Vec<u8, Global>> for AccountAddress
impl TryFrom<Vec<u8, Global>> for AccountAddress
impl UpperHex for AccountAddress
impl UpperHex for AccountAddress
impl Copy for AccountAddress
impl Eq for AccountAddress
impl StructuralEq for AccountAddress
impl StructuralPartialEq for AccountAddress
Auto Trait Implementations
impl RefUnwindSafe for AccountAddress
impl Send for AccountAddress
impl Sync for AccountAddress
impl Unpin for AccountAddress
impl UnwindSafe for AccountAddress
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
Generates a hash used only for tests.