MultipartCopy

Trait MultipartCopy 

Source
pub trait MultipartCopy:
    Send
    + Sync
    + Unpin
    + 'static {
    // Required methods
    fn source_metadata(
        &self,
    ) -> impl Future<Output = Result<Metadata, Error>> + MaybeSend;
    fn copy_once(&self) -> impl Future<Output = Result<(), Error>> + MaybeSend;
    fn initiate_copy(
        &self,
    ) -> impl Future<Output = Result<String, Error>> + MaybeSend;
    fn copy_part(
        &self,
        upload_id: &str,
        part_number: usize,
        range: BytesRange,
    ) -> impl Future<Output = Result<MultipartPart, Error>> + MaybeSend;
    fn complete_copy(
        &self,
        upload_id: &str,
        parts: &[MultipartPart],
    ) -> impl Future<Output = Result<(), Error>> + MaybeSend;
    fn abort_copy(
        &self,
        upload_id: &str,
    ) -> impl Future<Output = Result<(), Error>> + MaybeSend;
}
Expand description

MultipartCopy is used to implement oio::Copy based on multipart copy.

By implementing MultipartCopy, services only need to provide the service-specific multipart copy operations. MultipartCopier will drive the upload id, part queue, completion, and abort state.

Required Methods§

Source

fn source_metadata( &self, ) -> impl Future<Output = Result<Metadata, Error>> + MaybeSend

source_metadata returns source metadata for planning multipart copy.

MultipartCopier will call this API when source content length hint is not provided.

Source

fn copy_once(&self) -> impl Future<Output = Result<(), Error>> + MaybeSend

copy_once is used to copy the source object at once.

MultipartCopier will call this API when the source object can be copied without starting a multipart copy.

Source

fn initiate_copy( &self, ) -> impl Future<Output = Result<String, Error>> + MaybeSend

initiate_copy starts a multipart copy and returns the upload id.

Source

fn copy_part( &self, upload_id: &str, part_number: usize, range: BytesRange, ) -> impl Future<Output = Result<MultipartPart, Error>> + MaybeSend

copy_part copies one source range into one multipart upload part.

  • part_number is the index of the part, starting from 0.
Source

fn complete_copy( &self, upload_id: &str, parts: &[MultipartPart], ) -> impl Future<Output = Result<(), Error>> + MaybeSend

complete_copy completes the multipart copy with the ordered part list.

Source

fn abort_copy( &self, upload_id: &str, ) -> impl Future<Output = Result<(), Error>> + MaybeSend

abort_copy cancels the pending multipart copy and purges intermediate state.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§