pub struct DnsResolver(/* private fields */);
Expand description
An asynchronous DNS resolver
See also TokioResolver
use reth_dns_discovery::resolver::DnsResolver;
let resolver = DnsResolver::from_system_conf().unwrap();
Note: This Resolver can send multiple lookup attempts, See also
ResolverOpts
which configures 2 attempts (1 retry)
by default.
Implementations§
Source§impl DnsResolver
impl DnsResolver
Sourcepub const fn new(resolver: TokioResolver) -> Self
pub const fn new(resolver: TokioResolver) -> Self
Create a new resolver by wrapping the given TokioResolver
.
Sourcepub fn from_system_conf() -> Result<Self, ResolveError>
pub fn from_system_conf() -> Result<Self, ResolveError>
Constructs a new Tokio based Resolver with the system configuration.
This will use /etc/resolv.conf
on Unix OSes and the registry on Windows.
Trait Implementations§
Source§impl Clone for DnsResolver
impl Clone for DnsResolver
Source§fn clone(&self) -> DnsResolver
fn clone(&self) -> DnsResolver
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DnsResolver
impl Debug for DnsResolver
Source§impl Resolver for DnsResolver
impl Resolver for DnsResolver
Auto Trait Implementations§
impl Freeze for DnsResolver
impl !RefUnwindSafe for DnsResolver
impl Send for DnsResolver
impl Sync for DnsResolver
impl Unpin for DnsResolver
impl !UnwindSafe for DnsResolver
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
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> 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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 536 bytes