use Poll;
use task;
pub trait Stream {
type Item;
type Error;
fn poll_next(&mut self, cx: &mut task::Context) -> Poll<Option<Self::Item>, Self::Error>;
}
impl<'a, S: ?Sized + Stream> Stream for &'a mut S {
type Item = S::Item;
type Error = S::Error;
fn poll_next(&mut self, cx: &mut task::Context) -> Poll<Option<Self::Item>, Self::Error> {
(**self).poll_next(cx)
}
}
if_std! {
impl<S: ?Sized + Stream> Stream for ::std::boxed::Box<S> {
type Item = S::Item;
type Error = S::Error;
fn poll_next(&mut self, cx: &mut task::Context) -> Poll<Option<Self::Item>, Self::Error> {
(**self).poll_next(cx)
}
}
impl<S: Stream> Stream for ::std::panic::AssertUnwindSafe<S> {
type Item = S::Item;
type Error = S::Error;
fn poll_next(&mut self, cx: &mut task::Context) -> Poll<Option<S::Item>, S::Error> {
self.0.poll_next(cx)
}
}
}