Skip to main content

FeedSource

Trait FeedSource 

Source
pub trait FeedSource {
    type Item;

    // Required methods
    fn wait(&mut self) -> impl Future<Output = Option<Self::Item>>;
    fn poll_now(&mut self) -> Option<Self::Item>;
}
Expand description

Something a control loop waits on and then drains: one awaited receive for the select! arm, and a non-blocking receive for the batch that follows.

Required Associated Types§

Required Methods§

Source

fn wait(&mut self) -> impl Future<Output = Option<Self::Item>>

Cancel-safe: a wait that loses the race must not drop a message.

Source

fn poll_now(&mut self) -> Option<Self::Item>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Clone> FeedSource for Receiver<T>

Source§

type Item = T

Source§

async fn wait(&mut self) -> Option<T>

Source§

fn poll_now(&mut self) -> Option<T>

Source§

impl<T> FeedSource for Receiver<T>

Source§

type Item = T

Source§

fn wait(&mut self) -> impl Future<Output = Option<T>>

Source§

fn poll_now(&mut self) -> Option<T>

Source§

impl<T> FeedSource for UnboundedReceiver<T>

Source§

type Item = T

Source§

fn wait(&mut self) -> impl Future<Output = Option<T>>

Source§

fn poll_now(&mut self) -> Option<T>

Implementors§