narrative-macros 0.1.0

Procedural macros for the narrative crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use proc_macro2::TokenStream;
use quote::quote;

pub fn generate() -> TokenStream {
    // Clone, Debug, PartialEq are primitive traits for structured data in general.
    // Eq cannot be derived for floating point numbers.
    // PartialOrd and Hash cannot be derived for HashMap
    // Serialize is for transfer arguments to other processes.
    quote! {
        #[derive(Clone, Debug, PartialEq, narrative::serde::Serialize)]
        #[serde(crate = "narrative::serde")]
    }
}