1mod private
7{
8
9 use crate :: *;
10 use syn ::punctuated ::Punctuated;
11
12 pub fn named_fields(ast: &syn ::DeriveInput) -> crate ::Result< &Punctuated<syn ::Field, syn ::token ::Comma >>
31 {
32 let fields = match ast.data
33 {
34 syn ::Data ::Struct(ref data_struct) => match data_struct.fields
35 {
36 syn ::Fields ::Named(ref fields_named) => &fields_named.named,
37 _ =>
38 {
39 return Err(syn_err!(
40 ast,
41 "Unknown format of data, expected syn ::Fields ::Named( ref fields_named )\n {}",
42 qt! { #ast }
43 ))
44 }
45 },
46 _ =>
47 {
48 return Err(syn_err!(
49 ast,
50 "Unknown format of data, expected syn ::Data ::Struct( ref data_struct )\n {}",
51 qt! { #ast }
52 ))
53 }
54 };
55
56 Ok(fields)
57 }
58}
59
60#[ doc( inline ) ]
61#[ allow( unused_imports ) ]
62pub use own :: *;
63
64#[ allow( unused_imports ) ]
66pub mod own
67{
68
69 use super :: *;
70 #[ doc( inline ) ]
71 pub use orphan :: *;
72
73 #[ doc( inline ) ]
74 pub use private :: { named_fields };
75}
76
77#[ allow( unused_imports ) ]
79pub mod orphan
80{
81
82 use super :: *;
83 #[ doc( inline ) ]
84 pub use exposed :: *;
85}
86
87#[ allow( unused_imports ) ]
89pub mod exposed
90{
91
92 use super :: *;
93 pub use super ::super ::derive;
94
95 #[ doc( inline ) ]
96 pub use prelude :: *;
97
98 #[ doc( inline ) ]
99 pub use private :: { };
100}
101
102#[ allow( unused_imports ) ]
104pub mod prelude
105{
106
107 use super :: *;
108
109 #[ doc( inline ) ]
110 pub use private :: { };
111}