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.
Sourcepub async fn request_multipart_no_content(
&self,
method: Method,
path: &str,
body: Option<&Value>,
file: MultipartFile,
requires_user_action: bool,
) -> Result<(), Error>
pub async fn request_multipart_no_content( &self, method: Method, path: &str, body: Option<&Value>, file: MultipartFile, requires_user_action: bool, ) -> Result<(), Error>
Perform a multipart/form-data upload that returns no meaningful body.
Sourcepub async fn create_user_action_challenge(
&self,
method: Method,
path: &str,
body: Option<&Value>,
) -> Result<UserActionChallenge, Error>
pub async fn create_user_action_challenge( &self, method: Method, path: &str, body: Option<&Value>, ) -> Result<UserActionChallenge, Error>
Returns the challenge to sign for (method, path, body). The request must later be issued with the same (method, path, body).
Sourcepub async fn complete_user_action_signing(
&self,
challenge_identifier: String,
assertion: &CredentialAssertion,
) -> Result<String, Error>
pub async fn complete_user_action_signing( &self, challenge_identifier: String, assertion: &CredentialAssertion, ) -> Result<String, Error>
Submits an externally-signed assertion and returns the user action token.
Sourcepub async fn request_with_user_action<R: DeserializeOwned>(
&self,
method: Method,
path: &str,
body: Option<&Value>,
user_action_token: &str,
) -> Result<R, Error>
pub async fn request_with_user_action<R: DeserializeOwned>( &self, method: Method, path: &str, body: Option<&Value>, user_action_token: &str, ) -> Result<R, Error>
Performs a request with an already obtained user action token.
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