sea_orm_try_into_active_model/
lib.rs1extern crate proc_macro;
2
3use proc_macro::TokenStream;
4use syn::{parse_macro_input, DeriveInput, Error};
5
6#[cfg(feature = "derive")]
7mod derives;
8
9#[cfg(feature = "derive")]
10#[proc_macro_derive(DeriveTryIntoActiveModel, attributes(sea_orm))]
11pub fn derive_try_into_active_model(input: TokenStream) -> TokenStream {
12 let input = parse_macro_input!(input as DeriveInput);
13 derives::expand_try_into_active_model(input).unwrap_or_else(Error::into_compile_error).into()
14}