pub struct Constant { /* private fields */ }Expand description
Constant backoff strategy.
Always returns the same value no matter what the attempt is.
Note: This type cannot be constructed directly, instead BackoffStrategy::constant
should be used.
§Example
let strategy = BackoffStrategy::constant(TimeDelta::seconds(10));
assert_eq!(strategy.backoff(1), TimeDelta::seconds(10));
assert_eq!(strategy.backoff(2), TimeDelta::seconds(10));
assert_eq!(strategy.backoff(3), TimeDelta::seconds(10));Trait Implementations§
impl Copy for Constant
impl Eq for Constant
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl Freeze for Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnwindSafe for Constant
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