macro_rules! cmd_both {
() => { ... };
}
Expand description
Marks the command as both query and event by creating a stub for Command::meta.
struct MyQuery;
impl Command<MyDevice> for MyQuery {
cmd_both!();
fn query(
&self,
_device: &mut MyDevice,
_context: &mut Context,
_params: Parameters,
_response: ResponseUnit,
) -> Result<(), Error> {
// Do stuff
Ok(())
}
fn event(
&self,
_device: &mut MyDevice,
_context: &mut Context,
_params: Parameters,
) -> Result<(), Error> {
// Do stuff
Ok(())
}
}