Debian Codegraph @

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

raw
1 bitflags! {
2 /// Constants shared by multiple CSS Box Alignment properties
3 ///
4 /// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
5 #[derive(MallocSizeOf)]
6 #[repr(C)]
7 pub struct AlignFlags: u8 {
8 /// 'auto'
9 const AUTO = 0;
10 /// 'normal'
11 const NORMAL = 1;
12 /// 'start'
13 const START = 1 << 1;
14 /// 'end'
15 const END = 1 << 2;
16 const ALIAS = Self::END.bits;
17 /// 'flex-start'
18 const FLEX_START = 1 << 3;
19 const MIXED = 1 << 4 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits;
20 const MIXED_SELF = 1 << 5 | AlignFlags::FLEX_START.bits | AlignFlags::END.bits;
21 }
22 }
23
24 bitflags! {
25 #[repr(C)]
26 pub struct DebugFlags: u32 {
27 /// Flag with the topmost bit set of the u32
28 const BIGGEST_ALLOWED = 1 << 31;
29 }
30 }
31
32 bitflags! {
33 #[repr(C)]
34 pub struct LargeFlags: u64 {
35 /// Flag with a very large shift that usually would be narrowed.
36 const LARGE_SHIFT = 1u64 << 44;
37 const INVERTED = !Self::LARGE_SHIFT.bits;
38 }
39 }
40
41
42 #[no_mangle]
43 pub extern "C" fn root(flags: AlignFlags, bigger_flags: DebugFlags, largest_flags: LargeFlags) {}