nice_plug_derive/lib.rs
1use proc_macro::TokenStream;
2
3mod enums;
4mod params;
5
6/// Derive the `Enum` trait for simple enum parameters. See `EnumParam` for more information.
7#[proc_macro_derive(Enum, attributes(name, id))]
8pub fn derive_enum(input: TokenStream) -> TokenStream {
9 enums::derive_enum(input)
10}
11
12/// Derive the `Params` trait for your plugin's parameters struct. See the `Plugin` trait.
13#[proc_macro_derive(Params, attributes(id, persist, nested))]
14pub fn derive_params(input: TokenStream) -> TokenStream {
15 params::derive_params(input)
16}