pub struct IntervalStrategy { /* private fields */ }Available on crate feature
sleep only.Expand description
Interval-based polling strategy with optional backoff
Implementations§
Source§impl IntervalStrategy
impl IntervalStrategy
Sourcepub fn new(poll_interval: Duration) -> Self
pub fn new(poll_interval: Duration) -> Self
Create a new IntervalStrategy with the specified interval
Sourcepub fn poll_interval(&self) -> Duration
pub fn poll_interval(&self) -> Duration
Get the current polling interval
Sourcepub fn with_backoff(self, config: BackoffConfig) -> BackoffStrategy
pub fn with_backoff(self, config: BackoffConfig) -> BackoffStrategy
Wrap the IntervalStrategy with a BackoffStrategy
This will apply exponential backoff to the polling interval
based on the provided BackoffConfig.`
Trait Implementations§
Source§impl Clone for IntervalStrategy
impl Clone for IntervalStrategy
Source§impl Debug for IntervalStrategy
impl Debug for IntervalStrategy
Source§impl PollStrategy for IntervalStrategy
impl PollStrategy for IntervalStrategy
Source§fn poll_drive(
&mut self,
cx: &mut Context<'_>,
_ps: &PollSnapshot,
) -> Poll<Option<()>>
fn poll_drive( &mut self, cx: &mut Context<'_>, _ps: &PollSnapshot, ) -> Poll<Option<()>>
Poll to bind a waker to the next instance. Read more
Source§fn on_poll(&mut self, snapshot: &PollSnapshot)
fn on_poll(&mut self, snapshot: &PollSnapshot)
Signifies a poll was made
Auto Trait Implementations§
impl !RefUnwindSafe for IntervalStrategy
impl !UnwindSafe for IntervalStrategy
impl Freeze for IntervalStrategy
impl Send for IntervalStrategy
impl Sync for IntervalStrategy
impl Unpin for IntervalStrategy
impl UnsafeUnpin for IntervalStrategy
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