Struct iota_wallet::ClientOptions
[−]pub struct ClientOptions {
pub node_manager_builder: NodeManagerBuilder,
pub network_info: NetworkInfo,
pub api_timeout: Duration,
pub remote_pow_timeout: Duration,
pub offline: bool,
pub pow_worker_count: Option<usize>,
}
Expand description
The ClientOptions to build the iota_client for interactions with the IOTA Tangle. Builder to construct client instance with sensible default values
Fields
node_manager_builder: NodeManagerBuilder
Node manager builder
network_info: NetworkInfo
Data related to the used network
api_timeout: Duration
Timeout for API requests
remote_pow_timeout: Duration
Timeout when sending a block that requires remote proof of work
offline: bool
If the Client should be able to use without a node connection
pow_worker_count: Option<usize>
The amount of threads to be used for proof of work
Implementations
impl ClientBuilder
impl ClientBuilder
The ClientOptions to build the iota_client for interactions with the IOTA Tangle.
pub fn new() -> ClientBuilder
pub fn new() -> ClientBuilder
Creates an IOTA client builder.
pub fn from_json(self, client_config: &str) -> Result<ClientBuilder, Error>
pub fn from_json(self, client_config: &str) -> Result<ClientBuilder, Error>
Set the fields from a client JSON config
pub fn with_node(self, url: &str) -> Result<ClientBuilder, Error>
pub fn with_node(self, url: &str) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL.
pub fn with_primary_node(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
pub fn with_primary_node(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL to be used as primary node, with optional jwt and or basic authentication
pub fn with_primary_pow_node(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
pub fn with_primary_pow_node(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL to be used as primary PoW node (for remote Pow), with optional jwt and or basic authentication
pub fn with_permanode(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
pub fn with_permanode(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
Adds a permanode by its URL, with optional jwt and or basic authentication
pub fn with_node_auth(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
pub fn with_node_auth(
self,
url: &str,
auth: Option<NodeAuth>
) -> Result<ClientBuilder, Error>
Adds an IOTA node by its URL with optional jwt and or basic authentication
pub fn with_nodes(self, urls: &[&str]) -> Result<ClientBuilder, Error>
pub fn with_nodes(self, urls: &[&str]) -> Result<ClientBuilder, Error>
Adds a list of IOTA nodes by their URLs.
pub fn with_node_sync_interval(
self,
node_sync_interval: Duration
) -> ClientBuilder
pub fn with_node_sync_interval(
self,
node_sync_interval: Duration
) -> ClientBuilder
Set the node sync interval
pub fn with_node_sync_disabled(self) -> ClientBuilder
pub fn with_node_sync_disabled(self) -> ClientBuilder
Disables the node syncing process. Every node will be considered healthy and ready to use.
pub fn with_offline_mode(self) -> ClientBuilder
pub fn with_offline_mode(self) -> ClientBuilder
Allows creating the client without nodes for offline address generation or signing
pub fn with_quorum(self, quorum: bool) -> ClientBuilder
pub fn with_quorum(self, quorum: bool) -> ClientBuilder
Set if quorum should be used or not
pub fn with_min_quorum_size(self, min_quorum_size: usize) -> ClientBuilder
pub fn with_min_quorum_size(self, min_quorum_size: usize) -> ClientBuilder
Set amount of nodes which should be used for quorum
pub fn with_quorum_threshold(self, threshold: usize) -> ClientBuilder
pub fn with_quorum_threshold(self, threshold: usize) -> ClientBuilder
Set quorum_threshold
pub fn with_network(self, network: &str) -> ClientBuilder
pub fn with_network(self, network: &str) -> ClientBuilder
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 node info 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.
pub fn with_local_pow(self, local: bool) -> ClientBuilder
pub fn with_local_pow(self, local: bool) -> ClientBuilder
Sets whether the PoW should be done locally or remotely.
pub fn with_pow_worker_count(self, worker_count: usize) -> ClientBuilder
pub fn with_pow_worker_count(self, worker_count: usize) -> ClientBuilder
Sets the amount of workers that should be used for PoW, default is num_cpus::get().
pub fn with_fallback_to_local_pow(
self,
fallback_to_local_pow: bool
) -> ClientBuilder
pub fn with_fallback_to_local_pow(
self,
fallback_to_local_pow: bool
) -> ClientBuilder
Sets whether the PoW should be done locally in case a node doesn’t support remote PoW.
pub fn with_tips_interval(self, tips_interval: u64) -> ClientBuilder
pub fn with_tips_interval(self, tips_interval: u64) -> ClientBuilder
Sets after how many seconds new tips will be requested during PoW
pub fn with_api_timeout(self, timeout: Duration) -> ClientBuilder
pub fn with_api_timeout(self, timeout: Duration) -> ClientBuilder
Sets the default request timeout.
pub fn with_remote_pow_timeout(self, timeout: Duration) -> ClientBuilder
pub fn with_remote_pow_timeout(self, timeout: Duration) -> ClientBuilder
Sets the request timeout for API usage.
Trait Implementations
impl Clone for ClientBuilder
impl Clone for ClientBuilder
fn 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
impl Debug for ClientBuilder
impl Debug for ClientBuilder
impl Default for ClientBuilder
impl Default for ClientBuilder
fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
impl<'de> Deserialize<'de> for ClientBuilder
impl<'de> Deserialize<'de> for ClientBuilder
fn deserialize<__D>(
__deserializer: __D
) -> Result<ClientBuilder, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ClientBuilder, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl PartialEq<ClientBuilder> for ClientBuilder
impl PartialEq<ClientBuilder> for ClientBuilder
fn eq(&self, other: &ClientBuilder) -> bool
fn eq(&self, other: &ClientBuilder) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ClientBuilder) -> bool
fn ne(&self, other: &ClientBuilder) -> bool
This method tests for !=
.
impl Serialize for ClientBuilder
impl Serialize for ClientBuilder
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,
Serialize this value into the given Serde serializer. Read more
impl Eq for ClientBuilder
impl StructuralEq for ClientBuilder
impl StructuralPartialEq for ClientBuilder
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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