Skip to main content

bodkin_derive/
lib.rs

1//! This is an internal library for the `bodkin` crate.
2//! See <https://docs.rs/bodkin> for more information.
3
4use proc_macro::TokenStream;
5use syn::parse_macro_input;
6extern crate proc_macro;
7
8
9
10mod arrow_integration;
11
12#[proc_macro_derive(ArrowIntegration, attributes(arrow))]
13pub fn rule_system_derive(input: TokenStream) -> TokenStream {
14    let ast = parse_macro_input!(input as _);
15    TokenStream::from(match arrow_integration::impl_arrow_integration(ast) {
16        Ok(it) => it,
17        Err(err) => err.to_compile_error(),
18    })
19}