pub struct Builder { /* private fields */ }Available on non-
wasm_browser only.Expand description
Builder for DnsResolver.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn with_system_defaults(self) -> Self
pub fn with_system_defaults(self) -> Self
Makes the builder respect the host system’s DNS configuration.
We first try to read the system’s resolver from /etc/resolv.conf.
This does not work at least on some Androids, therefore we fallback
to a default config which uses Google’s 8.8.8.8 or 8.8.4.4.
Sourcepub fn with_nameserver(self, addr: SocketAddr, protocol: DnsProtocol) -> Self
pub fn with_nameserver(self, addr: SocketAddr, protocol: DnsProtocol) -> Self
Adds a single nameserver.
Sourcepub fn with_nameservers(
self,
nameservers: impl IntoIterator<Item = (SocketAddr, DnsProtocol)>,
) -> Self
pub fn with_nameservers( self, nameservers: impl IntoIterator<Item = (SocketAddr, DnsProtocol)>, ) -> Self
Adds a list of nameservers.
Sourcepub fn build(self) -> DnsResolver
pub fn build(self) -> DnsResolver
Builds the DNS resolver.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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> 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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