Trait qiniu_http::HttpCaller
source · [−]pub trait HttpCaller: Debug + Send + Sync {
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult;
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>;
fn is_resolved_ip_addrs_supported(&self) -> bool { ... }
fn is_response_metrics_supported(&self) -> bool { ... }
}
Expand description
HTTP 请求处理接口
实现该接口,即可处理所有七牛 SDK 发送的 HTTP 请求
Required Methods
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
阻塞发送 HTTP 请求
该方法的异步版本为 Self::async_call
。
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
Available on crate feature
async
only.异步发送 HTTP 请求
Provided Methods
fn is_resolved_ip_addrs_supported(&self) -> bool
fn is_resolved_ip_addrs_supported(&self) -> bool
是否实现了 IP 地址解析功能
fn is_response_metrics_supported(&self) -> bool
fn is_response_metrics_supported(&self) -> bool
是否返回响应指标信息功能
Implementations on Foreign Types
sourceimpl<'b, T: 'b + HttpCaller + ?Sized> HttpCaller for &'b T where
&'b T: Debug + Send + Sync,
impl<'b, T: 'b + HttpCaller + ?Sized> HttpCaller for &'b T where
&'b T: Debug + Send + Sync,
sourcefn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
阻塞发送 HTTP 请求
该方法的异步版本为 [Self::async_call
]。
sourcefn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
Available on crate feature async
only.
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
async
only.异步发送 HTTP 请求
sourcefn is_resolved_ip_addrs_supported(&self) -> bool
fn is_resolved_ip_addrs_supported(&self) -> bool
是否实现了 IP 地址解析功能
sourcefn is_response_metrics_supported(&self) -> bool
fn is_response_metrics_supported(&self) -> bool
是否返回响应指标信息功能
sourceimpl<'b, T: 'b + HttpCaller + ?Sized> HttpCaller for &'b mut T where
&'b mut T: Debug + Send + Sync,
impl<'b, T: 'b + HttpCaller + ?Sized> HttpCaller for &'b mut T where
&'b mut T: Debug + Send + Sync,
sourcefn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
阻塞发送 HTTP 请求
该方法的异步版本为 [Self::async_call
]。
sourcefn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
Available on crate feature async
only.
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
async
only.异步发送 HTTP 请求
sourcefn is_resolved_ip_addrs_supported(&self) -> bool
fn is_resolved_ip_addrs_supported(&self) -> bool
是否实现了 IP 地址解析功能
sourcefn is_response_metrics_supported(&self) -> bool
fn is_response_metrics_supported(&self) -> bool
是否返回响应指标信息功能
sourceimpl<T: HttpCaller + ?Sized> HttpCaller for Box<T> where
Box<T>: Debug + Send + Sync,
impl<T: HttpCaller + ?Sized> HttpCaller for Box<T> where
Box<T>: Debug + Send + Sync,
sourcefn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
阻塞发送 HTTP 请求
该方法的异步版本为 Self::async_call
。
sourcefn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
Available on crate feature async
only.
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
async
only.异步发送 HTTP 请求
sourcefn is_resolved_ip_addrs_supported(&self) -> bool
fn is_resolved_ip_addrs_supported(&self) -> bool
是否实现了 IP 地址解析功能
sourcefn is_response_metrics_supported(&self) -> bool
fn is_response_metrics_supported(&self) -> bool
是否返回响应指标信息功能
sourceimpl<T: HttpCaller + ?Sized> HttpCaller for Rc<T> where
Rc<T>: Debug + Send + Sync,
impl<T: HttpCaller + ?Sized> HttpCaller for Rc<T> where
Rc<T>: Debug + Send + Sync,
sourcefn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
阻塞发送 HTTP 请求
该方法的异步版本为 Self::async_call
。
sourcefn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
Available on crate feature async
only.
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
async
only.异步发送 HTTP 请求
sourcefn is_resolved_ip_addrs_supported(&self) -> bool
fn is_resolved_ip_addrs_supported(&self) -> bool
是否实现了 IP 地址解析功能
sourcefn is_response_metrics_supported(&self) -> bool
fn is_response_metrics_supported(&self) -> bool
是否返回响应指标信息功能
sourceimpl<T: HttpCaller + ?Sized> HttpCaller for Arc<T> where
Arc<T>: Debug + Send + Sync,
impl<T: HttpCaller + ?Sized> HttpCaller for Arc<T> where
Arc<T>: Debug + Send + Sync,
sourcefn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
fn call(&self, request: &mut SyncRequest<'_>) -> SyncResponseResult
阻塞发送 HTTP 请求
该方法的异步版本为 Self::async_call
。
sourcefn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
Available on crate feature async
only.
fn async_call<'a>(
&'a self,
request: &'a mut AsyncRequest<'_>
) -> Pin<Box<dyn Future<Output = AsyncResponseResult> + Send + 'a>>
async
only.异步发送 HTTP 请求
sourcefn is_resolved_ip_addrs_supported(&self) -> bool
fn is_resolved_ip_addrs_supported(&self) -> bool
是否实现了 IP 地址解析功能
sourcefn is_response_metrics_supported(&self) -> bool
fn is_response_metrics_supported(&self) -> bool
是否返回响应指标信息功能