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
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// DO NOT EDIT.
// Generated from FIDL library `zither.enums` by zither, a Fuchsia platform tool.

#![allow(unused_imports)]

use zerocopy::AsBytes;

#[repr(u8)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Color {
    Red = 0,
    Orange = 1,
    Yellow = 2,
    Green = 3,
    Blue = 4,
    Indigo = 5,
    Violet = 6,
}

#[repr(u8)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Uint8Limits {
    Min = 0,
    Max = 0b11111111,
}

#[repr(u16)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Uint16Limits {
    Min = 0,
    Max = 0xffff,
}

#[repr(u32)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Uint32Limits {
    Min = 0,
    Max = 0xffffffff,
}

#[repr(u64)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Uint64Limits {
    Min = 0,
    Max = 0xffffffffffffffff,
}

#[repr(i8)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Int8Limits {
    Min = -0x80,
    Max = 0x7f,
}

#[repr(i16)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Int16Limits {
    Min = -0x8000,
    Max = 0x7fff,
}

#[repr(i32)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Int32Limits {
    Min = -0x80000000,
    Max = 0x7fffffff,
}

#[repr(i64)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum Int64Limits {
    Min = -0x8000000000000000,
    Max = 0x7fffffffffffffff,
}

pub const FOUR: u16 = 0b100;

#[repr(u16)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum EnumWithExpressions {
    OrWithLiteral = 3,  // 0b01 | 0b10
    OrWithConstant = 5, // 0b001 | FOUR
}

/// Enum with a one-line comment.
#[repr(u8)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum EnumWithOneLineComment {
    /// Enum member with one-line comment.
    MemberWithOneLineComment = 0,

    /// Enum member
    ///     with a
    ///         many-line
    ///           comment.
    MemberWithManyLineComment = 1,
}

/// Enum
///
///     with a
///         many-line
///           comment.
#[repr(u16)]
#[derive(AsBytes, Clone, Copy, Debug, Eq, PartialEq)]
pub enum EnumWithManyLineComment {
    Member = 0,
}

pub const RED: Color = Color::Red;

pub const UINT8_MIN: Uint8Limits = Uint8Limits::Min;

pub const UINT8_MAX: Uint8Limits = Uint8Limits::Max;

pub const UINT16_MIN: Uint16Limits = Uint16Limits::Min;

pub const UINT16_MAX: Uint16Limits = Uint16Limits::Max;

pub const UINT32_MIN: Uint32Limits = Uint32Limits::Min;

pub const UINT32_MAX: Uint32Limits = Uint32Limits::Max;

pub const UINT64_MIN: Uint64Limits = Uint64Limits::Min;

pub const UINT64_MAX: Uint64Limits = Uint64Limits::Max;

pub const INT8_MIN: Int8Limits = Int8Limits::Min;

pub const INT8_MAX: Int8Limits = Int8Limits::Max;

pub const INT16_MIN: Int16Limits = Int16Limits::Min;

pub const INT16_MAX: Int16Limits = Int16Limits::Max;

pub const INT32_MIN: Int32Limits = Int32Limits::Min;

pub const INT32_MAX: Int32Limits = Int32Limits::Max;

pub const INT64_MIN: Int64Limits = Int64Limits::Min;

pub const INT64_MAX: Int64Limits = Int64Limits::Max;