[−][src]Struct google_drive::GoogleDrive
Entrypoint for interacting with the Google Drive API.
Implementations
impl GoogleDrive
[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]
Get the currently set authorization token.
pub async fn download_file_by_id<'_, '_>(
&'_ self,
id: &'_ str
) -> Result<Bytes, APIError>
[src]
&'_ self,
id: &'_ str
) -> Result<Bytes, APIError>
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]
&'_ self,
id: &'_ str
) -> Result<String, APIError>
Get a file's contents by it's ID. Only works for Google Docs.
pub async fn get_file_by_id<'_, '_>(
&'_ self,
id: &'_ str
) -> Result<File, APIError>
[src]
&'_ self,
id: &'_ str
) -> Result<File, APIError>
Get a file by it's ID.
pub async fn get_file_by_name<'_, '_, '_>(
&'_ self,
drive_id: &'_ str,
name: &'_ str
) -> Result<Vec<File>, APIError>
[src]
&'_ self,
drive_id: &'_ str,
name: &'_ str
) -> Result<Vec<File>, APIError>
Get a file by it's name.
pub async fn list_drives<'_>(&'_ self) -> Result<Vec<Drive>, APIError>
[src]
List drives.
pub async fn get_drive_by_name<'_>(
&'_ self,
name: String
) -> Result<Drive, APIError>
[src]
&'_ self,
name: String
) -> Result<Drive, APIError>
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]
&'_ self,
drive_id: &'_ str,
parent_id: &'_ str,
name: &'_ str
) -> Result<String, APIError>
Create a folder.
pub async fn upload_file<'_, '_, '_, '_>(
&'_ self,
drive_id: &'_ str,
file: PathBuf,
parent_id: &'_ str,
mime_type: &'_ str
) -> Result<(), APIError>
[src]
&'_ self,
drive_id: &'_ str,
file: PathBuf,
parent_id: &'_ str,
mime_type: &'_ str
) -> Result<(), APIError>
Upload a file.
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,