Trait qiniu_http_client::prelude::Resolver
source · [−]pub trait Resolver: Debug + Sync + Send {
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult;
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult> { ... }
}
Expand description
域名解析的接口
同时提供阻塞接口和异步接口,异步接口则需要启用 async
功能
Required Methods
sourcefn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
解析域名
该方法的异步版本为 Self::async_resolve
。
Provided Methods
sourcefn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
Available on crate feature
async
only.异步解析域名
Implementations on Foreign Types
sourceimpl<'b, T: 'b + Resolver + ?Sized> Resolver for &'b Twhere
&'b T: Debug + Sync + Send,
impl<'b, T: 'b + Resolver + ?Sized> Resolver for &'b Twhere
&'b T: Debug + Sync + Send,
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
sourcefn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
Available on crate feature
async
only.sourceimpl<'b, T: 'b + Resolver + ?Sized> Resolver for &'b mut Twhere
&'b mut T: Debug + Sync + Send,
impl<'b, T: 'b + Resolver + ?Sized> Resolver for &'b mut Twhere
&'b mut T: Debug + Sync + Send,
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
sourcefn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
Available on crate feature
async
only.sourceimpl<T: Resolver + ?Sized> Resolver for Box<T>where
Box<T>: Debug + Sync + Send,
impl<T: Resolver + ?Sized> Resolver for Box<T>where
Box<T>: Debug + Sync + Send,
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
sourcefn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
Available on crate feature
async
only.sourceimpl<T: Resolver + ?Sized> Resolver for Rc<T>where
Rc<T>: Debug + Sync + Send,
impl<T: Resolver + ?Sized> Resolver for Rc<T>where
Rc<T>: Debug + Sync + Send,
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
sourcefn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
Available on crate feature
async
only.sourceimpl<T: Resolver + ?Sized> Resolver for Arc<T>where
Arc<T>: Debug + Sync + Send,
impl<T: Resolver + ?Sized> Resolver for Arc<T>where
Arc<T>: Debug + Sync + Send,
fn resolve(&self, domain: &str, opts: ResolveOptions<'_>) -> ResolveResult
sourcefn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
fn async_resolve<'a>(
&'a self,
domain: &'a str,
opts: ResolveOptions<'a>
) -> BoxFuture<'a, ResolveResult>
Available on crate feature
async
only.