#[non_exhaustive]pub struct DiscoveryOptions {
pub dns_server: Option<String>,
pub enabled: bool,
pub dns_nameservers: Vec<String>,
}Expand description
DNS-based peer discovery configuration.
Marked #[non_exhaustive] so future additive fields are not a
source-compatibility break for downstream crates: construct it via
DiscoveryOptions::new (or Default) and set optional fields on the
returned value rather than with an exhaustive struct literal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dns_server: Option<String>DNS discovery server URL. Uses n0 DNS defaults when None.
enabled: boolWhether to enable DNS discovery. Default: true.
dns_nameservers: Vec<String>Explicit ordinary-DNS nameservers for iroh’s resolver.
Accepts IPs such as "8.8.8.8" and numeric scoped IPv6 addresses such
as "fe80::1%17". This setting is unrelated to DNS-SD/mDNS: it supplies
the resolver used for relay, pkarr, and DNS-discovery hostnames when the
platform’s system DNS config is unavailable. Empty means use iroh’s
default resolver.
Implementations§
Source§impl DiscoveryOptions
impl DiscoveryOptions
Sourcepub fn new(dns_server: Option<String>, enabled: bool) -> Self
pub fn new(dns_server: Option<String>, enabled: bool) -> Self
Construct a DiscoveryOptions with an empty dns_nameservers list.
The forward-compatible constructor for downstream crates: since the
struct is #[non_exhaustive] they cannot use a struct literal. Set
dns_nameservers (or any future field) on the returned value.
Trait Implementations§
Source§impl Clone for DiscoveryOptions
impl Clone for DiscoveryOptions
Source§fn clone(&self) -> DiscoveryOptions
fn clone(&self) -> DiscoveryOptions
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 DiscoveryOptions
impl Debug for DiscoveryOptions
Auto Trait Implementations§
impl Freeze for DiscoveryOptions
impl RefUnwindSafe for DiscoveryOptions
impl Send for DiscoveryOptions
impl Sync for DiscoveryOptions
impl Unpin for DiscoveryOptions
impl UnsafeUnpin for DiscoveryOptions
impl UnwindSafe for DiscoveryOptions
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