pub struct GoogleFiles { /* private fields */ }Expand description
Files service backed by the Files API.
Implementations§
Source§impl GoogleFiles
impl GoogleFiles
Sourcepub fn new(config: SharedConfig) -> Self
pub fn new(config: SharedConfig) -> Self
Creates the service.
Sourcepub fn to_result(&self, file: &GoogleFile) -> UploadFileResult
pub fn to_result(&self, file: &GoogleFile) -> UploadFileResult
Maps a file resource to the specification result.
Sourcepub async fn fetch_file(
&self,
name: &str,
headers: &Headers,
cancellation: CancellationToken,
) -> Result<GoogleFile, ProviderError>
pub async fn fetch_file( &self, name: &str, headers: &Headers, cancellation: CancellationToken, ) -> Result<GoogleFile, ProviderError>
Sourcepub async fn upload_bytes(
&self,
request: UploadRequest,
) -> Result<GoogleFile, ProviderError>
pub async fn upload_bytes( &self, request: UploadRequest, ) -> Result<GoogleFile, ProviderError>
Uploads bytes through the resumable protocol and waits until the file
leaves the PROCESSING state.
§Errors
Returns ProviderError::InvalidResponseData when the upload session
returns no upload URL, ProviderError::ApiCall when processing
fails or times out, and ProviderError::Cancelled when the token
fires while polling.
Trait Implementations§
Source§impl Clone for GoogleFiles
impl Clone for GoogleFiles
Source§fn clone(&self) -> GoogleFiles
fn clone(&self) -> GoogleFiles
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GoogleFiles
impl Debug for GoogleFiles
Source§impl Files for GoogleFiles
impl Files for GoogleFiles
Source§fn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier.
Source§async fn upload_file(
&self,
options: UploadFileOptions,
) -> Result<UploadFileResult, ProviderError>
async fn upload_file( &self, options: UploadFileOptions, ) -> Result<UploadFileResult, ProviderError>
Uploads a file and returns its provider reference.
Source§fn supports_get_file_metadata(&self) -> bool
fn supports_get_file_metadata(&self) -> bool
Whether
get_file_metadata is implemented.Source§async fn get_file_metadata(
&self,
options: FileReferenceOptions,
) -> Result<FileMetadataResult, ProviderError>
async fn get_file_metadata( &self, options: FileReferenceOptions, ) -> Result<FileMetadataResult, ProviderError>
Fetches metadata of an uploaded file.
Source§fn supports_delete_file(&self) -> bool
fn supports_delete_file(&self) -> bool
Whether
delete_file is implemented.Source§async fn delete_file(
&self,
options: FileReferenceOptions,
) -> Result<DeleteFileResult, ProviderError>
async fn delete_file( &self, options: FileReferenceOptions, ) -> Result<DeleteFileResult, ProviderError>
Deletes an uploaded file.
Source§fn supports_download_file(&self) -> bool
fn supports_download_file(&self) -> bool
Whether
download_file is implemented.Source§fn download_file(
&self,
options: FileReferenceOptions,
) -> impl Future<Output = Result<DownloadFileResult, ProviderError>> + Send
fn download_file( &self, options: FileReferenceOptions, ) -> impl Future<Output = Result<DownloadFileResult, ProviderError>> + Send
Downloads an uploaded file.
Auto Trait Implementations§
impl !RefUnwindSafe for GoogleFiles
impl !UnwindSafe for GoogleFiles
impl Freeze for GoogleFiles
impl Send for GoogleFiles
impl Sync for GoogleFiles
impl Unpin for GoogleFiles
impl UnsafeUnpin for GoogleFiles
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynFiles for Twhere
T: Files,
impl<T> DynFiles for Twhere
T: Files,
Source§fn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
See
Files::provider.Source§fn upload_file(
&self,
options: UploadFileOptions,
) -> Pin<Box<dyn Future<Output = Result<UploadFileResult, ProviderError>> + Send + '_>>
fn upload_file( &self, options: UploadFileOptions, ) -> Pin<Box<dyn Future<Output = Result<UploadFileResult, ProviderError>> + Send + '_>>
See
Files::upload_file.Source§fn supports_get_file_metadata(&self) -> bool
fn supports_get_file_metadata(&self) -> bool
Source§fn get_file_metadata(
&self,
options: FileReferenceOptions,
) -> Pin<Box<dyn Future<Output = Result<UploadFileResult, ProviderError>> + Send + '_>>
fn get_file_metadata( &self, options: FileReferenceOptions, ) -> Pin<Box<dyn Future<Output = Result<UploadFileResult, ProviderError>> + Send + '_>>
Source§fn supports_download_file(&self) -> bool
fn supports_download_file(&self) -> bool
Source§fn download_file(
&self,
options: FileReferenceOptions,
) -> Pin<Box<dyn Future<Output = Result<DownloadFileResult, ProviderError>> + Send + '_>>
fn download_file( &self, options: FileReferenceOptions, ) -> Pin<Box<dyn Future<Output = Result<DownloadFileResult, ProviderError>> + Send + '_>>
See
Files::download_file.Source§fn supports_delete_file(&self) -> bool
fn supports_delete_file(&self) -> bool
Source§fn delete_file(
&self,
options: FileReferenceOptions,
) -> Pin<Box<dyn Future<Output = Result<DeleteFileResult, ProviderError>> + Send + '_>>
fn delete_file( &self, options: FileReferenceOptions, ) -> Pin<Box<dyn Future<Output = Result<DeleteFileResult, ProviderError>> + Send + '_>>
See
Files::delete_file.