logo
pub struct QuicP2pConfig {
    pub forward_port: bool,
    pub external_port: Option<u16>,
    pub external_ip: Option<IpAddr>,
    pub idle_timeout: Option<Duration>,
    pub keep_alive_interval: Option<Duration>,
    pub upnp_lease_duration: Option<Duration>,
    pub retry_config: RetryConfig,
}
Expand description

QuicP2p configurations

Fields

forward_port: bool

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>

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>

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.

idle_timeout: Option<Duration>

How long to wait to hear from a peer before timing out a connection.

In the absence of any keep-alive messages, connections will be closed if they remain idle for at least this duration.

If unspecified, this will default to DEFAULT_IDLE_TIMEOUT.

keep_alive_interval: Option<Duration>

Interval at which to send keep-alives to maintain otherwise idle connections.

Keep-alives prevent otherwise idle connections from timing out.

If unspecified, this will default to None, disabling keep-alives.

upnp_lease_duration: Option<Duration>

How long UPnP port mappings will last.

Note that UPnP port mappings will be automatically renewed on this interval.

If unspecified, this will default to DEFAULT_UPNP_LEASE_DURATION, which should be suitable in most cases but some routers may clear UPnP port mapping more frequently.

retry_config: RetryConfig

Retry configurations for establishing connections and sending messages. Determines the retry behaviour of requests, by setting the back off strategy used.

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

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

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

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

Performs the conversion.

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

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

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more