[−][src]Struct domain_resolv::stub::resolver::StubResolver
A DNS stub resolver.
This type collects all information making it possible to start DNS
queries. You can create a new resoler 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.
Methods
impl StubResolver
[src]
pub fn new() -> Self
[src]
Creates a new resolver using the system’s default configuration.
pub fn from_conf(conf: ResolvConf) -> Self
[src]
Creates a new resolver using the given configuraiton.
pub fn options(&self) -> &ResolvOptions
[src]
impl StubResolver
[src]
pub fn run<R, F>(op: F) -> Result<R::Item, R::Error> where
R: Future + Send + 'static,
R::Item: Send + 'static,
R::Error: Send + 'static,
F: FnOnce(StubResolver) -> R + Send + 'static,
[src]
R: Future + Send + 'static,
R::Item: Send + 'static,
R::Error: Send + 'static,
F: FnOnce(StubResolver) -> R + Send + 'static,
Synchronously perform a DNS operation atop a standard resolver.
This associated functions removes almost all boiler plate for the case that you want to perform some DNS operation, either a query or lookup, on a resolver using the system’s configuration and wait for the result.
The only argument is a closure taking a reference to a StubResolver
and returning a future. Whatever that future resolves to will be
returned.
pub fn run_with_conf<R, F>(conf: ResolvConf, op: F) -> Result<R::Item, R::Error> where
R: Future + Send + 'static,
R::Item: Send + 'static,
R::Error: Send + 'static,
F: FnOnce(StubResolver) -> R + Send + 'static,
[src]
R: Future + Send + 'static,
R::Item: Send + 'static,
R::Error: Send + 'static,
F: FnOnce(StubResolver) -> R + Send + 'static,
Synchronously perform a DNS operation atop a configured resolver.
This is like run()
but also takes a resolver configuration for
tailor-making your own resolver.
Trait Implementations
impl Resolver for StubResolver
[src]
type Answer = Answer
The answer returned by a query. Read more
type Query = Query
The future resolving into an answer.
fn query<N, Q>(&self, question: Q) -> Query where
N: ToDname,
Q: Into<Question<N>>,
[src]
N: ToDname,
Q: Into<Question<N>>,
fn lookup_addr(&self, addr: IpAddr) -> LookupAddr<Self> where
Self: Sized,
[src]
Self: Sized,
fn lookup_host<N: ToDname>(&self, name: &N) -> LookupHost<Self> where
Self: Sized,
[src]
Self: Sized,
fn search_host<N>(self, name: N) -> SearchHost<Self, N> where
Self: Sized + SearchNames,
N: ToRelativeDname,
[src]
Self: Sized + SearchNames,
N: ToRelativeDname,
fn lookup_srv<S, N>(
self,
service: S,
name: N,
fallback_port: u16
) -> LookupSrv<Self, S, N> where
Self: Sized,
S: ToRelativeDname + Clone + Send + 'static,
N: ToDname + Send + 'static,
[src]
self,
service: S,
name: N,
fallback_port: u16
) -> LookupSrv<Self, S, N> where
Self: Sized,
S: ToRelativeDname + Clone + Send + 'static,
N: ToDname + Send + 'static,
impl SearchNames for StubResolver
[src]
type Iter = SearchIter
fn search_iter(&self) -> Self::Iter
[src]
impl Clone for StubResolver
[src]
fn clone(&self) -> StubResolver
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for StubResolver
[src]
Auto Trait Implementations
impl Send for StubResolver
impl Sync for StubResolver
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,