Struct diem_types::PeerId [−][src]
pub struct PeerId(_);
Expand description
A struct that represents an account address.
Implementations
impl AccountAddress
[src]
impl AccountAddress
[src]pub const fn new(address: [u8; 16]) -> AccountAddress
[src]
pub const ZERO: AccountAddress
[src]
pub const ZERO: AccountAddress
[src]Hex address: 0x0
pub fn random() -> AccountAddress
[src]
pub fn short_str_lossless(&self) -> String
[src]
pub fn to_vec(&self) -> Vec<u8, Global>
[src]
pub fn to_u8(self) -> [u8; 16]
[src]
pub fn from_hex_literal(
literal: &str
) -> Result<AccountAddress, AccountAddressParseError>
[src]
literal: &str
) -> Result<AccountAddress, AccountAddressParseError>
pub fn from_hex<T>(hex: T) -> Result<AccountAddress, AccountAddressParseError> where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
pub fn to_hex(&self) -> String
[src]
pub fn from_bytes<T>(
bytes: T
) -> Result<AccountAddress, AccountAddressParseError> where
T: AsRef<[u8]>,
[src]
bytes: T
) -> Result<AccountAddress, AccountAddressParseError> where
T: AsRef<[u8]>,
Methods from Deref<Target = [u8; 16]>
pub fn as_slice(&self) -> &[T]
[src]
🔬 This is a nightly-only experimental API. (array_methods
)
pub fn as_slice(&self) -> &[T]
[src]array_methods
)Returns a slice containing the entire array. Equivalent to &s[..]
.
pub fn each_ref(&self) -> [&T; N]
[src]
🔬 This is a nightly-only experimental API. (array_methods
)
pub fn each_ref(&self) -> [&T; N]
[src]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, array_map)] 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 Clone for AccountAddress
[src]
impl Clone for AccountAddress
[src]pub fn clone(&self) -> AccountAddress
[src]
pub fn clone(&self) -> AccountAddress
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for AccountAddress
[src]
impl Debug for AccountAddress
[src]impl Deref for AccountAddress
[src]
impl Deref for AccountAddress
[src]impl<'de> Deserialize<'de> for AccountAddress
[src]
impl<'de> Deserialize<'de> for AccountAddress
[src]pub fn deserialize<D>(
deserializer: D
) -> Result<AccountAddress, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<AccountAddress, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Display for AccountAddress
[src]
impl Display for AccountAddress
[src]impl FromStr for AccountAddress
[src]
impl FromStr for AccountAddress
[src]type Err = AccountAddressParseError
type Err = AccountAddressParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<AccountAddress, AccountAddressParseError>
[src]
pub fn from_str(s: &str) -> Result<AccountAddress, AccountAddressParseError>
[src]Parses a string s
to return a value of this type. Read more
impl Hash for AccountAddress
[src]
impl Hash for AccountAddress
[src]impl HashAccountAddress for AccountAddress
[src]
impl HashAccountAddress for AccountAddress
[src]impl LowerHex for AccountAddress
[src]
impl LowerHex for AccountAddress
[src]impl Ord for AccountAddress
[src]
impl Ord for AccountAddress
[src]impl PartialEq<AccountAddress> for AccountAddress
[src]
impl PartialEq<AccountAddress> for AccountAddress
[src]pub fn eq(&self, other: &AccountAddress) -> bool
[src]
pub fn eq(&self, other: &AccountAddress) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &AccountAddress) -> bool
[src]
pub fn ne(&self, other: &AccountAddress) -> bool
[src]This method tests for !=
.
impl PartialOrd<AccountAddress> for AccountAddress
[src]
impl PartialOrd<AccountAddress> for AccountAddress
[src]pub fn partial_cmp(&self, other: &AccountAddress) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &AccountAddress) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Serialize for AccountAddress
[src]
impl Serialize for AccountAddress
[src]pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
impl<'_> TryFrom<&'_ [u8]> for AccountAddress
[src]
impl<'_> TryFrom<&'_ [u8]> for AccountAddress
[src]pub fn try_from(
bytes: &[u8]
) -> Result<AccountAddress, AccountAddressParseError>
[src]
pub fn try_from(
bytes: &[u8]
) -> Result<AccountAddress, AccountAddressParseError>
[src]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.
impl TryFrom<String> for AccountAddress
[src]
impl TryFrom<String> for AccountAddress
[src]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>
[src]
pub fn try_from(s: String) -> Result<AccountAddress, AccountAddressParseError>
[src]Performs the conversion.
impl TryFrom<Vec<u8, Global>> for AccountAddress
[src]
impl TryFrom<Vec<u8, Global>> for AccountAddress
[src]pub fn try_from(
bytes: Vec<u8, Global>
) -> Result<AccountAddress, AccountAddressParseError>
[src]
pub fn try_from(
bytes: Vec<u8, Global>
) -> Result<AccountAddress, AccountAddressParseError>
[src]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.
impl UpperHex for AccountAddress
[src]
impl UpperHex for AccountAddress
[src]impl Copy for AccountAddress
[src]
impl Eq for AccountAddress
[src]
impl StructuralEq for AccountAddress
[src]
impl StructuralPartialEq for AccountAddress
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
[src]
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
[src]pub fn test_only_hash(&self) -> HashValue
[src]
pub fn test_only_hash(&self) -> HashValue
[src]Generates a hash used only for tests.
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]Encode the hex strict representing self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read more
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]Encode the hex strict representing self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,