obix_macros/
lib.rs

1#![cfg_attr(feature = "fail-on-warnings", deny(warnings))]
2#![cfg_attr(feature = "fail-on-warnings", deny(clippy::all))]
3#![forbid(unsafe_code)]
4
5mod tables;
6
7use proc_macro::TokenStream;
8use syn::parse_macro_input;
9
10#[proc_macro_derive(MailboxTables, attributes(obix))]
11pub fn es_event_derive(input: TokenStream) -> TokenStream {
12    let ast = parse_macro_input!(input as syn::DeriveInput);
13    match tables::derive(ast) {
14        Ok(tokens) => tokens.into(),
15        Err(e) => e.write_errors().into(),
16    }
17}