|
4 | 4 |
|
5 | 5 | use crate::context::ContextItems; |
6 | 6 | use proc_macro::TokenStream; |
7 | | -use syn::{parse_macro_input, DeriveInput, ItemFn}; |
| 7 | +use syn::{parse_macro_input, DeriveInput}; |
8 | 8 |
|
9 | 9 | mod command; |
10 | | -mod command_module; |
11 | 10 | mod mobile; |
12 | 11 | mod runtime; |
13 | 12 |
|
@@ -81,40 +80,3 @@ pub fn default_runtime(attributes: TokenStream, input: TokenStream) -> TokenStre |
81 | 80 | let input = parse_macro_input!(input as DeriveInput); |
82 | 81 | runtime::default_runtime(attributes, input).into() |
83 | 82 | } |
84 | | - |
85 | | -/// Prepares the command module enum. |
86 | | -#[doc(hidden)] |
87 | | -#[proc_macro_derive(CommandModule, attributes(cmd))] |
88 | | -pub fn derive_command_module(input: TokenStream) -> TokenStream { |
89 | | - let input = parse_macro_input!(input as DeriveInput); |
90 | | - command_module::generate_run_fn(input) |
91 | | -} |
92 | | - |
93 | | -/// Adds a `run` method to an enum (one of the tauri endpoint modules). |
94 | | -/// The `run` method takes a `tauri::endpoints::InvokeContext` |
95 | | -/// and returns a `tauri::Result<tauri::endpoints::InvokeResponse>`. |
96 | | -/// It matches on each enum variant and call a method with name equal to the variant name, lowercased and snake_cased, |
97 | | -/// passing the context and the variant's fields as arguments. |
98 | | -/// That function must also return the same `Result<InvokeResponse>`. |
99 | | -#[doc(hidden)] |
100 | | -#[proc_macro_attribute] |
101 | | -pub fn command_enum(_: TokenStream, input: TokenStream) -> TokenStream { |
102 | | - let input = parse_macro_input!(input as DeriveInput); |
103 | | - command_module::generate_command_enum(input) |
104 | | -} |
105 | | - |
106 | | -#[doc(hidden)] |
107 | | -#[proc_macro_attribute] |
108 | | -pub fn module_command_handler(attributes: TokenStream, input: TokenStream) -> TokenStream { |
109 | | - let attributes = parse_macro_input!(attributes as command_module::HandlerAttributes); |
110 | | - let input = parse_macro_input!(input as ItemFn); |
111 | | - command_module::command_handler(attributes, input).into() |
112 | | -} |
113 | | - |
114 | | -#[doc(hidden)] |
115 | | -#[proc_macro_attribute] |
116 | | -pub fn module_command_test(attributes: TokenStream, input: TokenStream) -> TokenStream { |
117 | | - let attributes = parse_macro_input!(attributes as command_module::HandlerTestAttributes); |
118 | | - let input = parse_macro_input!(input as ItemFn); |
119 | | - command_module::command_test(attributes, input).into() |
120 | | -} |
0 commit comments