makepad_futures/stream.rs
1mod next;
2
3pub use self::next::Next;
4
5use std::{
6 pin::Pin,
7 task::{Context, Poll},
8};
9
10pub trait Stream {
11 type Item;
12
13 fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>;
14
15 fn next(&mut self) -> Next<'_, Self>
16 where
17 Self: Unpin,
18 {
19 Next::new(self)
20 }
21}