Macro assertables::assert_poll_pending

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

Assert poll.is_pending() 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::Pending;
assert_poll_pending!(a);

let a: Result<(), i8> = Result::Err(1);
let a: Poll<i8> = Poll::Ready(1);
assert_poll_pending!(a);
// assertion failed: `assert_poll_pending!(poll)`
//         poll label: `a`,
//         poll debug: `Ready(1)`,
//  poll.is_pending(): `false`

§Module macros