Struct identity_iota::client::ClientBuilder
source · [−]pub struct ClientBuilder { /* private fields */ }
Expand description
A ClientBuilder
is used to generated a customized Client
.
Implementations
sourceimpl ClientBuilder
impl ClientBuilder
sourcepub fn new() -> ClientBuilder
pub fn new() -> ClientBuilder
Creates a new ClientBuilder
.
sourcepub fn network(self, network: Network) -> ClientBuilder
pub fn network(self, network: Network) -> ClientBuilder
Sets the IOTA Tangle network.
sourcepub fn encoding(self, encoding: DIDMessageEncoding) -> ClientBuilder
pub fn encoding(self, encoding: DIDMessageEncoding) -> ClientBuilder
Sets the DID message encoding used when publishing to the Tangle.
sourcepub fn retry_until_included(self, value: bool) -> ClientBuilder
pub fn retry_until_included(self, value: bool) -> ClientBuilder
When publishing to the Tangle, sets whether to retry until the message is confirmed by a milestone. Default: true.
sourcepub fn primary_node(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
pub fn primary_node(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL to be used as primary node.
sourcepub fn primary_pow_node(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
pub fn primary_pow_node(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL to be used as primary PoW node (for remote PoW).
sourcepub fn permanode(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
pub fn permanode(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
Adds a permanode by its URL.
sourcepub fn node_auth(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
pub fn node_auth(
self,
url: &str,
jwt: Option<String>,
basic_auth: Option<(&str, &str)>
) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL.
sourcepub fn nodes(self, urls: &[&str]) -> Result<ClientBuilder, Error>
pub fn nodes(self, urls: &[&str]) -> Result<ClientBuilder, Error>
Adds a list of IOTA nodes by their URLs.
sourcepub fn node_sync_interval(self, value: Duration) -> ClientBuilder
pub fn node_sync_interval(self, value: Duration) -> ClientBuilder
Sets the node sync interval.
sourcepub fn node_sync_disabled(self) -> ClientBuilder
pub fn node_sync_disabled(self) -> ClientBuilder
Disables the node sync process.
sourcepub async fn node_pool_urls(
self,
urls: &[String]
) -> Result<ClientBuilder, Error>
pub async fn node_pool_urls(
self,
urls: &[String]
) -> Result<ClientBuilder, Error>
Get node list from the urls
.
sourcepub fn quorum(self, value: bool) -> ClientBuilder
pub fn quorum(self, value: bool) -> ClientBuilder
Enables/disables quorum.
sourcepub fn quorum_size(self, value: usize) -> ClientBuilder
pub fn quorum_size(self, value: usize) -> ClientBuilder
Sets the number of nodes used for quorum.
sourcepub fn quorum_threshold(self, value: usize) -> ClientBuilder
pub fn quorum_threshold(self, value: usize) -> ClientBuilder
Sets the quorum threshold.
sourcepub fn local_pow(self, value: bool) -> ClientBuilder
pub fn local_pow(self, value: bool) -> ClientBuilder
Sets whether proof-of-work (PoW) is performed locally or remotely.
Default: false.
sourcepub fn fallback_to_local_pow(self, value: bool) -> ClientBuilder
pub fn fallback_to_local_pow(self, value: bool) -> ClientBuilder
Sets whether the PoW should be done locally in case a node doesn’t support remote PoW.
Default: true.
sourcepub fn tips_interval(self, value: u64) -> ClientBuilder
pub fn tips_interval(self, value: u64) -> ClientBuilder
Sets the number of seconds that new tips will be requested during PoW.
sourcepub fn request_timeout(self, value: Duration) -> ClientBuilder
pub fn request_timeout(self, value: Duration) -> ClientBuilder
Sets the default request timeout.
Trait Implementations
sourceimpl Debug for ClientBuilder
impl Debug for ClientBuilder
sourceimpl Default for ClientBuilder
impl Default for ClientBuilder
sourcefn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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