use err::Error; use futures_util::Stream; use futures_util::StreamExt; use std::pin::Pin; use std::task::{Context, Poll}; // TODO remove after refactor. pub struct BoxedStream { inp: Pin + Send>>, } impl BoxedStream { pub fn new(inp: T) -> Result where T: Stream + Send + 'static, { Ok(Self { inp: Box::pin(inp) }) } } impl Stream for BoxedStream { type Item = I; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> { self.inp.poll_next_unpin(cx) } }