Trait futures_core::stream::TryStream
source · pub trait TryStream: Stream + Sealed {
type Ok;
type Error;
// Required method
fn try_poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>;
}
Expand description
A convenience for streams that return Result
values that includes
a variety of adapters tailored to such futures.
Required Associated Types§
Required Methods§
sourcefn try_poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>
fn try_poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Self::Ok, Self::Error>>>
Poll this TryStream
as if it were a Stream
.
This method is a stopgap for a compiler limitation that prevents us from
directly inheriting from the Stream
trait; in the future it won’t be
needed.