Struct diem_client::AccountAddress [−][src]
pub struct AccountAddress(_);
Expand description
A struct that represents an account address.
Implementations
Hex address: 0x0
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
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
type Err = AccountAddressParseError
type Err = AccountAddressParseError
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
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
Tries to convert the provided byte array into Address.
type Error = AccountAddressParseError
type Error = AccountAddressParseError
The type returned in the event of a conversion error.
type Error = AccountAddressParseError
type Error = AccountAddressParseError
The type returned in the event of a conversion error.
Performs the conversion.
Tries to convert the provided byte buffer into Address.
type Error = AccountAddressParseError
type Error = AccountAddressParseError
The type returned in the event of a conversion error.
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
Generates a hash used only for tests.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more