qbittorrent_web_api/qbittorrent-web-api-gen/src/lib.rs

16 lines
393 B
Rust
Raw Normal View History

2022-07-12 12:28:03 +02:00
mod generate;
2022-07-11 02:09:17 +02:00
mod md_parser;
mod parser;
2022-07-12 12:28:03 +02:00
mod types;
2022-07-10 17:06:19 +02:00
use proc_macro::TokenStream;
use syn::parse_macro_input;
const API_CONTENT: &str = include_str!("../api-4_1.md");
2022-07-10 17:06:19 +02:00
#[proc_macro_derive(QBittorrentApiGen, attributes(api_gen))]
pub fn derive(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as syn::DeriveInput);
2022-07-12 12:28:03 +02:00
generate::generate(&ast, API_CONTENT).into()
2022-07-10 17:06:19 +02:00
}