Struct iota_client::builder::ClientBuilder
source · [−]pub struct ClientBuilder { /* private fields */ }Expand description
Builder to construct client instance with sensible default values
Implementations
sourceimpl ClientBuilder
impl ClientBuilder
sourcepub fn with_primary_node(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_primary_node(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
Adds an IOTA node by its URL to be used as primary node, with optional jwt and or basic authentication
sourcepub fn with_primary_pow_node(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_primary_pow_node(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
Adds an IOTA node by its URL to be used as primary PoW node (for remote PoW), with optional jwt and or basic authentication
sourcepub fn with_permanode(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_permanode(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
Adds a permanode by its URL, with optional jwt and or basic authentication
sourcepub fn with_node_auth(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_node_auth(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
Adds an IOTA node by its URL with optional jwt and or basic authentication
sourcepub fn with_nodes(self, urls: &[&str]) -> Result<Self>
pub fn with_nodes(self, urls: &[&str]) -> Result<Self>
Adds a list of IOTA nodes by their URLs.
sourcepub fn with_node_sync_interval(self, node_sync_interval: Duration) -> Self
pub fn with_node_sync_interval(self, node_sync_interval: Duration) -> Self
Set the node sync interval
sourcepub fn with_node_sync_disabled(self) -> Self
pub fn with_node_sync_disabled(self) -> Self
Disables the node syncing process. Every node will be considered healthy and ready to use.
sourcepub fn with_offline_mode(self) -> Self
pub fn with_offline_mode(self) -> Self
Allows creating the client without nodes for offline address generation or signing
sourcepub async fn with_node_pool_urls(self, node_pool_urls: &[String]) -> Result<Self>
pub async fn with_node_pool_urls(self, node_pool_urls: &[String]) -> Result<Self>
Get node list from the node_pool_urls
sourcepub fn with_quorum(self, quorum: bool) -> Self
pub fn with_quorum(self, quorum: bool) -> Self
Set if quroum should be used or not
sourcepub fn with_quorum_size(self, quorum_size: usize) -> Self
pub fn with_quorum_size(self, quorum_size: usize) -> Self
Set amount of nodes which should be used for quorum
sourcepub fn with_quorum_threshold(self, threshold: usize) -> Self
pub fn with_quorum_threshold(self, threshold: usize) -> Self
Set quorum_threshold
sourcepub fn with_network(self, network: &str) -> Self
pub fn with_network(self, network: &str) -> Self
Selects the type of network to get default nodes for it, only “testnet” is supported at the moment.
Nodes that don’t belong to this network are ignored. The &str must match a part or all of the networkId returned
in the nodeinfo from a node. For example, if the networkId is "private-tangle", "tangle" can be used.
Default nodes are only used when no other nodes are provided.
sourcepub fn with_local_pow(self, local: bool) -> Self
pub fn with_local_pow(self, local: bool) -> Self
Sets whether the PoW should be done locally or remotely.
sourcepub fn with_fallback_to_local_pow(self, fallback_to_local_pow: bool) -> Self
pub fn with_fallback_to_local_pow(self, fallback_to_local_pow: bool) -> Self
Sets whether the PoW should be done locally in case a node doesn’t support remote PoW.
sourcepub fn with_tips_interval(self, tips_interval: u64) -> Self
pub fn with_tips_interval(self, tips_interval: u64) -> Self
Sets after how many seconds new tips will be requested during PoW
sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Sets the default request timeout.
sourcepub fn with_api_timeout(self, api: Api, timeout: Duration) -> Self
pub fn with_api_timeout(self, api: Api, timeout: Duration) -> Self
Sets the request timeout for a specific API usage.
Trait Implementations
sourceimpl Clone for ClientBuilder
impl Clone for ClientBuilder
sourcefn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. 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>
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