Struct ResolverConfig
#[non_exhaustive]pub struct ResolverConfig {
pub domain: Option<Name>,
pub search: Vec<Name>,
pub name_servers: Vec<NameServerConfig>,
}dns and hickory and std only.Expand description
Configuration for the upstream nameservers to use for resolution.
The Default implementation of this struct will be removed in a future version. Use
Self::from_name_servers() instead. Note that a ResolverConfig with no name servers will
produce a nonfunctional resolver.
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§
§impl ResolverConfig
impl ResolverConfig
pub fn udp_and_tcp(config: &ServerGroup<'_>) -> ResolverConfig
pub fn udp_and_tcp(config: &ServerGroup<'_>) -> ResolverConfig
Create a new ResolverConfig from ServerGroup configuration.
Connects via UDP and TCP.
pub fn from_parts(
domain: Option<Name>,
search: Vec<Name>,
name_servers: Vec<NameServerConfig>,
) -> ResolverConfig
pub fn from_parts( domain: Option<Name>, search: Vec<Name>, name_servers: Vec<NameServerConfig>, ) -> ResolverConfig
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
pub fn from_name_servers(name_servers: Vec<NameServerConfig>) -> ResolverConfig
pub fn from_name_servers(name_servers: Vec<NameServerConfig>) -> ResolverConfig
Create a ResolverConfig from a list of name server configurations.
No base domain for relative names will be set, and no additional search domains will be set.
pub 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.
pub 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
pub fn set_domain(&mut self, domain: Name)
pub fn set_domain(&mut self, domain: Name)
Set the domain of the entity querying results.
pub 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
pub fn add_search(&mut self, search: Name)
pub fn add_search(&mut self, search: Name)
Add a search domain
pub 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
pub fn name_servers(&self) -> &[NameServerConfig]
pub fn name_servers(&self) -> &[NameServerConfig]
Returns a reference to the name servers
Trait Implementations§
§impl Clone for ResolverConfig
impl Clone for ResolverConfig
§fn clone(&self) -> ResolverConfig
fn clone(&self) -> ResolverConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ResolverConfig
impl Debug for ResolverConfig
§impl Default for ResolverConfig
impl Default for ResolverConfig
§fn default() -> ResolverConfig
fn default() -> ResolverConfig
§impl<'de> Deserialize<'de> for ResolverConfig
impl<'de> Deserialize<'de> for ResolverConfig
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResolverConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResolverConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for ResolverConfig
impl Serialize for ResolverConfig
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more