1use crate::{Result, StorageClient};
4
5#[derive(Debug, Clone)]
7pub struct MultipartUpload {
8 pub upload_id: String,
9 pub bucket: String,
10 pub key: String,
11}
12
13impl StorageClient {
14 pub async fn create_multipart_upload(
16 &self,
17 bucket: &str,
18 key: &str,
19 ) -> Result<MultipartUpload> {
20 Ok(MultipartUpload {
23 upload_id: uuid::Uuid::new_v4().to_string(),
24 bucket: bucket.to_string(),
25 key: key.to_string(),
26 })
27 }
28
29 pub async fn upload_part(
31 &self,
32 bucket: &str,
33 key: &str,
34 upload_id: &str,
35 part_number: i32,
36 body: Vec<u8>,
37 ) -> Result<String> {
38 Ok("part-etag".to_string())
42 }
43
44 pub async fn complete_multipart_upload(
46 &self,
47 bucket: &str,
48 key: &str,
49 upload_id: &str,
50 parts: Vec<(i32, String)>, ) -> Result<()> {
52 Ok(())
54 }
55
56 pub async fn abort_multipart_upload(
58 &self,
59 bucket: &str,
60 key: &str,
61 upload_id: &str,
62 ) -> Result<()> {
63 Ok(())
65 }
66}