Debian Codegraph @

.cargo/vendor/cbindgen/tests/rust/struct.rs

raw
1 use std::marker::PhantomData;
2
3 struct Opaque {
4 x: i32,
5 y: f32,
6 }
7
8 #[repr(C)]
9 struct Normal {
10 x: i32,
11 y: f32,
12 }
13
14 #[repr(C)]
15 struct NormalWithZST {
16 x: i32,
17 y: f32,
18 z: (),
19 w: PhantomData<i32>,
20 v: PhantomPinned,
21 }
22
23 /// cbindgen:rename-all=GeckoCase
24 #[repr(C)]
25 struct TupleRenamed(i32, f32);
26
27 /// cbindgen:field-names=[x, y]
28 #[repr(C)]
29 struct TupleNamed(i32, f32);
30
31 #[no_mangle]
32 pub extern "C" fn root(
33 a: *mut Opaque,
34 b: Normal,
35 c: NormalWithZST,
36 d: TupleRenamed,
37 e: TupleNamed
38 ) { }