pub struct ResendPlanner { /* private fields */ }Expand description
Helper struct tracking resend attempts for a given block.
Implementations§
Source§impl ResendPlanner
impl ResendPlanner
pub fn new(max_retries: u32, base_delay: Duration) -> Self
Sourcepub fn should_resend(&self, now: Instant) -> bool
pub fn should_resend(&self, now: Instant) -> bool
Determine whether a resend can be attempted at the provided instant.
Sourcepub fn record_attempt(&mut self, now: Instant, jitter: Duration)
pub fn record_attempt(&mut self, now: Instant, jitter: Duration)
Record a resend attempt and compute the next deadline.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Whether the resend planner exhausted all retries.
Trait Implementations§
Source§impl Clone for ResendPlanner
impl Clone for ResendPlanner
Source§fn clone(&self) -> ResendPlanner
fn clone(&self) -> ResendPlanner
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 ResendPlanner
impl RefUnwindSafe for ResendPlanner
impl Send for ResendPlanner
impl Sync for ResendPlanner
impl Unpin for ResendPlanner
impl UnwindSafe for ResendPlanner
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