Skip to main content

crossterm_keybind_derive/
lib.rs

1mod key_bind;
2
3#[proc_macro_derive(KeyBind, attributes(keybindings))]
4pub fn derive_patch(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
5    key_bind::Events::from_ast(syn::parse_macro_input!(item as syn::DeriveInput))
6        .unwrap()
7        .into_token_stream()
8        .unwrap()
9}