Trait unicycle::PollNext

source ·
pub trait PollNext {
    type Item;

    // Required method
    fn poll_next(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Option<Self::Item>>;
}
Expand description

Trait for providing a poll_next implementation for various unordered set types.

This is like the lightweight unicycle version of the Stream trait, but we provide it here so we can shim in our own generic next implementation.

Required Associated Types§

source

type Item

The output of the poll.

Required Methods§

source

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Option<Self::Item>>

Poll the stream for the next item.

Once this completes with Poll::Ready(None), no more items are expected and it should not be polled again.

Implementors§

source§

impl<T> PollNext for FuturesUnordered<T>
where T: Future,

§

type Item = <T as Future>::Output

source§

impl<T> PollNext for IndexedStreamsUnordered<T>
where T: Stream,

Available on crate feature futures-rs only.
§

type Item = (usize, Option<<T as Stream>::Item>)

source§

impl<T> PollNext for StreamsUnordered<T>
where T: Stream,

Available on crate feature futures-rs only.
§

type Item = <T as Stream>::Item