Macro wookie::assert_ready [−][src]
macro_rules! assert_ready {
($expr : expr) => { ... };
($expected : expr, $expr : expr) => { ... };
}
Expand description
Asserts that a [Poll
] is a [Poll::Ready
]
Examples
use wookie::assert_ready;
use core::task::Poll;
// With 1 arg, just checks for ready, returning the unwrapped value.
assert_eq!(42, assert_ready!(Poll::Ready(42)));
// assert_ready!(Poll::<i32>::Pending); // would fail
// With 2 args, it's like [`assert_eq`] on the unwrapped value.
assert_ready!(42, Poll::Ready(42));
// assert_ready!(Poll::<i32>::Pending); // would fail
// assert_ready!(42, Poll::Ready(420)); // would fail