Macro lib::assert_poll_ready
source · macro_rules! assert_poll_ready { ($poll:expr $(,)?) => { ... }; ($poll:expr, $($message:tt)+) => { ... }; }
Expand description
Assert an expression is Ready(_).
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use std::task::Poll;
use std::task::Poll::*;
let a: Poll<i8> = Ready(1);
assert_poll_ready!(a);
let a: Poll<i8> = Pending;
assert_poll_ready!(a);
// assertion failed: `assert_poll_ready!(a)`
// a label: `a`,
// a debug: `Pending`