pub struct Files { /* private fields */ }Implementations§
Source§impl Files
impl Files
Sourcepub async fn upload(
&self,
data: Vec<u8>,
mime_type: impl Into<String>,
) -> Result<File>
pub async fn upload( &self, data: Vec<u8>, mime_type: impl Into<String>, ) -> Result<File>
上传文件(直接上传字节数据)。
Sourcepub async fn upload_with_config(
&self,
data: Vec<u8>,
config: UploadFileConfig,
) -> Result<File>
pub async fn upload_with_config( &self, data: Vec<u8>, config: UploadFileConfig, ) -> Result<File>
上传文件(自定义配置)。
Sourcepub async fn upload_from_path_with_config(
&self,
path: impl AsRef<Path>,
config: UploadFileConfig,
) -> Result<File>
pub async fn upload_from_path_with_config( &self, path: impl AsRef<Path>, config: UploadFileConfig, ) -> Result<File>
从文件路径上传(自定义配置)。
Sourcepub async fn download_with_config(
&self,
name_or_uri: impl AsRef<str>,
_config: DownloadFileConfig,
) -> Result<Vec<u8>>
pub async fn download_with_config( &self, name_or_uri: impl AsRef<str>, _config: DownloadFileConfig, ) -> Result<Vec<u8>>
下载文件(自定义配置)。
Sourcepub async fn list(&self) -> Result<ListFilesResponse>
pub async fn list(&self) -> Result<ListFilesResponse>
列出文件。
Sourcepub async fn list_with_config(
&self,
config: ListFilesConfig,
) -> Result<ListFilesResponse>
pub async fn list_with_config( &self, config: ListFilesConfig, ) -> Result<ListFilesResponse>
列出文件(自定义配置)。
Sourcepub async fn all_with_config(
&self,
config: ListFilesConfig,
) -> Result<Vec<File>>
pub async fn all_with_config( &self, config: ListFilesConfig, ) -> Result<Vec<File>>
列出所有文件(带配置,自动翻页)。
Sourcepub async fn wait_for_active(
&self,
name_or_uri: impl AsRef<str>,
config: WaitForFileConfig,
) -> Result<File>
pub async fn wait_for_active( &self, name_or_uri: impl AsRef<str>, config: WaitForFileConfig, ) -> Result<File>
轮询直到文件状态变为 ACTIVE。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Files
impl !RefUnwindSafe for Files
impl Send for Files
impl Sync for Files
impl Unpin for Files
impl !UnwindSafe for Files
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