lv2_core_derive/
lib.rs

1//! Procedural macros for `lv2-core`.
2#![recursion_limit = "128"]
3
4extern crate proc_macro;
5extern crate proc_macro2;
6extern crate syn;
7#[macro_use]
8extern crate quote;
9
10mod feature_collection_derive;
11mod lv2_descriptors;
12mod port_collection_derive;
13
14use proc_macro::TokenStream;
15
16/// Generate external symbols for LV2 plugins.
17#[proc_macro]
18pub fn lv2_descriptors(input: TokenStream) -> TokenStream {
19    lv2_descriptors::lv2_descriptors_impl(input)
20}
21
22/// Implement the `PortCollection` trait for a port struct.
23#[proc_macro_derive(PortCollection)]
24pub fn port_collection_derive(input: TokenStream) -> TokenStream {
25    port_collection_derive::port_collection_derive_impl(input)
26}
27
28#[proc_macro_derive(FeatureCollection)]
29pub fn feature_collection_derive(input: TokenStream) -> TokenStream {
30    feature_collection_derive::feature_collection_derive_impl(input)
31}