Struct opendal::ObjectMultipart
source · pub struct ObjectMultipart { /* private fields */ }
Expand description
ObjectMultipart represent an ongoing multipart upload.
Process
create
-> write
-> complete to build a normal Object
-> abort to cancel upload and delete all existing parts
Notes
Before ObjectMultipart::complete
has been called, we can’t read any content from this multipart object.
Implementations§
source§impl ObjectMultipart
impl ObjectMultipart
sourcepub async fn write(
&self,
part_number: usize,
bs: impl Into<Vec<u8>>
) -> Result<ObjectPart>
pub async fn write(
&self,
part_number: usize,
bs: impl Into<Vec<u8>>
) -> Result<ObjectPart>
Write a new ObjectPart
with specified part number.
sourcepub async fn complete(&self, parts: Vec<ObjectPart>) -> Result<Object>
pub async fn complete(&self, parts: Vec<ObjectPart>) -> Result<Object>
Complete multipart uploads with specified parts.
Notes
- This operation will complete and finish this upload.
- This operation will concat input parts to build a new object.
- Input parts order is SENSITIVE, please make sure the order is correct.
sourcepub async fn abort(&self) -> Result<()>
pub async fn abort(&self) -> Result<()>
Abort multipart uploads.
Notes
- This operation will cancel this upload.
- This operation will remove all parts that already uploaded.
- This operation will return
succeeded
even when object or upload_id not exist.
sourcepub fn presign_write(
&self,
part_number: usize,
expire: Duration
) -> Result<PresignedRequest>
pub fn presign_write(
&self,
part_number: usize,
expire: Duration
) -> Result<PresignedRequest>
Presign an operation for write multipart.
TODO
User need to handle the response by self which may differ for different platforms.