Struct google_drive::GoogleDrive [−][src]
pub struct GoogleDrive { /* fields omitted */ }
Entrypoint for interacting with the Google Drive API.
Implementations
impl GoogleDrive
[src]
impl GoogleDrive
[src]pub fn new(token: AccessToken) -> Self
[src]
pub fn new(token: AccessToken) -> Self
[src]Create a new Drive client struct. It takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API Key and Secret your requests will work.
pub fn get_token(&self) -> &AccessToken
[src]
pub fn get_token(&self) -> &AccessToken
[src]Get the currently set authorization token.
pub async fn download_file_by_id(&self, id: &str) -> Result<Bytes, APIError>
[src]
pub async fn download_file_by_id(&self, id: &str) -> Result<Bytes, APIError>
[src]Download a file stored on Google Drive by it’s ID.
pub async fn get_file_contents_by_id(
&self,
id: &str
) -> Result<String, APIError>
[src]
pub async fn get_file_contents_by_id(
&self,
id: &str
) -> Result<String, APIError>
[src]Get a file’s contents by it’s ID. Only works for Google Docs.
pub async fn get_file_by_name(
&self,
drive_id: &str,
name: &str
) -> Result<Vec<File>, APIError>
[src]
pub async fn get_file_by_name(
&self,
drive_id: &str,
name: &str
) -> Result<Vec<File>, APIError>
[src]Get a file by it’s name.
pub async fn get_drive_by_name(&self, name: &str) -> Result<Drive, APIError>
[src]
pub async fn get_drive_by_name(&self, name: &str) -> Result<Drive, APIError>
[src]Get a drive by it’s name.
pub async fn create_folder(
&self,
drive_id: &str,
parent_id: &str,
name: &str
) -> Result<String, APIError>
[src]
pub async fn create_folder(
&self,
drive_id: &str,
parent_id: &str,
name: &str
) -> Result<String, APIError>
[src]Create a folder.
Auto Trait Implementations
impl !RefUnwindSafe for GoogleDrive
impl Send for GoogleDrive
impl Sync for GoogleDrive
impl Unpin for GoogleDrive
impl !UnwindSafe for GoogleDrive
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]