expression

Combined readiness flags

Represent a set of readiness conditions. Several flags may be present together. A readiness bit is distinct from a successful read or write; this fixture manipulates flags without sockets. Tokio is an external crate. Synthetic data only. Expected stdout (not executed): true true Common mistake: Assuming readiness states are mutually exclusive.

Formal Syntax & Structure

rust syntaxrust
Ready::READABLE | Ready::WRITABLE

Working Example

Example Snippetrust
#[tokio::main(flavor = "current_thread")]async fn main() {    tokio::time::timeout(std::time::Duration::from_secs(3), async {        use tokio::io::Ready;        let flags = Ready::READABLE | Ready::WRITABLE;        println!("{} {}", flags.is_readable(), flags.is_writable());    }).await.expect("fixture deadline");}
Rust Reference