pub struct FilesResource { /* private fields */ }Expand description
EN: Files API resource. 中文:Files API 资源。
Implementations§
Source§impl FilesResource
impl FilesResource
Sourcepub async fn create(
&self,
request: CreateFileRequest,
) -> Result<FileObject, LingerError>
pub async fn create( &self, request: CreateFileRequest, ) -> Result<FileObject, LingerError>
EN: Uploads a file with POST /v1/files.
中文:使用 POST /v1/files 上传文件。
Sourcepub async fn list(&self) -> Result<FilesPage, LingerError>
pub async fn list(&self) -> Result<FilesPage, LingerError>
EN: Lists files with GET /v1/files.
中文:使用 GET /v1/files 列出文件。
Sourcepub async fn retrieve(&self, file_id: &str) -> Result<FileObject, LingerError>
pub async fn retrieve(&self, file_id: &str) -> Result<FileObject, LingerError>
EN: Retrieves a file with GET /v1/files/{file_id}.
中文:使用 GET /v1/files/{file_id} 获取文件。
Sourcepub async fn delete(&self, file_id: &str) -> Result<FileDeletion, LingerError>
pub async fn delete(&self, file_id: &str) -> Result<FileDeletion, LingerError>
EN: Deletes a file with DELETE /v1/files/{file_id}.
中文:使用 DELETE /v1/files/{file_id} 删除文件。
Sourcepub async fn content(&self, file_id: &str) -> Result<FileContent, LingerError>
pub async fn content(&self, file_id: &str) -> Result<FileContent, LingerError>
EN: Downloads file content with GET /v1/files/{file_id}/content.
中文:使用 GET /v1/files/{file_id}/content 下载文件内容。
Trait Implementations§
Source§impl Clone for FilesResource
impl Clone for FilesResource
Source§fn clone(&self) -> FilesResource
fn clone(&self) -> FilesResource
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for FilesResource
impl !UnwindSafe for FilesResource
impl Freeze for FilesResource
impl Send for FilesResource
impl Sync for FilesResource
impl Unpin for FilesResource
impl UnsafeUnpin for FilesResource
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