Struct safe_network::client::Config [−][src]
pub struct Config {
pub local_addr: SocketAddr,
pub bootstrap_nodes: Vec<SocketAddr>,
pub qp2p: QuicP2pConfig,
pub query_timeout: Duration,
}
Expand description
Configuration for sn_client.
Fields
local_addr: SocketAddr
The local address to bind to.
bootstrap_nodes: Vec<SocketAddr>
Initial network contacts.
qp2p: QuicP2pConfig
QuicP2p options.
query_timeout: Duration
The amount of time to wait for responses to queries before giving up and returning an error.
Implementations
Returns a new Config
instance.
This will try to read QuicP2P configuration from config_file_path
, or else use the default
QuicP2P config. In either case, bootstrap_nodes
will be used to override the initial
network contacts.
If local_addr
is not specified, 127.0.0.1:0
will be used (e.g. localhost with a random
port).
If query_timeout
is not specified, DEFAULT_QUERY_TIMEOUT
will be used.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more