pub struct AppAuthDefaultClient { /* private fields */ }
Available on crate feature
default_async_client
only.Expand description
Default HTTP client using App authorization.
Implementations§
Source§impl AppAuthDefaultClient
impl AppAuthDefaultClient
Sourcepub fn new(app_key: &str, app_secret: &str) -> Self
pub fn new(app_key: &str, app_secret: &str) -> Self
Create a new App auth client using the given app key and secret, which can be found in the Dropbox app console.
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 Debug for AppAuthDefaultClient
impl Debug for AppAuthDefaultClient
Source§impl HttpClient for AppAuthDefaultClient
impl HttpClient for AppAuthDefaultClient
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 AppAuthClient for AppAuthDefaultClient
Auto Trait Implementations§
impl Freeze for AppAuthDefaultClient
impl !RefUnwindSafe for AppAuthDefaultClient
impl Send for AppAuthDefaultClient
impl Sync for AppAuthDefaultClient
impl Unpin for AppAuthDefaultClient
impl !UnwindSafe for AppAuthDefaultClient
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