Struct libp2p_autonat::v1::Config
source · 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,
}
v1
only.Expand description
Config for the Behaviour
.
Fields§
§timeout: Duration
Timeout for requests.
boot_delay: Duration
Delay on init before starting the fist probe.
refresh_interval: Duration
Interval in which the NAT should be tested again if max confidence was reached in a status.
retry_interval: Duration
Interval in which the NAT status should be re-tried if it is currently unknown or max confidence was not reached yet.
throttle_server_period: Duration
Throttle period for re-using a peer as server for a dial-request.
use_connected: bool
Use connected peers as servers for probes.
confidence_max: usize
Max confidence that can be reached in a public / private NAT status.
Note: for NatStatus::Unknown
the confidence is always 0.
max_peer_addresses: usize
Max addresses that are tried per peer.
throttle_clients_global_max: usize
Max total dial requests done in [Config::throttle_clients_period
].
throttle_clients_peer_max: usize
Max dial requests done in [Config::throttle_clients_period
] for a peer.
throttle_clients_period: Duration
Period for throttling clients requests.
only_global_ips: bool
As 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§
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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