Struct Config
pub struct Config {
pub timeout: Duration,
pub boot_delay: Duration,
pub refresh_interval: Duration,
pub retry_interval: Duration,
pub throttle_server_period: Duration,
pub use_connected: bool,
pub confidence_max: usize,
pub max_peer_addresses: usize,
pub throttle_clients_global_max: usize,
pub throttle_clients_peer_max: usize,
pub throttle_clients_period: Duration,
pub only_global_ips: bool,
}autonat only.Expand description
Config for the Behaviour.
Fields§
§timeout: DurationTimeout for requests.
boot_delay: DurationDelay on init before starting the fist probe.
refresh_interval: DurationInterval in which the NAT should be tested again if max confidence was reached in a status.
retry_interval: DurationInterval in which the NAT status should be re-tried if it is currently unknown or max confidence was not reached yet.
throttle_server_period: DurationThrottle period for re-using a peer as server for a dial-request.
use_connected: boolUse connected peers as servers for probes.
confidence_max: usizeMax confidence that can be reached in a public / private NAT status.
Note: for NatStatus::Unknown the confidence is always 0.
max_peer_addresses: usizeMax addresses that are tried per peer.
throttle_clients_global_max: usizeMax total dial requests done in [Config::throttle_clients_period].
throttle_clients_peer_max: usizeMax dial requests done in [Config::throttle_clients_period] for a peer.
throttle_clients_period: DurationPeriod for throttling clients requests.
only_global_ips: boolAs a server reject probes for clients that are observed at a non-global ip address.
Correspondingly as a client only pick peers as server that are not observed at a
private ip address. Note that this does not apply for servers that are added via
Behaviour::add_server.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more