Macro cogo::select_token
source · [−]macro_rules! select_token {
(
$($name:pat = $top:expr => $bottom:expr), +$(,)?
) => { ... };
}
Expand description
macro used to select for only one event it will return the index of which event happens first for example:
use cogo::{chan, select_token};
let (s, r) = chan!();
s.send(1);
let id = select_token! {
rv = r.recv() => {
println!("{:?}",rv);
}
};