forked from reitermarkus/rust-bindgen
/
transform-op.rs
226 lines (224 loc) · 6.3 KB
/
transform-op.rs
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* automatically generated by rust-bindgen */
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl<T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self {
__BindgenUnionField(::std::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ref(&self) -> &T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T {
::std::mem::transmute(self)
}
}
impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
}
}
impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StylePoint<T> {
pub x: T,
pub y: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StylePoint<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct StyleFoo<T> {
pub __bindgen_anon_1: __BindgenUnionField<StyleFoo__bindgen_ty_1>,
pub foo: __BindgenUnionField<StyleFoo_Foo_Body<T>>,
pub bar: __BindgenUnionField<StyleFoo_Bar_Body<T>>,
pub baz: __BindgenUnionField<StyleFoo_Baz_Body<T>>,
pub bindgen_union_field: [u8; 0usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
pub const StyleFoo_Tag_Foo: StyleFoo_Tag = 0;
pub const StyleFoo_Tag_Bar: StyleFoo_Tag = 0;
pub const StyleFoo_Tag_Baz: StyleFoo_Tag = 0;
pub const StyleFoo_Tag_Bazz: StyleFoo_Tag = 0;
pub type StyleFoo_Tag = u8;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleFoo_Foo_Body<T> {
pub tag: StyleFoo_Tag,
pub x: i32,
pub y: StylePoint<T>,
pub z: StylePoint<f32>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleFoo_Foo_Body<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleFoo_Bar_Body<T> {
pub tag: StyleFoo_Tag,
pub _0: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleFoo_Bar_Body<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleFoo_Baz_Body<T> {
pub tag: StyleFoo_Tag,
pub _0: StylePoint<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleFoo_Baz_Body<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleFoo__bindgen_ty_1 {
pub tag: StyleFoo_Tag,
}
impl Default for StyleFoo__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleBar<T> {
pub tag: StyleBar_Tag,
pub __bindgen_anon_1: StyleBar__bindgen_ty_1<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
pub const StyleBar_Tag_Bar1: StyleBar_Tag = 0;
pub const StyleBar_Tag_Bar2: StyleBar_Tag = 0;
pub const StyleBar_Tag_Bar3: StyleBar_Tag = 0;
pub const StyleBar_Tag_Bar4: StyleBar_Tag = 0;
pub type StyleBar_Tag = i32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleBar_StyleBar1_Body<T> {
pub x: i32,
pub y: StylePoint<T>,
pub z: StylePoint<f32>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleBar_StyleBar1_Body<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleBar_StyleBar2_Body<T> {
pub _0: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleBar_StyleBar2_Body<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct StyleBar_StyleBar3_Body<T> {
pub _0: StylePoint<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleBar_StyleBar3_Body<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct StyleBar__bindgen_ty_1<T> {
pub bar1: __BindgenUnionField<StyleBar_StyleBar1_Body<T>>,
pub bar2: __BindgenUnionField<StyleBar_StyleBar2_Body<T>>,
pub bar3: __BindgenUnionField<StyleBar_StyleBar3_Body<T>>,
pub bindgen_union_field: [u8; 0usize],
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
impl<T> Default for StyleBar<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[test]
fn __bindgen_test_layout_StylePoint_open0_float_close0_instantiation() {
assert_eq!(
::std::mem::size_of::<StylePoint<f32>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(StylePoint<f32>)
)
);
assert_eq!(
::std::mem::align_of::<StylePoint<f32>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(StylePoint<f32>)
)
);
}
#[test]
fn __bindgen_test_layout_StylePoint_open0_float_close0_instantiation_1() {
assert_eq!(
::std::mem::size_of::<StylePoint<f32>>(),
8usize,
concat!(
"Size of template specialization: ",
stringify!(StylePoint<f32>)
)
);
assert_eq!(
::std::mem::align_of::<StylePoint<f32>>(),
4usize,
concat!(
"Alignment of template specialization: ",
stringify!(StylePoint<f32>)
)
);
}