pub trait FilesModel:
Send
+ Sync
+ Debug {
// Required methods
fn provider(&self) -> &str;
fn upload_file<'life0, 'async_trait>(
&'life0 self,
options: UploadFileOptions,
) -> Pin<Box<dyn Future<Output = Result<UploadFileResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn specification_version(&self) -> &'static str { ... }
}Expand description
Contract every file-upload model implements.
Mirrors FilesV4.
Required Methods§
Sourcefn upload_file<'life0, 'async_trait>(
&'life0 self,
options: UploadFileOptions,
) -> Pin<Box<dyn Future<Output = Result<UploadFileResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upload_file<'life0, 'async_trait>(
&'life0 self,
options: UploadFileOptions,
) -> Pin<Box<dyn Future<Output = Result<UploadFileResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Upload a file to the provider and return a reusable reference.
§Errors
Returns a crate::ProviderError when the upstream call fails or
the response is malformed. Implementations should return
crate::ProviderError::invalid_argument when given an
UploadFileData variant the endpoint cannot handle.
Provided Methods§
Sourcefn specification_version(&self) -> &'static str
fn specification_version(&self) -> &'static str
Specification version (currently "v4").
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".