Struct TokioDnsResolver
#[non_exhaustive]pub struct TokioDnsResolver { /* private fields */ }dns and std only.Expand description
Portable DNS resolver backed by the host’s getaddrinfo, run on tokio’s
blocking pool.
This relies on the host resolver for address lookups and does not support
CNAME, TXT, SVCB, or HTTPS record resolution. Concurrent lookups of one
name share a single getaddrinfo call.
Implementations§
§impl TokioDnsResolver
impl TokioDnsResolver
pub fn new() -> TokioDnsResolver
pub const fn timeout(&self) -> Duration
pub fn with_timeout(self, timeout: Duration) -> TokioDnsResolver
pub fn with_timeout(self, timeout: Duration) -> TokioDnsResolver
The budget of one lookup, including any wait for a free slot (default 5s). Clones made before this call no longer share lookups with this resolver.
pub fn set_timeout(&mut self, timeout: Duration) -> &mut TokioDnsResolver
pub fn set_timeout(&mut self, timeout: Duration) -> &mut TokioDnsResolver
The budget of one lookup, including any wait for a free slot (default 5s). Clones made before this call no longer share lookups with this resolver.
pub fn max_concurrency(&self) -> Option<usize>
pub fn maybe_with_max_concurrency(self, max: Option<usize>) -> TokioDnsResolver
pub fn maybe_with_max_concurrency(self, max: Option<usize>) -> TokioDnsResolver
Maximum concurrent getaddrinfo calls (default 384, 64 on Apple
platforms, at least 1). Each holds a blocking-pool thread until
libc returns, which a timeout cannot cancel, and on Apple platforms
an mDNSResponder connection of launchd’s default 256 descriptors.
Clones made before this call keep their own bounds.
pub fn maybe_set_max_concurrency(
&mut self,
max: Option<usize>,
) -> &mut TokioDnsResolver
pub fn maybe_set_max_concurrency( &mut self, max: Option<usize>, ) -> &mut TokioDnsResolver
Maximum concurrent getaddrinfo calls (default 384, 64 on Apple
platforms, at least 1). Each holds a blocking-pool thread until
libc returns, which a timeout cannot cancel, and on Apple platforms
an mDNSResponder connection of launchd’s default 256 descriptors.
Clones made before this call keep their own bounds.
pub fn with_max_concurrency(self, max: usize) -> TokioDnsResolver
pub fn with_max_concurrency(self, max: usize) -> TokioDnsResolver
Maximum concurrent getaddrinfo calls (default 384, 64 on Apple
platforms, at least 1). Each holds a blocking-pool thread until
libc returns, which a timeout cannot cancel, and on Apple platforms
an mDNSResponder connection of launchd’s default 256 descriptors.
Clones made before this call keep their own bounds.
pub fn set_max_concurrency(&mut self, max: usize) -> &mut TokioDnsResolver
pub fn set_max_concurrency(&mut self, max: usize) -> &mut TokioDnsResolver
Maximum concurrent getaddrinfo calls (default 384, 64 on Apple
platforms, at least 1). Each holds a blocking-pool thread until
libc returns, which a timeout cannot cancel, and on Apple platforms
an mDNSResponder connection of launchd’s default 256 descriptors.
Clones made before this call keep their own bounds.
pub fn without_max_concurrency(self) -> TokioDnsResolver
pub fn without_max_concurrency(self) -> TokioDnsResolver
Maximum concurrent getaddrinfo calls (default 384, 64 on Apple
platforms, at least 1). Each holds a blocking-pool thread until
libc returns, which a timeout cannot cancel, and on Apple platforms
an mDNSResponder connection of launchd’s default 256 descriptors.
Clones made before this call keep their own bounds.
pub fn unset_max_concurrency(&mut self) -> &mut TokioDnsResolver
pub fn unset_max_concurrency(&mut self) -> &mut TokioDnsResolver
Maximum concurrent getaddrinfo calls (default 384, 64 on Apple
platforms, at least 1). Each holds a blocking-pool thread until
libc returns, which a timeout cannot cancel, and on Apple platforms
an mDNSResponder connection of launchd’s default 256 descriptors.
Clones made before this call keep their own bounds.
pub fn burst_limit(&self) -> Option<usize>
pub fn maybe_with_burst_limit(self, max: Option<usize>) -> TokioDnsResolver
pub fn maybe_with_burst_limit(self, max: Option<usize>) -> TokioDnsResolver
Maximum getaddrinfo calls started within one
burst window and still unanswered (default
64, as each asks for A and AAAA; at least 1). A local stub such as
systemd-resolved drops queries that arrive faster than it reads
them; an answer frees its place at once, a query waiting on a slow
upstream once the window has passed. Clones made before this call
keep their own bounds.
pub fn maybe_set_burst_limit(
&mut self,
max: Option<usize>,
) -> &mut TokioDnsResolver
pub fn maybe_set_burst_limit( &mut self, max: Option<usize>, ) -> &mut TokioDnsResolver
Maximum getaddrinfo calls started within one
burst window and still unanswered (default
64, as each asks for A and AAAA; at least 1). A local stub such as
systemd-resolved drops queries that arrive faster than it reads
them; an answer frees its place at once, a query waiting on a slow
upstream once the window has passed. Clones made before this call
keep their own bounds.
pub fn with_burst_limit(self, max: usize) -> TokioDnsResolver
pub fn with_burst_limit(self, max: usize) -> TokioDnsResolver
Maximum getaddrinfo calls started within one
burst window and still unanswered (default
64, as each asks for A and AAAA; at least 1). A local stub such as
systemd-resolved drops queries that arrive faster than it reads
them; an answer frees its place at once, a query waiting on a slow
upstream once the window has passed. Clones made before this call
keep their own bounds.
pub fn set_burst_limit(&mut self, max: usize) -> &mut TokioDnsResolver
pub fn set_burst_limit(&mut self, max: usize) -> &mut TokioDnsResolver
Maximum getaddrinfo calls started within one
burst window and still unanswered (default
64, as each asks for A and AAAA; at least 1). A local stub such as
systemd-resolved drops queries that arrive faster than it reads
them; an answer frees its place at once, a query waiting on a slow
upstream once the window has passed. Clones made before this call
keep their own bounds.
pub fn without_burst_limit(self) -> TokioDnsResolver
pub fn without_burst_limit(self) -> TokioDnsResolver
Maximum getaddrinfo calls started within one
burst window and still unanswered (default
64, as each asks for A and AAAA; at least 1). A local stub such as
systemd-resolved drops queries that arrive faster than it reads
them; an answer frees its place at once, a query waiting on a slow
upstream once the window has passed. Clones made before this call
keep their own bounds.
pub fn unset_burst_limit(&mut self) -> &mut TokioDnsResolver
pub fn unset_burst_limit(&mut self) -> &mut TokioDnsResolver
Maximum getaddrinfo calls started within one
burst window and still unanswered (default
64, as each asks for A and AAAA; at least 1). A local stub such as
systemd-resolved drops queries that arrive faster than it reads
them; an answer frees its place at once, a query waiting on a slow
upstream once the window has passed. Clones made before this call
keep their own bounds.
pub fn burst_window(&self) -> Duration
pub fn with_burst_window(self, window: Duration) -> TokioDnsResolver
pub fn with_burst_window(self, window: Duration) -> TokioDnsResolver
The window of Self::burst_limit (default 20ms). Clones made
before this call keep their own bounds.
pub fn set_burst_window(&mut self, window: Duration) -> &mut TokioDnsResolver
pub fn set_burst_window(&mut self, window: Duration) -> &mut TokioDnsResolver
The window of Self::burst_limit (default 20ms). Clones made
before this call keep their own bounds.
Trait Implementations§
§impl Clone for TokioDnsResolver
impl Clone for TokioDnsResolver
§fn clone(&self) -> TokioDnsResolver
fn clone(&self) -> TokioDnsResolver
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 TokioDnsResolver
impl Debug for TokioDnsResolver
§impl Default for TokioDnsResolver
impl Default for TokioDnsResolver
§fn default() -> TokioDnsResolver
fn default() -> TokioDnsResolver
§impl DnsAddressResolver for TokioDnsResolver
impl DnsAddressResolver for TokioDnsResolver
§fn lookup_ipv4(
&self,
domain: Domain,
) -> impl Stream<Item = Result<Ipv4Addr, <TokioDnsResolver as DnsAddressResolver>::Error>> + Send
fn lookup_ipv4( &self, domain: Domain, ) -> impl Stream<Item = Result<Ipv4Addr, <TokioDnsResolver as DnsAddressResolver>::Error>> + Send
§fn lookup_ipv6(
&self,
domain: Domain,
) -> impl Stream<Item = Result<Ipv6Addr, <TokioDnsResolver as DnsAddressResolver>::Error>> + Send
fn lookup_ipv6( &self, domain: Domain, ) -> impl Stream<Item = Result<Ipv6Addr, <TokioDnsResolver as DnsAddressResolver>::Error>> + Send
§fn lookup_ipv4_first(
&self,
domain: Domain,
) -> impl Future<Output = Option<Result<Ipv4Addr, Self::Error>>> + Send
fn lookup_ipv4_first( &self, domain: Domain, ) -> impl Future<Output = Option<Result<Ipv4Addr, Self::Error>>> + Send
§fn lookup_ipv4_rand(
&self,
domain: Domain,
) -> impl Future<Output = Option<Result<Ipv4Addr, Self::Error>>> + Send
fn lookup_ipv4_rand( &self, domain: Domain, ) -> impl Future<Output = Option<Result<Ipv4Addr, Self::Error>>> + Send
§fn lookup_ipv6_first(
&self,
domain: Domain,
) -> impl Future<Output = Option<Result<Ipv6Addr, Self::Error>>> + Send
fn lookup_ipv6_first( &self, domain: Domain, ) -> impl Future<Output = Option<Result<Ipv6Addr, Self::Error>>> + Send
§fn lookup_ipv6_rand(
&self,
domain: Domain,
) -> impl Future<Output = Option<Result<Ipv6Addr, Self::Error>>> + Send
fn lookup_ipv6_rand( &self, domain: Domain, ) -> impl Future<Output = Option<Result<Ipv6Addr, Self::Error>>> + Send
§fn into_box_dns_address_resolver(self) -> BoxDnsAddressResolver
fn into_box_dns_address_resolver(self) -> BoxDnsAddressResolver
§impl DnsCnameResolver for TokioDnsResolver
impl DnsCnameResolver for TokioDnsResolver
§type Error = TokioDnsCnameUnsupportedError
type Error = TokioDnsCnameUnsupportedError
§fn lookup_cname(
&self,
_domain: Domain,
) -> impl Stream<Item = Result<Name, <TokioDnsResolver as DnsCnameResolver>::Error>> + Send
fn lookup_cname( &self, _domain: Domain, ) -> impl Stream<Item = Result<Name, <TokioDnsResolver as DnsCnameResolver>::Error>> + Send
§fn into_box_dns_cname_resolver(self) -> BoxDnsCnameResolver
fn into_box_dns_cname_resolver(self) -> BoxDnsCnameResolver
§impl DnsResolver for TokioDnsResolver
impl DnsResolver for TokioDnsResolver
§fn into_box_dns_resolver(self) -> BoxDnsResolverwhere
Self: Sized,
fn into_box_dns_resolver(self) -> BoxDnsResolverwhere
Self: Sized,
§impl DnsServiceBindingResolver for TokioDnsResolver
impl DnsServiceBindingResolver for TokioDnsResolver
§type Error = TokioDnsServiceBindingUnsupportedError
type Error = TokioDnsServiceBindingUnsupportedError
§fn lookup_svcb(
&self,
_domain: Domain,
) -> impl Stream<Item = Result<ServiceBinding, <TokioDnsResolver as DnsServiceBindingResolver>::Error>> + Send
fn lookup_svcb( &self, _domain: Domain, ) -> impl Stream<Item = Result<ServiceBinding, <TokioDnsResolver as DnsServiceBindingResolver>::Error>> + Send
§fn lookup_https(
&self,
_domain: Domain,
) -> impl Stream<Item = Result<ServiceBinding, <TokioDnsResolver as DnsServiceBindingResolver>::Error>> + Send
fn lookup_https( &self, _domain: Domain, ) -> impl Stream<Item = Result<ServiceBinding, <TokioDnsResolver as DnsServiceBindingResolver>::Error>> + Send
§fn into_box_dns_service_binding_resolver(self) -> BoxDnsServiceBindingResolver
fn into_box_dns_service_binding_resolver(self) -> BoxDnsServiceBindingResolver
§impl DnsTxtResolver for TokioDnsResolver
impl DnsTxtResolver for TokioDnsResolver
§type Error = TokioDnsTxtUnsupportedError
type Error = TokioDnsTxtUnsupportedError
DnsTxtResolver§fn lookup_txt(
&self,
_domain: Domain,
) -> impl Stream<Item = Result<Txt, <TokioDnsResolver as DnsTxtResolver>::Error>> + Send
fn lookup_txt( &self, _domain: Domain, ) -> impl Stream<Item = Result<Txt, <TokioDnsResolver as DnsTxtResolver>::Error>> + Send
§fn into_box_dns_txt_resolver(self) -> BoxDnsTxtResolver
fn into_box_dns_txt_resolver(self) -> BoxDnsTxtResolver
Auto Trait Implementations§
impl !RefUnwindSafe for TokioDnsResolver
impl !UnwindSafe for TokioDnsResolver
impl Freeze for TokioDnsResolver
impl Send for TokioDnsResolver
impl Sync for TokioDnsResolver
impl Unpin for TokioDnsResolver
impl UnsafeUnpin for TokioDnsResolver
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> 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<R> HappyEyeballAddressResolverExt for Rwhere
R: DnsAddressResolver,
impl<R> HappyEyeballAddressResolverExt for Rwhere
R: DnsAddressResolver,
§fn happy_eyeballs_resolver(
&self,
host: impl Into<Host>,
) -> HappyEyeballAddressResolver<'_, R>
fn happy_eyeballs_resolver( &self, host: impl Into<Host>, ) -> HappyEyeballAddressResolver<'_, R>
§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