pub struct Client<MW = NoopResponseMiddleware> { /* private fields */ }Expand description
Wrapper client that exposes ergonomic request builders with rate limiting.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder<NoopResponseMiddleware>
pub fn builder() -> ClientBuilder<NoopResponseMiddleware>
Start building a wrapper client with default middleware.
Source§impl<MW> Client<MW>where
MW: ResponseMiddleware + Clone,
impl<MW> Client<MW>where
MW: ResponseMiddleware + Clone,
Sourcepub fn get<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
pub fn get<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
Begin a GET request.
Sourcepub fn post<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
pub fn post<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
Begin a POST request.
Sourcepub fn put<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
pub fn put<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
Begin a PUT request.
Sourcepub fn patch<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
pub fn patch<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
Begin a PATCH request.
Sourcepub fn delete<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
pub fn delete<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
Begin a DELETE request.
Sourcepub fn head<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
pub fn head<U: IntoUrl>(&self, url: U) -> RequestBuilder<MW>
Begin a HEAD request.
Sourcepub fn request<U: IntoUrl>(&self, method: Method, url: U) -> RequestBuilder<MW>
pub fn request<U: IntoUrl>(&self, method: Method, url: U) -> RequestBuilder<MW>
Begin a request with an explicit HTTP method.
Trait Implementations§
Auto Trait Implementations§
impl<MW> Freeze for Client<MW>where
MW: Freeze,
impl<MW = NoopResponseMiddleware> !RefUnwindSafe for Client<MW>
impl<MW> Send for Client<MW>where
MW: Send,
impl<MW> Sync for Client<MW>where
MW: Sync,
impl<MW> Unpin for Client<MW>where
MW: Unpin,
impl<MW> UnsafeUnpin for Client<MW>where
MW: UnsafeUnpin,
impl<MW = NoopResponseMiddleware> !UnwindSafe for Client<MW>
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