pub struct Drive { /* private fields */ }Expand description
Typed Google Drive provider client. Obtain via
leash.integrations().drive() or .google_drive().
Implementations§
Source§impl Drive
impl Drive
Sourcepub async fn list_files(
&self,
params: DriveListFilesParams,
) -> Result<DriveFileList>
pub async fn list_files( &self, params: DriveListFilesParams, ) -> Result<DriveFileList>
List files from the user’s Drive. Pass Default::default() for platform defaults.
Sourcepub async fn get_file(&self, file_id: &str) -> Result<DriveFile>
pub async fn get_file(&self, file_id: &str) -> Result<DriveFile>
Retrieve a file’s metadata by ID.
Sourcepub async fn download_file(&self, file_id: &str) -> Result<Value>
pub async fn download_file(&self, file_id: &str) -> Result<Value>
Download a file’s content envelope (raw JSON — base64 bytes or text depending on file type).
Sourcepub async fn create_folder(
&self,
name: &str,
parent_id: Option<&str>,
) -> Result<DriveFile>
pub async fn create_folder( &self, name: &str, parent_id: Option<&str>, ) -> Result<DriveFile>
Create a new folder. Pass None for parent_id to create at the root of My Drive.
Sourcepub async fn upload_file(
&self,
params: DriveUploadFileParams,
) -> Result<DriveFile>
pub async fn upload_file( &self, params: DriveUploadFileParams, ) -> Result<DriveFile>
Upload a new file with the given content.
Sourcepub async fn delete_file(&self, file_id: &str) -> Result<Value>
pub async fn delete_file(&self, file_id: &str) -> Result<Value>
Permanently delete a file by ID.
Sourcepub async fn search_files(
&self,
query: &str,
max_results: Option<u32>,
) -> Result<DriveFileList>
pub async fn search_files( &self, query: &str, max_results: Option<u32>, ) -> Result<DriveFileList>
Run a Drive-syntax search query. Pass None for max_results to use the platform default.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Drive
impl !RefUnwindSafe for Drive
impl Send for Drive
impl Sync for Drive
impl Unpin for Drive
impl UnsafeUnpin for Drive
impl !UnwindSafe for Drive
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