#[non_exhaustive]pub struct NameServerConfig {
pub ip: IpAddr,
pub trust_negative_responses: bool,
pub connections: Vec<ConnectionConfig>,
}Expand description
Configuration for the NameServer
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.ip: IpAddrThe address which the DNS NameServer is registered at.
trust_negative_responses: boolWhether to trust NXDOMAIN responses from upstream nameservers.
When this is true, and an empty NXDOMAIN response with an empty answers set is
received, the query will not be retried against other configured name servers.
(On a response with any other error response code, the query will still be retried regardless of this configuration setting.)
Defaults to true.
connections: Vec<ConnectionConfig>Connection protocols configured for this server.
Implementations§
Source§impl NameServerConfig
impl NameServerConfig
Sourcepub fn udp_and_tcp(ip: IpAddr) -> Self
pub fn udp_and_tcp(ip: IpAddr) -> Self
Constructs a nameserver configuration with a UDP and TCP connections
Sourcepub fn udp(ip: IpAddr) -> Self
pub fn udp(ip: IpAddr) -> Self
Constructs a nameserver configuration with a single UDP connection
Sourcepub fn tcp(ip: IpAddr) -> Self
pub fn tcp(ip: IpAddr) -> Self
Constructs a nameserver configuration with a single TCP connection
Sourcepub fn tls(ip: IpAddr, server_name: Arc<str>) -> Self
Available on crate feature __tls only.
pub fn tls(ip: IpAddr, server_name: Arc<str>) -> Self
__tls only.Constructs a nameserver configuration with a single TLS connection
Sourcepub fn https(ip: IpAddr, server_name: Arc<str>, path: Option<Arc<str>>) -> Self
Available on crate feature __https only.
pub fn https(ip: IpAddr, server_name: Arc<str>, path: Option<Arc<str>>) -> Self
__https only.Constructs a nameserver configuration with a single HTTP/2 connection
Sourcepub fn quic(ip: IpAddr, server_name: Arc<str>) -> Self
Available on crate feature __quic only.
pub fn quic(ip: IpAddr, server_name: Arc<str>) -> Self
__quic only.Constructs a nameserver configuration with a single QUIC connection
Sourcepub fn h3(ip: IpAddr, server_name: Arc<str>, path: Option<Arc<str>>) -> Self
Available on crate feature __h3 only.
pub fn h3(ip: IpAddr, server_name: Arc<str>, path: Option<Arc<str>>) -> Self
__h3 only.Constructs a nameserver configuration with a single HTTP/3 connection
Sourcepub fn opportunistic_encryption(ip: IpAddr) -> Self
Available on crate features __tls or __quic only.
pub fn opportunistic_encryption(ip: IpAddr) -> Self
__tls or __quic only.Constructs a nameserver configuration for opportunistic encryption.
This will include configurations for plaintext UDP/TCP as well as DNS-over-TLS and/or DNS-over-QUIC depending on feature flag support.
Notably, the TLS and QUIC configurations will not verify peer certificates, in keeping with RFC 9539’s requirement. See RFC 9539 §4.6.3.4 for more information.
Sourcepub fn new(
ip: IpAddr,
trust_negative_responses: bool,
connections: Vec<ConnectionConfig>,
) -> Self
pub fn new( ip: IpAddr, trust_negative_responses: bool, connections: Vec<ConnectionConfig>, ) -> Self
Create a new NameServerConfig from its constituent parts.
Trait Implementations§
Source§impl Clone for NameServerConfig
impl Clone for NameServerConfig
Source§fn clone(&self) -> NameServerConfig
fn clone(&self) -> NameServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NameServerConfig
impl Debug for NameServerConfig
Source§impl<'de> Deserialize<'de> for NameServerConfig
impl<'de> Deserialize<'de> for NameServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for NameServerConfig
impl RefUnwindSafe for NameServerConfig
impl Send for NameServerConfig
impl Sync for NameServerConfig
impl Unpin for NameServerConfig
impl UnsafeUnpin for NameServerConfig
impl UnwindSafe for NameServerConfig
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