pub enum Address {
Account(AccountHash),
Contract(ContractPackageHash),
}Expand description
An enum representing an AccountHash or a ContractPackageHash.
Variants§
Account(AccountHash)
Represents an account hash.
Contract(ContractPackageHash)
Represents a contract package hash.
Implementations§
Source§impl CasperAddress
impl CasperAddress
Sourcepub fn as_account_hash(&self) -> Option<&AccountHash>
pub fn as_account_hash(&self) -> Option<&AccountHash>
Returns the inner account hash if self is the Account variant.
Sourcepub fn as_contract_package_hash(&self) -> Option<&ContractPackageHash>
pub fn as_contract_package_hash(&self) -> Option<&ContractPackageHash>
Returns the inner contract hash if self is the Contract variant.
Trait Implementations§
Source§impl Clone for CasperAddress
impl Clone for CasperAddress
Source§fn clone(&self) -> CasperAddress
fn clone(&self) -> CasperAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CasperAddress
Source§impl Debug for CasperAddress
impl Debug for CasperAddress
impl Eq for CasperAddress
Source§impl From<CasperAddress> for Key
impl From<CasperAddress> for Key
Source§fn from(address: CasperAddress) -> Self
fn from(address: CasperAddress) -> Self
Converts to this type from the input type.
Source§impl From<PublicKey> for CasperAddress
impl From<PublicKey> for CasperAddress
Source§impl FromBytes for CasperAddress
impl FromBytes for CasperAddress
Source§impl FromStr for CasperAddress
impl FromStr for CasperAddress
Source§impl Hash for CasperAddress
impl Hash for CasperAddress
Source§impl OdraAddress for CasperAddress
impl OdraAddress for CasperAddress
Source§fn is_contract(&self) -> bool
fn is_contract(&self) -> bool
Returns true if the address is a contract address.
Source§impl Ord for CasperAddress
impl Ord for CasperAddress
Source§fn cmp(&self, other: &CasperAddress) -> Ordering
fn cmp(&self, other: &CasperAddress) -> Ordering
1.21.0 (const: unstable) · 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 CasperAddress
impl PartialEq for CasperAddress
Source§fn eq(&self, other: &CasperAddress) -> bool
fn eq(&self, other: &CasperAddress) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CasperAddress
impl PartialOrd for CasperAddress
impl StructuralPartialEq for CasperAddress
Source§impl ToBytes for CasperAddress
impl ToBytes for CasperAddress
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.Source§impl ToString for CasperAddress
impl ToString for CasperAddress
Source§impl TryFrom<AccountHash> for CasperAddress
impl TryFrom<AccountHash> for CasperAddress
Source§type Error = AddressError
type Error = AddressError
The type returned in the event of a conversion error.
Source§impl TryFrom<ContractPackageHash> for CasperAddress
impl TryFrom<ContractPackageHash> for CasperAddress
Source§type Error = AddressError
type Error = AddressError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for CasperAddress
impl RefUnwindSafe for CasperAddress
impl Send for CasperAddress
impl Sync for CasperAddress
impl Unpin for CasperAddress
impl UnsafeUnpin for CasperAddress
impl UnwindSafe for CasperAddress
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