#[non_exhaustive]pub struct ResolverConfig {
pub domain: Option<Name>,
pub search: Vec<Name>,
pub name_servers: Vec<NameServerConfig>,
}Expand description
Configuration for the upstream nameservers to use for resolution
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.domain: Option<Name>Base search domain
search: Vec<Name>Search domains
name_servers: Vec<NameServerConfig>Name servers to use for resolution
Implementations§
Source§impl ResolverConfig
impl ResolverConfig
Sourcepub fn udp_and_tcp(config: &ServerGroup<'_>) -> Self
pub fn udp_and_tcp(config: &ServerGroup<'_>) -> Self
Create a new ResolverConfig from ServerGroup configuration.
Connects via UDP and TCP.
Sourcepub fn tls(config: &ServerGroup<'_>) -> Self
Available on crate feature __tls only.
pub fn tls(config: &ServerGroup<'_>) -> Self
__tls only.Create a new ResolverConfig from ServerGroup configuration.
Only connects via TLS.
Sourcepub fn https(config: &ServerGroup<'_>) -> Self
Available on crate feature __https only.
pub fn https(config: &ServerGroup<'_>) -> Self
__https only.Create a new ResolverConfig from ServerGroup configuration.
Only connects via HTTPS (HTTP/2).
Sourcepub fn quic(config: &ServerGroup<'_>) -> Self
Available on crate feature __quic only.
pub fn quic(config: &ServerGroup<'_>) -> Self
__quic only.Create a new ResolverConfig from ServerGroup configuration.
Only connects via QUIC.
Sourcepub fn h3(config: &ServerGroup<'_>) -> Self
Available on crate feature __h3 only.
pub fn h3(config: &ServerGroup<'_>) -> Self
__h3 only.Create a new ResolverConfig from ServerGroup configuration.
Only connects via HTTP/3.
Sourcepub fn from_parts(
domain: Option<Name>,
search: Vec<Name>,
name_servers: Vec<NameServerConfig>,
) -> Self
pub fn from_parts( domain: Option<Name>, search: Vec<Name>, name_servers: Vec<NameServerConfig>, ) -> Self
Create a ResolverConfig with all parts specified
§Arguments
domain- domain of the entity querying results. If theNamebeing looked up is not an FQDN, then this is the first part appended to attempt a lookup.ndotsin theResolverOptiondoes take precedence over this.search- additional search domains that are attempted if theNameis not found indomain, defaults tovec![]name_servers- set of name servers to use for lookups
Sourcepub fn into_parts(self) -> (Option<Name>, Vec<Name>, Vec<NameServerConfig>)
pub fn into_parts(self) -> (Option<Name>, Vec<Name>, Vec<NameServerConfig>)
Take the domain, search, and name_servers from the config.
Sourcepub fn domain(&self) -> Option<&Name>
pub fn domain(&self) -> Option<&Name>
Returns the local domain
By default any names will be appended to all non-fully-qualified-domain names, and searched for after any ndots rules
Sourcepub fn set_domain(&mut self, domain: Name)
pub fn set_domain(&mut self, domain: Name)
Set the domain of the entity querying results.
Sourcepub fn search(&self) -> &[Name]
pub fn search(&self) -> &[Name]
Returns the search domains
These will be queried after any local domain and then in the order of the set of search domains
Sourcepub fn add_search(&mut self, search: Name)
pub fn add_search(&mut self, search: Name)
Add a search domain
Sourcepub fn add_name_server(&mut self, name_server: NameServerConfig)
pub fn add_name_server(&mut self, name_server: NameServerConfig)
Add the configuration for a name server
Sourcepub fn name_servers(&self) -> &[NameServerConfig]
pub fn name_servers(&self) -> &[NameServerConfig]
Returns a reference to the name servers
Trait Implementations§
Source§impl Clone for ResolverConfig
impl Clone for ResolverConfig
Source§fn clone(&self) -> ResolverConfig
fn clone(&self) -> ResolverConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolverConfig
impl Debug for ResolverConfig
Source§impl Default for ResolverConfig
impl Default for ResolverConfig
Source§fn default() -> ResolverConfig
fn default() -> ResolverConfig
Source§impl<'de> Deserialize<'de> for ResolverConfig
impl<'de> Deserialize<'de> for ResolverConfig
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 ResolverConfig
impl RefUnwindSafe for ResolverConfig
impl Send for ResolverConfig
impl Sync for ResolverConfig
impl Unpin for ResolverConfig
impl UnsafeUnpin for ResolverConfig
impl UnwindSafe for ResolverConfig
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