Macro assertables::assert_poll_ready

source ·
macro_rules! assert_poll_ready {
    ($poll:expr $(,)?) => { ... };
    ($poll:expr, $($message:tt)+) => { ... };
}
Expand description

Assert poll.is_ready() is true.

  • If true, return ().

  • Otherwise, call panic! with a message and the values of the expressions with their debug representations.

§Examples

use std::task::Poll;
let a: Poll<i8> = Poll::Ready(1);
assert_poll_ready!(a);

let a: Poll<i8> = Poll::Pending;
assert_poll_ready!(a);
// assertion failed: `assert_poll_ready!(poll)`
//      poll label: `a`,
//      poll debug: `Pending`,
// expr.is_ready(): `false`

§Module macros