pub struct AccountBuilder<C = Arc<Client>> where
    C: SharedPtr<Client>, 
{ /* private fields */ }
Available on crate feature account only.
Expand description

An Account builder for easy account configuration.

To reduce memory usage, accounts created from the same builder share the same Storage used to store identities, and the same Client used to publish identities to the Tangle.

The configuration on the other hand is cloned, and therefore unique for each built account. This means a builder can be reconfigured in-between account creations, without affecting the configuration of previously built accounts.

Implementations

Creates a new AccountBuilder.

Sets the account auto-save behaviour.

Sets the account auto-publish behaviour.

Sets the account storage adapter.

Sets the account storage adapter from a shared pointer.

Sets the IOTA Tangle Client, this determines the Network used by the identity. Accounts created by the same AccountBuilder will share the same Client.

NOTE: this overwrites any ClientBuilder previously set by AccountBuilder::client_builder.

Sets the IOTA Tangle Client, this determines the Network used by the identity. Accounts created by the same AccountBuilder will share the same Client.

NOTE: this overwrites any Client previously set by AccountBuilder::client.

Creates a new identity based on the builder configuration and returns an Account instance to manage it.

The identity is stored locally in the Storage. The DID network is automatically determined by the Client used to publish it.

See IdentitySetup to customize the identity creation.

Loads an existing identity with the specified did using the current builder configuration. The identity must exist in the configured Storage.

Warning

Callers are expected not to load the same IotaDID into more than one account, as that would cause race conditions when updating the identity.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more