Struct ethcore_network::NetworkConfiguration
source · [−]pub struct NetworkConfiguration {Show 17 fields
pub config_path: Option<String>,
pub net_config_path: Option<String>,
pub listen_address: Option<SocketAddr>,
pub public_address: Option<SocketAddr>,
pub udp_port: Option<u16>,
pub nat_enabled: bool,
pub discovery_enabled: bool,
pub boot_nodes: Vec<String>,
pub use_secret: Option<Secret>,
pub min_peers: u32,
pub max_peers: u32,
pub max_handshakes: u32,
pub reserved_protocols: HashMap<ProtocolId, u32>,
pub reserved_nodes: Vec<String>,
pub non_reserved_mode: NonReservedPeerMode,
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<SocketAddr>
IP address to listen for incoming connections. Listen to all connections by default
public_address: Option<SocketAddr>
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
min_peers: u32
Minimum number of connected peers to maintain
max_peers: u32
Maximum allowed number of peers
max_handshakes: u32
Maximum handshakes
reserved_protocols: HashMap<ProtocolId, u32>
Reserved protocols. Peers with
reserved_nodes: Vec<String>
List of reserved node addresses.
non_reserved_mode: NonReservedPeerMode
The non-reserved peer mode.
ip_filter: IpFilter
IP filter
client_version: String
Client identifier
Implementations
sourceimpl NetworkConfiguration
impl NetworkConfiguration
sourcepub fn new_with_port(port: u16) -> NetworkConfiguration
pub fn new_with_port(port: u16) -> NetworkConfiguration
Create new default configuration with specified listen port.
sourcepub fn new_local() -> NetworkConfiguration
pub fn new_local() -> NetworkConfiguration
Create new default configuration for localhost-only connection with random port (usefull for testing)
Trait Implementations
sourceimpl Clone for NetworkConfiguration
impl Clone for NetworkConfiguration
sourcefn clone(&self) -> NetworkConfiguration
fn clone(&self) -> NetworkConfiguration
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
sourceimpl Debug for NetworkConfiguration
impl Debug for NetworkConfiguration
sourceimpl Default for NetworkConfiguration
impl Default for NetworkConfiguration
sourceimpl PartialEq<NetworkConfiguration> for NetworkConfiguration
impl PartialEq<NetworkConfiguration> for NetworkConfiguration
sourcefn eq(&self, other: &NetworkConfiguration) -> bool
fn eq(&self, other: &NetworkConfiguration) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &NetworkConfiguration) -> bool
fn ne(&self, other: &NetworkConfiguration) -> bool
This method tests for !=
.
impl StructuralPartialEq for NetworkConfiguration
Auto Trait Implementations
impl RefUnwindSafe for NetworkConfiguration
impl Send for NetworkConfiguration
impl Sync for NetworkConfiguration
impl Unpin for NetworkConfiguration
impl UnwindSafe for NetworkConfiguration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more