Skip to main content

EventSource

Trait EventSource 

Source
pub trait EventSource<T> {
    // Required method
    fn next(&mut self) -> impl Future<Output = Option<T>> + Send;
}
Expand description

Anything that yields events asynchronously (a postcard-rpc subscription, an mpsc receiver, an RTT line stream…). None means the source closed.

Required Methods§

Source

fn next(&mut self) -> impl Future<Output = Option<T>> + Send

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: Send> EventSource<T> for Receiver<T>

Source§

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

Source§

impl<T: Send> EventSource<T> for UnboundedReceiver<T>

Source§

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

Implementors§