pub struct RetryPolicy {
pub limit: RetryLimit,
pub base_delay: u64,
pub delay_time: fn(&RetryPolicy, u64) -> u64,
}Fields§
§limit: RetryLimit§base_delay: u64§delay_time: fn(&RetryPolicy, u64) -> u64Implementations§
Source§impl RetryPolicy
impl RetryPolicy
pub async fn wait(&self, count: u64)
pub fn can_retry(&self, count: u64) -> bool
Sourcepub async fn call<Func, RetType, ErrType>(
&self,
executor: Func,
) -> Result<RetType, ErrType>where
Func: Executor<RetType, ErrType>,
pub async fn call<Func, RetType, ErrType>(
&self,
executor: Func,
) -> Result<RetType, ErrType>where
Func: Executor<RetType, ErrType>,
Runs a function against the given policy
Sourcepub async fn call_closure<RetType: Send + Sync, ErrType: Send + Sync>(
&self,
f: impl AsyncFn() -> RetryResult<RetType, ErrType> + Send + Sync,
) -> Result<RetType, ErrType>
pub async fn call_closure<RetType: Send + Sync, ErrType: Send + Sync>( &self, f: impl AsyncFn() -> RetryResult<RetType, ErrType> + Send + Sync, ) -> Result<RetType, ErrType>
Runs a function against the given policy
pub fn builder() -> RetryPolicyBuilder
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnwindSafe for RetryPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more