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 ToDname ) -> Result<FoundHosts<&Self>, Error>
pub async fn search_host( &self, qname: impl ToRelativeDname ) -> Result<FoundHosts<&Self>, Error>
sourcepub async fn lookup_srv(
&self,
service: impl ToRelativeDname,
name: impl ToDname,
fallback_port: u16
) -> Result<Option<FoundSrvs>, SrvError>
pub async fn lookup_srv( &self, service: impl ToRelativeDname, name: impl ToDname, 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 Clone for StubResolver
impl Clone for StubResolver
source§fn clone(&self) -> StubResolver
fn clone(&self) -> StubResolver
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§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 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<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) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,
Performs an infallible conversion.