macro_rules! dispatch {
($client:expr, $update:expr, $( $pattern:tt )+ ) => { ... };
}Expand description
Route a crate::update::Update to the first matching arm.
ยงSyntax
dispatch!(client, update,
VariantName(binding) [if guard] => { body },
...
[_ => { fallback }]
);clientโ alayer_client::Client(available inside every arm body)updateโ theUpdatevalue to dispatch- Each arm mirrors a variant of
crate::update::Update - Guards (
if expr) are optional - A catch-all
_ => {}arm is optional but recommended to avoid warnings