Files
ansi_term
anyhow
atty
bitflags
bstr
byteorder
cargo_metadata
cargo_preflight
cfg_if
clap
csv
csv_core
darling
darling_core
darling_macro
dlopen
dlopen_derive
fnv
getrandom
glob
heck
ident_case
indoc
itoa
lazy_static
lerp
lerp_derive
libc
libm
maplit
memchr
num_traits
open
pest
pest_derive
pest_generator
pest_meta
ppv_lite86
preflight
preflight_macros
proc_macro2
proc_macro_error
proc_macro_error_attr
quote
rand
rand_chacha
rand_core
regex_automata
ryu
semver
semver_parser
serde
serde_derive
serde_json
smawk
strsim
structopt
structopt_derive
syn
termcolor
textwrap
timescale
timescale_macros
typenum
ucd_trie
unicode_segmentation
unicode_width
unicode_xid
unindent
uom
uuid
vec_map
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use proc_macro2::TokenStream;
use quote::ToTokens;
use syn;

use codegen::FromMetaImpl;
use options::{Core, ParseAttribute, ParseData};
use Result;

pub struct FromMetaOptions {
    base: Core,
}

impl FromMetaOptions {
    pub fn new(di: &syn::DeriveInput) -> Result<Self> {
        (FromMetaOptions {
            base: Core::start(di),
        })
        .parse_attributes(&di.attrs)?
        .parse_body(&di.data)
    }
}

impl ParseAttribute for FromMetaOptions {
    fn parse_nested(&mut self, mi: &syn::Meta) -> Result<()> {
        self.base.parse_nested(mi)
    }
}

impl ParseData for FromMetaOptions {
    fn parse_variant(&mut self, variant: &syn::Variant) -> Result<()> {
        self.base.parse_variant(variant)
    }

    fn parse_field(&mut self, field: &syn::Field) -> Result<()> {
        self.base.parse_field(field)
    }
}

impl<'a> From<&'a FromMetaOptions> for FromMetaImpl<'a> {
    fn from(v: &'a FromMetaOptions) -> Self {
        FromMetaImpl {
            base: (&v.base).into(),
        }
    }
}

impl ToTokens for FromMetaOptions {
    fn to_tokens(&self, tokens: &mut TokenStream) {
        FromMetaImpl::from(self).to_tokens(tokens)
    }
}