tengri/input/src/input_macros.rs
unspeaker 22d63eed9c
Some checks are pending
/ build (push) Waiting to run
input, dsl: cleanup
2025-05-09 01:38:18 +03:00

10 lines
383 B
Rust

/** Implement `Command` for given `State` and `handler` */
#[macro_export] macro_rules! command {
($(<$($l:lifetime),+>)?|$self:ident:$Command:ty,$state:ident:$State:ty|$handler:expr) => {
impl$(<$($l),+>)? Command<$State> for $Command {
fn execute ($self, $state: &mut $State) -> Perhaps<Self> {
Ok($handler)
}
}
};
}