pub struct DhtConfig {Show 13 fields
pub max_k: usize,
pub max_peer_info_ttl: Duration,
pub max_stored_value_ttl: Duration,
pub max_storage_capacity: ByteSize,
pub storage_item_time_to_idle: Option<Duration>,
pub local_info_refresh_period: Duration,
pub local_info_announce_period: Duration,
pub local_info_announce_period_max_jitter: Duration,
pub routing_table_refresh_period: Duration,
pub routing_table_refresh_period_max_jitter: Duration,
pub announced_peers_channel_capacity: usize,
pub bootstrap_peers_refill_period: Option<Duration>,
pub request_timeout: Duration,
}Fields§
§max_k: usizeDHT K parameter.
Default: 6.
max_peer_info_ttl: DurationMaximum time to live for peer info.
Default: 1 hour.
max_stored_value_ttl: DurationMaximum time to live for stored values.
Default: 1 hour.
max_storage_capacity: ByteSizeMaximum storage capacity (number of entries).
Default: 16 MiB.
storage_item_time_to_idle: Option<Duration>Time until a stored item is considered idle and can be removed.
Default: unlimited.
local_info_refresh_period: DurationA period of refreshing the local peer info.
Default: 1 minute.
local_info_announce_period: DurationA period of storing the local peer info into the DHT.
Default: 10 minutes.
local_info_announce_period_max_jitter: DurationA maximum value of a random jitter for the peer announce period.
Default: 1 minute.
routing_table_refresh_period: DurationA period of updating and populating the routing table.
Default: 10 minutes.
routing_table_refresh_period_max_jitter: DurationA maximum value of a random jitter for the routing table refresh period.
Default: 1 minutes.
announced_peers_channel_capacity: usizeThe capacity of the announced peers channel.
Default: 10.
bootstrap_peers_refill_period: Option<Duration>A period of refilling bootstrap peers in the routing table.
Default: 1 minutes.
request_timeout: DurationTimeout for DHT query request.
Default: 500 ms.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DhtConfig
impl<'de> Deserialize<'de> for DhtConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DhtConfig
impl RefUnwindSafe for DhtConfig
impl Send for DhtConfig
impl Sync for DhtConfig
impl Unpin for DhtConfig
impl UnsafeUnpin for DhtConfig
impl UnwindSafe for DhtConfig
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§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