summaryrefslogtreecommitdiff
path: root/examples/13-transient-0/output/rust/src/gen/data.rs
blob: 77bcbe87273fa8714f597f33b2114f827a26993d (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// Generated by hobgoblin.

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructSingleton;

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithBool {
    pub a: ::core::primitive::bool,
    pub b: ::core::primitive::bool,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithInt8 {
    pub a: ::core::primitive::i8,
    pub b: ::core::primitive::i8,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithInt32 {
    pub a: ::core::primitive::i32,
    pub b: ::core::primitive::i32,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithInt64 {
    pub a: ::core::primitive::i64,
    pub b: ::core::primitive::i64,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithString {
    pub a: ::std::string::String,
    pub b: ::std::string::String,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithStruct {
    pub inner: crate::data::StructWithInt32,
    pub c: ::core::primitive::i32,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithList {
    pub a: ::std::vec::Vec::<::core::primitive::i64>,
    pub b: ::std::vec::Vec::<crate::data::StructWithInt32>,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithOption {
    pub a: ::std::option::Option::<::core::primitive::i64>,
    pub b: ::std::option::Option::<crate::data::StructWithInt32>,
}

#[derive(Clone, Copy, Debug, Hash, PartialEq)]
pub enum EnumWithVariants {
    Zero,
    One,
    Two,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithEnum {
    pub inner: crate::data::EnumWithVariants,
    pub c: ::core::primitive::i32,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub enum SumWithVariants {
    VariantOne(crate::data::VariantOne),
    VariantTwo(crate::data::VariantTwo),
}

impl ::std::convert::From::<crate::data::VariantOne> for crate::data::SumWithVariants {
    fn from(value: crate::data::VariantOne) -> Self {
        Self::VariantOne(value)
    }
}

impl ::std::convert::From::<crate::data::VariantTwo> for crate::data::SumWithVariants {
    fn from(value: crate::data::VariantTwo) -> Self {
        Self::VariantTwo(value)
    }
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct VariantOne {
    pub a: ::core::primitive::i32,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct VariantTwo {
    pub a: ::core::primitive::i64,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub enum SumWithBoxedVariants {
    VariantOne(::std::boxed::Box::<crate::data::VariantOne>),
    VariantTwo(::std::boxed::Box::<crate::data::VariantTwo>),
}

impl ::std::convert::From::<crate::data::VariantOne> for crate::data::SumWithBoxedVariants {
    fn from(value: crate::data::VariantOne) -> Self {
        Self::VariantOne(::std::boxed::Box::new(value))
    }
}

impl ::std::convert::From::<crate::data::VariantTwo> for crate::data::SumWithBoxedVariants {
    fn from(value: crate::data::VariantTwo) -> Self {
        Self::VariantTwo(::std::boxed::Box::new(value))
    }
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithSum {
    pub inner: crate::data::SumWithVariants,
    pub b: ::core::primitive::i32,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithListOfShared {
    pub inner: ::std::vec::Vec::<::std::sync::Arc::<crate::data::StructWithInt32>>,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithDifferentSharedTypes {
    pub a: ::std::sync::Arc::<crate::data::StructWithInt32>,
    pub b: ::std::sync::Arc::<crate::data::StructWithInt64>,
    pub c: ::std::sync::Arc::<crate::data::StructWithInt32>,
}

#[derive(Clone, Debug, Hash, PartialEq)]
pub struct StructWithSharedSumAndVariant {
    pub a: ::std::sync::Arc::<crate::data::SumWithVariants>,
    pub b: ::std::sync::Arc::<crate::data::VariantOne>,
}