pub trait Files:
Send
+ Sync
+ 'static {
// Required methods
fn provider(&self) -> &ProviderId;
fn upload_file(
&self,
options: UploadFileOptions,
) -> impl Future<Output = Result<UploadFileResult, ProviderError>> + Send;
// Provided methods
fn supports_get_file_metadata(&self) -> bool { ... }
fn get_file_metadata(
&self,
options: FileReferenceOptions,
) -> impl Future<Output = Result<FileMetadataResult, ProviderError>> + Send { ... }
fn supports_download_file(&self) -> bool { ... }
fn download_file(
&self,
options: FileReferenceOptions,
) -> impl Future<Output = Result<DownloadFileResult, ProviderError>> + Send { ... }
fn supports_delete_file(&self) -> bool { ... }
fn delete_file(
&self,
options: FileReferenceOptions,
) -> impl Future<Output = Result<DeleteFileResult, ProviderError>> + Send { ... }
}Expand description
Upload, inspect, download and delete files stored at the provider.
Only upload_file is required; the other operations
are gated by supports_* queries and default to an
UnsupportedFunctionality error.
Required Methods§
Sourcefn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier.
Sourcefn upload_file(
&self,
options: UploadFileOptions,
) -> impl Future<Output = Result<UploadFileResult, ProviderError>> + Send
fn upload_file( &self, options: UploadFileOptions, ) -> impl Future<Output = Result<UploadFileResult, ProviderError>> + Send
Uploads a file and returns its provider reference.
Provided Methods§
Sourcefn supports_get_file_metadata(&self) -> bool
fn supports_get_file_metadata(&self) -> bool
Whether get_file_metadata is implemented.
Sourcefn get_file_metadata(
&self,
options: FileReferenceOptions,
) -> impl Future<Output = Result<FileMetadataResult, ProviderError>> + Send
fn get_file_metadata( &self, options: FileReferenceOptions, ) -> impl Future<Output = Result<FileMetadataResult, ProviderError>> + Send
Fetches metadata of an uploaded file.
Sourcefn supports_download_file(&self) -> bool
fn supports_download_file(&self) -> bool
Whether download_file is implemented.
Sourcefn 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.
Sourcefn supports_delete_file(&self) -> bool
fn supports_delete_file(&self) -> bool
Whether delete_file is implemented.
Sourcefn delete_file(
&self,
options: FileReferenceOptions,
) -> impl Future<Output = Result<DeleteFileResult, ProviderError>> + Send
fn delete_file( &self, options: FileReferenceOptions, ) -> impl Future<Output = Result<DeleteFileResult, ProviderError>> + Send
Deletes an uploaded file.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".