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 outbox_event;
6mod tables;
7
8use proc_macro::TokenStream;
9use syn::parse_macro_input;
10
11#[proc_macro_derive(MailboxTables, attributes(obix))]
12pub fn mailbox_tables_derive(input: TokenStream) -> TokenStream {
13 let ast = parse_macro_input!(input as syn::DeriveInput);
14 match tables::derive(ast) {
15 Ok(tokens) => tokens.into(),
16 Err(e) => e.write_errors().into(),
17 }
18}
19
20#[proc_macro_derive(OutboxEvent, attributes(obix))]
21pub fn outbox_event_derive(input: TokenStream) -> TokenStream {
22 let ast = parse_macro_input!(input as syn::DeriveInput);
23 match outbox_event::derive(ast) {
24 Ok(tokens) => tokens.into(),
25 Err(e) => e.write_errors().into(),
26 }
27}