moxy-derive 0.0.1

derive macros for moxy crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mod structs;

use crate::{Render, params};

pub fn render(tokens: proc_macro::TokenStream) -> syn::Result<proc_macro2::TokenStream> {
    let input = syn::parse::<syn::DeriveInput>(tokens.into())?;

    match input.data.clone() {
        syn::Data::Struct(data) => {
            structs::StructSyntax.render(params::StructParams { input, data })
        }
        _ => panic!("invalid type"),
    }
}