pub struct FilesResource { /* private fields */ }Expand description
Uploads, downloads, lists, and deletes files.
Implementations§
Source§impl FilesResource
impl FilesResource
Sourcepub async fn list(&self, query: &[(&str, &str)]) -> Result<JsonObject>
pub async fn list(&self, query: &[(&str, &str)]) -> Result<JsonObject>
Returns the file list envelope (data + pagination).
Sourcepub async fn get(&self, file_id: &str) -> Result<JsonObject>
pub async fn get(&self, file_id: &str) -> Result<JsonObject>
Returns a single file’s metadata.
Sourcepub async fn download(&self, file_id: &str) -> Result<Response>
pub async fn download(&self, file_id: &str) -> Result<Response>
Returns the raw HTTP response streaming the file content.
Sourcepub async fn upload(
&self,
path: &str,
content: Vec<u8>,
content_type: Option<&str>,
) -> Result<JsonObject>
pub async fn upload( &self, path: &str, content: Vec<u8>, content_type: Option<&str>, ) -> Result<JsonObject>
Uploads content to a slash-separated file path.
Sourcepub async fn initiate_upload(&self, body: impl Serialize) -> Result<JsonObject>
pub async fn initiate_upload(&self, body: impl Serialize) -> Result<JsonObject>
Starts a multipart upload.
Sourcepub async fn upload_part(
&self,
upload_id: &str,
part_number: u32,
content: Vec<u8>,
) -> Result<JsonObject>
pub async fn upload_part( &self, upload_id: &str, part_number: u32, content: Vec<u8>, ) -> Result<JsonObject>
Uploads one part of a multipart upload.
Sourcepub async fn complete_upload(&self, upload_id: &str) -> Result<JsonObject>
pub async fn complete_upload(&self, upload_id: &str) -> Result<JsonObject>
Finishes a multipart upload.
Sourcepub async fn abort_upload(&self, upload_id: &str) -> Result<()>
pub async fn abort_upload(&self, upload_id: &str) -> Result<()>
Cancels a multipart upload.
Auto 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