fidl_next_common_fdf/
fidl_next_common_fdf.rs1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 #[repr(u32)]
9 pub enum ObjType {
10 Channel = 4,
11 }
12 impl ::core::convert::TryFrom<u32> for ObjType {
13 type Error = ::fidl_next::UnknownStrictEnumMemberError;
14 fn try_from(
15 value: u32,
16 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
17 match value {
18 4 => Ok(Self::Channel),
19
20 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
21 }
22 }
23 }
24
25 impl ::std::convert::From<ObjType> for u32 {
26 fn from(value: ObjType) -> Self {
27 match value {
28 ObjType::Channel => 4,
29 }
30 }
31 }
32
33 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ObjType, ___E> for ObjType
34 where
35 ___E: ?Sized,
36 {
37 #[inline]
38 fn encode(
39 self,
40 encoder: &mut ___E,
41 out: &mut ::core::mem::MaybeUninit<crate::wire::ObjType>,
42 _: (),
43 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
44 ::fidl_next::Encode::encode(&self, encoder, out, ())
45 }
46 }
47
48 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ObjType, ___E> for &'a ObjType
49 where
50 ___E: ?Sized,
51 {
52 #[inline]
53 fn encode(
54 self,
55 encoder: &mut ___E,
56 out: &mut ::core::mem::MaybeUninit<crate::wire::ObjType>,
57 _: (),
58 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
59 ::fidl_next::munge!(let crate::wire::ObjType { value } = out);
60 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
61 ObjType::Channel => 4,
62 }));
63
64 Ok(())
65 }
66 }
67
68 impl ::core::convert::From<crate::wire::ObjType> for ObjType {
69 fn from(wire: crate::wire::ObjType) -> Self {
70 match u32::from(wire.value) {
71 4 => Self::Channel,
72
73 _ => unsafe { ::core::hint::unreachable_unchecked() },
74 }
75 }
76 }
77
78 impl ::fidl_next::FromWire<crate::wire::ObjType> for ObjType {
79 #[inline]
80 fn from_wire(wire: crate::wire::ObjType) -> Self {
81 Self::from(wire)
82 }
83 }
84
85 impl ::fidl_next::FromWireRef<crate::wire::ObjType> for ObjType {
86 #[inline]
87 fn from_wire_ref(wire: &crate::wire::ObjType) -> Self {
88 Self::from(*wire)
89 }
90 }
91}
92
93pub mod wire {
94
95 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
97 #[repr(transparent)]
98 pub struct ObjType {
99 pub(crate) value: ::fidl_next::wire::Uint32,
100 }
101
102 impl ::fidl_next::Constrained for ObjType {
103 type Constraint = ();
104
105 fn validate(
106 _: ::fidl_next::Slot<'_, Self>,
107 _: Self::Constraint,
108 ) -> Result<(), ::fidl_next::ValidationError> {
109 Ok(())
110 }
111 }
112
113 unsafe impl ::fidl_next::Wire for ObjType {
114 type Narrowed<'de> = Self;
115
116 #[inline]
117 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
118 }
120 }
121
122 impl ObjType {
123 pub const CHANNEL: ObjType = ObjType { value: ::fidl_next::wire::Uint32(4) };
124 }
125
126 unsafe impl<___D> ::fidl_next::Decode<___D> for ObjType
127 where
128 ___D: ?Sized,
129 {
130 fn decode(
131 slot: ::fidl_next::Slot<'_, Self>,
132 _: &mut ___D,
133 _: (),
134 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
135 ::fidl_next::munge!(let Self { value } = slot);
136
137 match u32::from(*value) {
138 4 => (),
139 unknown => {
140 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
141 }
142 }
143
144 Ok(())
145 }
146 }
147
148 impl ::core::convert::From<crate::natural::ObjType> for ObjType {
149 fn from(natural: crate::natural::ObjType) -> Self {
150 match natural {
151 crate::natural::ObjType::Channel => ObjType::CHANNEL,
152 }
153 }
154 }
155
156 impl ::fidl_next::IntoNatural for ObjType {
157 type Natural = crate::natural::ObjType;
158 }
159}
160
161pub mod wire_optional {}
162
163pub mod generic {}
164
165pub use self::natural::*;