pub trait MultiPartsUploader: MultiPartsUploaderWithCallbacks + Send + Sync + Debug {
    type ResumableRecorder: 'static + ResumableRecorder;
    type InitializedParts: 'static + InitializedParts;
    type UploadedPart: 'static + UploadedPart;

    fn new(
        upload_manager: UploadManager,
        resumable_recorder: Self::ResumableRecorder
    ) -> Self; fn initialize_parts<D>(
        &self,
        source: D,
        params: ObjectParams
    ) -> Result<Self::InitializedParts, Error>
    where
        D: 'static + DataSource<<Self::ResumableRecorder as ResumableRecorder>::HashAlgorithm>
; fn upload_part(
        &self,
        initialized: &Self::InitializedParts,
        data_partitioner_provider: &dyn DataPartitionProvider
    ) -> Result<Option<Self::UploadedPart>, Error>; fn complete_parts(
        &self,
        initialized: Self::InitializedParts,
        parts: Vec<Self::UploadedPart, Global>
    ) -> Result<Value, Error>; fn async_initialize_parts<D>(
        &self,
        source: D,
        params: ObjectParams
    ) -> Pin<Box<dyn Future<Output = Result<Self::InitializedParts, Error>> + Send, Global>>
    where
        D: 'static + DataSource<<Self::ResumableRecorder as ResumableRecorder>::HashAlgorithm>
; fn async_upload_part(
        &'r self,
        initialized: &'r Self::InitializedParts,
        data_partitioner_provider: &'r (dyn DataPartitionProvider + 'r)
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::UploadedPart>, Error>> + Send + 'r, Global>>; fn async_complete_parts(
        &self,
        initialized: Self::InitializedParts,
        parts: Vec<Self::UploadedPart, Global>
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send, Global>>; }
Expand description

分片上传器接口

将数据源通过多个分片的方式逐一上传,适合数据量较大的数据源,可以提供断点恢复的能力。

Required Associated Types

断点恢复记录器

初始化的分片信息

已经上传的分片信息

Required Methods

创建分片上传器

初始化分片信息

该步骤只负责初始化分片,但不实际上传数据,如果提供了有效的断点续传记录器,则可以尝试在这一步找到记录。

该方法的异步版本为 Self::async_initialize_parts

上传分片

实际上传的分片大小由提供的分片大小提供者获取。

如果返回 [Ok(None)] 则表示已经没有更多分片可以上传。

该方法的异步版本为 Self::async_upload_part

完成分片上传

在这步成功返回后,对象即可被读取。

该方法的异步版本为 Self::async_complete_parts

异步初始化分片信息

该步骤只负责初始化分片,但不实际上传数据,如果提供了有效的断点续传记录器,则可以尝试在这一步找到记录。

异步上传分片

实际上传的分片大小由提供的分片大小提供者获取。

如果返回 [Ok(None)] 则表示已经没有更多分片可以上传。

异步完成分片上传

在这步成功返回后,对象即可被读取。

Implementors