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
#![allow(
unused_parens, unused_mut, nonstandard_style, )]
#![recursion_limit = "512"]
#[cfg(target_os = "fuchsia")]
#[allow(unused_imports)]
use fuchsia_zircon as zx;
#[allow(unused_imports)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
encoding::zerocopy,
endpoints::{ControlHandle as _, Responder as _},
fidl_bits, fidl_enum, fidl_struct, fidl_table, fidl_union,
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
bitflags! {
pub struct BitsType: u32 {
const VALUE = 1;
const TRUE_ = 2;
}
}
impl BitsType {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
fidl_bits! {
name: BitsType,
prim_ty: u32,
strict: true,
}
pub const ANSWER: u16 = 42;
pub const ANSWER_IN_BINARY: u16 = 42;
pub const CONVERSION_FACTOR: f64 = 1.41421;
pub const DIAMOND: u64 = 1746410393481133080;
pub const ENABLED_FLAG: bool = true;
pub const FUCHSIA: u64 = 4054509061583223046;
pub const MIN_TEMP: f32 = -273.15;
pub const OFFSET: i8 = -33;
pub const POPULATION_USA_2018: u32 = 330000000;
pub const USERNAME: &str = "\"squeenze\"";
pub const ZX_CONST: u64 = fidl_zx::CHANNEL_MAX_MSG_BYTES;
pub const ZX_OBJ_VAL: fidl_zx::ObjType = fidl_zx::ObjType::Channel;
pub const ZX_RIGHTS_VAL: fidl_zx::Rights = fidl_zx::Rights::READ;
pub const BITS_PRIMITIVE_TRUE: u32 = BitsType::TRUE_.bits();
pub const BITS_PRIMITIVE_VAL: u32 = BitsType::VALUE.bits();
pub const BITS_TRUE: BitsType = BitsType::TRUE_;
pub const BITS_VAL: BitsType = BitsType::VALUE;
pub const ENUM_PRIMITIVE_TRUE: i32 = EnumType::True_.into_primitive();
pub const ENUM_PRIMITIVE_VAL: i32 = EnumType::Value.into_primitive();
pub const ENUM_TRUE: EnumType = EnumType::True_;
pub const ENUM_VAL: EnumType = EnumType::Value;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(i32)]
pub enum EnumType {
Value = 1,
True_ = 2,
}
impl EnumType {
#[inline]
pub fn from_primitive(prim: i32) -> Option<Self> {
match prim {
1 => Some(Self::Value),
2 => Some(Self::True_),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> i32 {
self as i32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
fidl_enum! {
name: EnumType,
prim_ty: i32,
strict: true,
min_member: Value,
}