Struct identity_iota::iota::block::address::Bech32Address
source · pub struct Bech32Address { /* private fields */ }
Expand description
An address and its network type.
Implementations§
source§impl Bech32Address
impl Bech32Address
sourcepub fn new(hrp: Hrp, inner: impl Into<Address>) -> Bech32Address
pub fn new(hrp: Hrp, inner: impl Into<Address>) -> Bech32Address
Creates a new address wrapper.
sourcepub fn try_new(
hrp: impl ConvertTo<Hrp>,
inner: impl Into<Address>,
) -> Result<Bech32Address, Error>
pub fn try_new( hrp: impl ConvertTo<Hrp>, inner: impl Into<Address>, ) -> Result<Bech32Address, Error>
Creates a new address wrapper by parsing a string HRP.
sourcepub fn into_inner(self) -> Address
pub fn into_inner(self) -> Address
Discard the hrp and get the address.
sourcepub fn try_from_str(address: impl AsRef<str>) -> Result<Bech32Address, Error>
pub fn try_from_str(address: impl AsRef<str>) -> Result<Bech32Address, Error>
Parses a bech32 address string.
Methods from Deref<Target = 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 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 AsRef<Address> for Bech32Address
impl AsRef<Address> for Bech32Address
source§impl Clone for Bech32Address
impl Clone for Bech32Address
source§fn clone(&self) -> Bech32Address
fn clone(&self) -> Bech32Address
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Bech32Address
impl Debug for Bech32Address
source§impl Deref for Bech32Address
impl Deref for Bech32Address
source§impl<'de> Deserialize<'de> for Bech32Address
impl<'de> Deserialize<'de> for Bech32Address
source§fn deserialize<D>(
deserializer: D,
) -> Result<Bech32Address, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Bech32Address, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl Display for Bech32Address
impl Display for Bech32Address
source§impl FromStr for Bech32Address
impl FromStr for Bech32Address
source§impl Hash for Bech32Address
impl Hash for Bech32Address
source§impl Ord for Bech32Address
impl Ord for Bech32Address
source§fn cmp(&self, other: &Bech32Address) -> Ordering
fn cmp(&self, other: &Bech32Address) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<&str> for Bech32Address
impl PartialEq<&str> for Bech32Address
source§impl PartialEq<String> for Bech32Address
impl PartialEq<String> for Bech32Address
source§impl PartialEq<str> for Bech32Address
impl PartialEq<str> for Bech32Address
source§impl PartialEq for Bech32Address
impl PartialEq for Bech32Address
source§impl PartialOrd for Bech32Address
impl PartialOrd for Bech32Address
source§impl Serialize for Bech32Address
impl Serialize for Bech32Address
source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Copy for Bech32Address
impl Eq for Bech32Address
impl StructuralPartialEq for Bech32Address
Auto Trait Implementations§
impl Freeze for Bech32Address
impl RefUnwindSafe for Bech32Address
impl Send for Bech32Address
impl Sync for Bech32Address
impl Unpin for Bech32Address
impl UnwindSafe for Bech32Address
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<T> ConvertTo<Bech32Address> for T
impl<T> ConvertTo<Bech32Address> for T
fn convert(self) -> Result<Bech32Address, Error>
fn convert_unchecked(self) -> T
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
key
and return true
if they are equal.source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
source§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Self
from a string of JSON text.source§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Self
from bytes of JSON text.source§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Self
from a serde_json::Value
.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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.source§impl<T> ToBech32Ext for T
impl<T> ToBech32Ext for T
source§fn try_to_bech32(self, hrp: impl ConvertTo<Hrp>) -> Result<Bech32Address, Error>
fn try_to_bech32(self, hrp: impl ConvertTo<Hrp>) -> Result<Bech32Address, Error>
Try to encode this address to a bech32 string with the given Human Readable Part as prefix.
source§fn to_bech32(self, hrp: Hrp) -> Bech32Address
fn to_bech32(self, hrp: Hrp) -> Bech32Address
Encodes this address to a bech32 string with the given Human Readable Part as prefix.
source§fn to_bech32_unchecked(self, hrp: impl ConvertTo<Hrp>) -> Bech32Address
fn to_bech32_unchecked(self, hrp: impl ConvertTo<Hrp>) -> Bech32Address
Encodes this address to a bech32 string with the given Human Readable Part as prefix without checking validity.
source§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
source§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
self
as a serde_json::Value
.