nongoose-derive 0.1.0-beta.1

Macros implementation of #[derive(Schema)]
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use syn::{Attribute, Meta, MetaList};

pub(crate) fn is_schema(attr: &Attribute) -> bool {
  attr.path.is_ident("schema")
}

pub(crate) fn parse(attr: &Attribute) -> MetaList {
  match attr.parse_meta() {
    Ok(Meta::List(list)) => list,
    _ => panic!("Invalid attribute syntax"),
  }
}