pub enum Address {
Ed25519(Ed25519Address),
Alias(AliasAddress),
Nft(NftAddress),
}Expand description
A generic address supporting different address kinds.
Variants§
Ed25519(Ed25519Address)
An Ed25519 address.
Alias(AliasAddress)
An alias address.
Nft(NftAddress)
An NFT address.
Implementations§
Source§impl Address
impl Address
Sourcepub fn is_ed25519(&self) -> bool
pub fn is_ed25519(&self) -> bool
Checks whether the address is an Ed25519Address.
Sourcepub fn as_ed25519(&self) -> &Ed25519Address
pub fn as_ed25519(&self) -> &Ed25519Address
Gets the address as an actual Ed25519Address.
PANIC: do not call on a non-ed25519 address.
Sourcepub fn is_alias(&self) -> bool
pub fn is_alias(&self) -> bool
Checks whether the address is an AliasAddress.
Sourcepub fn as_alias(&self) -> &AliasAddress
pub fn as_alias(&self) -> &AliasAddress
Gets the address as an actual AliasAddress.
PANIC: do not call on a non-alias address.
Sourcepub fn is_nft(&self) -> bool
pub fn is_nft(&self) -> bool
Checks whether the address is an NftAddress.
Sourcepub fn as_nft(&self) -> &NftAddress
pub fn as_nft(&self) -> &NftAddress
Gets the address as an actual NftAddress.
PANIC: do not call on a non-nft address.
Sourcepub fn try_from_bech32(address: impl AsRef<str>) -> Result<Self, Error>
pub fn try_from_bech32(address: impl AsRef<str>) -> Result<Self, Error>
Tries to create an Address from a bech32 encoded string.
Sourcepub fn is_valid_bech32(address: &str) -> bool
pub fn is_valid_bech32(address: &str) -> bool
Checks if a string is a valid bech32 encoded address.
Trait Implementations§
Source§impl AsRef<Address> for Bech32Address
impl AsRef<Address> for Bech32Address
Source§impl From<Address> for AddressUnlockCondition
impl From<Address> for AddressUnlockCondition
Source§impl From<Address> for GovernorAddressUnlockCondition
impl From<Address> for GovernorAddressUnlockCondition
Source§impl From<Address> for IssuerFeature
impl From<Address> for IssuerFeature
Source§impl From<Address> for SenderFeature
impl From<Address> for SenderFeature
Source§impl From<AliasAddress> for Address
impl From<AliasAddress> for Address
Source§fn from(value: AliasAddress) -> Self
fn from(value: AliasAddress) -> Self
Source§impl From<Ed25519Address> for Address
impl From<Ed25519Address> for Address
Source§fn from(value: Ed25519Address) -> Self
fn from(value: Ed25519Address) -> Self
Source§impl From<NftAddress> for Address
impl From<NftAddress> for Address
Source§fn from(value: NftAddress) -> Self
fn from(value: NftAddress) -> Self
Source§impl Ord for Address
impl Ord for Address
Source§impl Packable for Address
impl Packable for Address
Source§type UnpackError = Error
type UnpackError = Error
Source§type UnpackVisitor = <Ed25519Address as Packable>::UnpackVisitor
type UnpackVisitor = <Ed25519Address as Packable>::UnpackVisitor
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
§fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor,
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_verified<T>( bytes: T, visitor: &<P as Packable>::UnpackVisitor, ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>].
§fn unpack_unverified<T>(
bytes: T,
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_unverified<T>( bytes: T, ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>] skipping some syntatical checks.
§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
pack.