Struct iota_types::base_types::IotaAddress
source · pub struct IotaAddress(/* private fields */);
Implementations§
source§impl IotaAddress
impl IotaAddress
pub const ZERO: Self = _
pub fn new(bytes: [u8; 32]) -> Self
sourcepub fn random_for_testing_only() -> Self
pub fn random_for_testing_only() -> Self
Return a random IotaAddress.
pub fn generate<R: RngCore + CryptoRng>(rng: R) -> Self
sourcepub fn optional_address_as_hex<S>(
key: &Option<IotaAddress>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn optional_address_as_hex<S>(
key: &Option<IotaAddress>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize an Option<IotaAddress>
in Hex.
sourcepub fn optional_address_from_hex<'de, D>(
deserializer: D,
) -> Result<Option<IotaAddress>, D::Error>where
D: Deserializer<'de>,
pub fn optional_address_from_hex<'de, D>(
deserializer: D,
) -> Result<Option<IotaAddress>, D::Error>where
D: Deserializer<'de>,
Deserialize into an Option<IotaAddress>
.
sourcepub fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, IotaError>
pub fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, IotaError>
Parse a IotaAddress from a byte array or buffer.
sourcepub fn try_from_padded(inputs: &ZkLoginInputs) -> IotaResult<Self>
pub fn try_from_padded(inputs: &ZkLoginInputs) -> IotaResult<Self>
This derives a zkLogin address by parsing the iss and address_seed from [struct ZkLoginAuthenticator]. Define as iss_bytes_len || iss_bytes || padded_32_byte_address_seed. This is to be differentiated with try_from_unpadded defined below.
sourcepub fn try_from_unpadded(inputs: &ZkLoginInputs) -> IotaResult<Self>
pub fn try_from_unpadded(inputs: &ZkLoginInputs) -> IotaResult<Self>
Define as iss_bytes_len || iss_bytes || unpadded_32_byte_address_seed.
Trait Implementations§
source§impl Arbitrary for IotaAddress
impl Arbitrary for IotaAddress
§type Parameters = <[u8; 32] as Arbitrary>::Parameters
type Parameters = <[u8; 32] as Arbitrary>::Parameters
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<[u8; 32] as Arbitrary>::Strategy, fn(_: [u8; 32]) -> IotaAddress>
type Strategy = Map<<[u8; 32] as Arbitrary>::Strategy, fn(_: [u8; 32]) -> IotaAddress>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl AsRef<[u8]> for IotaAddress
impl AsRef<[u8]> for IotaAddress
source§impl Clone for IotaAddress
impl Clone for IotaAddress
source§fn clone(&self) -> IotaAddress
fn clone(&self) -> IotaAddress
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for IotaAddress
impl Debug for IotaAddress
source§impl Default for IotaAddress
impl Default for IotaAddress
source§fn default() -> IotaAddress
fn default() -> IotaAddress
source§impl<'de> Deserialize<'de> for IotaAddress
impl<'de> Deserialize<'de> for IotaAddress
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 Display for IotaAddress
impl Display for IotaAddress
source§impl From<&MultiSigPublicKey> for IotaAddress
impl From<&MultiSigPublicKey> for IotaAddress
source§fn from(multisig_pk: &MultiSigPublicKey) -> Self
fn from(multisig_pk: &MultiSigPublicKey) -> Self
Derive a IotaAddress from [struct MultiSigPublicKey]. A MultiSig address
is defined as the 32-byte Blake2b hash of serializing the flag, the
threshold, concatenation of all n flag, public keys and
its weight. flag_MultiSig || threshold || flag_1 || pk_1 || weight_1 || ... || flag_n || pk_n || weight_n
.
When flag_i is ZkLogin, pk_i refers to [struct ZkLoginPublicIdentifier] derived from padded address seed in bytes and iss.
source§impl From<&PublicKey> for IotaAddress
impl From<&PublicKey> for IotaAddress
source§impl<T: IotaPublicKey> From<&T> for IotaAddress
impl<T: IotaPublicKey> From<&T> for IotaAddress
source§impl From<AccountAddress> for IotaAddress
impl From<AccountAddress> for IotaAddress
source§fn from(address: AccountAddress) -> IotaAddress
fn from(address: AccountAddress) -> IotaAddress
source§impl From<Address> for IotaAddress
impl From<Address> for IotaAddress
source§impl From<IotaAddress> for AccountAddress
impl From<IotaAddress> for AccountAddress
source§fn from(address: IotaAddress) -> Self
fn from(address: IotaAddress) -> Self
source§impl From<IotaAddress> for Address
impl From<IotaAddress> for Address
source§fn from(value: IotaAddress) -> Self
fn from(value: IotaAddress) -> Self
source§impl From<IotaAddress> for ObjectID
impl From<IotaAddress> for ObjectID
source§fn from(address: IotaAddress) -> ObjectID
fn from(address: IotaAddress) -> ObjectID
source§impl From<IotaAddress> for ObjectId
impl From<IotaAddress> for ObjectId
source§fn from(value: IotaAddress) -> Self
fn from(value: IotaAddress) -> Self
source§impl From<ObjectID> for IotaAddress
impl From<ObjectID> for IotaAddress
source§fn from(object_id: ObjectID) -> IotaAddress
fn from(object_id: ObjectID) -> IotaAddress
source§impl From<ObjectId> for IotaAddress
impl From<ObjectId> for IotaAddress
source§impl FromStr for IotaAddress
impl FromStr for IotaAddress
source§impl Hash for IotaAddress
impl Hash for IotaAddress
source§impl JsonSchema for IotaAddress
impl JsonSchema for IotaAddress
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl MoveTypeTagTrait for IotaAddress
impl MoveTypeTagTrait for IotaAddress
fn get_type_tag() -> TypeTag
source§impl Ord for IotaAddress
impl Ord for IotaAddress
source§fn cmp(&self, other: &IotaAddress) -> Ordering
fn cmp(&self, other: &IotaAddress) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<IotaAddress> for Owner
impl PartialEq<IotaAddress> for Owner
source§fn eq(&self, other: &IotaAddress) -> bool
fn eq(&self, other: &IotaAddress) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for IotaAddress
impl PartialEq for IotaAddress
source§fn eq(&self, other: &IotaAddress) -> bool
fn eq(&self, other: &IotaAddress) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for IotaAddress
impl PartialOrd for IotaAddress
source§fn partial_cmp(&self, other: &IotaAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &IotaAddress) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for IotaAddress
impl Serialize for IotaAddress
source§impl TryFrom<&[u8]> for IotaAddress
impl TryFrom<&[u8]> for IotaAddress
source§impl TryFrom<&GenericSignature> for IotaAddress
impl TryFrom<&GenericSignature> for IotaAddress
source§fn try_from(sig: &GenericSignature) -> IotaResult<Self>
fn try_from(sig: &GenericSignature) -> IotaResult<Self>
Derive a IotaAddress from a serialized signature in Iota GenericSignature.
source§impl TryFrom<&ZkLoginAuthenticator> for IotaAddress
impl TryFrom<&ZkLoginAuthenticator> for IotaAddress
Iota address for [struct ZkLoginAuthenticator] is defined as the black2b hash of [zklogin_flag || iss_bytes_length || iss_bytes || unpadded_address_seed_in_bytes].
source§fn try_from(authenticator: &ZkLoginAuthenticator) -> IotaResult<Self>
fn try_from(authenticator: &ZkLoginAuthenticator) -> IotaResult<Self>
impl Copy for IotaAddress
impl Eq for IotaAddress
impl StructuralPartialEq for IotaAddress
Auto Trait Implementations§
impl Freeze for IotaAddress
impl RefUnwindSafe for IotaAddress
impl Send for IotaAddress
impl Sync for IotaAddress
impl Unpin for IotaAddress
impl UnwindSafe for IotaAddress
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more§impl<A, T> AsBits<T> for A
impl<A, T> AsBits<T> for A
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> Base32Len for T
impl<T> Base32Len for T
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> ConvertTo<T> for Twhere
T: Send,
impl<T> ConvertTo<T> for Twhere
T: Send,
fn convert(self) -> Result<T, Error>
fn convert_unchecked(self) -> T
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.§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<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<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a Request
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>
T
in a tonic::Request
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§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
§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
§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.§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.§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.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 more§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.§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.§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.§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.§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.§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.§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.§impl<T> ToBase32 for T
impl<T> ToBase32 for T
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Upper case
letters are used (e.g. F9B4CA
)§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.