1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use Arc;
use async_trait;
use ;
use PartId;
use crateError;
pub
// #[async_trait]
// impl PutPart for MultiPartUpload {
// async fn put_part(&self, buf: Vec<u8>, part_idx: usize) -> Result<PartId, object_store::Error> {
// let part = part_idx + 1;
// let response = self
// .client
// .upload_part()
// .bucket(&self.bucket)
// .key(&self.location)
// .upload_id(&self.upload_id)
// .part_number(part as i32)
// .body(ByteStream::from(buf))
// .send()
// .await
// .map_err(Error::from)?;
// Ok(PartId {
// content_id: response
// .e_tag()
// .map(|x| x.to_string())
// .ok_or(Error::Unknown)?,
// })
// }
// async fn complete(&self, completed_parts: Vec<PartId>) -> Result<(), object_store::Error> {
// let upload = CompletedMultipartUpload::builder().set_parts(Some(
// completed_parts
// .into_iter()
// .map(|x| {
// Ok(CompletedPart::builder()
// .part_number(x.content_id.parse()?)
// .build())
// })
// .collect::<Result<Vec<_>, Error>>()?,
// ));
// self.client
// .complete_multipart_upload()
// .bucket(&self.bucket)
// .key(&self.location)
// .upload_id(&self.upload_id)
// .multipart_upload(upload.build())
// .send()
// .await
// .map_err(Error::from)?;
// Ok(())
// }
// }