Trait qiniu_sdk::prelude::MultiPartsUploaderScheduler
source · [−]pub trait MultiPartsUploaderScheduler: Send + Sync + Debug {
type MultiPartsUploader: MultiPartsUploader;
fn new(multi_parts_uploader: Self::MultiPartsUploader) -> Self;
fn set_concurrency_provider(
&mut self,
concurrency_provider: impl ConcurrencyProvider + 'static
);
fn set_data_partition_provider(
&mut self,
data_partition_provider: impl DataPartitionProvider + 'static
);
fn upload<D>(&self, source: D, params: ObjectParams) -> Result<Value, Error>
where
D: 'static + DataSource<<<Self::MultiPartsUploader as MultiPartsUploader>::ResumableRecorder as ResumableRecorder>::HashAlgorithm>;
fn async_upload<D>(
&self,
source: D,
params: ObjectParams
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send, Global>>
where
D: 'static + DataSource<<<Self::MultiPartsUploader as MultiPartsUploader>::ResumableRecorder as ResumableRecorder>::HashAlgorithm>;
}
Expand description
分片上传调度器接口
负责分片上传的调度,包括初始化分片信息、上传分片、完成分片上传。
Required Associated Types
分片上传器
Required Methods
fn new(multi_parts_uploader: Self::MultiPartsUploader) -> Self
fn new(multi_parts_uploader: Self::MultiPartsUploader) -> Self
创建分片上传调度器
fn set_concurrency_provider(
&mut self,
concurrency_provider: impl ConcurrencyProvider + 'static
)
fn set_concurrency_provider(
&mut self,
concurrency_provider: impl ConcurrencyProvider + 'static
)
设置并发数提供者
fn set_data_partition_provider(
&mut self,
data_partition_provider: impl DataPartitionProvider + 'static
)
fn set_data_partition_provider(
&mut self,
data_partition_provider: impl DataPartitionProvider + 'static
)
设置分片大小提供者
fn upload<D>(&self, source: D, params: ObjectParams) -> Result<Value, Error> where
D: 'static + DataSource<<<Self::MultiPartsUploader as MultiPartsUploader>::ResumableRecorder as ResumableRecorder>::HashAlgorithm>,
fn upload<D>(&self, source: D, params: ObjectParams) -> Result<Value, Error> where
D: 'static + DataSource<<<Self::MultiPartsUploader as MultiPartsUploader>::ResumableRecorder as ResumableRecorder>::HashAlgorithm>,
上传数据源
该方法的异步版本为 Self::async_upload
。
fn async_upload<D>(
&self,
source: D,
params: ObjectParams
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send, Global>> where
D: 'static + DataSource<<<Self::MultiPartsUploader as MultiPartsUploader>::ResumableRecorder as ResumableRecorder>::HashAlgorithm>,
fn async_upload<D>(
&self,
source: D,
params: ObjectParams
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send, Global>> where
D: 'static + DataSource<<<Self::MultiPartsUploader as MultiPartsUploader>::ResumableRecorder as ResumableRecorder>::HashAlgorithm>,
异步上传数据源