assert_ready

Macro assert_ready 

Source
macro_rules! assert_ready {
    ($a:expr $(,)?) => { ... };
    ($a:expr, $($message:tt)+) => { ... };
}
Expand description

Assert an expression is Ready.

Pseudocode:
a is Ready(a1)

  • If true, return (a1).

  • 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_ready!(a);

// This will panic
let a: Poll<i8> = Pending;
assert_ready!(a);
// assertion failed: `assert_ready!(a)`
// https://docs.rs/assertables/…/assertables/macro.assert_ready.html
//  a label: `a`,
//  a debug: `Pending`

§Module macros