pub trait HttpCaller: Debug + Send + Sync {
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>;
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>;
fn is_resolved_ip_addrs_supported(&self) -> bool { ... }
fn is_response_metrics_supported(&self) -> bool { ... }
}
Expand description
HTTP 请求处理接口
实现该接口,即可处理所有七牛 SDK 发送的 HTTP 请求
Required methods
阻塞发送 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
impl<T> HttpCaller for Rc<T> where
T: HttpCaller + ?Sized,
Rc<T>: Debug,
Rc<T>: Send,
Rc<T>: Sync,
impl<T> HttpCaller for Rc<T> where
T: HttpCaller + ?Sized,
Rc<T>: Debug,
Rc<T>: Send,
Rc<T>: Sync,
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
阻塞发送 HTTP 请求
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
异步发送 HTTP 请求
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
是否返回响应指标信息功能
impl<'b, T> HttpCaller for &'b mut T where
T: 'b + HttpCaller + ?Sized,
&'b mut T: Debug,
&'b mut T: Send,
&'b mut T: Sync,
impl<'b, T> HttpCaller for &'b mut T where
T: 'b + HttpCaller + ?Sized,
&'b mut T: Debug,
&'b mut T: Send,
&'b mut T: Sync,
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
阻塞发送 HTTP 请求
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
异步发送 HTTP 请求
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
是否返回响应指标信息功能
impl<T> HttpCaller for Arc<T> where
T: HttpCaller + ?Sized,
Arc<T>: Debug,
Arc<T>: Send,
Arc<T>: Sync,
impl<T> HttpCaller for Arc<T> where
T: HttpCaller + ?Sized,
Arc<T>: Debug,
Arc<T>: Send,
Arc<T>: Sync,
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
阻塞发送 HTTP 请求
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
异步发送 HTTP 请求
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
是否返回响应指标信息功能
impl<'b, T> HttpCaller for &'b T where
T: 'b + HttpCaller + ?Sized,
&'b T: Debug,
&'b T: Send,
&'b T: Sync,
impl<'b, T> HttpCaller for &'b T where
T: 'b + HttpCaller + ?Sized,
&'b T: Debug,
&'b T: Send,
&'b T: Sync,
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
阻塞发送 HTTP 请求
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
异步发送 HTTP 请求
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
是否返回响应指标信息功能
impl<T> HttpCaller for Box<T, Global> where
T: HttpCaller + ?Sized,
Box<T, Global>: Debug,
Box<T, Global>: Send,
Box<T, Global>: Sync,
impl<T> HttpCaller for Box<T, Global> where
T: HttpCaller + ?Sized,
Box<T, Global>: Debug,
Box<T, Global>: Send,
Box<T, Global>: Sync,
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
fn call(
&self,
request: &mut Request<'_, RequestBody<'_>>
) -> Result<Response<ResponseBody>, Error>
阻塞发送 HTTP 请求
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
fn async_call(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>
) -> Pin<Box<dyn Future<Output = Result<Response<AsyncResponseBody>, Error>> + Send + 'a, Global>>
异步发送 HTTP 请求
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
是否返回响应指标信息功能