Struct sn_routing::TransportConfig[][src]

pub struct TransportConfig {
    pub hard_coded_contacts: HashSet<SocketAddr, RandomState>,
    pub local_port: Option<u16>,
    pub local_ip: Option<IpAddr>,
    pub forward_port: bool,
    pub external_port: Option<u16>,
    pub external_ip: Option<IpAddr>,
    pub max_msg_size_allowed: Option<u32>,
    pub idle_timeout_msec: Option<u64>,
    pub keep_alive_interval_msec: Option<u32>,
    pub bootstrap_cache_dir: Option<String>,
    pub upnp_lease_duration: Option<u32>,
}
Expand description

QuicP2p configurations

Fields

hard_coded_contacts: HashSet<SocketAddr, RandomState>
Expand description

Hard Coded contacts

local_port: Option<u16>
Expand description

Port we want to reserve for QUIC. If none supplied we’ll use the OS given random port. If external port is provided it means that the user is carrying out manual port forwarding and this field is mandatory. This will be the internal port number mapped to the process

local_ip: Option<IpAddr>
Expand description

IP address for the listener. If none is supplied and forward_port is enabled, we will use IGD to realize the local IP address of the machine. If IGD fails the application will exit.

forward_port: bool
Expand description

Specify if port forwarding via UPnP should be done or not. This can be set to false if the network is run locally on the network loopback or on a local area network.

external_port: Option<u16>
Expand description

External port number assigned to the socket address of the program. If this is provided, QP2p considers that the local port provided has been mapped to the provided external port number and automatic port forwarding will be skipped.

external_ip: Option<IpAddr>
Expand description

External IP address of the computer on the WAN. This field is mandatory if the node is the genesis node and port forwarding is not available. In case of non-genesis nodes, the external IP address will be resolved using the Echo service.

max_msg_size_allowed: Option<u32>
Expand description

This is the maximum message size we’ll allow the peer to send to us. Any bigger message and we’ll error out probably shutting down the connection to the peer. If none supplied we’ll default to the documented constant.

idle_timeout_msec: Option<u64>
Expand description

If we hear nothing from the peer in the given interval we declare it offline to us. If none supplied we’ll default to the documented constant.

The interval is in milliseconds. A value of 0 disables this feature.

keep_alive_interval_msec: Option<u32>
Expand description

Interval to send keep-alives if we are idling so that the peer does not disconnect from us declaring us offline. If none is supplied we’ll default to the documented constant.

The interval is in milliseconds. A value of 0 disables this feature.

bootstrap_cache_dir: Option<String>
Expand description

Directory in which the bootstrap cache will be stored. If none is supplied, the platform specific default cache directory is used.

upnp_lease_duration: Option<u32>
Expand description

Duration of a UPnP port mapping.

Trait Implementations

impl Clone for Config[src]

pub fn clone(&self) -> Config[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Config[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Default for Config[src]

pub fn default() -> Config[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for Config[src]

pub fn deserialize<__D>(
    __deserializer: __D
) -> Result<Config, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<Config> for Config[src]

pub fn eq(&self, other: &Config) -> bool[src]

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

pub fn ne(&self, other: &Config) -> bool[src]

This method tests for !=.

impl Serialize for Config[src]

pub fn serialize<__S>(
    &self,
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl StructOpt for Config[src]

pub fn clap<'a, 'b>() -> App<'a, 'b>[src]

Returns clap::App corresponding to the struct.

pub fn from_clap(matches: &ArgMatches<'_>) -> Config[src]

Builds the struct from clap::ArgMatches. It’s guaranteed to succeed if matches originates from an App generated by [StructOpt::clap] called on the same type, otherwise it must panic. Read more

fn from_args() -> Self

Builds the struct from the command line arguments (std::env::args_os). Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more

fn from_args_safe() -> Result<Self, Error>

Builds the struct from the command line arguments (std::env::args_os). Unlike [StructOpt::from_args], returns clap::Error on failure instead of aborting the program, so calling .exit is up to you. Read more

fn from_iter<I>(iter: I) -> Self where
    I: IntoIterator,
    <I as IntoIterator>::Item: Into<OsString>,
    <I as IntoIterator>::Item: Clone

Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more

fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
    I: IntoIterator,
    <I as IntoIterator>::Item: Into<OsString>,
    <I as IntoIterator>::Item: Clone

Gets the struct from any iterator such as a Vec of your making. Read more

impl Eq for Config[src]

impl StructuralEq for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

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

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]