pub struct DefaultClient { /* private fields */ }Expand description
Default HTTP client for this crate
Implementations§
source§impl DefaultClient
impl DefaultClient
pub fn new() -> Result<Self>
sourcepub async fn send_request<B>(
&self,
req: Request<B>,
) -> Result<(Response<Incoming>, Option<Upgrade>), Error>
pub async fn send_request<B>( &self, req: Request<B>, ) -> Result<(Response<Incoming>, Option<Upgrade>), Error>
Send a request and return a response. If the response is an upgrade (= if status code is 101 Switching Protocols), it will return a response and an Upgrade struct. Request should have a full URL including scheme.
Trait Implementations§
source§impl Clone for DefaultClient
impl Clone for DefaultClient
source§fn clone(&self) -> DefaultClient
fn clone(&self) -> DefaultClient
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for DefaultClient
impl RefUnwindSafe for DefaultClient
impl Send for DefaultClient
impl Sync for DefaultClient
impl Unpin for DefaultClient
impl UnwindSafe for DefaultClient
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)