pub trait DataSource<A: Digest>: Debug + Sync + Send {
    fn slice(&self, size: PartSize) -> IoResult<Option<DataSourceReader>>;
    fn async_slice(
        &self,
        size: PartSize
    ) -> BoxFuture<'_, IoResult<Option<AsyncDataSourceReader>>>; fn total_size(&self) -> IoResult<Option<u64>>; fn source_key(&self) -> IoResult<Option<SourceKey<A>>> { ... } fn async_source_key(&self) -> BoxFuture<'_, IoResult<Option<SourceKey<A>>>> { ... } fn async_total_size(&self) -> BoxFuture<'_, IoResult<Option<u64>>> { ... } }
Expand description

数据源接口

提供上传所用的数据源

Required Methods

数据源切片

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

This is supported on crate feature async only.

异步数据源切片

获取数据源大小

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

Provided Methods

获取数据源 KEY

用于区分不同的数据源

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

This is supported on crate feature async only.

异步获取数据源 KEY

用于区分不同的数据源

This is supported on crate feature async only.

异步获取数据源大小

Implementations on Foreign Types

数据源切片

该方法的异步版本为 [Self::async_slice]。

This is supported on crate feature async only.

异步数据源切片

获取数据源 KEY

用于区分不同的数据源

该方法的异步版本为 [Self::async_source_key]。

This is supported on crate feature async only.

异步获取数据源 KEY

用于区分不同的数据源

获取数据源大小

该方法的异步版本为 [Self::async_total_size]。

This is supported on crate feature async only.

异步获取数据源大小

数据源切片

该方法的异步版本为 [Self::async_slice]。

This is supported on crate feature async only.

异步数据源切片

获取数据源 KEY

用于区分不同的数据源

该方法的异步版本为 [Self::async_source_key]。

This is supported on crate feature async only.

异步获取数据源 KEY

用于区分不同的数据源

获取数据源大小

该方法的异步版本为 [Self::async_total_size]。

This is supported on crate feature async only.

异步获取数据源大小

数据源切片

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

This is supported on crate feature async only.

异步数据源切片

获取数据源 KEY

用于区分不同的数据源

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

This is supported on crate feature async only.

异步获取数据源 KEY

用于区分不同的数据源

获取数据源大小

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

This is supported on crate feature async only.

异步获取数据源大小

数据源切片

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

This is supported on crate feature async only.

异步数据源切片

获取数据源 KEY

用于区分不同的数据源

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

This is supported on crate feature async only.

异步获取数据源 KEY

用于区分不同的数据源

获取数据源大小

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

This is supported on crate feature async only.

异步获取数据源大小

数据源切片

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

This is supported on crate feature async only.

异步数据源切片

获取数据源 KEY

用于区分不同的数据源

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

This is supported on crate feature async only.

异步获取数据源 KEY

用于区分不同的数据源

获取数据源大小

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

This is supported on crate feature async only.

异步获取数据源大小

Implementors