1use crate::*;
2
3#[derive(Clone, Debug)]
4pub struct Field {
5 pub ty: Type,
7
8 pub flattened: bool,
10
11 pub aliases: &'static [&'static str],
13}
14
15impl From<Type> for Field {
16 fn from(ty: Type) -> Self {
17 Self {
18 ty,
19 flattened: false,
20 aliases: &[],
21 }
22 }
23}
24
25impl From<TypeKind> for Field {
26 fn from(kind: TypeKind) -> Self {
27 let ty: Type = kind.into();
28 ty.into()
29 }
30}
31
32impl From<Fields> for Field {
33 fn from(fields: Fields) -> Self {
34 let kind: TypeKind = fields.into();
35 kind.into()
36 }
37}