json_api_derive 0.1.0

Code generation for json_api
1
2
3
4
5
6
7
8
9
10
11
12
13
use syn::Path;

#[derive(Copy, Clone)]
pub struct Symbol(&'static str);
pub const ID: Symbol = Symbol("id");
pub const TO_ONE: Symbol = Symbol("to_one");
pub const URL: Symbol = Symbol("url");

impl PartialEq<Symbol> for Path {
    fn eq(&self, word: &Symbol) -> bool {
        self.is_ident(word.0)
    }
}