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(interval: Duration) -> Self
pub fn new(interval: Duration) -> Self
Create a new IntervalStrategy with the specified 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§fn clone(&self) -> IntervalStrategy
fn clone(&self) -> IntervalStrategy
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 moreSource§impl Debug for IntervalStrategy
impl Debug for IntervalStrategy
Source§impl PollStrategy for IntervalStrategy
impl PollStrategy for IntervalStrategy
Auto Trait Implementations§
impl Freeze for IntervalStrategy
impl RefUnwindSafe for IntervalStrategy
impl Send for IntervalStrategy
impl Sync for IntervalStrategy
impl Unpin for IntervalStrategy
impl UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PollStrategyExt for Twhere
T: PollStrategy,
impl<T> PollStrategyExt for Twhere
T: PollStrategy,
Source§fn build_stream(
self,
ctx: &PollContext,
) -> Pin<Box<dyn Stream<Item = ()> + Send>>where
Self::Stream: 'static,
fn build_stream(
self,
ctx: &PollContext,
) -> Pin<Box<dyn Stream<Item = ()> + Send>>where
Self::Stream: 'static,
Build a boxed stream from the strategy
This is a convenience method that boxes the strategy and calls
poll_strategy