fidl_data_zither_aliases/
aliases.rs1#![allow(unused_imports)]
9
10use zerocopy::{FromBytes, IntoBytes};
11
12pub type BoolAlias = bool;
13
14pub type Int8Alias = i8;
15
16pub type Int16Alias = i16;
17
18pub type Int32Alias = i32;
19
20pub type Int64Alias = i64;
21
22pub type Uint8Alias = u8;
23
24pub type Uint16Alias = u16;
25
26pub type Uint32Alias = u32;
27
28pub type Uint64Alias = u64;
29
30pub const CONST_FROM_ALIAS: u8 = 0xff;
33
34#[repr(i16)]
35#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
36pub enum Enum {
37 Member = 0,
38}
39
40impl Enum {
41 pub fn from_raw(raw: i16) -> Option<Self> {
42 match raw {
43 0 => Some(Self::Member),
44
45 _ => None,
46 }
47 }
48}
49
50pub type EnumAlias = Enum;
51
52#[repr(u16)]
53#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
54pub enum Bits {
55 One = 1,
56}
57
58impl Bits {
59 pub fn from_raw(raw: u16) -> Option<Self> {
60 match raw {
61 1 => Some(Self::One),
62
63 _ => None,
64 }
65 }
66}
67
68pub type BitsAlias = Bits;
69
70#[repr(C)]
71#[derive(Clone, Copy, Debug, Eq, PartialEq)]
72pub struct Struct {
73 pub x: u64,
74 pub y: u64,
75 pub e: EnumAlias,
76}
77
78pub type StructAlias = Struct;
79
80pub type ArrayAlias = [u32; 4];
81
82pub type NestedArrayAlias = [[Struct; 8]; 4];
83
84pub type AliasWithOneLineComment = bool;
86
87pub type AliasWithManyLineComment = u8;