pub trait ResumablePolicyProvider:
DynClone
+ Debug
+ Sync
+ Send {
// Required methods
fn get_policy_from_size(
&self,
source_size: u64,
opts: GetPolicyOptions,
) -> ResumablePolicy;
fn get_policy_from_reader<'a>(
&self,
reader: Box<dyn DynRead + 'a>,
opts: GetPolicyOptions,
) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>;
fn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>;
}
Expand description
可恢复策略获取接口
Required Methods§
Sourcefn get_policy_from_size(
&self,
source_size: u64,
opts: GetPolicyOptions,
) -> ResumablePolicy
fn get_policy_from_size( &self, source_size: u64, opts: GetPolicyOptions, ) -> ResumablePolicy
通过数据源大小获取可恢复策略
Sourcefn get_policy_from_reader<'a>(
&self,
reader: Box<dyn DynRead + 'a>,
opts: GetPolicyOptions,
) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
fn get_policy_from_reader<'a>( &self, reader: Box<dyn DynRead + 'a>, opts: GetPolicyOptions, ) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
Sourcefn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
Available on crate feature async
only.
fn get_policy_from_async_reader<'a>( &self, reader: Box<dyn DynAsyncRead + 'a>, opts: GetPolicyOptions, ) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
async
only.通过异步输入流获取可恢复策略
返回选择的可恢复策略,以及经过更新的异步输入流
Implementations on Foreign Types§
Source§impl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b T
impl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b T
fn get_policy_from_size( &self, source_size: u64, opts: GetPolicyOptions, ) -> ResumablePolicy
fn get_policy_from_reader<'a>( &self, reader: Box<dyn DynRead + 'a>, opts: GetPolicyOptions, ) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
Source§fn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
fn get_policy_from_async_reader<'a>( &self, reader: Box<dyn DynAsyncRead + 'a>, opts: GetPolicyOptions, ) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
Available on crate feature
async
only.Source§impl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b mut T
impl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b mut T
fn get_policy_from_size( &self, source_size: u64, opts: GetPolicyOptions, ) -> ResumablePolicy
fn get_policy_from_reader<'a>( &self, reader: Box<dyn DynRead + 'a>, opts: GetPolicyOptions, ) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
Source§fn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
fn get_policy_from_async_reader<'a>( &self, reader: Box<dyn DynAsyncRead + 'a>, opts: GetPolicyOptions, ) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
Available on crate feature
async
only.Source§impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Box<T>
impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Box<T>
fn get_policy_from_size( &self, source_size: u64, opts: GetPolicyOptions, ) -> ResumablePolicy
fn get_policy_from_reader<'a>( &self, reader: Box<dyn DynRead + 'a>, opts: GetPolicyOptions, ) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
Source§fn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
fn get_policy_from_async_reader<'a>( &self, reader: Box<dyn DynAsyncRead + 'a>, opts: GetPolicyOptions, ) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
Available on crate feature
async
only.Source§impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Rc<T>
impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Rc<T>
fn get_policy_from_size( &self, source_size: u64, opts: GetPolicyOptions, ) -> ResumablePolicy
fn get_policy_from_reader<'a>( &self, reader: Box<dyn DynRead + 'a>, opts: GetPolicyOptions, ) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
Source§fn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
fn get_policy_from_async_reader<'a>( &self, reader: Box<dyn DynAsyncRead + 'a>, opts: GetPolicyOptions, ) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
Available on crate feature
async
only.Source§impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Arc<T>
impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Arc<T>
fn get_policy_from_size( &self, source_size: u64, opts: GetPolicyOptions, ) -> ResumablePolicy
fn get_policy_from_reader<'a>( &self, reader: Box<dyn DynRead + 'a>, opts: GetPolicyOptions, ) -> IoResult<(ResumablePolicy, Box<dyn DynRead + 'a>)>
Source§fn get_policy_from_async_reader<'a>(
&self,
reader: Box<dyn DynAsyncRead + 'a>,
opts: GetPolicyOptions,
) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
fn get_policy_from_async_reader<'a>( &self, reader: Box<dyn DynAsyncRead + 'a>, opts: GetPolicyOptions, ) -> BoxFuture<'a, IoResult<(ResumablePolicy, Box<dyn DynAsyncRead + 'a>)>>
Available on crate feature
async
only.