fidl_data_zither_enums/
enums.rs

1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// DO NOT EDIT.
6// Generated from FIDL library `zither.enums` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use zerocopy::IntoBytes;
11
12#[repr(u8)]
13#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
14pub enum Color {
15    Red = 0,
16    Orange = 1,
17    Yellow = 2,
18    Green = 3,
19    Blue = 4,
20    Indigo = 5,
21    Violet = 6,
22}
23
24#[repr(u8)]
25#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
26pub enum Uint8Limits {
27    Min = 0,
28    Max = 0b11111111,
29}
30
31#[repr(u16)]
32#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
33pub enum Uint16Limits {
34    Min = 0,
35    Max = 0xffff,
36}
37
38#[repr(u32)]
39#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
40pub enum Uint32Limits {
41    Min = 0,
42    Max = 0xffffffff,
43}
44
45#[repr(u64)]
46#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
47pub enum Uint64Limits {
48    Min = 0,
49    Max = 0xffffffffffffffff,
50}
51
52#[repr(i8)]
53#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
54pub enum Int8Limits {
55    Min = -0x80,
56    Max = 0x7f,
57}
58
59#[repr(i16)]
60#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
61pub enum Int16Limits {
62    Min = -0x8000,
63    Max = 0x7fff,
64}
65
66#[repr(i32)]
67#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
68pub enum Int32Limits {
69    Min = -0x80000000,
70    Max = 0x7fffffff,
71}
72
73#[repr(i64)]
74#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
75pub enum Int64Limits {
76    Min = -0x8000000000000000,
77    Max = 0x7fffffffffffffff,
78}
79
80pub const FOUR: u16 = 0b100;
81
82#[repr(u16)]
83#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
84pub enum EnumWithExpressions {
85    OrWithLiteral = 3,  // 0b01 | 0b10
86    OrWithConstant = 5, // 0b001 | FOUR
87}
88
89/// Enum with a one-line comment.
90#[repr(u8)]
91#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
92pub enum EnumWithOneLineComment {
93    /// Enum member with one-line comment.
94    MemberWithOneLineComment = 0,
95
96    /// Enum member
97    ///     with a
98    ///         many-line
99    ///           comment.
100    MemberWithManyLineComment = 1,
101}
102
103/// Enum
104///
105///     with a
106///         many-line
107///           comment.
108#[repr(u16)]
109#[derive(Clone, Copy, Debug, Eq, IntoBytes, PartialEq)]
110pub enum EnumWithManyLineComment {
111    Member = 0,
112}
113
114pub const RED: Color = Color::Red;
115
116pub const UINT8_MIN: Uint8Limits = Uint8Limits::Min;
117
118pub const UINT8_MAX: Uint8Limits = Uint8Limits::Max;
119
120pub const UINT16_MIN: Uint16Limits = Uint16Limits::Min;
121
122pub const UINT16_MAX: Uint16Limits = Uint16Limits::Max;
123
124pub const UINT32_MIN: Uint32Limits = Uint32Limits::Min;
125
126pub const UINT32_MAX: Uint32Limits = Uint32Limits::Max;
127
128pub const UINT64_MIN: Uint64Limits = Uint64Limits::Min;
129
130pub const UINT64_MAX: Uint64Limits = Uint64Limits::Max;
131
132pub const INT8_MIN: Int8Limits = Int8Limits::Min;
133
134pub const INT8_MAX: Int8Limits = Int8Limits::Max;
135
136pub const INT16_MIN: Int16Limits = Int16Limits::Min;
137
138pub const INT16_MAX: Int16Limits = Int16Limits::Max;
139
140pub const INT32_MIN: Int32Limits = Int32Limits::Min;
141
142pub const INT32_MAX: Int32Limits = Int32Limits::Max;
143
144pub const INT64_MIN: Int64Limits = Int64Limits::Min;
145
146pub const INT64_MAX: Int64Limits = Int64Limits::Max;