pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(config: ClientConfig) -> Self
pub fn config(&self) -> &ClientConfig
Sourcepub fn send(&self, req: &Request) -> Result<Response, HttpError>
pub fn send(&self, req: &Request) -> Result<Response, HttpError>
Buffered request; non-2xx becomes HttpError::Status.
Sourcepub fn send_any(&self, req: &Request) -> Result<Response, HttpError>
pub fn send_any(&self, req: &Request) -> Result<Response, HttpError>
Buffered request returning any final status (retryable statuses are still retried).
Sourcepub fn stream(&self, req: &Request) -> Result<StreamResponse, HttpError>
pub fn stream(&self, req: &Request) -> Result<StreamResponse, HttpError>
Streaming request; non-2xx becomes HttpError::Status. Retries happen
only before the response headers arrive (never mid-stream).
pub fn get_json<T: DeserializeOwned>(&self, url: &str) -> Result<T, HttpError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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