pub struct UserAuthDefaultClient { /* private fields */ }
Available on crate feature
default_async_client
only.Expand description
Default HTTP client using User authorization.
Implementations§
Source§impl UserAuthDefaultClient
impl UserAuthDefaultClient
Sourcepub fn new(auth: Authorization) -> Self
pub fn new(auth: Authorization) -> Self
Create a new client using the given OAuth2 authorization.
Sourcepub fn from_token_cache(tokens: Arc<TokenCache>) -> Self
pub fn from_token_cache(tokens: Arc<TokenCache>) -> Self
Create a new client from a TokenCache
, which lets you share the same tokens between
multiple clients.
Sourcepub fn set_path_root(&mut self, path_root: &PathRoot)
pub fn set_path_root(&mut self, path_root: &PathRoot)
Set a root which all subsequent paths are evaluated relative to.
The default, if this function is not called, is to behave as if it was called with
PathRoot::Home
.
See https://www.dropbox.com/developers/reference/path-root-header-modes for more information.
Trait Implementations§
Source§impl HttpClient for UserAuthDefaultClient
impl HttpClient for UserAuthDefaultClient
Source§type Request = ReqwestRequest
type Request = ReqwestRequest
The concrete type of request supported by the client.
Source§fn execute(
&self,
request: Self::Request,
body: Bytes,
) -> impl Future<Output = Result<HttpRequestResultRaw, Error>> + Send
fn execute( &self, request: Self::Request, body: Bytes, ) -> impl Future<Output = Result<HttpRequestResultRaw, Error>> + Send
Make a HTTP request.
Source§fn new_request(&self, url: &str) -> Self::Request
fn new_request(&self, url: &str) -> Self::Request
Create a new request instance for the given URL. It should be a POST request.
Source§fn update_token(
&self,
old_token: Arc<String>,
) -> impl Future<Output = Result<bool, Error>> + Send
fn update_token( &self, old_token: Arc<String>, ) -> impl Future<Output = Result<bool, Error>> + Send
Attempt to update the current authentication token. The previously fetched token is given
as a way to avoid repeat updates in case of a race. If the update is successful, return
true
and the current request will be retried with a newly-fetched token. Return false
if
authentication is not supported, or return an error if the update operation fails.Source§fn team_select(&self) -> Option<&TeamSelect>
fn team_select(&self) -> Option<&TeamSelect>
The alternate user or team context currently set, if any.
impl UserAuthClient for UserAuthDefaultClient
Auto Trait Implementations§
impl Freeze for UserAuthDefaultClient
impl !RefUnwindSafe for UserAuthDefaultClient
impl Send for UserAuthDefaultClient
impl Sync for UserAuthDefaultClient
impl Unpin for UserAuthDefaultClient
impl !UnwindSafe for UserAuthDefaultClient
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