pub struct DefaultDnsClient { /* private fields */ }Expand description
Implementation of a DnsClient that uses UDP with TCP fallback.
Supports nameserver rotation, retries, timeouts, and pooling of client connections. Names are assumed to already be fully qualified, meaning that they are not combined with a search domain.
Timeouts are handled by the client itself and so callers should not
add a timeout on the resolve method. Note that timeouts are per-network
operation. This means that a single call to resolve make take longer
than the timeout since failed network operations are retried.
Implementations§
Source§impl DefaultDnsClient
impl DefaultDnsClient
Sourcepub fn new<U, T>(
config: DnsClientConfig,
udp_factory: U,
tcp_factory: T,
) -> Selfwhere
U: ClientFactory<SocketAddr, UdpConnection> + Send + Sync + 'static,
T: ClientFactory<SocketAddr, TcpConnection> + Send + Sync + 'static,
pub fn new<U, T>(
config: DnsClientConfig,
udp_factory: U,
tcp_factory: T,
) -> Selfwhere
U: ClientFactory<SocketAddr, UdpConnection> + Send + Sync + 'static,
T: ClientFactory<SocketAddr, TcpConnection> + Send + Sync + 'static,
Create a new DnsClient that will resolve names using UDP or TCP connections and behavior based on a resolv.conf configuration file.
Trait Implementations§
Source§impl Debug for DefaultDnsClient
impl Debug for DefaultDnsClient
Auto Trait Implementations§
impl !Freeze for DefaultDnsClient
impl !RefUnwindSafe for DefaultDnsClient
impl Send for DefaultDnsClient
impl Sync for DefaultDnsClient
impl Unpin for DefaultDnsClient
impl !UnwindSafe for DefaultDnsClient
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