pub enum Address {
Ed25519(Ed25519Address),
Alias(AliasAddress),
Nft(NftAddress),
}block only.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<T: AsRef<str>>(
address: T,
) -> Result<(String, Self), Error>
pub fn try_from_bech32<T: AsRef<str>>( address: T, ) -> Result<(String, Self), Error>
Tries to create an Address from a bech32 encoded string.
Sourcepub fn to_bech32<T: AsRef<str>>(&self, hrp: T) -> String
pub fn to_bech32<T: AsRef<str>>(&self, hrp: T) -> String
Encodes this address to a bech32 string with the given Human Readable Part as prefix.
Sourcepub fn unlock(
&self,
unlock: &Unlock,
inputs: &[(OutputId, &Output)],
context: &mut ValidationContext<'_>,
) -> Result<(), ConflictReason>
pub fn unlock( &self, unlock: &Unlock, inputs: &[(OutputId, &Output)], context: &mut ValidationContext<'_>, ) -> Result<(), ConflictReason>
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>,
Source§impl From<&Address> for AddressDto
Available on crate feature dto only.
impl From<&Address> for AddressDto
dto only.Source§impl From<Address> for AddressUnlockCondition
impl From<Address> for AddressUnlockCondition
Source§fn from(original: Address) -> AddressUnlockCondition
fn from(original: Address) -> AddressUnlockCondition
Source§impl From<Address> for GovernorAddressUnlockCondition
impl From<Address> for GovernorAddressUnlockCondition
Source§fn from(original: Address) -> GovernorAddressUnlockCondition
fn from(original: Address) -> GovernorAddressUnlockCondition
Source§impl From<Address> for ImmutableAliasAddressUnlockCondition
impl From<Address> for ImmutableAliasAddressUnlockCondition
Source§fn from(original: Address) -> ImmutableAliasAddressUnlockCondition
fn from(original: Address) -> ImmutableAliasAddressUnlockCondition
Source§impl From<Address> for IssuerFeature
impl From<Address> for IssuerFeature
Source§fn from(original: Address) -> IssuerFeature
fn from(original: Address) -> IssuerFeature
Source§impl From<Address> for SenderFeature
impl From<Address> for SenderFeature
Source§fn from(original: Address) -> SenderFeature
fn from(original: Address) -> SenderFeature
Source§impl From<Address> for StateControllerAddressUnlockCondition
impl From<Address> for StateControllerAddressUnlockCondition
Source§fn from(original: Address) -> StateControllerAddressUnlockCondition
fn from(original: Address) -> StateControllerAddressUnlockCondition
Source§impl From<AliasAddress> for Address
impl From<AliasAddress> for Address
Source§fn from(original: AliasAddress) -> Address
fn from(original: AliasAddress) -> Address
Source§impl From<Ed25519Address> for Address
impl From<Ed25519Address> for Address
Source§fn from(original: Ed25519Address) -> Address
fn from(original: Ed25519Address) -> Address
Source§impl From<NftAddress> for Address
impl From<NftAddress> for Address
Source§fn from(original: NftAddress) -> Address
fn from(original: NftAddress) -> Address
Source§impl Ord for Address
impl Ord for Address
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
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§fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
Packer.Source§fn unpack<U: Unpacker, const VERIFY: bool>(
unpacker: &mut U,
visitor: &Self::UnpackVisitor,
) -> Result<Self, UnpackError<Self::UnpackError, U::Error>>
fn unpack<U: Unpacker, const VERIFY: bool>( unpacker: &mut U, visitor: &Self::UnpackVisitor, ) -> Result<Self, UnpackError<Self::UnpackError, U::Error>>
Unpacker. The VERIFY generic parameter can be used to skip additional
syntactic checks.Source§impl PartialOrd for Address
impl PartialOrd for Address
Source§impl TryFrom<&AddressDto> for Address
Available on crate feature dto only.
impl TryFrom<&AddressDto> for Address
dto only.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 UnsafeUnpin 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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
Source§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]>].
Source§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.
Source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
pack.