struct-input-derive 0.1.1

Procedural derive macro for the struct-input crate, enabling automatic mapping of CLI inputs to struct fields.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use proc_macro::TokenStream;
use crate::derive::impl_struct_input;
use darling::export::syn;

mod derive;

#[proc_macro_derive(StructInput, attributes(struct_input))]
pub fn struct_input_drive(input: TokenStream) -> TokenStream {

    let ast = syn::parse(input).unwrap();

    impl_struct_input(&ast)
}