PollStrategy

Trait PollStrategy 

Source
pub trait PollStrategy {
    type Stream: Stream + Send;

    // Required method
    fn poll_strategy(self: Box<Self>, ctx: &PollContext) -> Self::Stream;
}
Expand description

A trait for different polling strategies All strategies can be combined in a race condition

Required Associated Types§

Source

type Stream: Stream + Send

The stream returned by the strategy

Required Methods§

Source

fn poll_strategy(self: Box<Self>, ctx: &PollContext) -> Self::Stream

Create a stream that completes when the next poll should occur

Implementors§

Source§

impl PollStrategy for BackoffStrategy

Available on crate feature sleep only.
Source§

type Stream = Pin<Box<dyn Stream<Item = ()> + Send>>

Source§

impl PollStrategy for IntervalStrategy

Available on crate feature sleep only.
Source§

type Stream = Pin<Box<dyn Stream<Item = ()> + Send>>

Source§

impl PollStrategy for MultiStrategy

Source§

type Stream = Pin<Box<dyn Stream<Item = ()> + Send>>

Source§

impl<F> PollStrategy for FutureStrategy<F>
where F: Future<Output = ()> + Send + 'static,

Source§

type Stream = Pin<Box<dyn Stream<Item = ()> + Send>>

Source§

impl<S> PollStrategy for StreamStrategy<S>
where S: Stream<Item = ()> + Unpin + Send + 'static,

Source§

impl<S> PollStrategy for WrapperStrategy<S>
where S: PollStrategy + Send + 'static,

Source§

type Stream = Pin<Box<dyn Stream<Item = ()> + Send>>