pub struct Client { /* private fields */ }Expand description
The shared transport. Cheap to clone (all state is Arc-backed).
Implementations§
Source§impl Client
impl Client
pub fn new(opts: Options) -> Result<Self, Error>
Sourcepub async fn request<R: DeserializeOwned>(
&self,
method: Method,
path: &str,
body: Option<&Value>,
requires_user_action: bool,
) -> Result<R, Error>
pub async fn request<R: DeserializeOwned>( &self, method: Method, path: &str, body: Option<&Value>, requires_user_action: bool, ) -> Result<R, Error>
Perform a request and decode a typed response.
Sourcepub async fn request_no_content(
&self,
method: Method,
path: &str,
body: Option<&Value>,
requires_user_action: bool,
) -> Result<(), Error>
pub async fn request_no_content( &self, method: Method, path: &str, body: Option<&Value>, requires_user_action: bool, ) -> Result<(), Error>
Perform a request that returns no meaningful body.
Sourcepub async fn request_multipart<R: DeserializeOwned>(
&self,
method: Method,
path: &str,
body: Option<&Value>,
file: MultipartFile,
requires_user_action: bool,
) -> Result<R, Error>
pub async fn request_multipart<R: DeserializeOwned>( &self, method: Method, path: &str, body: Option<&Value>, file: MultipartFile, requires_user_action: bool, ) -> Result<R, Error>
Perform a multipart/form-data upload and decode a typed response.
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