|
|
|
|
|
by typicalset
570 days ago
|
|
This looks interesting as an approach to relating schema to data types. One aspect that feels very counter-intuitive/unidiomatic is that, if I understand correctly, in your example there is no Schema enum. Usually this sort of macro does not erase the type defined, and I would find it extremely confusing that I cannot reference, say, Schema::User{..}. It would be clearer to me if this were defined inside of a macro_rules macro, more like lazy_static e.g. ```
schema!{
User {
name: String,
},
Story {
author: User,
title: String,
content: String,
},
}
``` |
|