Module assertables::assert_poll
source · Expand description
Assert macros for Poll {Ready, Pending}
These macros help compare a Poll that is either Ready, Pending.
The macros use these capabilities:
-
implements
.is_ready() -> boolean -
implements
.is_pending() -> boolean
§Macros
-
assert_poll_ready!(a)≈ a is Poll::Ready -
assert_poll_ready_eq!(a, b)≈ Poll::Ready(a) == Poll::Ready(b) -
assert_poll_ready_ne!(a, b)≈ Poll::Ready(a) == Poll::Ready(b) -
assert_poll_pending!(a)≈ a is Poll::Pending
§Example
use std::task::Poll;
use std::task::Poll::*;
let a: Poll<i8> = Poll::Ready(1);
assert_poll_ready!(a);Modules§
- Assert an expression is Pending.
- Assert an expression is Ready(_).
- Assert two expressions are Ready(_) and their values are equal.
- Assert two expressions are Ready(_) and their values are not equal.