pub struct ReqwestHttpClient {
pub client: Arc<Client>,
}Expand description
基于 reqwest 库的默认 HTTP 客户端实现。
Fields§
§client: Arc<Client>Implementations§
Trait Implementations§
Source§impl Clone for ReqwestHttpClient
impl Clone for ReqwestHttpClient
Source§fn clone(&self) -> ReqwestHttpClient
fn clone(&self) -> ReqwestHttpClient
Returns a duplicate 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 Default for ReqwestHttpClient
impl Default for ReqwestHttpClient
Source§fn default() -> ReqwestHttpClient
fn default() -> ReqwestHttpClient
Returns the “default value” for a type. Read more
Source§impl HttpClient for ReqwestHttpClient
基于 reqwest 库的默认 HTTP 客户端实现。
impl HttpClient for ReqwestHttpClient
基于 reqwest 库的默认 HTTP 客户端实现。
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
req: Request<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
req: Request<Vec<u8>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
使用 reqwest 执行请求,并将 http::Request 转换为 reqwest::Request,
再将 reqwest::Response 转换为 http::Response。
Auto Trait Implementations§
impl Freeze for ReqwestHttpClient
impl !RefUnwindSafe for ReqwestHttpClient
impl Send for ReqwestHttpClient
impl Sync for ReqwestHttpClient
impl Unpin for ReqwestHttpClient
impl !UnwindSafe for ReqwestHttpClient
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