Struct identity_iota::prelude::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Client for performing IOTA Identity operations on the Tangle.
Implementations
sourceimpl Client
impl Client
sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a ClientBuilder
to configure a new Client
.
This is the same as ClientBuilder::new
.
sourcepub async fn from_builder(builder: ClientBuilder) -> Result<Client, Error>
pub async fn from_builder(builder: ClientBuilder) -> Result<Client, Error>
Creates a new Client
based on the ClientBuilder
configuration.
sourcepub async fn publish_document(
&self,
document: &IotaDocument
) -> Result<Receipt, Error>
pub async fn publish_document(
&self,
document: &IotaDocument
) -> Result<Receipt, Error>
Publishes an IotaDocument
to the Tangle.
If retry_until_included
is true, this method calls publish_json_with_retry
with its default interval
and max_attempts
values to increase the probability that the message will be referenced by a milestone.
sourcepub async fn publish_diff(
&self,
message_id: &MessageId,
diff: &DiffMessage
) -> Result<Receipt, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
pub async fn publish_diff(
&self,
message_id: &MessageId,
diff: &DiffMessage
) -> Result<Receipt, Error>
diff chain features are slated for removal
Publishes a DiffMessage
to the Tangle to form part of the diff chain for the integration.
chain message specified by the given MessageId
.
This method calls publish_json_with_retry
with its default interval
and max_attempts
values for increasing the probability that the message will be referenced by a milestone.
sourcepub async fn publish_json<T>(
&self,
index: &str,
data: &T
) -> Result<Receipt, Error> where
T: ToJson,
pub async fn publish_json<T>(
&self,
index: &str,
data: &T
) -> Result<Receipt, Error> where
T: ToJson,
Compresses and publishes arbitrary JSON data to the specified index on the Tangle.
sourcepub async fn publish_json_with_retry<T>(
&self,
index: &str,
data: &T,
interval: Option<u64>,
max_attempts: Option<u64>
) -> Result<Receipt, Error> where
T: ToJson,
pub async fn publish_json_with_retry<T>(
&self,
index: &str,
data: &T,
interval: Option<u64>,
max_attempts: Option<u64>
) -> Result<Receipt, Error> where
T: ToJson,
Publishes arbitrary JSON data to the specified index on the Tangle. Retries (promotes or reattaches) the message until it’s included (referenced by a milestone). Default interval is 5 seconds and max attempts is 40.
sourcepub async fn read_document(
&self,
did: &IotaDID
) -> Result<ResolvedIotaDocument, Error>
pub async fn read_document(
&self,
did: &IotaDID
) -> Result<ResolvedIotaDocument, Error>
Fetch the IotaDocument
specified by the given IotaDID
.
sourcepub async fn read_document_chain(
&self,
did: &IotaDID
) -> Result<DocumentChain, Error>
pub async fn read_document_chain(
&self,
did: &IotaDID
) -> Result<DocumentChain, Error>
Fetches a DocumentChain
given an IotaDID
.
sourcepub async fn resolve_history(
&self,
did: &IotaDID
) -> Result<DocumentHistory, Error>
pub async fn resolve_history(
&self,
did: &IotaDID
) -> Result<DocumentHistory, Error>
Returns the DocumentHistory
of the given IotaDID
.
sourcepub async fn resolve_diff_history(
&self,
document: &ResolvedIotaDocument
) -> Result<ChainHistory<DiffMessage>, Error>
👎 Deprecated since 0.5.0: diff chain features are slated for removal
pub async fn resolve_diff_history(
&self,
document: &ResolvedIotaDocument
) -> Result<ChainHistory<DiffMessage>, Error>
diff chain features are slated for removal
Returns the ChainHistory
of a diff chain starting from an IotaDocument
on the
integration chain.
NOTE: the document must have been published to the Tangle and have a valid message id.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more