pub trait ResumablePolicyProvider: DynClone + Debug + Sync + Send {
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>)>>
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.通过异步输入流获取可恢复策略
返回选择的可恢复策略,以及经过更新的异步输入流
Trait Implementations
sourceimpl<'clone> Clone for Box<dyn ResumablePolicyProvider + 'clone>
impl<'clone> Clone for Box<dyn ResumablePolicyProvider + 'clone>
sourceimpl<'clone> Clone for Box<dyn ResumablePolicyProvider + Send + 'clone>
impl<'clone> Clone for Box<dyn ResumablePolicyProvider + Send + 'clone>
Implementations on Foreign Types
sourceimpl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b Twhere
&'b T: DynClone + Debug + Sync + Send,
impl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b Twhere
&'b T: DynClone + Debug + Sync + Send,
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>)>
sourcefn 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.sourceimpl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b mut Twhere
&'b mut T: DynClone + Debug + Sync + Send,
impl<'b, T: 'b + ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for &'b mut Twhere
&'b mut T: DynClone + Debug + Sync + Send,
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>)>
sourcefn 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.sourceimpl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Box<T>where
Box<T>: DynClone + Debug + Sync + Send,
impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Box<T>where
Box<T>: DynClone + Debug + Sync + Send,
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>)>
sourcefn 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.sourceimpl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Rc<T>where
Rc<T>: DynClone + Debug + Sync + Send,
impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Rc<T>where
Rc<T>: DynClone + Debug + Sync + Send,
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>)>
sourcefn 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.sourceimpl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Arc<T>where
Arc<T>: DynClone + Debug + Sync + Send,
impl<T: ResumablePolicyProvider + ?Sized> ResumablePolicyProvider for Arc<T>where
Arc<T>: DynClone + Debug + Sync + Send,
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>)>
sourcefn 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.