Struct domain::resolv::stub::StubResolver
source · pub struct StubResolver { /* private fields */ }
Expand description
A DNS stub resolver.
This type collects all information making it possible to start DNS
queries. You can create a new resolver using the system’s configuration
using the new
associate function or using your own configuration with
from_conf
.
Stub resolver values can be cloned relatively cheaply as they keep all information behind an arc.
If you want to run a single query or lookup on a resolver synchronously,
you can do so simply by using the run
or run_with_conf
associated
functions.
Implementations§
source§impl StubResolver
impl StubResolver
source§impl StubResolver
impl StubResolver
pub async fn lookup_addr( &self, addr: IpAddr, ) -> Result<FoundAddrs<&Self>, Error>
pub async fn lookup_host( &self, qname: impl ToName, ) -> Result<FoundHosts<&Self>, Error>
pub async fn search_host( &self, qname: impl ToRelativeName, ) -> Result<FoundHosts<&Self>, Error>
sourcepub async fn lookup_srv(
&self,
service: impl ToRelativeName,
name: impl ToName,
fallback_port: u16,
) -> Result<Option<FoundSrvs>, SrvError>
pub async fn lookup_srv( &self, service: impl ToRelativeName, name: impl ToName, fallback_port: u16, ) -> Result<Option<FoundSrvs>, SrvError>
Performs an SRV lookup using this resolver.
See the documentation for the lookup_srv
function for details.
Trait Implementations§
source§impl Debug for StubResolver
impl Debug for StubResolver
source§impl Default for StubResolver
impl Default for StubResolver
source§impl<'a> Resolver for &'a StubResolver
impl<'a> Resolver for &'a StubResolver
source§impl<'a> SearchNames for &'a StubResolver
impl<'a> SearchNames for &'a StubResolver
Auto Trait Implementations§
impl !Freeze for StubResolver
impl !RefUnwindSafe for StubResolver
impl Send for StubResolver
impl Sync for StubResolver
impl Unpin for StubResolver
impl UnwindSafe for StubResolver
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
Mutably borrows from an owned value. Read more
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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.