mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-27 02:41:55 +00:00
fix locking logic
This commit is contained in:
13
patch-db-derive/src/lib.rs
Normal file
13
patch-db-derive/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro_derive(Model, attributes(serde))]
|
||||
pub fn model_derive(input: TokenStream) -> TokenStream {
|
||||
// Construct a representation of Rust code as a syntax tree
|
||||
// that we can manipulate
|
||||
let ast = syn::parse(input).unwrap();
|
||||
|
||||
// Build the trait implementation
|
||||
patch_db_derive_internals::build_model(&ast).into()
|
||||
}
|
||||
Reference in New Issue
Block a user