fix locking logic

This commit is contained in:
Aiden McClelland
2021-03-09 19:30:56 -07:00
parent 4dbff195d5
commit c2e50d0e88
7 changed files with 305 additions and 44 deletions

View File

@@ -0,0 +1,16 @@
[package]
name = "patch-db-derive"
version = "0.1.0"
authors = ["Aiden McClelland <me@drbonez.dev>"]
edition = "2018"
description = "derive macros for defining typed patch dbs"
license = "MIT"
repository = "https://github.com/dr-bonez/patch-db"
[lib]
proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
patch-db-derive-internals = { path = "../patch-db-derive-internals" }
syn = "1.0.62"

View 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()
}