fidl_data_zither_structs/
structs.rs
1#![allow(unused_imports)]
9
10use bitflags::bitflags;
11use zerocopy::{FromBytes, IntoBytes};
12
13#[repr(C)]
14#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
15pub struct Empty {}
16
17#[repr(C)]
18#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
19pub struct Singleton {
20 pub value: u8,
21}
22
23#[repr(C)]
24#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
25pub struct Doubtleton {
26 pub first: Singleton,
27 pub second: Singleton,
28}
29
30#[repr(C)]
31#[derive(Clone, Copy, Debug, Eq, PartialEq)]
32pub struct PrimitiveMembers {
33 pub i64: i64,
34 pub u64: u64,
35 pub i32: i32,
36 pub u32: u32,
37 pub i16: i16,
38 pub u16: u16,
39 pub i8: i8,
40 pub u8: u8,
41 pub b: bool,
42}
43
44#[repr(C)]
45#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
46pub struct ArrayMembers {
47 pub u8s: [u8; 10],
48 pub singletons: [Singleton; 6],
49 pub nested_arrays1: [[u8; 10]; 20],
50 pub nested_arrays2: [[[i8; 1]; 2]; 3],
51}
52
53#[repr(i32)]
54#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
55pub enum Enum {
56 Zero = 0,
57 One = 1,
58}
59
60#[repr(C)]
61#[derive(IntoBytes, FromBytes, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
62pub struct Bits(u16);
63
64bitflags! {
65 impl Bits : u16 {
66 const ONE = 1 << 0;
67 const TWO = 1 << 1;
68 }
69}
70
71#[repr(C)]
72#[derive(Clone, Copy, Debug, Eq, PartialEq)]
73pub struct EnumAndBitsMembers {
74 pub e: Enum,
75 pub b: Bits,
76}
77
78#[repr(C)]
80#[derive(Clone, Copy, Debug, Eq, PartialEq)]
81pub struct StructWithOneLineComment {
82 pub member_with_one_line_comment: u32,
84
85 pub member_with_many_line_comment: bool,
90}
91
92#[repr(C)]
98#[derive(Clone, Copy, Debug, Eq, FromBytes, IntoBytes, PartialEq)]
99pub struct StructWithManyLineComment {
100 pub member: u16,
101}