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
sourceimpl ObjectMultipart
impl ObjectMultipart
sourcepub fn new(acc: Arc<dyn Accessor>, path: &str, upload_id: &str) -> Self
pub fn new(acc: Arc<dyn Accessor>, path: &str, upload_id: &str) -> Self
Build a new MultipartObject.
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.
Auto Trait Implementations
impl !RefUnwindSafe for ObjectMultipart
impl Send for ObjectMultipart
impl Sync for ObjectMultipart
impl Unpin for ObjectMultipart
impl !UnwindSafe for ObjectMultipart
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more