argser_macros/
lib.rs

1#![warn(missing_docs)]
2#![doc = include_str!("../README.md")]
3
4mod argser;
5
6/// This will automatically implement the `argser::FromArgs` trait for the
7/// Struct it is applied on, while considering all the Configuration on the
8/// Struct and all its parts when generating the implemenatation.
9#[proc_macro_attribute]
10pub fn argser(
11    attributes: proc_macro::TokenStream,
12    input: proc_macro::TokenStream,
13) -> proc_macro::TokenStream {
14    let attr: syn::AttributeArgs = syn::parse_macro_input!(attributes);
15    let input: syn::ItemStruct = syn::parse_macro_input!(input);
16
17    argser::argser(attr, input).into()
18}