Struct mtop_client::dns::DnsClientConfig
source · pub struct DnsClientConfig {
pub nameservers: Vec<SocketAddr>,
pub timeout: Duration,
pub attempts: u8,
pub rotate: bool,
pub pool_max_idle: u64,
}Expand description
Configuration for creating a new DnsClient instance.
Fields§
§nameservers: Vec<SocketAddr>One or more DNS nameservers to use for resolution. These servers will be tried
in order for each resolution unless rotate is set.
timeout: DurationTimeout for each resolution. This timeout is applied to each attempt and so a
single call to DnsClient::resolve may take longer based on the value of attempts.
attempts: u8Number of attempts to make performing a resolution for a single name. Note that any response from a DNS server counts as “success”. Only timeout or network errors will trigger retries.
rotate: boolIf true, nameservers will be round-robin load balanced for each resolution. If false
the nameservers are tried in-order for each resolution.
pool_max_idle: u64Max number of open sockets or connections to each nameserver. Default is to keep one open socket or connection per nameserver. Set to 0 to disable this behavior.
Trait Implementations§
source§impl Clone for DnsClientConfig
impl Clone for DnsClientConfig
source§fn clone(&self) -> DnsClientConfig
fn clone(&self) -> DnsClientConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DnsClientConfig
impl Debug for DnsClientConfig
Auto Trait Implementations§
impl Freeze for DnsClientConfig
impl RefUnwindSafe for DnsClientConfig
impl Send for DnsClientConfig
impl Sync for DnsClientConfig
impl Unpin for DnsClientConfig
impl UnwindSafe for DnsClientConfig
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)