pub struct OnChainIdentity { /* private fields */ }Expand description
An on-chain entity that wraps an optional DID Document.
Implementations§
Source§impl OnChainIdentity
impl OnChainIdentity
Sourcepub fn id(&self) -> ObjectID
pub fn id(&self) -> ObjectID
Returns the [ObjectID] of this OnChainIdentity.
Sourcepub fn did_document(&self) -> &IotaDocument
pub fn did_document(&self) -> &IotaDocument
Returns the IotaDocument contained in this OnChainIdentity.
Sourcepub fn has_deleted_did(&self) -> bool
pub fn has_deleted_did(&self) -> bool
Returns whether the IotaDocument contained in this OnChainIdentity has been deleted. Once a DID Document is deleted, it cannot be reactivated.
When calling OnChainIdentity::did_document on an Identity whose DID Document had been deleted, an empty and deactivated IotaDocument will be returned.
Returns true if this OnChainIdentity is shared between multiple controllers.
Sourcepub fn proposals(&self) -> &HashSet<ObjectID>
pub fn proposals(&self) -> &HashSet<ObjectID>
Returns this OnChainIdentity’s list of active proposals.
Sourcepub fn controllers(&self) -> &HashMap<ObjectID, u64>
pub fn controllers(&self) -> &HashMap<ObjectID, u64>
Returns this OnChainIdentity’s controllers as the map: controller_id -> controller_voting_power.
Sourcepub fn threshold(&self) -> u64
pub fn threshold(&self) -> u64
Returns the threshold required by this OnChainIdentity for executing a proposal.
Sourcepub fn controller_voting_power(&self, controller_id: ObjectID) -> Option<u64>
pub fn controller_voting_power(&self, controller_id: ObjectID) -> Option<u64>
Returns the voting power of controller with ID controller_id, if any.
Sourcepub async fn get_controller_token_for_address(
&self,
address: IotaAddress,
client: &(impl CoreClientReadOnly + OptionalSync),
) -> Result<Option<ControllerToken>, Error>
pub async fn get_controller_token_for_address( &self, address: IotaAddress, client: &(impl CoreClientReadOnly + OptionalSync), ) -> Result<Option<ControllerToken>, Error>
Returns a ControllerToken owned by address that grants access to this Identity.
§Notes
None is returned if address doesn’t own a valid ControllerToken.
Sourcepub async fn get_controller_token<S>(
&self,
client: &(impl CoreClient<S> + OptionalSync),
) -> Result<Option<ControllerToken>, Error>where
S: Signer<IotaKeySignature> + OptionalSync,
pub async fn get_controller_token<S>(
&self,
client: &(impl CoreClient<S> + OptionalSync),
) -> Result<Option<ControllerToken>, Error>where
S: Signer<IotaKeySignature> + OptionalSync,
Returns a ControllerToken, owned by client’s sender address, that grants access to this Identity.
§Notes
None is returned if client’s sender address doesn’t own a valid ControllerToken.
Sourcepub fn update_did_document<'i, 'c>(
&'i mut self,
updated_doc: IotaDocument,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, UpdateDidDocument>
pub fn update_did_document<'i, 'c>( &'i mut self, updated_doc: IotaDocument, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, UpdateDidDocument>
Updates this OnChainIdentity’s DID Document.
Sourcepub fn update_config<'i, 'c>(
&'i mut self,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, ConfigChange>
pub fn update_config<'i, 'c>( &'i mut self, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, ConfigChange>
Updates this OnChainIdentity’s configuration.
Sourcepub fn deactivate_did<'i, 'c>(
&'i mut self,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, UpdateDidDocument>
pub fn deactivate_did<'i, 'c>( &'i mut self, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, UpdateDidDocument>
Deactivates the DID Document represented by this OnChainIdentity.
Sourcepub fn delete_did<'i, 'c>(
&'i mut self,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, UpdateDidDocument>
pub fn delete_did<'i, 'c>( &'i mut self, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, UpdateDidDocument>
Deletes the DID Document contained in this OnChainIdentity.
Sourcepub fn upgrade_version<'i, 'c>(
&'i mut self,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, Upgrade>
pub fn upgrade_version<'i, 'c>( &'i mut self, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, Upgrade>
Upgrades this OnChainIdentity’s version to match the package’s.
Sourcepub fn send_assets<'i, 'c>(
&'i mut self,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, SendAction>
pub fn send_assets<'i, 'c>( &'i mut self, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, SendAction>
Sends assets owned by this OnChainIdentity to other addresses.
Sourcepub fn borrow_assets<'i, 'c>(
&'i mut self,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, BorrowAction>
pub fn borrow_assets<'i, 'c>( &'i mut self, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, BorrowAction>
Borrows assets owned by this OnChainIdentity to use them in a custom transaction.
Sourcepub fn controller_execution<'i, 'c>(
&'i mut self,
controller_cap: ObjectID,
controller_token: &'c ControllerToken,
) -> ProposalBuilder<'i, 'c, ControllerExecution>
👎Deprecated: use OnChainIdentity::access_sub_identity instead.
pub fn controller_execution<'i, 'c>( &'i mut self, controller_cap: ObjectID, controller_token: &'c ControllerToken, ) -> ProposalBuilder<'i, 'c, ControllerExecution>
OnChainIdentity::access_sub_identity instead.Borrows a ControllerCap with ID controller_cap owned by this identity in a transaction.
This proposal is used to perform operation on a sub-identity controlled
by this one.
Sourcepub fn access_sub_identity<'i, 'sub>(
&'i mut self,
sub_identity: &'sub mut OnChainIdentity,
controller_token: &ControllerToken,
) -> AccessSubIdentityBuilder<'i, 'sub>
pub fn access_sub_identity<'i, 'sub>( &'i mut self, sub_identity: &'sub mut OnChainIdentity, controller_token: &ControllerToken, ) -> AccessSubIdentityBuilder<'i, 'sub>
Perform an action on an Identity that is controlled by this Identity.
Sourcepub async fn get_history(
&self,
client: &IdentityClientReadOnly,
last_version: Option<&IotaObjectData>,
page_size: Option<usize>,
) -> Result<Vec<IotaObjectData>, Error>
pub async fn get_history( &self, client: &IdentityClientReadOnly, last_version: Option<&IotaObjectData>, page_size: Option<usize>, ) -> Result<Vec<IotaObjectData>, Error>
Returns historical data for this OnChainIdentity.
Sourcepub fn revoke_delegation_token(
&self,
controller_capability: &ControllerCap,
delegation_token: &DelegationToken,
) -> Result<TransactionBuilder<DelegationTokenRevocation>, Error>
pub fn revoke_delegation_token( &self, controller_capability: &ControllerCap, delegation_token: &DelegationToken, ) -> Result<TransactionBuilder<DelegationTokenRevocation>, Error>
Returns a [Transaction] to revoke a DelegationToken.
Sourcepub fn unrevoke_delegation_token(
&self,
controller_capability: &ControllerCap,
delegation_token: &DelegationToken,
) -> Result<TransactionBuilder<DelegationTokenRevocation>, Error>
pub fn unrevoke_delegation_token( &self, controller_capability: &ControllerCap, delegation_token: &DelegationToken, ) -> Result<TransactionBuilder<DelegationTokenRevocation>, Error>
Returns a [Transaction] to unrevoke a DelegationToken.
Sourcepub fn delete_delegation_token(
&self,
delegation_token: DelegationToken,
) -> Result<TransactionBuilder<DeleteDelegationToken>, Error>
pub fn delete_delegation_token( &self, delegation_token: DelegationToken, ) -> Result<TransactionBuilder<DeleteDelegationToken>, Error>
Returns a [Transaction] to delete a DelegationToken.
Trait Implementations§
Source§impl Clone for OnChainIdentity
impl Clone for OnChainIdentity
Source§fn clone(&self) -> OnChainIdentity
fn clone(&self) -> OnChainIdentity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OnChainIdentity
impl Debug for OnChainIdentity
Source§impl From<OnChainIdentity> for IotaDocument
impl From<OnChainIdentity> for IotaDocument
Source§fn from(identity: OnChainIdentity) -> IotaDocument
fn from(identity: OnChainIdentity) -> IotaDocument
Source§impl MoveType for OnChainIdentity
impl MoveType for OnChainIdentity
Source§impl Serialize for OnChainIdentity
impl Serialize for OnChainIdentity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for OnChainIdentity
impl RefUnwindSafe for OnChainIdentity
impl Send for OnChainIdentity
impl Sync for OnChainIdentity
impl Unpin for OnChainIdentity
impl UnwindSafe for OnChainIdentity
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, 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,
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<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
§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§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 tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§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> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§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.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.