pub struct DiscoveryConfig {
pub ttl: u8,
pub attempt_timeouts_secs: Vec<u64>,
pub recent_expiry_secs: u64,
pub backoff_base_secs: u64,
pub backoff_max_secs: u64,
pub forward_min_interval_secs: u64,
pub nostr: NostrDiscoveryConfig,
pub lan: LanDiscoveryConfig,
}Expand description
Discovery protocol (node.discovery.*).
Fields§
§ttl: u8Hop limit for LookupRequest flood (node.discovery.ttl).
attempt_timeouts_secs: Vec<u64>Per-attempt timeouts in seconds (node.discovery.attempt_timeouts_secs).
Each entry is the time to wait for a response before sending the next
LookupRequest (with a fresh request_id). Sequence length determines the
total number of attempts before declaring the destination unreachable.
Default [1, 2, 4, 8] gives 4 attempts and a 15s total budget.
recent_expiry_secs: u64Dedup cache expiry in seconds (node.discovery.recent_expiry_secs).
backoff_base_secs: u64Base backoff after lookup failure in seconds (node.discovery.backoff_base_secs).
Doubles per consecutive failure up to backoff_max_secs. Defaults to 0
(no post-failure suppression); the per-attempt sequence in
attempt_timeouts_secs provides the only retry pacing.
backoff_max_secs: u64Maximum backoff cap in seconds (node.discovery.backoff_max_secs).
forward_min_interval_secs: u64Minimum interval between forwarded lookups for the same target in seconds
(node.discovery.forward_min_interval_secs).
Defense-in-depth against misbehaving nodes.
nostr: NostrDiscoveryConfigNostr-mediated overlay endpoint discovery.
lan: LanDiscoveryConfigmDNS / DNS-SD peer discovery on the local link. Identity surface
is a strict subset of what nostr.advertise already publishes
publicly, so there’s no marginal privacy cost; the latency win
for same-LAN peers is large (sub-second pairing, no relay).
Trait Implementations§
Source§impl Clone for DiscoveryConfig
impl Clone for DiscoveryConfig
Source§fn clone(&self) -> DiscoveryConfig
fn clone(&self) -> DiscoveryConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveryConfig
impl Debug for DiscoveryConfig
Source§impl Default for DiscoveryConfig
impl Default for DiscoveryConfig
Source§impl<'de> Deserialize<'de> for DiscoveryConfig
impl<'de> Deserialize<'de> for DiscoveryConfig
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 DiscoveryConfig
impl RefUnwindSafe for DiscoveryConfig
impl Send for DiscoveryConfig
impl Sync for DiscoveryConfig
impl Unpin for DiscoveryConfig
impl UnsafeUnpin for DiscoveryConfig
impl UnwindSafe for DiscoveryConfig
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