pub struct NetworkConfiguration {
Show 17 fields pub config_path: Option<String>, pub net_config_path: Option<String>, pub listen_address: Option<String>, pub public_address: Option<String>, pub udp_port: Option<u16>, pub nat_enabled: bool, pub discovery_enabled: bool, pub boot_nodes: Vec<String>, pub use_secret: Option<Secret>, pub max_peers: u32, pub min_peers: u32, pub max_pending_peers: u32, pub snapshot_peers: u32, pub reserved_nodes: Vec<String>, pub allow_non_reserved: bool, pub ip_filter: IpFilter, pub client_version: String,
}
Expand description

Network service configuration

Fields

config_path: Option<String>

Directory path to store general network configuration. None means nothing will be saved

net_config_path: Option<String>

Directory path to store network-specific configuration. None means nothing will be saved

listen_address: Option<String>

IP address to listen for incoming connections. Listen to all connections by default

public_address: Option<String>

IP address to advertise. Detected automatically if none.

udp_port: Option<u16>

Port for UDP connections, same as TCP by default

nat_enabled: bool

Enable NAT configuration

discovery_enabled: bool

Enable discovery

boot_nodes: Vec<String>

List of initial node addresses

use_secret: Option<Secret>

Use provided node key instead of default

max_peers: u32

Max number of connected peers to maintain

min_peers: u32

Min number of connected peers to maintain

max_pending_peers: u32

Max pending peers.

snapshot_peers: u32

Reserved snapshot sync peers.

reserved_nodes: Vec<String>

List of reserved node addresses.

allow_non_reserved: bool

The non-reserved peer mode.

ip_filter: IpFilter

IP Filtering

client_version: String

Client version string

Implementations

Create a new default config.

Create a new local config.

Attempt to convert this config into a BasicNetworkConfiguration.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Compare self to key and return true if they are equal.

Returns the argument unchanged.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.