Macro stream_assert::assert_ready
source · macro_rules! assert_ready { ($stream:expr) => { ... }; }
Expand description
Assert that the stream is ready, i.e. calling poll_next
returns
Poll::Ready(Some(_))
.
Semantically equivalent to stream.next().now_or_never().unwrap().unwrap()
,
but produces nicer error messages in case the stream is not ready.