pub enum Address {
Account(AccountAddress),
Contract(ContractAddress),
}
Expand description
Either an address of an account, or contract.
Variants§
Account(AccountAddress)
Contract(ContractAddress)
Implementations§
source§impl Address
impl Address
pub fn matches_account(&self, acc: &AccountAddress) -> bool
pub fn matches_contract(&self, cnt: &ContractAddress) -> bool
sourcepub fn is_account(&self) -> bool
pub fn is_account(&self) -> bool
Return true
if and only if the address is an account address.
sourcepub fn is_contract(&self) -> bool
pub fn is_contract(&self) -> bool
Return true
if and only if the address is a contract address.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Address
impl Display for Address
Display the Address
using contract notation <index,subindex> for
contract addresses and display for account addresses.
source§impl From<AccountAddress> for Address
impl From<AccountAddress> for Address
source§fn from(address: AccountAddress) -> Address
fn from(address: AccountAddress) -> Address
Converts to this type from the input type.
source§impl From<ContractAddress> for Address
impl From<ContractAddress> for Address
source§fn from(address: ContractAddress) -> Address
fn from(address: ContractAddress) -> Address
Converts to this type from the input type.
source§impl FromStr for Address
impl FromStr for Address
Parse a string into an Address
, by first trying to parse the string
as a contract address string. If this fails, because of missing
bracket, it will try parsing it as an account address string.
source§impl Ord for Address
impl Ord for Address
source§impl PartialEq for Address
impl PartialEq for Address
source§impl PartialOrd for Address
impl PartialOrd for Address
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 moreimpl Copy for Address
impl Eq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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