pub struct ScionTxtDnsResolver { /* private fields */ }Expand description
Resolver that interprets TXT records using the TSAR format.
Use this resolver to look up scion=v1;... TXT records and translate them into ScionIpAddr
values. Construction errors are reported via TxtResolverError, while lookup failures and
parsing outcomes are reported through ResolveError from ScionDnsResolver::resolve.
Domain-specific overrides can be added to bypass DNS and always return the configured addresses.
Implementations§
Source§impl ScionTxtDnsResolver
impl ScionTxtDnsResolver
Sourcepub fn new() -> Result<Self, TxtResolverError>
pub fn new() -> Result<Self, TxtResolverError>
Create a resolver using the system DNS configuration.
This uses the OS resolver configuration (for example /etc/resolv.conf)
and then applies the default hickory-dns options for lookups.
§Errors
Returns TxtResolverError if the system configuration cannot be loaded.
Sourcepub fn with_override(self, domain: &str, addrs: Vec<ScionIpAddr>) -> Self
pub fn with_override(self, domain: &str, addrs: Vec<ScionIpAddr>) -> Self
Override DNS resolution for a specific domain.
Sourcepub fn with_overrides<D, I>(self, overrides: I) -> Self
pub fn with_overrides<D, I>(self, overrides: I) -> Self
Override DNS resolution for multiple domains at once.
Sourcepub fn from_builder(
builder: ResolverBuilder<TokioConnectionProvider>,
) -> Result<Self, TxtResolverError>
pub fn from_builder( builder: ResolverBuilder<TokioConnectionProvider>, ) -> Result<Self, TxtResolverError>
Constructs a resolver from a pre-configured hickory ResolverBuilder.
This allows callers to customize resolver options (timeouts, retries, name servers) via hickory-dns before constructing the resolver.
§Errors
This function is currently infallible, but returns Result for future compatibility with
hickory-dns builder changes.
Sourcepub fn builder() -> Result<ResolverBuilder<TokioConnectionProvider>, TxtResolverError>
pub fn builder() -> Result<ResolverBuilder<TokioConnectionProvider>, TxtResolverError>
Creates a builder for configuring resolver options.
On Linux/macOS the builder is initialized from the system DNS
configuration (/etc/resolv.conf). On Android and iOS, which do not
expose /etc/resolv.conf, Google Public DNS is used as a fallback.
The returned builder can be adjusted before calling
ScionTxtDnsResolver::from_builder.
§Errors
Returns TxtResolverError if system configuration cannot be loaded (non-Android/iOS
platforms only).
Trait Implementations§
Source§impl Clone for ScionTxtDnsResolver
impl Clone for ScionTxtDnsResolver
Source§fn clone(&self) -> ScionTxtDnsResolver
fn clone(&self) -> ScionTxtDnsResolver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScionTxtDnsResolver
impl Debug for ScionTxtDnsResolver
Auto Trait Implementations§
impl !RefUnwindSafe for ScionTxtDnsResolver
impl !UnwindSafe for ScionTxtDnsResolver
impl Freeze for ScionTxtDnsResolver
impl Send for ScionTxtDnsResolver
impl Sync for ScionTxtDnsResolver
impl Unpin for ScionTxtDnsResolver
impl UnsafeUnpin for ScionTxtDnsResolver
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
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,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request