pub struct AppAuthDefaultClient { /* private fields */ }Available on crate feature 
default_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 = UreqRequest
 
type Request = UreqRequest
The concrete type of request supported by the client.
Source§fn execute(
    &self,
    request: Self::Request,
    body: &[u8],
) -> Result<HttpRequestResultRaw, Error>
 
fn execute( &self, request: Self::Request, body: &[u8], ) -> Result<HttpRequestResultRaw, Error>
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>) -> Result<bool, Error>
 
fn update_token(&self, _old_token: Arc<String>) -> Result<bool, Error>
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
Source§impl<T> HttpClient for Twhere
    T: HttpClient + Sync,
 
impl<T> HttpClient for Twhere
    T: HttpClient + Sync,
Source§type Request = <T as HttpClient>::Request
 
type Request = <T as HttpClient>::Request
The concrete type of request supported by the client.
Source§async fn execute(
    &self,
    request: <T as HttpClient>::Request,
    body: Bytes,
) -> Result<HttpRequestResultRaw, Error>
 
async fn execute( &self, request: <T as HttpClient>::Request, body: Bytes, ) -> Result<HttpRequestResultRaw, Error>
Make a HTTP request.
async fn execute_borrowed_body( &self, request: <T as HttpClient>::Request, body_slice: &[u8], ) -> Result<HttpRequestResultRaw, Error>
Source§fn new_request(&self, url: &str) -> <T as HttpClient>::Request
 
fn new_request(&self, url: &str) -> <T as HttpClient>::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.