I have the following type:
pub type MessageStream = Pin<Box<dyn Stream<Item = Result<rtsp_types::Message<Body>, ReadError>> + Send>>;
and a struct member:
stream: Option<MessageStream>,
That I call like this:
self.stream.as_mut().unwrap().poll_next();
but I get
116 | let response = self.stream.as_mut().unwrap().poll_next();
| ^^^^^^^^^ method not found in `&mut Pin<Box<(dyn futures::Stream<Item = std::result::Result<rtsp_types::Message<Body>, message_socket::ReadError>> + std::marker::Send + 'static)>>`
On futures::stream::Stream - Rust it lists only poll_next
, but into_future()
worked for me for some reason.
It's nice to convert to a future but I also want to poll_next
, I'm trying lots of things.
What is wrong?