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 is_alias(&self) -> bool
pub fn is_alias(&self) -> bool
Checks whether the address is an AliasAddress.
Sourcepub fn is_nft(&self) -> bool
pub fn is_nft(&self) -> bool
Checks whether the address is an NftAddress.
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Address> for AddressDto
impl From<&Address> for AddressDto
Source§impl From<Address> for AddressUnlockCondition
impl From<Address> for AddressUnlockCondition
Source§fn from(original: Address) -> AddressUnlockCondition
fn from(original: Address) -> AddressUnlockCondition
Converts to this type from the input type.
Source§impl From<Address> for GovernorAddressUnlockCondition
impl From<Address> for GovernorAddressUnlockCondition
Source§fn from(original: Address) -> GovernorAddressUnlockCondition
fn from(original: Address) -> GovernorAddressUnlockCondition
Converts to this type from the input type.
Source§impl From<Address> for ImmutableAliasAddressUnlockCondition
impl From<Address> for ImmutableAliasAddressUnlockCondition
Source§fn from(original: Address) -> ImmutableAliasAddressUnlockCondition
fn from(original: Address) -> ImmutableAliasAddressUnlockCondition
Converts to this type from the input type.
Source§impl From<Address> for IssuerFeature
impl From<Address> for IssuerFeature
Source§fn from(original: Address) -> IssuerFeature
fn from(original: Address) -> IssuerFeature
Converts to this type from the input type.
Source§impl From<Address> for SenderFeature
impl From<Address> for SenderFeature
Source§fn from(original: Address) -> SenderFeature
fn from(original: Address) -> SenderFeature
Converts to this type from the input type.
Source§impl From<Address> for StateControllerAddressUnlockCondition
impl From<Address> for StateControllerAddressUnlockCondition
Source§fn from(original: Address) -> StateControllerAddressUnlockCondition
fn from(original: Address) -> StateControllerAddressUnlockCondition
Converts to this type from the input type.
Source§impl From<AliasAddress> for Address
impl From<AliasAddress> for Address
Source§fn from(original: AliasAddress) -> Address
fn from(original: AliasAddress) -> Address
Converts to this type from the input type.
Source§impl From<Ed25519Address> for Address
impl From<Ed25519Address> for Address
Source§fn from(original: Ed25519Address) -> Address
fn from(original: Ed25519Address) -> Address
Converts to this type from the input type.
Source§impl From<NftAddress> for Address
impl From<NftAddress> for Address
Source§fn from(original: NftAddress) -> Address
fn from(original: NftAddress) -> Address
Converts to this type from the input type.
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
The error type that can be returned if some semantic error occurs while unpacking. Read more
Source§type UnpackVisitor = <Ed25519Address as Packable>::UnpackVisitor
type UnpackVisitor = <Ed25519Address as Packable>::UnpackVisitor
FIXME: docs
Source§fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
fn pack<P: Packer>(&self, packer: &mut P) -> Result<(), P::Error>
Packs this value into the given
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>>
Unpacks this value from the given
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
impl TryFrom<&AddressDto> 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
Mutably borrows from an owned value. Read more
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§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
Returns the length in bytes of the value after being packed. The returned value always matches the number of
bytes written using
pack.