pub struct ReceiptPoller { /* private fields */ }Expand description
Smart receipt poller with exponential backoff.
Does not perform I/O itself — it computes delays and decides when to stop polling. The caller drives the actual RPC calls.
Implementations§
Source§impl ReceiptPoller
impl ReceiptPoller
Sourcepub fn new(config: ReceiptPollerConfig) -> Self
pub fn new(config: ReceiptPollerConfig) -> Self
Create a new poller with the given configuration.
Sourcepub fn delay_for_attempt(&self, attempt: u32) -> Option<Duration>
pub fn delay_for_attempt(&self, attempt: u32) -> Option<Duration>
Calculate the delay before the given attempt (1-indexed).
Returns None when attempt exceeds max_attempts, signalling that
polling should stop.
Sourcepub fn should_continue(&self, attempt: u32) -> bool
pub fn should_continue(&self, attempt: u32) -> bool
Check if we should continue polling at the given attempt number.
Auto Trait Implementations§
impl Freeze for ReceiptPoller
impl RefUnwindSafe for ReceiptPoller
impl Send for ReceiptPoller
impl Sync for ReceiptPoller
impl Unpin for ReceiptPoller
impl UnsafeUnpin for ReceiptPoller
impl UnwindSafe for ReceiptPoller
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