macro_rules! select {
(@build [$($arms:tt)*] $val:ident = $rx:expr => $body:expr, $($rest:tt)*) => { ... };
(@build [$($arms:tt)*] timeout($dur:expr) => $body:expr $(,)?) => { ... };
(@build [$($arms:tt)*]) => { ... };
($($tokens:tt)*) => { ... };
}Expand description
Select over multiple channel operations with optional timeout.
§Syntax
ⓘ
camber::select! {
val = rx1 => expr1,
val = rx2 => expr2,
timeout(duration) => expr3,
}Each recv arm binds the received Result<T, RuntimeError> to val.
The timeout arm fires if no channel is ready within the given Duration.
All arms must produce the same type.