pub struct Client { /* private fields */ }Expand description
HTTP client
Implementations§
Source§impl Client
impl Client
pub fn new(headers: Option<HeaderMap>) -> Self
pub async fn get<T>(&self, url: T) -> Result<Response, Error>where
T: IntoUrl,
pub async fn get_with_headers<T>(
&self,
url: T,
headers: HashMap<String, String>,
) -> Result<Response, Error>where
T: IntoUrl,
pub async fn run(&self, request: RequestBuilder) -> Result<Response, Error>
pub async fn download<P, T>( &self, url: T, target_path: P, ) -> Result<usize, Error>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more