Trait AsyncDataSource

Source
pub trait AsyncDataSource<A>:
    DynClone
    + Debug
    + Sync
    + Send
where A: Digest,
{ // Required methods fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>; fn reset( &self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>; fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>; fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>; }
Expand description

异步数据源接口

提供上传所用的数据源

Required Methods§

Source

fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>

异步数据源切片

Source

fn reset(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

异步重置数据源

Source

fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>

异步获取数据源 KEY

用于区分不同的数据源

Source

fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>

异步获取数据源大小

Trait Implementations§

Source§

impl<'clone, A> Clone for Box<dyn AsyncDataSource<A> + 'clone>
where A: Digest,

Source§

fn clone(&self) -> Box<dyn AsyncDataSource<A> + 'clone>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone, A> Clone for Box<dyn AsyncDataSource<A> + Send + 'clone>
where A: Digest,

Source§

fn clone(&self) -> Box<dyn AsyncDataSource<A> + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone, A> Clone for Box<dyn AsyncDataSource<A> + Sync + Send + 'clone>
where A: Digest,

Source§

fn clone(&self) -> Box<dyn AsyncDataSource<A> + Sync + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone, A> Clone for Box<dyn AsyncDataSource<A> + Sync + 'clone>
where A: Digest,

Source§

fn clone(&self) -> Box<dyn AsyncDataSource<A> + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementations on Foreign Types§

Source§

impl<'a, A, T> AsyncDataSource<A> for &'a T
where A: Digest, T: 'a + AsyncDataSource<A> + ?Sized, &'a T: DynClone + Debug + Sync + Send,

Source§

fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>

Source§

fn reset(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Source§

fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>

Source§

fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>

Source§

impl<'a, A, T> AsyncDataSource<A> for &'a mut T
where A: Digest, T: 'a + AsyncDataSource<A> + ?Sized, &'a mut T: DynClone + Debug + Sync + Send,

Source§

fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>

Source§

fn reset(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Source§

fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>

Source§

fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>

Source§

impl<A, T> AsyncDataSource<A> for Box<T>
where A: Digest, T: AsyncDataSource<A> + ?Sized, Box<T>: DynClone + Debug + Sync + Send,

Source§

fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>

Source§

fn reset(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Source§

fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>

Source§

fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>

Source§

impl<A, T> AsyncDataSource<A> for Rc<T>
where A: Digest, T: AsyncDataSource<A> + ?Sized, Rc<T>: DynClone + Debug + Sync + Send,

Source§

fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>

Source§

fn reset(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Source§

fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>

Source§

fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>

Source§

impl<A, T> AsyncDataSource<A> for Arc<T>
where A: Digest, T: AsyncDataSource<A> + ?Sized, Arc<T>: DynClone + Debug + Sync + Send,

Source§

fn slice( &self, size: PartSize, ) -> Pin<Box<dyn Future<Output = Result<Option<AsyncDataSourceReader>, Error>> + Send + '_>>

Source§

fn reset(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Source§

fn source_key( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceKey<A>>, Error>> + Send + '_>>

Source§

fn total_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + '_>>

Implementors§

Source§

impl<A> AsyncDataSource<A> for AsyncFileDataSource<A>
where A: Digest + Send,

Source§

impl<R, A> AsyncDataSource<A> for AsyncUnseekableDataSource<R, A>
where R: AsyncRead + Debug + Unpin + Send + Sync + 'static, A: Digest,