macro_rules! assert_poll_ready { ($a:expr $(,)?) => { ... }; ($a:expr, $($message:tt)+) => { ... }; }
👎Deprecated: Please rename from
assert_poll_ready to assert_ready because more developers prefer the shorter name.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 assertables::*;
use std::task::Poll;
use std::task::Poll::*;
let a: Poll<i8> = Ready(1);
assert_poll_ready!(a);
// This will panic
let a: Poll<i8> = Pending;
assert_poll_ready!(a);
// assertion failed: `assert_poll_ready!(a)`
// https://docs.rs/assertables/8.18.0/assertables/macro.assert_poll_ready.html
// a label: `a`,
// a debug: `Pending`