pub trait MultipartCopy:
Send
+ Sync
+ Unpin
+ 'static {
// Required methods
fn source_metadata(
&self,
) -> impl Future<Output = Result<Metadata>> + MaybeSend;
fn copy_once(&self) -> impl Future<Output = Result<Metadata>> + MaybeSend;
fn initiate_copy(&self) -> impl Future<Output = Result<String>> + MaybeSend;
fn copy_part(
&self,
upload_id: &str,
part_number: usize,
range: BytesRange,
) -> impl Future<Output = Result<MultipartPart>> + MaybeSend;
fn complete_copy(
&self,
upload_id: &str,
parts: &[MultipartPart],
) -> impl Future<Output = Result<Metadata>> + MaybeSend;
fn abort_copy(
&self,
upload_id: &str,
) -> impl Future<Output = Result<()>> + 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§
Sourcefn source_metadata(&self) -> impl Future<Output = Result<Metadata>> + MaybeSend
fn source_metadata(&self) -> impl Future<Output = Result<Metadata>> + MaybeSend
source_metadata returns source metadata for planning multipart copy.
MultipartCopier will call this API when source content length hint is not provided.
Sourcefn copy_once(&self) -> impl Future<Output = Result<Metadata>> + MaybeSend
fn copy_once(&self) -> impl Future<Output = Result<Metadata>> + 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.
Sourcefn initiate_copy(&self) -> impl Future<Output = Result<String>> + MaybeSend
fn initiate_copy(&self) -> impl Future<Output = Result<String>> + MaybeSend
initiate_copy starts a multipart copy and returns the upload id.
Sourcefn copy_part(
&self,
upload_id: &str,
part_number: usize,
range: BytesRange,
) -> impl Future<Output = Result<MultipartPart>> + MaybeSend
fn copy_part( &self, upload_id: &str, part_number: usize, range: BytesRange, ) -> impl Future<Output = Result<MultipartPart>> + MaybeSend
copy_part copies one source range into one multipart upload part.
- part_number is the index of the part, starting from 0.
Sourcefn complete_copy(
&self,
upload_id: &str,
parts: &[MultipartPart],
) -> impl Future<Output = Result<Metadata>> + MaybeSend
fn complete_copy( &self, upload_id: &str, parts: &[MultipartPart], ) -> impl Future<Output = Result<Metadata>> + MaybeSend
complete_copy completes the multipart copy with the ordered part list.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".