1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const CLIENT_SUITE_VERSION: u64 = 1;
12
13#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14#[repr(u32)]
15pub enum FidlErrorKind {
16 OtherError = 1,
17 DecodingError = 2,
18 ChannelPeerClosed = 3,
19 UnknownMethod = 4,
20 UnexpectedMessage = 5,
21}
22
23impl FidlErrorKind {
24 #[inline]
25 pub fn from_primitive(prim: u32) -> Option<Self> {
26 match prim {
27 1 => Some(Self::OtherError),
28 2 => Some(Self::DecodingError),
29 3 => Some(Self::ChannelPeerClosed),
30 4 => Some(Self::UnknownMethod),
31 5 => Some(Self::UnexpectedMessage),
32 _ => None,
33 }
34 }
35
36 #[inline]
37 pub const fn into_primitive(self) -> u32 {
38 self as u32
39 }
40}
41
42#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
43#[repr(u32)]
44pub enum IoStyle {
45 Sync = 1,
46 Async = 2,
47}
48
49impl IoStyle {
50 #[inline]
51 pub fn from_primitive(prim: u32) -> Option<Self> {
52 match prim {
53 1 => Some(Self::Sync),
54 2 => Some(Self::Async),
55 _ => None,
56 }
57 }
58
59 #[inline]
60 pub const fn into_primitive(self) -> u32 {
61 self as u32
62 }
63}
64
65#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
66pub enum Test {
67 Setup,
68 TwoWayNoPayload,
69 TwoWayStructPayload,
70 TwoWayTablePayload,
71 TwoWayUnionPayload,
72 TwoWayResultWithPayload,
73 TwoWayResultWithError,
74 TwoWayStructRequest,
75 TwoWayTableRequest,
76 TwoWayUnionRequest,
77 OneWayNoRequest,
78 OneWayStructRequest,
79 OneWayTableRequest,
80 OneWayUnionRequest,
81 ReceiveEventNoPayload,
82 ReceiveEventStructPayload,
83 ReceiveEventTablePayload,
84 ReceiveEventUnionPayload,
85 GracefulFailureDuringCallAfterPeerClose,
86 ReceiveEventBadMagicNumber,
87 ReceiveEventUnexpectedTxid,
88 ReceiveEventUnknownOrdinal,
89 ReceiveResponseBadMagicNumber,
90 ReceiveResponseUnexpectedTxid,
91 ReceiveResponseWrongOrdinalKnown,
92 ReceiveResponseWrongOrdinalUnknown,
93 V1TwoWayNoPayload,
94 V1TwoWayStructPayload,
95 OneWayCallDoNotReportPeerClosed,
96 OneWayStrictSend,
97 OneWayFlexibleSend,
98 TwoWayStrictSend,
99 TwoWayStrictSendMismatchedStrictness,
100 TwoWayStrictSendNonEmptyPayload,
101 TwoWayStrictErrorSyntaxSendSuccessResponse,
102 TwoWayStrictErrorSyntaxSendErrorResponse,
103 TwoWayStrictErrorSyntaxSendUnknownMethodResponse,
104 TwoWayStrictErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse,
105 TwoWayStrictErrorSyntaxSendNonEmptyPayload,
106 TwoWayFlexibleSendSuccessResponse,
107 TwoWayFlexibleSendErrorResponse,
108 TwoWayFlexibleSendUnknownMethodResponse,
109 TwoWayFlexibleSendMismatchedStrictnessUnknownMethodResponse,
110 TwoWayFlexibleSendOtherFrameworkErrResponse,
111 TwoWayFlexibleSendNonEmptyPayloadSuccessResponse,
112 TwoWayFlexibleSendNonEmptyPayloadUnknownMethodResponse,
113 TwoWayFlexibleErrorSyntaxSendSuccessResponse,
114 TwoWayFlexibleErrorSyntaxSendErrorResponse,
115 TwoWayFlexibleErrorSyntaxSendUnknownMethodResponse,
116 TwoWayFlexibleErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse,
117 TwoWayFlexibleErrorSyntaxSendOtherFrameworkErrResponse,
118 TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadSuccessResponse,
119 TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadUnknownMethodResponse,
120 ReceiveStrictEvent,
121 ReceiveStrictEventMismatchedStrictness,
122 ReceiveFlexibleEvent,
123 ReceiveFlexibleEventMismatchedStrictness,
124 UnknownStrictEventOpenProtocol,
125 UnknownFlexibleEventOpenProtocol,
126 UnknownStrictEventAjarProtocol,
127 UnknownFlexibleEventAjarProtocol,
128 UnknownStrictEventClosedProtocol,
129 UnknownFlexibleEventClosedProtocol,
130 UnknownStrictServerInitiatedTwoWay,
131 UnknownFlexibleServerInitiatedTwoWay,
132 #[doc(hidden)]
133 __SourceBreaking {
134 unknown_ordinal: u32,
135 },
136}
137
138#[macro_export]
140macro_rules! TestUnknown {
141 () => {
142 _
143 };
144}
145
146impl Test {
147 #[inline]
148 pub fn from_primitive(prim: u32) -> Option<Self> {
149 match prim {
150 1 => Some(Self::Setup),
151 2 => Some(Self::TwoWayNoPayload),
152 42 => Some(Self::TwoWayStructPayload),
153 43 => Some(Self::TwoWayTablePayload),
154 44 => Some(Self::TwoWayUnionPayload),
155 45 => Some(Self::TwoWayResultWithPayload),
156 46 => Some(Self::TwoWayResultWithError),
157 52 => Some(Self::TwoWayStructRequest),
158 53 => Some(Self::TwoWayTableRequest),
159 54 => Some(Self::TwoWayUnionRequest),
160 48 => Some(Self::OneWayNoRequest),
161 49 => Some(Self::OneWayStructRequest),
162 50 => Some(Self::OneWayTableRequest),
163 51 => Some(Self::OneWayUnionRequest),
164 55 => Some(Self::ReceiveEventNoPayload),
165 56 => Some(Self::ReceiveEventStructPayload),
166 57 => Some(Self::ReceiveEventTablePayload),
167 58 => Some(Self::ReceiveEventUnionPayload),
168 3 => Some(Self::GracefulFailureDuringCallAfterPeerClose),
169 60 => Some(Self::ReceiveEventBadMagicNumber),
170 61 => Some(Self::ReceiveEventUnexpectedTxid),
171 62 => Some(Self::ReceiveEventUnknownOrdinal),
172 63 => Some(Self::ReceiveResponseBadMagicNumber),
173 64 => Some(Self::ReceiveResponseUnexpectedTxid),
174 65 => Some(Self::ReceiveResponseWrongOrdinalKnown),
175 67 => Some(Self::ReceiveResponseWrongOrdinalUnknown),
176 40 => Some(Self::V1TwoWayNoPayload),
177 41 => Some(Self::V1TwoWayStructPayload),
178 59 => Some(Self::OneWayCallDoNotReportPeerClosed),
179 4 => Some(Self::OneWayStrictSend),
180 5 => Some(Self::OneWayFlexibleSend),
181 6 => Some(Self::TwoWayStrictSend),
182 7 => Some(Self::TwoWayStrictSendMismatchedStrictness),
183 38 => Some(Self::TwoWayStrictSendNonEmptyPayload),
184 8 => Some(Self::TwoWayStrictErrorSyntaxSendSuccessResponse),
185 9 => Some(Self::TwoWayStrictErrorSyntaxSendErrorResponse),
186 10 => Some(Self::TwoWayStrictErrorSyntaxSendUnknownMethodResponse),
187 11 => Some(Self::TwoWayStrictErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse),
188 39 => Some(Self::TwoWayStrictErrorSyntaxSendNonEmptyPayload),
189 12 => Some(Self::TwoWayFlexibleSendSuccessResponse),
190 13 => Some(Self::TwoWayFlexibleSendErrorResponse),
191 14 => Some(Self::TwoWayFlexibleSendUnknownMethodResponse),
192 15 => Some(Self::TwoWayFlexibleSendMismatchedStrictnessUnknownMethodResponse),
193 16 => Some(Self::TwoWayFlexibleSendOtherFrameworkErrResponse),
194 17 => Some(Self::TwoWayFlexibleSendNonEmptyPayloadSuccessResponse),
195 18 => Some(Self::TwoWayFlexibleSendNonEmptyPayloadUnknownMethodResponse),
196 19 => Some(Self::TwoWayFlexibleErrorSyntaxSendSuccessResponse),
197 20 => Some(Self::TwoWayFlexibleErrorSyntaxSendErrorResponse),
198 21 => Some(Self::TwoWayFlexibleErrorSyntaxSendUnknownMethodResponse),
199 22 => {
200 Some(Self::TwoWayFlexibleErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse)
201 }
202 23 => Some(Self::TwoWayFlexibleErrorSyntaxSendOtherFrameworkErrResponse),
203 24 => Some(Self::TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadSuccessResponse),
204 25 => Some(Self::TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadUnknownMethodResponse),
205 26 => Some(Self::ReceiveStrictEvent),
206 27 => Some(Self::ReceiveStrictEventMismatchedStrictness),
207 28 => Some(Self::ReceiveFlexibleEvent),
208 29 => Some(Self::ReceiveFlexibleEventMismatchedStrictness),
209 30 => Some(Self::UnknownStrictEventOpenProtocol),
210 31 => Some(Self::UnknownFlexibleEventOpenProtocol),
211 32 => Some(Self::UnknownStrictEventAjarProtocol),
212 33 => Some(Self::UnknownFlexibleEventAjarProtocol),
213 34 => Some(Self::UnknownStrictEventClosedProtocol),
214 35 => Some(Self::UnknownFlexibleEventClosedProtocol),
215 36 => Some(Self::UnknownStrictServerInitiatedTwoWay),
216 37 => Some(Self::UnknownFlexibleServerInitiatedTwoWay),
217 _ => None,
218 }
219 }
220
221 #[inline]
222 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
223 match prim {
224 1 => Self::Setup,
225 2 => Self::TwoWayNoPayload,
226 42 => Self::TwoWayStructPayload,
227 43 => Self::TwoWayTablePayload,
228 44 => Self::TwoWayUnionPayload,
229 45 => Self::TwoWayResultWithPayload,
230 46 => Self::TwoWayResultWithError,
231 52 => Self::TwoWayStructRequest,
232 53 => Self::TwoWayTableRequest,
233 54 => Self::TwoWayUnionRequest,
234 48 => Self::OneWayNoRequest,
235 49 => Self::OneWayStructRequest,
236 50 => Self::OneWayTableRequest,
237 51 => Self::OneWayUnionRequest,
238 55 => Self::ReceiveEventNoPayload,
239 56 => Self::ReceiveEventStructPayload,
240 57 => Self::ReceiveEventTablePayload,
241 58 => Self::ReceiveEventUnionPayload,
242 3 => Self::GracefulFailureDuringCallAfterPeerClose,
243 60 => Self::ReceiveEventBadMagicNumber,
244 61 => Self::ReceiveEventUnexpectedTxid,
245 62 => Self::ReceiveEventUnknownOrdinal,
246 63 => Self::ReceiveResponseBadMagicNumber,
247 64 => Self::ReceiveResponseUnexpectedTxid,
248 65 => Self::ReceiveResponseWrongOrdinalKnown,
249 67 => Self::ReceiveResponseWrongOrdinalUnknown,
250 40 => Self::V1TwoWayNoPayload,
251 41 => Self::V1TwoWayStructPayload,
252 59 => Self::OneWayCallDoNotReportPeerClosed,
253 4 => Self::OneWayStrictSend,
254 5 => Self::OneWayFlexibleSend,
255 6 => Self::TwoWayStrictSend,
256 7 => Self::TwoWayStrictSendMismatchedStrictness,
257 38 => Self::TwoWayStrictSendNonEmptyPayload,
258 8 => Self::TwoWayStrictErrorSyntaxSendSuccessResponse,
259 9 => Self::TwoWayStrictErrorSyntaxSendErrorResponse,
260 10 => Self::TwoWayStrictErrorSyntaxSendUnknownMethodResponse,
261 11 => Self::TwoWayStrictErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse,
262 39 => Self::TwoWayStrictErrorSyntaxSendNonEmptyPayload,
263 12 => Self::TwoWayFlexibleSendSuccessResponse,
264 13 => Self::TwoWayFlexibleSendErrorResponse,
265 14 => Self::TwoWayFlexibleSendUnknownMethodResponse,
266 15 => Self::TwoWayFlexibleSendMismatchedStrictnessUnknownMethodResponse,
267 16 => Self::TwoWayFlexibleSendOtherFrameworkErrResponse,
268 17 => Self::TwoWayFlexibleSendNonEmptyPayloadSuccessResponse,
269 18 => Self::TwoWayFlexibleSendNonEmptyPayloadUnknownMethodResponse,
270 19 => Self::TwoWayFlexibleErrorSyntaxSendSuccessResponse,
271 20 => Self::TwoWayFlexibleErrorSyntaxSendErrorResponse,
272 21 => Self::TwoWayFlexibleErrorSyntaxSendUnknownMethodResponse,
273 22 => Self::TwoWayFlexibleErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse,
274 23 => Self::TwoWayFlexibleErrorSyntaxSendOtherFrameworkErrResponse,
275 24 => Self::TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadSuccessResponse,
276 25 => Self::TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadUnknownMethodResponse,
277 26 => Self::ReceiveStrictEvent,
278 27 => Self::ReceiveStrictEventMismatchedStrictness,
279 28 => Self::ReceiveFlexibleEvent,
280 29 => Self::ReceiveFlexibleEventMismatchedStrictness,
281 30 => Self::UnknownStrictEventOpenProtocol,
282 31 => Self::UnknownFlexibleEventOpenProtocol,
283 32 => Self::UnknownStrictEventAjarProtocol,
284 33 => Self::UnknownFlexibleEventAjarProtocol,
285 34 => Self::UnknownStrictEventClosedProtocol,
286 35 => Self::UnknownFlexibleEventClosedProtocol,
287 36 => Self::UnknownStrictServerInitiatedTwoWay,
288 37 => Self::UnknownFlexibleServerInitiatedTwoWay,
289 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
290 }
291 }
292
293 #[inline]
294 pub fn unknown() -> Self {
295 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
296 }
297
298 #[inline]
299 pub const fn into_primitive(self) -> u32 {
300 match self {
301 Self::Setup => 1,
302 Self::TwoWayNoPayload => 2,
303 Self::TwoWayStructPayload => 42,
304 Self::TwoWayTablePayload => 43,
305 Self::TwoWayUnionPayload => 44,
306 Self::TwoWayResultWithPayload => 45,
307 Self::TwoWayResultWithError => 46,
308 Self::TwoWayStructRequest => 52,
309 Self::TwoWayTableRequest => 53,
310 Self::TwoWayUnionRequest => 54,
311 Self::OneWayNoRequest => 48,
312 Self::OneWayStructRequest => 49,
313 Self::OneWayTableRequest => 50,
314 Self::OneWayUnionRequest => 51,
315 Self::ReceiveEventNoPayload => 55,
316 Self::ReceiveEventStructPayload => 56,
317 Self::ReceiveEventTablePayload => 57,
318 Self::ReceiveEventUnionPayload => 58,
319 Self::GracefulFailureDuringCallAfterPeerClose => 3,
320 Self::ReceiveEventBadMagicNumber => 60,
321 Self::ReceiveEventUnexpectedTxid => 61,
322 Self::ReceiveEventUnknownOrdinal => 62,
323 Self::ReceiveResponseBadMagicNumber => 63,
324 Self::ReceiveResponseUnexpectedTxid => 64,
325 Self::ReceiveResponseWrongOrdinalKnown => 65,
326 Self::ReceiveResponseWrongOrdinalUnknown => 67,
327 Self::V1TwoWayNoPayload => 40,
328 Self::V1TwoWayStructPayload => 41,
329 Self::OneWayCallDoNotReportPeerClosed => 59,
330 Self::OneWayStrictSend => 4,
331 Self::OneWayFlexibleSend => 5,
332 Self::TwoWayStrictSend => 6,
333 Self::TwoWayStrictSendMismatchedStrictness => 7,
334 Self::TwoWayStrictSendNonEmptyPayload => 38,
335 Self::TwoWayStrictErrorSyntaxSendSuccessResponse => 8,
336 Self::TwoWayStrictErrorSyntaxSendErrorResponse => 9,
337 Self::TwoWayStrictErrorSyntaxSendUnknownMethodResponse => 10,
338 Self::TwoWayStrictErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse => 11,
339 Self::TwoWayStrictErrorSyntaxSendNonEmptyPayload => 39,
340 Self::TwoWayFlexibleSendSuccessResponse => 12,
341 Self::TwoWayFlexibleSendErrorResponse => 13,
342 Self::TwoWayFlexibleSendUnknownMethodResponse => 14,
343 Self::TwoWayFlexibleSendMismatchedStrictnessUnknownMethodResponse => 15,
344 Self::TwoWayFlexibleSendOtherFrameworkErrResponse => 16,
345 Self::TwoWayFlexibleSendNonEmptyPayloadSuccessResponse => 17,
346 Self::TwoWayFlexibleSendNonEmptyPayloadUnknownMethodResponse => 18,
347 Self::TwoWayFlexibleErrorSyntaxSendSuccessResponse => 19,
348 Self::TwoWayFlexibleErrorSyntaxSendErrorResponse => 20,
349 Self::TwoWayFlexibleErrorSyntaxSendUnknownMethodResponse => 21,
350 Self::TwoWayFlexibleErrorSyntaxSendMismatchedStrictnessUnknownMethodResponse => 22,
351 Self::TwoWayFlexibleErrorSyntaxSendOtherFrameworkErrResponse => 23,
352 Self::TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadSuccessResponse => 24,
353 Self::TwoWayFlexibleErrorSyntaxSendNonEmptyPayloadUnknownMethodResponse => 25,
354 Self::ReceiveStrictEvent => 26,
355 Self::ReceiveStrictEventMismatchedStrictness => 27,
356 Self::ReceiveFlexibleEvent => 28,
357 Self::ReceiveFlexibleEventMismatchedStrictness => 29,
358 Self::UnknownStrictEventOpenProtocol => 30,
359 Self::UnknownFlexibleEventOpenProtocol => 31,
360 Self::UnknownStrictEventAjarProtocol => 32,
361 Self::UnknownFlexibleEventAjarProtocol => 33,
362 Self::UnknownStrictEventClosedProtocol => 34,
363 Self::UnknownFlexibleEventClosedProtocol => 35,
364 Self::UnknownStrictServerInitiatedTwoWay => 36,
365 Self::UnknownFlexibleServerInitiatedTwoWay => 37,
366 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
367 }
368 }
369
370 #[inline]
371 pub fn is_unknown(&self) -> bool {
372 match self {
373 Self::__SourceBreaking { unknown_ordinal: _ } => true,
374 _ => false,
375 }
376 }
377}
378
379#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
380pub struct Empty;
381
382impl fidl::Persistable for Empty {}
383
384#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
385#[repr(C)]
386pub struct NonEmptyPayload {
387 pub some_field: i32,
388}
389
390impl fidl::Persistable for NonEmptyPayload {}
391
392#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
393#[repr(C)]
394pub struct RunnerGetVersionResponse {
395 pub version: u64,
396}
397
398impl fidl::Persistable for RunnerGetVersionResponse {}
399
400#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
401pub struct RunnerIsTestEnabledRequest {
402 pub test: Test,
403}
404
405impl fidl::Persistable for RunnerIsTestEnabledRequest {}
406
407#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
408pub struct RunnerIsTestEnabledResponse {
409 pub is_enabled: bool,
410}
411
412impl fidl::Persistable for RunnerIsTestEnabledResponse {}
413
414#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
415#[repr(C)]
416pub struct UnknownEvent {
417 pub ordinal: u64,
418}
419
420impl fidl::Persistable for UnknownEvent {}
421
422#[derive(Clone, Debug, Default, PartialEq)]
423pub struct BindingsProperties {
424 pub io_style: Option<IoStyle>,
425 #[doc(hidden)]
426 pub __source_breaking: fidl::marker::SourceBreaking,
427}
428
429impl fidl::Persistable for BindingsProperties {}
430
431#[derive(Clone, Debug, Default, PartialEq)]
432pub struct TablePayload {
433 pub some_field: Option<i32>,
434 #[doc(hidden)]
435 pub __source_breaking: fidl::marker::SourceBreaking,
436}
437
438impl fidl::Persistable for TablePayload {}
439
440#[derive(Clone, Debug)]
441pub enum AjarTargetEventReport {
442 FidlError(FidlErrorKind),
443 UnknownEvent(UnknownEvent),
444 #[doc(hidden)]
445 __SourceBreaking {
446 unknown_ordinal: u64,
447 },
448}
449
450#[macro_export]
452macro_rules! AjarTargetEventReportUnknown {
453 () => {
454 _
455 };
456}
457
458impl PartialEq for AjarTargetEventReport {
460 fn eq(&self, other: &Self) -> bool {
461 match (self, other) {
462 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
463 (Self::UnknownEvent(x), Self::UnknownEvent(y)) => *x == *y,
464 _ => false,
465 }
466 }
467}
468
469impl AjarTargetEventReport {
470 #[inline]
471 pub fn ordinal(&self) -> u64 {
472 match *self {
473 Self::FidlError(_) => 1,
474 Self::UnknownEvent(_) => 2,
475 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
476 }
477 }
478
479 #[inline]
480 pub fn unknown_variant_for_testing() -> Self {
481 Self::__SourceBreaking { unknown_ordinal: 0 }
482 }
483
484 #[inline]
485 pub fn is_unknown(&self) -> bool {
486 match self {
487 Self::__SourceBreaking { .. } => true,
488 _ => false,
489 }
490 }
491}
492
493impl fidl::Persistable for AjarTargetEventReport {}
494
495#[derive(Clone, Debug)]
496pub enum ClosedTargetEventReport {
497 FidlError(FidlErrorKind),
498 OnEventNoPayload(Empty),
499 OnEventStructPayload(NonEmptyPayload),
500 OnEventTablePayload(TablePayload),
501 OnEventUnionPayload(UnionPayload),
502 #[doc(hidden)]
503 __SourceBreaking {
504 unknown_ordinal: u64,
505 },
506}
507
508#[macro_export]
510macro_rules! ClosedTargetEventReportUnknown {
511 () => {
512 _
513 };
514}
515
516impl PartialEq for ClosedTargetEventReport {
518 fn eq(&self, other: &Self) -> bool {
519 match (self, other) {
520 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
521 (Self::OnEventNoPayload(x), Self::OnEventNoPayload(y)) => *x == *y,
522 (Self::OnEventStructPayload(x), Self::OnEventStructPayload(y)) => *x == *y,
523 (Self::OnEventTablePayload(x), Self::OnEventTablePayload(y)) => *x == *y,
524 (Self::OnEventUnionPayload(x), Self::OnEventUnionPayload(y)) => *x == *y,
525 _ => false,
526 }
527 }
528}
529
530impl ClosedTargetEventReport {
531 #[inline]
532 pub fn ordinal(&self) -> u64 {
533 match *self {
534 Self::FidlError(_) => 1,
535 Self::OnEventNoPayload(_) => 2,
536 Self::OnEventStructPayload(_) => 3,
537 Self::OnEventTablePayload(_) => 4,
538 Self::OnEventUnionPayload(_) => 5,
539 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
540 }
541 }
542
543 #[inline]
544 pub fn unknown_variant_for_testing() -> Self {
545 Self::__SourceBreaking { unknown_ordinal: 0 }
546 }
547
548 #[inline]
549 pub fn is_unknown(&self) -> bool {
550 match self {
551 Self::__SourceBreaking { .. } => true,
552 _ => false,
553 }
554 }
555}
556
557impl fidl::Persistable for ClosedTargetEventReport {}
558
559#[derive(Clone, Debug)]
560pub enum EmptyResultClassification {
561 Success(Empty),
562 FidlError(FidlErrorKind),
563 #[doc(hidden)]
564 __SourceBreaking {
565 unknown_ordinal: u64,
566 },
567}
568
569#[macro_export]
571macro_rules! EmptyResultClassificationUnknown {
572 () => {
573 _
574 };
575}
576
577impl PartialEq for EmptyResultClassification {
579 fn eq(&self, other: &Self) -> bool {
580 match (self, other) {
581 (Self::Success(x), Self::Success(y)) => *x == *y,
582 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
583 _ => false,
584 }
585 }
586}
587
588impl EmptyResultClassification {
589 #[inline]
590 pub fn ordinal(&self) -> u64 {
591 match *self {
592 Self::Success(_) => 1,
593 Self::FidlError(_) => 3,
594 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
595 }
596 }
597
598 #[inline]
599 pub fn unknown_variant_for_testing() -> Self {
600 Self::__SourceBreaking { unknown_ordinal: 0 }
601 }
602
603 #[inline]
604 pub fn is_unknown(&self) -> bool {
605 match self {
606 Self::__SourceBreaking { .. } => true,
607 _ => false,
608 }
609 }
610}
611
612impl fidl::Persistable for EmptyResultClassification {}
613
614#[derive(Clone, Debug)]
615pub enum EmptyResultWithErrorClassification {
616 Success(Empty),
617 ApplicationError(i32),
618 FidlError(FidlErrorKind),
619 #[doc(hidden)]
620 __SourceBreaking {
621 unknown_ordinal: u64,
622 },
623}
624
625#[macro_export]
627macro_rules! EmptyResultWithErrorClassificationUnknown {
628 () => {
629 _
630 };
631}
632
633impl PartialEq for EmptyResultWithErrorClassification {
635 fn eq(&self, other: &Self) -> bool {
636 match (self, other) {
637 (Self::Success(x), Self::Success(y)) => *x == *y,
638 (Self::ApplicationError(x), Self::ApplicationError(y)) => *x == *y,
639 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
640 _ => false,
641 }
642 }
643}
644
645impl EmptyResultWithErrorClassification {
646 #[inline]
647 pub fn ordinal(&self) -> u64 {
648 match *self {
649 Self::Success(_) => 1,
650 Self::ApplicationError(_) => 2,
651 Self::FidlError(_) => 3,
652 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
653 }
654 }
655
656 #[inline]
657 pub fn unknown_variant_for_testing() -> Self {
658 Self::__SourceBreaking { unknown_ordinal: 0 }
659 }
660
661 #[inline]
662 pub fn is_unknown(&self) -> bool {
663 match self {
664 Self::__SourceBreaking { .. } => true,
665 _ => false,
666 }
667 }
668}
669
670impl fidl::Persistable for EmptyResultWithErrorClassification {}
671
672#[derive(Clone, Debug)]
673pub enum NonEmptyResultClassification {
674 Success(NonEmptyPayload),
675 FidlError(FidlErrorKind),
676 #[doc(hidden)]
677 __SourceBreaking {
678 unknown_ordinal: u64,
679 },
680}
681
682#[macro_export]
684macro_rules! NonEmptyResultClassificationUnknown {
685 () => {
686 _
687 };
688}
689
690impl PartialEq for NonEmptyResultClassification {
692 fn eq(&self, other: &Self) -> bool {
693 match (self, other) {
694 (Self::Success(x), Self::Success(y)) => *x == *y,
695 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
696 _ => false,
697 }
698 }
699}
700
701impl NonEmptyResultClassification {
702 #[inline]
703 pub fn ordinal(&self) -> u64 {
704 match *self {
705 Self::Success(_) => 1,
706 Self::FidlError(_) => 3,
707 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
708 }
709 }
710
711 #[inline]
712 pub fn unknown_variant_for_testing() -> Self {
713 Self::__SourceBreaking { unknown_ordinal: 0 }
714 }
715
716 #[inline]
717 pub fn is_unknown(&self) -> bool {
718 match self {
719 Self::__SourceBreaking { .. } => true,
720 _ => false,
721 }
722 }
723}
724
725impl fidl::Persistable for NonEmptyResultClassification {}
726
727#[derive(Clone, Debug)]
728pub enum NonEmptyResultWithErrorClassification {
729 Success(NonEmptyPayload),
730 ApplicationError(i32),
731 FidlError(FidlErrorKind),
732 #[doc(hidden)]
733 __SourceBreaking {
734 unknown_ordinal: u64,
735 },
736}
737
738#[macro_export]
740macro_rules! NonEmptyResultWithErrorClassificationUnknown {
741 () => {
742 _
743 };
744}
745
746impl PartialEq for NonEmptyResultWithErrorClassification {
748 fn eq(&self, other: &Self) -> bool {
749 match (self, other) {
750 (Self::Success(x), Self::Success(y)) => *x == *y,
751 (Self::ApplicationError(x), Self::ApplicationError(y)) => *x == *y,
752 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
753 _ => false,
754 }
755 }
756}
757
758impl NonEmptyResultWithErrorClassification {
759 #[inline]
760 pub fn ordinal(&self) -> u64 {
761 match *self {
762 Self::Success(_) => 1,
763 Self::ApplicationError(_) => 2,
764 Self::FidlError(_) => 3,
765 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
766 }
767 }
768
769 #[inline]
770 pub fn unknown_variant_for_testing() -> Self {
771 Self::__SourceBreaking { unknown_ordinal: 0 }
772 }
773
774 #[inline]
775 pub fn is_unknown(&self) -> bool {
776 match self {
777 Self::__SourceBreaking { .. } => true,
778 _ => false,
779 }
780 }
781}
782
783impl fidl::Persistable for NonEmptyResultWithErrorClassification {}
784
785#[derive(Clone, Debug)]
786pub enum OpenTargetEventReport {
787 FidlError(FidlErrorKind),
788 UnknownEvent(UnknownEvent),
789 StrictEvent(Empty),
790 FlexibleEvent(Empty),
791 #[doc(hidden)]
792 __SourceBreaking {
793 unknown_ordinal: u64,
794 },
795}
796
797#[macro_export]
799macro_rules! OpenTargetEventReportUnknown {
800 () => {
801 _
802 };
803}
804
805impl PartialEq for OpenTargetEventReport {
807 fn eq(&self, other: &Self) -> bool {
808 match (self, other) {
809 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
810 (Self::UnknownEvent(x), Self::UnknownEvent(y)) => *x == *y,
811 (Self::StrictEvent(x), Self::StrictEvent(y)) => *x == *y,
812 (Self::FlexibleEvent(x), Self::FlexibleEvent(y)) => *x == *y,
813 _ => false,
814 }
815 }
816}
817
818impl OpenTargetEventReport {
819 #[inline]
820 pub fn ordinal(&self) -> u64 {
821 match *self {
822 Self::FidlError(_) => 1,
823 Self::UnknownEvent(_) => 2,
824 Self::StrictEvent(_) => 3,
825 Self::FlexibleEvent(_) => 4,
826 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
827 }
828 }
829
830 #[inline]
831 pub fn unknown_variant_for_testing() -> Self {
832 Self::__SourceBreaking { unknown_ordinal: 0 }
833 }
834
835 #[inline]
836 pub fn is_unknown(&self) -> bool {
837 match self {
838 Self::__SourceBreaking { .. } => true,
839 _ => false,
840 }
841 }
842}
843
844impl fidl::Persistable for OpenTargetEventReport {}
845
846#[derive(Clone, Debug)]
847pub enum TableResultClassification {
848 Success(TablePayload),
849 FidlError(FidlErrorKind),
850 #[doc(hidden)]
851 __SourceBreaking {
852 unknown_ordinal: u64,
853 },
854}
855
856#[macro_export]
858macro_rules! TableResultClassificationUnknown {
859 () => {
860 _
861 };
862}
863
864impl PartialEq for TableResultClassification {
866 fn eq(&self, other: &Self) -> bool {
867 match (self, other) {
868 (Self::Success(x), Self::Success(y)) => *x == *y,
869 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
870 _ => false,
871 }
872 }
873}
874
875impl TableResultClassification {
876 #[inline]
877 pub fn ordinal(&self) -> u64 {
878 match *self {
879 Self::Success(_) => 1,
880 Self::FidlError(_) => 3,
881 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
882 }
883 }
884
885 #[inline]
886 pub fn unknown_variant_for_testing() -> Self {
887 Self::__SourceBreaking { unknown_ordinal: 0 }
888 }
889
890 #[inline]
891 pub fn is_unknown(&self) -> bool {
892 match self {
893 Self::__SourceBreaking { .. } => true,
894 _ => false,
895 }
896 }
897}
898
899impl fidl::Persistable for TableResultClassification {}
900
901#[derive(Clone, Debug)]
902pub enum UnionPayload {
903 SomeVariant(i32),
904 #[doc(hidden)]
905 __SourceBreaking {
906 unknown_ordinal: u64,
907 },
908}
909
910#[macro_export]
912macro_rules! UnionPayloadUnknown {
913 () => {
914 _
915 };
916}
917
918impl PartialEq for UnionPayload {
920 fn eq(&self, other: &Self) -> bool {
921 match (self, other) {
922 (Self::SomeVariant(x), Self::SomeVariant(y)) => *x == *y,
923 _ => false,
924 }
925 }
926}
927
928impl UnionPayload {
929 #[inline]
930 pub fn ordinal(&self) -> u64 {
931 match *self {
932 Self::SomeVariant(_) => 1,
933 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
934 }
935 }
936
937 #[inline]
938 pub fn unknown_variant_for_testing() -> Self {
939 Self::__SourceBreaking { unknown_ordinal: 0 }
940 }
941
942 #[inline]
943 pub fn is_unknown(&self) -> bool {
944 match self {
945 Self::__SourceBreaking { .. } => true,
946 _ => false,
947 }
948 }
949}
950
951impl fidl::Persistable for UnionPayload {}
952
953#[derive(Clone, Debug)]
954pub enum UnionResultClassification {
955 Success(UnionPayload),
956 FidlError(FidlErrorKind),
957 #[doc(hidden)]
958 __SourceBreaking {
959 unknown_ordinal: u64,
960 },
961}
962
963#[macro_export]
965macro_rules! UnionResultClassificationUnknown {
966 () => {
967 _
968 };
969}
970
971impl PartialEq for UnionResultClassification {
973 fn eq(&self, other: &Self) -> bool {
974 match (self, other) {
975 (Self::Success(x), Self::Success(y)) => *x == *y,
976 (Self::FidlError(x), Self::FidlError(y)) => *x == *y,
977 _ => false,
978 }
979 }
980}
981
982impl UnionResultClassification {
983 #[inline]
984 pub fn ordinal(&self) -> u64 {
985 match *self {
986 Self::Success(_) => 1,
987 Self::FidlError(_) => 3,
988 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
989 }
990 }
991
992 #[inline]
993 pub fn unknown_variant_for_testing() -> Self {
994 Self::__SourceBreaking { unknown_ordinal: 0 }
995 }
996
997 #[inline]
998 pub fn is_unknown(&self) -> bool {
999 match self {
1000 Self::__SourceBreaking { .. } => true,
1001 _ => false,
1002 }
1003 }
1004}
1005
1006impl fidl::Persistable for UnionResultClassification {}
1007
1008mod internal {
1009 use super::*;
1010 unsafe impl fidl::encoding::TypeMarker for FidlErrorKind {
1011 type Owned = Self;
1012
1013 #[inline(always)]
1014 fn inline_align(_context: fidl::encoding::Context) -> usize {
1015 std::mem::align_of::<u32>()
1016 }
1017
1018 #[inline(always)]
1019 fn inline_size(_context: fidl::encoding::Context) -> usize {
1020 std::mem::size_of::<u32>()
1021 }
1022
1023 #[inline(always)]
1024 fn encode_is_copy() -> bool {
1025 true
1026 }
1027
1028 #[inline(always)]
1029 fn decode_is_copy() -> bool {
1030 false
1031 }
1032 }
1033
1034 impl fidl::encoding::ValueTypeMarker for FidlErrorKind {
1035 type Borrowed<'a> = Self;
1036 #[inline(always)]
1037 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1038 *value
1039 }
1040 }
1041
1042 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FidlErrorKind {
1043 #[inline]
1044 unsafe fn encode(
1045 self,
1046 encoder: &mut fidl::encoding::Encoder<'_, D>,
1047 offset: usize,
1048 _depth: fidl::encoding::Depth,
1049 ) -> fidl::Result<()> {
1050 encoder.debug_check_bounds::<Self>(offset);
1051 encoder.write_num(self.into_primitive(), offset);
1052 Ok(())
1053 }
1054 }
1055
1056 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FidlErrorKind {
1057 #[inline(always)]
1058 fn new_empty() -> Self {
1059 Self::OtherError
1060 }
1061
1062 #[inline]
1063 unsafe fn decode(
1064 &mut self,
1065 decoder: &mut fidl::encoding::Decoder<'_, D>,
1066 offset: usize,
1067 _depth: fidl::encoding::Depth,
1068 ) -> fidl::Result<()> {
1069 decoder.debug_check_bounds::<Self>(offset);
1070 let prim = decoder.read_num::<u32>(offset);
1071
1072 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1073 Ok(())
1074 }
1075 }
1076 unsafe impl fidl::encoding::TypeMarker for IoStyle {
1077 type Owned = Self;
1078
1079 #[inline(always)]
1080 fn inline_align(_context: fidl::encoding::Context) -> usize {
1081 std::mem::align_of::<u32>()
1082 }
1083
1084 #[inline(always)]
1085 fn inline_size(_context: fidl::encoding::Context) -> usize {
1086 std::mem::size_of::<u32>()
1087 }
1088
1089 #[inline(always)]
1090 fn encode_is_copy() -> bool {
1091 true
1092 }
1093
1094 #[inline(always)]
1095 fn decode_is_copy() -> bool {
1096 false
1097 }
1098 }
1099
1100 impl fidl::encoding::ValueTypeMarker for IoStyle {
1101 type Borrowed<'a> = Self;
1102 #[inline(always)]
1103 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1104 *value
1105 }
1106 }
1107
1108 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for IoStyle {
1109 #[inline]
1110 unsafe fn encode(
1111 self,
1112 encoder: &mut fidl::encoding::Encoder<'_, D>,
1113 offset: usize,
1114 _depth: fidl::encoding::Depth,
1115 ) -> fidl::Result<()> {
1116 encoder.debug_check_bounds::<Self>(offset);
1117 encoder.write_num(self.into_primitive(), offset);
1118 Ok(())
1119 }
1120 }
1121
1122 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IoStyle {
1123 #[inline(always)]
1124 fn new_empty() -> Self {
1125 Self::Sync
1126 }
1127
1128 #[inline]
1129 unsafe fn decode(
1130 &mut self,
1131 decoder: &mut fidl::encoding::Decoder<'_, D>,
1132 offset: usize,
1133 _depth: fidl::encoding::Depth,
1134 ) -> fidl::Result<()> {
1135 decoder.debug_check_bounds::<Self>(offset);
1136 let prim = decoder.read_num::<u32>(offset);
1137
1138 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1139 Ok(())
1140 }
1141 }
1142 unsafe impl fidl::encoding::TypeMarker for Test {
1143 type Owned = Self;
1144
1145 #[inline(always)]
1146 fn inline_align(_context: fidl::encoding::Context) -> usize {
1147 std::mem::align_of::<u32>()
1148 }
1149
1150 #[inline(always)]
1151 fn inline_size(_context: fidl::encoding::Context) -> usize {
1152 std::mem::size_of::<u32>()
1153 }
1154
1155 #[inline(always)]
1156 fn encode_is_copy() -> bool {
1157 false
1158 }
1159
1160 #[inline(always)]
1161 fn decode_is_copy() -> bool {
1162 false
1163 }
1164 }
1165
1166 impl fidl::encoding::ValueTypeMarker for Test {
1167 type Borrowed<'a> = Self;
1168 #[inline(always)]
1169 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1170 *value
1171 }
1172 }
1173
1174 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Test {
1175 #[inline]
1176 unsafe fn encode(
1177 self,
1178 encoder: &mut fidl::encoding::Encoder<'_, D>,
1179 offset: usize,
1180 _depth: fidl::encoding::Depth,
1181 ) -> fidl::Result<()> {
1182 encoder.debug_check_bounds::<Self>(offset);
1183 encoder.write_num(self.into_primitive(), offset);
1184 Ok(())
1185 }
1186 }
1187
1188 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Test {
1189 #[inline(always)]
1190 fn new_empty() -> Self {
1191 Self::unknown()
1192 }
1193
1194 #[inline]
1195 unsafe fn decode(
1196 &mut self,
1197 decoder: &mut fidl::encoding::Decoder<'_, D>,
1198 offset: usize,
1199 _depth: fidl::encoding::Depth,
1200 ) -> fidl::Result<()> {
1201 decoder.debug_check_bounds::<Self>(offset);
1202 let prim = decoder.read_num::<u32>(offset);
1203
1204 *self = Self::from_primitive_allow_unknown(prim);
1205 Ok(())
1206 }
1207 }
1208
1209 impl fidl::encoding::ValueTypeMarker for Empty {
1210 type Borrowed<'a> = &'a Self;
1211 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1212 value
1213 }
1214 }
1215
1216 unsafe impl fidl::encoding::TypeMarker for Empty {
1217 type Owned = Self;
1218
1219 #[inline(always)]
1220 fn inline_align(_context: fidl::encoding::Context) -> usize {
1221 1
1222 }
1223
1224 #[inline(always)]
1225 fn inline_size(_context: fidl::encoding::Context) -> usize {
1226 1
1227 }
1228 }
1229
1230 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
1231 #[inline]
1232 unsafe fn encode(
1233 self,
1234 encoder: &mut fidl::encoding::Encoder<'_, D>,
1235 offset: usize,
1236 _depth: fidl::encoding::Depth,
1237 ) -> fidl::Result<()> {
1238 encoder.debug_check_bounds::<Empty>(offset);
1239 encoder.write_num(0u8, offset);
1240 Ok(())
1241 }
1242 }
1243
1244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
1245 #[inline(always)]
1246 fn new_empty() -> Self {
1247 Self
1248 }
1249
1250 #[inline]
1251 unsafe fn decode(
1252 &mut self,
1253 decoder: &mut fidl::encoding::Decoder<'_, D>,
1254 offset: usize,
1255 _depth: fidl::encoding::Depth,
1256 ) -> fidl::Result<()> {
1257 decoder.debug_check_bounds::<Self>(offset);
1258 match decoder.read_num::<u8>(offset) {
1259 0 => Ok(()),
1260 _ => Err(fidl::Error::Invalid),
1261 }
1262 }
1263 }
1264
1265 impl fidl::encoding::ValueTypeMarker for NonEmptyPayload {
1266 type Borrowed<'a> = &'a Self;
1267 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1268 value
1269 }
1270 }
1271
1272 unsafe impl fidl::encoding::TypeMarker for NonEmptyPayload {
1273 type Owned = Self;
1274
1275 #[inline(always)]
1276 fn inline_align(_context: fidl::encoding::Context) -> usize {
1277 4
1278 }
1279
1280 #[inline(always)]
1281 fn inline_size(_context: fidl::encoding::Context) -> usize {
1282 4
1283 }
1284 #[inline(always)]
1285 fn encode_is_copy() -> bool {
1286 true
1287 }
1288
1289 #[inline(always)]
1290 fn decode_is_copy() -> bool {
1291 true
1292 }
1293 }
1294
1295 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NonEmptyPayload, D>
1296 for &NonEmptyPayload
1297 {
1298 #[inline]
1299 unsafe fn encode(
1300 self,
1301 encoder: &mut fidl::encoding::Encoder<'_, D>,
1302 offset: usize,
1303 _depth: fidl::encoding::Depth,
1304 ) -> fidl::Result<()> {
1305 encoder.debug_check_bounds::<NonEmptyPayload>(offset);
1306 unsafe {
1307 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1309 (buf_ptr as *mut NonEmptyPayload)
1310 .write_unaligned((self as *const NonEmptyPayload).read());
1311 }
1314 Ok(())
1315 }
1316 }
1317 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1318 fidl::encoding::Encode<NonEmptyPayload, D> for (T0,)
1319 {
1320 #[inline]
1321 unsafe fn encode(
1322 self,
1323 encoder: &mut fidl::encoding::Encoder<'_, D>,
1324 offset: usize,
1325 depth: fidl::encoding::Depth,
1326 ) -> fidl::Result<()> {
1327 encoder.debug_check_bounds::<NonEmptyPayload>(offset);
1328 self.0.encode(encoder, offset + 0, depth)?;
1332 Ok(())
1333 }
1334 }
1335
1336 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NonEmptyPayload {
1337 #[inline(always)]
1338 fn new_empty() -> Self {
1339 Self { some_field: fidl::new_empty!(i32, D) }
1340 }
1341
1342 #[inline]
1343 unsafe fn decode(
1344 &mut self,
1345 decoder: &mut fidl::encoding::Decoder<'_, D>,
1346 offset: usize,
1347 _depth: fidl::encoding::Depth,
1348 ) -> fidl::Result<()> {
1349 decoder.debug_check_bounds::<Self>(offset);
1350 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1351 unsafe {
1354 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1355 }
1356 Ok(())
1357 }
1358 }
1359
1360 impl fidl::encoding::ValueTypeMarker for RunnerGetVersionResponse {
1361 type Borrowed<'a> = &'a Self;
1362 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1363 value
1364 }
1365 }
1366
1367 unsafe impl fidl::encoding::TypeMarker for RunnerGetVersionResponse {
1368 type Owned = Self;
1369
1370 #[inline(always)]
1371 fn inline_align(_context: fidl::encoding::Context) -> usize {
1372 8
1373 }
1374
1375 #[inline(always)]
1376 fn inline_size(_context: fidl::encoding::Context) -> usize {
1377 8
1378 }
1379 #[inline(always)]
1380 fn encode_is_copy() -> bool {
1381 true
1382 }
1383
1384 #[inline(always)]
1385 fn decode_is_copy() -> bool {
1386 true
1387 }
1388 }
1389
1390 unsafe impl<D: fidl::encoding::ResourceDialect>
1391 fidl::encoding::Encode<RunnerGetVersionResponse, D> for &RunnerGetVersionResponse
1392 {
1393 #[inline]
1394 unsafe fn encode(
1395 self,
1396 encoder: &mut fidl::encoding::Encoder<'_, D>,
1397 offset: usize,
1398 _depth: fidl::encoding::Depth,
1399 ) -> fidl::Result<()> {
1400 encoder.debug_check_bounds::<RunnerGetVersionResponse>(offset);
1401 unsafe {
1402 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1404 (buf_ptr as *mut RunnerGetVersionResponse)
1405 .write_unaligned((self as *const RunnerGetVersionResponse).read());
1406 }
1409 Ok(())
1410 }
1411 }
1412 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
1413 fidl::encoding::Encode<RunnerGetVersionResponse, D> for (T0,)
1414 {
1415 #[inline]
1416 unsafe fn encode(
1417 self,
1418 encoder: &mut fidl::encoding::Encoder<'_, D>,
1419 offset: usize,
1420 depth: fidl::encoding::Depth,
1421 ) -> fidl::Result<()> {
1422 encoder.debug_check_bounds::<RunnerGetVersionResponse>(offset);
1423 self.0.encode(encoder, offset + 0, depth)?;
1427 Ok(())
1428 }
1429 }
1430
1431 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1432 for RunnerGetVersionResponse
1433 {
1434 #[inline(always)]
1435 fn new_empty() -> Self {
1436 Self { version: fidl::new_empty!(u64, D) }
1437 }
1438
1439 #[inline]
1440 unsafe fn decode(
1441 &mut self,
1442 decoder: &mut fidl::encoding::Decoder<'_, D>,
1443 offset: usize,
1444 _depth: fidl::encoding::Depth,
1445 ) -> fidl::Result<()> {
1446 decoder.debug_check_bounds::<Self>(offset);
1447 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1448 unsafe {
1451 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1452 }
1453 Ok(())
1454 }
1455 }
1456
1457 impl fidl::encoding::ValueTypeMarker for RunnerIsTestEnabledRequest {
1458 type Borrowed<'a> = &'a Self;
1459 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1460 value
1461 }
1462 }
1463
1464 unsafe impl fidl::encoding::TypeMarker for RunnerIsTestEnabledRequest {
1465 type Owned = Self;
1466
1467 #[inline(always)]
1468 fn inline_align(_context: fidl::encoding::Context) -> usize {
1469 4
1470 }
1471
1472 #[inline(always)]
1473 fn inline_size(_context: fidl::encoding::Context) -> usize {
1474 4
1475 }
1476 }
1477
1478 unsafe impl<D: fidl::encoding::ResourceDialect>
1479 fidl::encoding::Encode<RunnerIsTestEnabledRequest, D> for &RunnerIsTestEnabledRequest
1480 {
1481 #[inline]
1482 unsafe fn encode(
1483 self,
1484 encoder: &mut fidl::encoding::Encoder<'_, D>,
1485 offset: usize,
1486 _depth: fidl::encoding::Depth,
1487 ) -> fidl::Result<()> {
1488 encoder.debug_check_bounds::<RunnerIsTestEnabledRequest>(offset);
1489 fidl::encoding::Encode::<RunnerIsTestEnabledRequest, D>::encode(
1491 (<Test as fidl::encoding::ValueTypeMarker>::borrow(&self.test),),
1492 encoder,
1493 offset,
1494 _depth,
1495 )
1496 }
1497 }
1498 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Test, D>>
1499 fidl::encoding::Encode<RunnerIsTestEnabledRequest, D> for (T0,)
1500 {
1501 #[inline]
1502 unsafe fn encode(
1503 self,
1504 encoder: &mut fidl::encoding::Encoder<'_, D>,
1505 offset: usize,
1506 depth: fidl::encoding::Depth,
1507 ) -> fidl::Result<()> {
1508 encoder.debug_check_bounds::<RunnerIsTestEnabledRequest>(offset);
1509 self.0.encode(encoder, offset + 0, depth)?;
1513 Ok(())
1514 }
1515 }
1516
1517 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1518 for RunnerIsTestEnabledRequest
1519 {
1520 #[inline(always)]
1521 fn new_empty() -> Self {
1522 Self { test: fidl::new_empty!(Test, D) }
1523 }
1524
1525 #[inline]
1526 unsafe fn decode(
1527 &mut self,
1528 decoder: &mut fidl::encoding::Decoder<'_, D>,
1529 offset: usize,
1530 _depth: fidl::encoding::Depth,
1531 ) -> fidl::Result<()> {
1532 decoder.debug_check_bounds::<Self>(offset);
1533 fidl::decode!(Test, D, &mut self.test, decoder, offset + 0, _depth)?;
1535 Ok(())
1536 }
1537 }
1538
1539 impl fidl::encoding::ValueTypeMarker for RunnerIsTestEnabledResponse {
1540 type Borrowed<'a> = &'a Self;
1541 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1542 value
1543 }
1544 }
1545
1546 unsafe impl fidl::encoding::TypeMarker for RunnerIsTestEnabledResponse {
1547 type Owned = Self;
1548
1549 #[inline(always)]
1550 fn inline_align(_context: fidl::encoding::Context) -> usize {
1551 1
1552 }
1553
1554 #[inline(always)]
1555 fn inline_size(_context: fidl::encoding::Context) -> usize {
1556 1
1557 }
1558 }
1559
1560 unsafe impl<D: fidl::encoding::ResourceDialect>
1561 fidl::encoding::Encode<RunnerIsTestEnabledResponse, D> for &RunnerIsTestEnabledResponse
1562 {
1563 #[inline]
1564 unsafe fn encode(
1565 self,
1566 encoder: &mut fidl::encoding::Encoder<'_, D>,
1567 offset: usize,
1568 _depth: fidl::encoding::Depth,
1569 ) -> fidl::Result<()> {
1570 encoder.debug_check_bounds::<RunnerIsTestEnabledResponse>(offset);
1571 fidl::encoding::Encode::<RunnerIsTestEnabledResponse, D>::encode(
1573 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_enabled),),
1574 encoder,
1575 offset,
1576 _depth,
1577 )
1578 }
1579 }
1580 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1581 fidl::encoding::Encode<RunnerIsTestEnabledResponse, D> for (T0,)
1582 {
1583 #[inline]
1584 unsafe fn encode(
1585 self,
1586 encoder: &mut fidl::encoding::Encoder<'_, D>,
1587 offset: usize,
1588 depth: fidl::encoding::Depth,
1589 ) -> fidl::Result<()> {
1590 encoder.debug_check_bounds::<RunnerIsTestEnabledResponse>(offset);
1591 self.0.encode(encoder, offset + 0, depth)?;
1595 Ok(())
1596 }
1597 }
1598
1599 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1600 for RunnerIsTestEnabledResponse
1601 {
1602 #[inline(always)]
1603 fn new_empty() -> Self {
1604 Self { is_enabled: fidl::new_empty!(bool, D) }
1605 }
1606
1607 #[inline]
1608 unsafe fn decode(
1609 &mut self,
1610 decoder: &mut fidl::encoding::Decoder<'_, D>,
1611 offset: usize,
1612 _depth: fidl::encoding::Depth,
1613 ) -> fidl::Result<()> {
1614 decoder.debug_check_bounds::<Self>(offset);
1615 fidl::decode!(bool, D, &mut self.is_enabled, decoder, offset + 0, _depth)?;
1617 Ok(())
1618 }
1619 }
1620
1621 impl fidl::encoding::ValueTypeMarker for UnknownEvent {
1622 type Borrowed<'a> = &'a Self;
1623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1624 value
1625 }
1626 }
1627
1628 unsafe impl fidl::encoding::TypeMarker for UnknownEvent {
1629 type Owned = Self;
1630
1631 #[inline(always)]
1632 fn inline_align(_context: fidl::encoding::Context) -> usize {
1633 8
1634 }
1635
1636 #[inline(always)]
1637 fn inline_size(_context: fidl::encoding::Context) -> usize {
1638 8
1639 }
1640 #[inline(always)]
1641 fn encode_is_copy() -> bool {
1642 true
1643 }
1644
1645 #[inline(always)]
1646 fn decode_is_copy() -> bool {
1647 true
1648 }
1649 }
1650
1651 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnknownEvent, D>
1652 for &UnknownEvent
1653 {
1654 #[inline]
1655 unsafe fn encode(
1656 self,
1657 encoder: &mut fidl::encoding::Encoder<'_, D>,
1658 offset: usize,
1659 _depth: fidl::encoding::Depth,
1660 ) -> fidl::Result<()> {
1661 encoder.debug_check_bounds::<UnknownEvent>(offset);
1662 unsafe {
1663 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1665 (buf_ptr as *mut UnknownEvent)
1666 .write_unaligned((self as *const UnknownEvent).read());
1667 }
1670 Ok(())
1671 }
1672 }
1673 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
1674 fidl::encoding::Encode<UnknownEvent, D> for (T0,)
1675 {
1676 #[inline]
1677 unsafe fn encode(
1678 self,
1679 encoder: &mut fidl::encoding::Encoder<'_, D>,
1680 offset: usize,
1681 depth: fidl::encoding::Depth,
1682 ) -> fidl::Result<()> {
1683 encoder.debug_check_bounds::<UnknownEvent>(offset);
1684 self.0.encode(encoder, offset + 0, depth)?;
1688 Ok(())
1689 }
1690 }
1691
1692 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnknownEvent {
1693 #[inline(always)]
1694 fn new_empty() -> Self {
1695 Self { ordinal: fidl::new_empty!(u64, D) }
1696 }
1697
1698 #[inline]
1699 unsafe fn decode(
1700 &mut self,
1701 decoder: &mut fidl::encoding::Decoder<'_, D>,
1702 offset: usize,
1703 _depth: fidl::encoding::Depth,
1704 ) -> fidl::Result<()> {
1705 decoder.debug_check_bounds::<Self>(offset);
1706 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1707 unsafe {
1710 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1711 }
1712 Ok(())
1713 }
1714 }
1715
1716 impl BindingsProperties {
1717 #[inline(always)]
1718 fn max_ordinal_present(&self) -> u64 {
1719 if let Some(_) = self.io_style {
1720 return 1;
1721 }
1722 0
1723 }
1724 }
1725
1726 impl fidl::encoding::ValueTypeMarker for BindingsProperties {
1727 type Borrowed<'a> = &'a Self;
1728 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1729 value
1730 }
1731 }
1732
1733 unsafe impl fidl::encoding::TypeMarker for BindingsProperties {
1734 type Owned = Self;
1735
1736 #[inline(always)]
1737 fn inline_align(_context: fidl::encoding::Context) -> usize {
1738 8
1739 }
1740
1741 #[inline(always)]
1742 fn inline_size(_context: fidl::encoding::Context) -> usize {
1743 16
1744 }
1745 }
1746
1747 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BindingsProperties, D>
1748 for &BindingsProperties
1749 {
1750 unsafe fn encode(
1751 self,
1752 encoder: &mut fidl::encoding::Encoder<'_, D>,
1753 offset: usize,
1754 mut depth: fidl::encoding::Depth,
1755 ) -> fidl::Result<()> {
1756 encoder.debug_check_bounds::<BindingsProperties>(offset);
1757 let max_ordinal: u64 = self.max_ordinal_present();
1759 encoder.write_num(max_ordinal, offset);
1760 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1761 if max_ordinal == 0 {
1763 return Ok(());
1764 }
1765 depth.increment()?;
1766 let envelope_size = 8;
1767 let bytes_len = max_ordinal as usize * envelope_size;
1768 #[allow(unused_variables)]
1769 let offset = encoder.out_of_line_offset(bytes_len);
1770 let mut _prev_end_offset: usize = 0;
1771 if 1 > max_ordinal {
1772 return Ok(());
1773 }
1774
1775 let cur_offset: usize = (1 - 1) * envelope_size;
1778
1779 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1781
1782 fidl::encoding::encode_in_envelope_optional::<IoStyle, D>(
1787 self.io_style.as_ref().map(<IoStyle as fidl::encoding::ValueTypeMarker>::borrow),
1788 encoder,
1789 offset + cur_offset,
1790 depth,
1791 )?;
1792
1793 _prev_end_offset = cur_offset + envelope_size;
1794
1795 Ok(())
1796 }
1797 }
1798
1799 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BindingsProperties {
1800 #[inline(always)]
1801 fn new_empty() -> Self {
1802 Self::default()
1803 }
1804
1805 unsafe fn decode(
1806 &mut self,
1807 decoder: &mut fidl::encoding::Decoder<'_, D>,
1808 offset: usize,
1809 mut depth: fidl::encoding::Depth,
1810 ) -> fidl::Result<()> {
1811 decoder.debug_check_bounds::<Self>(offset);
1812 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1813 None => return Err(fidl::Error::NotNullable),
1814 Some(len) => len,
1815 };
1816 if len == 0 {
1818 return Ok(());
1819 };
1820 depth.increment()?;
1821 let envelope_size = 8;
1822 let bytes_len = len * envelope_size;
1823 let offset = decoder.out_of_line_offset(bytes_len)?;
1824 let mut _next_ordinal_to_read = 0;
1826 let mut next_offset = offset;
1827 let end_offset = offset + bytes_len;
1828 _next_ordinal_to_read += 1;
1829 if next_offset >= end_offset {
1830 return Ok(());
1831 }
1832
1833 while _next_ordinal_to_read < 1 {
1835 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1836 _next_ordinal_to_read += 1;
1837 next_offset += envelope_size;
1838 }
1839
1840 let next_out_of_line = decoder.next_out_of_line();
1841 let handles_before = decoder.remaining_handles();
1842 if let Some((inlined, num_bytes, num_handles)) =
1843 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1844 {
1845 let member_inline_size =
1846 <IoStyle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1847 if inlined != (member_inline_size <= 4) {
1848 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1849 }
1850 let inner_offset;
1851 let mut inner_depth = depth.clone();
1852 if inlined {
1853 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1854 inner_offset = next_offset;
1855 } else {
1856 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1857 inner_depth.increment()?;
1858 }
1859 let val_ref = self.io_style.get_or_insert_with(|| fidl::new_empty!(IoStyle, D));
1860 fidl::decode!(IoStyle, D, val_ref, decoder, inner_offset, inner_depth)?;
1861 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1862 {
1863 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1864 }
1865 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1866 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1867 }
1868 }
1869
1870 next_offset += envelope_size;
1871
1872 while next_offset < end_offset {
1874 _next_ordinal_to_read += 1;
1875 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1876 next_offset += envelope_size;
1877 }
1878
1879 Ok(())
1880 }
1881 }
1882
1883 impl TablePayload {
1884 #[inline(always)]
1885 fn max_ordinal_present(&self) -> u64 {
1886 if let Some(_) = self.some_field {
1887 return 1;
1888 }
1889 0
1890 }
1891 }
1892
1893 impl fidl::encoding::ValueTypeMarker for TablePayload {
1894 type Borrowed<'a> = &'a Self;
1895 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1896 value
1897 }
1898 }
1899
1900 unsafe impl fidl::encoding::TypeMarker for TablePayload {
1901 type Owned = Self;
1902
1903 #[inline(always)]
1904 fn inline_align(_context: fidl::encoding::Context) -> usize {
1905 8
1906 }
1907
1908 #[inline(always)]
1909 fn inline_size(_context: fidl::encoding::Context) -> usize {
1910 16
1911 }
1912 }
1913
1914 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TablePayload, D>
1915 for &TablePayload
1916 {
1917 unsafe fn encode(
1918 self,
1919 encoder: &mut fidl::encoding::Encoder<'_, D>,
1920 offset: usize,
1921 mut depth: fidl::encoding::Depth,
1922 ) -> fidl::Result<()> {
1923 encoder.debug_check_bounds::<TablePayload>(offset);
1924 let max_ordinal: u64 = self.max_ordinal_present();
1926 encoder.write_num(max_ordinal, offset);
1927 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1928 if max_ordinal == 0 {
1930 return Ok(());
1931 }
1932 depth.increment()?;
1933 let envelope_size = 8;
1934 let bytes_len = max_ordinal as usize * envelope_size;
1935 #[allow(unused_variables)]
1936 let offset = encoder.out_of_line_offset(bytes_len);
1937 let mut _prev_end_offset: usize = 0;
1938 if 1 > max_ordinal {
1939 return Ok(());
1940 }
1941
1942 let cur_offset: usize = (1 - 1) * envelope_size;
1945
1946 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1948
1949 fidl::encoding::encode_in_envelope_optional::<i32, D>(
1954 self.some_field.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
1955 encoder,
1956 offset + cur_offset,
1957 depth,
1958 )?;
1959
1960 _prev_end_offset = cur_offset + envelope_size;
1961
1962 Ok(())
1963 }
1964 }
1965
1966 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TablePayload {
1967 #[inline(always)]
1968 fn new_empty() -> Self {
1969 Self::default()
1970 }
1971
1972 unsafe fn decode(
1973 &mut self,
1974 decoder: &mut fidl::encoding::Decoder<'_, D>,
1975 offset: usize,
1976 mut depth: fidl::encoding::Depth,
1977 ) -> fidl::Result<()> {
1978 decoder.debug_check_bounds::<Self>(offset);
1979 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1980 None => return Err(fidl::Error::NotNullable),
1981 Some(len) => len,
1982 };
1983 if len == 0 {
1985 return Ok(());
1986 };
1987 depth.increment()?;
1988 let envelope_size = 8;
1989 let bytes_len = len * envelope_size;
1990 let offset = decoder.out_of_line_offset(bytes_len)?;
1991 let mut _next_ordinal_to_read = 0;
1993 let mut next_offset = offset;
1994 let end_offset = offset + bytes_len;
1995 _next_ordinal_to_read += 1;
1996 if next_offset >= end_offset {
1997 return Ok(());
1998 }
1999
2000 while _next_ordinal_to_read < 1 {
2002 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2003 _next_ordinal_to_read += 1;
2004 next_offset += envelope_size;
2005 }
2006
2007 let next_out_of_line = decoder.next_out_of_line();
2008 let handles_before = decoder.remaining_handles();
2009 if let Some((inlined, num_bytes, num_handles)) =
2010 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2011 {
2012 let member_inline_size =
2013 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2014 if inlined != (member_inline_size <= 4) {
2015 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2016 }
2017 let inner_offset;
2018 let mut inner_depth = depth.clone();
2019 if inlined {
2020 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2021 inner_offset = next_offset;
2022 } else {
2023 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2024 inner_depth.increment()?;
2025 }
2026 let val_ref = self.some_field.get_or_insert_with(|| fidl::new_empty!(i32, D));
2027 fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
2028 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2029 {
2030 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2031 }
2032 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2033 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2034 }
2035 }
2036
2037 next_offset += envelope_size;
2038
2039 while next_offset < end_offset {
2041 _next_ordinal_to_read += 1;
2042 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2043 next_offset += envelope_size;
2044 }
2045
2046 Ok(())
2047 }
2048 }
2049
2050 impl fidl::encoding::ValueTypeMarker for AjarTargetEventReport {
2051 type Borrowed<'a> = &'a Self;
2052 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2053 value
2054 }
2055 }
2056
2057 unsafe impl fidl::encoding::TypeMarker for AjarTargetEventReport {
2058 type Owned = Self;
2059
2060 #[inline(always)]
2061 fn inline_align(_context: fidl::encoding::Context) -> usize {
2062 8
2063 }
2064
2065 #[inline(always)]
2066 fn inline_size(_context: fidl::encoding::Context) -> usize {
2067 16
2068 }
2069 }
2070
2071 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AjarTargetEventReport, D>
2072 for &AjarTargetEventReport
2073 {
2074 #[inline]
2075 unsafe fn encode(
2076 self,
2077 encoder: &mut fidl::encoding::Encoder<'_, D>,
2078 offset: usize,
2079 _depth: fidl::encoding::Depth,
2080 ) -> fidl::Result<()> {
2081 encoder.debug_check_bounds::<AjarTargetEventReport>(offset);
2082 encoder.write_num::<u64>(self.ordinal(), offset);
2083 match self {
2084 AjarTargetEventReport::FidlError(ref val) => {
2085 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
2086 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
2087 encoder,
2088 offset + 8,
2089 _depth,
2090 )
2091 }
2092 AjarTargetEventReport::UnknownEvent(ref val) => {
2093 fidl::encoding::encode_in_envelope::<UnknownEvent, D>(
2094 <UnknownEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
2095 encoder,
2096 offset + 8,
2097 _depth,
2098 )
2099 }
2100 AjarTargetEventReport::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
2101 }
2102 }
2103 }
2104
2105 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AjarTargetEventReport {
2106 #[inline(always)]
2107 fn new_empty() -> Self {
2108 Self::__SourceBreaking { unknown_ordinal: 0 }
2109 }
2110
2111 #[inline]
2112 unsafe fn decode(
2113 &mut self,
2114 decoder: &mut fidl::encoding::Decoder<'_, D>,
2115 offset: usize,
2116 mut depth: fidl::encoding::Depth,
2117 ) -> fidl::Result<()> {
2118 decoder.debug_check_bounds::<Self>(offset);
2119 #[allow(unused_variables)]
2120 let next_out_of_line = decoder.next_out_of_line();
2121 let handles_before = decoder.remaining_handles();
2122 let (ordinal, inlined, num_bytes, num_handles) =
2123 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2124
2125 let member_inline_size = match ordinal {
2126 1 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2127 2 => <UnknownEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2128 0 => return Err(fidl::Error::UnknownUnionTag),
2129 _ => num_bytes as usize,
2130 };
2131
2132 if inlined != (member_inline_size <= 4) {
2133 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2134 }
2135 let _inner_offset;
2136 if inlined {
2137 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2138 _inner_offset = offset + 8;
2139 } else {
2140 depth.increment()?;
2141 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2142 }
2143 match ordinal {
2144 1 => {
2145 #[allow(irrefutable_let_patterns)]
2146 if let AjarTargetEventReport::FidlError(_) = self {
2147 } else {
2149 *self =
2151 AjarTargetEventReport::FidlError(fidl::new_empty!(FidlErrorKind, D));
2152 }
2153 #[allow(irrefutable_let_patterns)]
2154 if let AjarTargetEventReport::FidlError(ref mut val) = self {
2155 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
2156 } else {
2157 unreachable!()
2158 }
2159 }
2160 2 => {
2161 #[allow(irrefutable_let_patterns)]
2162 if let AjarTargetEventReport::UnknownEvent(_) = self {
2163 } else {
2165 *self =
2167 AjarTargetEventReport::UnknownEvent(fidl::new_empty!(UnknownEvent, D));
2168 }
2169 #[allow(irrefutable_let_patterns)]
2170 if let AjarTargetEventReport::UnknownEvent(ref mut val) = self {
2171 fidl::decode!(UnknownEvent, D, val, decoder, _inner_offset, depth)?;
2172 } else {
2173 unreachable!()
2174 }
2175 }
2176 #[allow(deprecated)]
2177 ordinal => {
2178 for _ in 0..num_handles {
2179 decoder.drop_next_handle()?;
2180 }
2181 *self = AjarTargetEventReport::__SourceBreaking { unknown_ordinal: ordinal };
2182 }
2183 }
2184 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2185 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2186 }
2187 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2188 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2189 }
2190 Ok(())
2191 }
2192 }
2193
2194 impl fidl::encoding::ValueTypeMarker for ClosedTargetEventReport {
2195 type Borrowed<'a> = &'a Self;
2196 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2197 value
2198 }
2199 }
2200
2201 unsafe impl fidl::encoding::TypeMarker for ClosedTargetEventReport {
2202 type Owned = Self;
2203
2204 #[inline(always)]
2205 fn inline_align(_context: fidl::encoding::Context) -> usize {
2206 8
2207 }
2208
2209 #[inline(always)]
2210 fn inline_size(_context: fidl::encoding::Context) -> usize {
2211 16
2212 }
2213 }
2214
2215 unsafe impl<D: fidl::encoding::ResourceDialect>
2216 fidl::encoding::Encode<ClosedTargetEventReport, D> for &ClosedTargetEventReport
2217 {
2218 #[inline]
2219 unsafe fn encode(
2220 self,
2221 encoder: &mut fidl::encoding::Encoder<'_, D>,
2222 offset: usize,
2223 _depth: fidl::encoding::Depth,
2224 ) -> fidl::Result<()> {
2225 encoder.debug_check_bounds::<ClosedTargetEventReport>(offset);
2226 encoder.write_num::<u64>(self.ordinal(), offset);
2227 match self {
2228 ClosedTargetEventReport::FidlError(ref val) => {
2229 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
2230 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
2231 encoder,
2232 offset + 8,
2233 _depth,
2234 )
2235 }
2236 ClosedTargetEventReport::OnEventNoPayload(ref val) => {
2237 fidl::encoding::encode_in_envelope::<Empty, D>(
2238 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
2239 encoder,
2240 offset + 8,
2241 _depth,
2242 )
2243 }
2244 ClosedTargetEventReport::OnEventStructPayload(ref val) => {
2245 fidl::encoding::encode_in_envelope::<NonEmptyPayload, D>(
2246 <NonEmptyPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
2247 encoder,
2248 offset + 8,
2249 _depth,
2250 )
2251 }
2252 ClosedTargetEventReport::OnEventTablePayload(ref val) => {
2253 fidl::encoding::encode_in_envelope::<TablePayload, D>(
2254 <TablePayload as fidl::encoding::ValueTypeMarker>::borrow(val),
2255 encoder,
2256 offset + 8,
2257 _depth,
2258 )
2259 }
2260 ClosedTargetEventReport::OnEventUnionPayload(ref val) => {
2261 fidl::encoding::encode_in_envelope::<UnionPayload, D>(
2262 <UnionPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
2263 encoder,
2264 offset + 8,
2265 _depth,
2266 )
2267 }
2268 ClosedTargetEventReport::__SourceBreaking { .. } => {
2269 Err(fidl::Error::UnknownUnionTag)
2270 }
2271 }
2272 }
2273 }
2274
2275 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2276 for ClosedTargetEventReport
2277 {
2278 #[inline(always)]
2279 fn new_empty() -> Self {
2280 Self::__SourceBreaking { unknown_ordinal: 0 }
2281 }
2282
2283 #[inline]
2284 unsafe fn decode(
2285 &mut self,
2286 decoder: &mut fidl::encoding::Decoder<'_, D>,
2287 offset: usize,
2288 mut depth: fidl::encoding::Depth,
2289 ) -> fidl::Result<()> {
2290 decoder.debug_check_bounds::<Self>(offset);
2291 #[allow(unused_variables)]
2292 let next_out_of_line = decoder.next_out_of_line();
2293 let handles_before = decoder.remaining_handles();
2294 let (ordinal, inlined, num_bytes, num_handles) =
2295 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2296
2297 let member_inline_size = match ordinal {
2298 1 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2299 2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2300 3 => <NonEmptyPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2301 4 => <TablePayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2302 5 => <UnionPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2303 0 => return Err(fidl::Error::UnknownUnionTag),
2304 _ => num_bytes as usize,
2305 };
2306
2307 if inlined != (member_inline_size <= 4) {
2308 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2309 }
2310 let _inner_offset;
2311 if inlined {
2312 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2313 _inner_offset = offset + 8;
2314 } else {
2315 depth.increment()?;
2316 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2317 }
2318 match ordinal {
2319 1 => {
2320 #[allow(irrefutable_let_patterns)]
2321 if let ClosedTargetEventReport::FidlError(_) = self {
2322 } else {
2324 *self =
2326 ClosedTargetEventReport::FidlError(fidl::new_empty!(FidlErrorKind, D));
2327 }
2328 #[allow(irrefutable_let_patterns)]
2329 if let ClosedTargetEventReport::FidlError(ref mut val) = self {
2330 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
2331 } else {
2332 unreachable!()
2333 }
2334 }
2335 2 => {
2336 #[allow(irrefutable_let_patterns)]
2337 if let ClosedTargetEventReport::OnEventNoPayload(_) = self {
2338 } else {
2340 *self =
2342 ClosedTargetEventReport::OnEventNoPayload(fidl::new_empty!(Empty, D));
2343 }
2344 #[allow(irrefutable_let_patterns)]
2345 if let ClosedTargetEventReport::OnEventNoPayload(ref mut val) = self {
2346 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
2347 } else {
2348 unreachable!()
2349 }
2350 }
2351 3 => {
2352 #[allow(irrefutable_let_patterns)]
2353 if let ClosedTargetEventReport::OnEventStructPayload(_) = self {
2354 } else {
2356 *self = ClosedTargetEventReport::OnEventStructPayload(fidl::new_empty!(
2358 NonEmptyPayload,
2359 D
2360 ));
2361 }
2362 #[allow(irrefutable_let_patterns)]
2363 if let ClosedTargetEventReport::OnEventStructPayload(ref mut val) = self {
2364 fidl::decode!(NonEmptyPayload, D, val, decoder, _inner_offset, depth)?;
2365 } else {
2366 unreachable!()
2367 }
2368 }
2369 4 => {
2370 #[allow(irrefutable_let_patterns)]
2371 if let ClosedTargetEventReport::OnEventTablePayload(_) = self {
2372 } else {
2374 *self = ClosedTargetEventReport::OnEventTablePayload(fidl::new_empty!(
2376 TablePayload,
2377 D
2378 ));
2379 }
2380 #[allow(irrefutable_let_patterns)]
2381 if let ClosedTargetEventReport::OnEventTablePayload(ref mut val) = self {
2382 fidl::decode!(TablePayload, D, val, decoder, _inner_offset, depth)?;
2383 } else {
2384 unreachable!()
2385 }
2386 }
2387 5 => {
2388 #[allow(irrefutable_let_patterns)]
2389 if let ClosedTargetEventReport::OnEventUnionPayload(_) = self {
2390 } else {
2392 *self = ClosedTargetEventReport::OnEventUnionPayload(fidl::new_empty!(
2394 UnionPayload,
2395 D
2396 ));
2397 }
2398 #[allow(irrefutable_let_patterns)]
2399 if let ClosedTargetEventReport::OnEventUnionPayload(ref mut val) = self {
2400 fidl::decode!(UnionPayload, D, val, decoder, _inner_offset, depth)?;
2401 } else {
2402 unreachable!()
2403 }
2404 }
2405 #[allow(deprecated)]
2406 ordinal => {
2407 for _ in 0..num_handles {
2408 decoder.drop_next_handle()?;
2409 }
2410 *self = ClosedTargetEventReport::__SourceBreaking { unknown_ordinal: ordinal };
2411 }
2412 }
2413 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2414 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2415 }
2416 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2417 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2418 }
2419 Ok(())
2420 }
2421 }
2422
2423 impl fidl::encoding::ValueTypeMarker for EmptyResultClassification {
2424 type Borrowed<'a> = &'a Self;
2425 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2426 value
2427 }
2428 }
2429
2430 unsafe impl fidl::encoding::TypeMarker for EmptyResultClassification {
2431 type Owned = Self;
2432
2433 #[inline(always)]
2434 fn inline_align(_context: fidl::encoding::Context) -> usize {
2435 8
2436 }
2437
2438 #[inline(always)]
2439 fn inline_size(_context: fidl::encoding::Context) -> usize {
2440 16
2441 }
2442 }
2443
2444 unsafe impl<D: fidl::encoding::ResourceDialect>
2445 fidl::encoding::Encode<EmptyResultClassification, D> for &EmptyResultClassification
2446 {
2447 #[inline]
2448 unsafe fn encode(
2449 self,
2450 encoder: &mut fidl::encoding::Encoder<'_, D>,
2451 offset: usize,
2452 _depth: fidl::encoding::Depth,
2453 ) -> fidl::Result<()> {
2454 encoder.debug_check_bounds::<EmptyResultClassification>(offset);
2455 encoder.write_num::<u64>(self.ordinal(), offset);
2456 match self {
2457 EmptyResultClassification::Success(ref val) => {
2458 fidl::encoding::encode_in_envelope::<Empty, D>(
2459 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
2460 encoder,
2461 offset + 8,
2462 _depth,
2463 )
2464 }
2465 EmptyResultClassification::FidlError(ref val) => {
2466 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
2467 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
2468 encoder,
2469 offset + 8,
2470 _depth,
2471 )
2472 }
2473 EmptyResultClassification::__SourceBreaking { .. } => {
2474 Err(fidl::Error::UnknownUnionTag)
2475 }
2476 }
2477 }
2478 }
2479
2480 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2481 for EmptyResultClassification
2482 {
2483 #[inline(always)]
2484 fn new_empty() -> Self {
2485 Self::__SourceBreaking { unknown_ordinal: 0 }
2486 }
2487
2488 #[inline]
2489 unsafe fn decode(
2490 &mut self,
2491 decoder: &mut fidl::encoding::Decoder<'_, D>,
2492 offset: usize,
2493 mut depth: fidl::encoding::Depth,
2494 ) -> fidl::Result<()> {
2495 decoder.debug_check_bounds::<Self>(offset);
2496 #[allow(unused_variables)]
2497 let next_out_of_line = decoder.next_out_of_line();
2498 let handles_before = decoder.remaining_handles();
2499 let (ordinal, inlined, num_bytes, num_handles) =
2500 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2501
2502 let member_inline_size = match ordinal {
2503 1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2504 3 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2505 0 => return Err(fidl::Error::UnknownUnionTag),
2506 _ => num_bytes as usize,
2507 };
2508
2509 if inlined != (member_inline_size <= 4) {
2510 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2511 }
2512 let _inner_offset;
2513 if inlined {
2514 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2515 _inner_offset = offset + 8;
2516 } else {
2517 depth.increment()?;
2518 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2519 }
2520 match ordinal {
2521 1 => {
2522 #[allow(irrefutable_let_patterns)]
2523 if let EmptyResultClassification::Success(_) = self {
2524 } else {
2526 *self = EmptyResultClassification::Success(fidl::new_empty!(Empty, D));
2528 }
2529 #[allow(irrefutable_let_patterns)]
2530 if let EmptyResultClassification::Success(ref mut val) = self {
2531 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
2532 } else {
2533 unreachable!()
2534 }
2535 }
2536 3 => {
2537 #[allow(irrefutable_let_patterns)]
2538 if let EmptyResultClassification::FidlError(_) = self {
2539 } else {
2541 *self = EmptyResultClassification::FidlError(fidl::new_empty!(
2543 FidlErrorKind,
2544 D
2545 ));
2546 }
2547 #[allow(irrefutable_let_patterns)]
2548 if let EmptyResultClassification::FidlError(ref mut val) = self {
2549 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
2550 } else {
2551 unreachable!()
2552 }
2553 }
2554 #[allow(deprecated)]
2555 ordinal => {
2556 for _ in 0..num_handles {
2557 decoder.drop_next_handle()?;
2558 }
2559 *self =
2560 EmptyResultClassification::__SourceBreaking { unknown_ordinal: ordinal };
2561 }
2562 }
2563 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2564 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2565 }
2566 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2567 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2568 }
2569 Ok(())
2570 }
2571 }
2572
2573 impl fidl::encoding::ValueTypeMarker for EmptyResultWithErrorClassification {
2574 type Borrowed<'a> = &'a Self;
2575 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2576 value
2577 }
2578 }
2579
2580 unsafe impl fidl::encoding::TypeMarker for EmptyResultWithErrorClassification {
2581 type Owned = Self;
2582
2583 #[inline(always)]
2584 fn inline_align(_context: fidl::encoding::Context) -> usize {
2585 8
2586 }
2587
2588 #[inline(always)]
2589 fn inline_size(_context: fidl::encoding::Context) -> usize {
2590 16
2591 }
2592 }
2593
2594 unsafe impl<D: fidl::encoding::ResourceDialect>
2595 fidl::encoding::Encode<EmptyResultWithErrorClassification, D>
2596 for &EmptyResultWithErrorClassification
2597 {
2598 #[inline]
2599 unsafe fn encode(
2600 self,
2601 encoder: &mut fidl::encoding::Encoder<'_, D>,
2602 offset: usize,
2603 _depth: fidl::encoding::Depth,
2604 ) -> fidl::Result<()> {
2605 encoder.debug_check_bounds::<EmptyResultWithErrorClassification>(offset);
2606 encoder.write_num::<u64>(self.ordinal(), offset);
2607 match self {
2608 EmptyResultWithErrorClassification::Success(ref val) => {
2609 fidl::encoding::encode_in_envelope::<Empty, D>(
2610 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
2611 encoder,
2612 offset + 8,
2613 _depth,
2614 )
2615 }
2616 EmptyResultWithErrorClassification::ApplicationError(ref val) => {
2617 fidl::encoding::encode_in_envelope::<i32, D>(
2618 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
2619 encoder,
2620 offset + 8,
2621 _depth,
2622 )
2623 }
2624 EmptyResultWithErrorClassification::FidlError(ref val) => {
2625 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
2626 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
2627 encoder,
2628 offset + 8,
2629 _depth,
2630 )
2631 }
2632 EmptyResultWithErrorClassification::__SourceBreaking { .. } => {
2633 Err(fidl::Error::UnknownUnionTag)
2634 }
2635 }
2636 }
2637 }
2638
2639 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2640 for EmptyResultWithErrorClassification
2641 {
2642 #[inline(always)]
2643 fn new_empty() -> Self {
2644 Self::__SourceBreaking { unknown_ordinal: 0 }
2645 }
2646
2647 #[inline]
2648 unsafe fn decode(
2649 &mut self,
2650 decoder: &mut fidl::encoding::Decoder<'_, D>,
2651 offset: usize,
2652 mut depth: fidl::encoding::Depth,
2653 ) -> fidl::Result<()> {
2654 decoder.debug_check_bounds::<Self>(offset);
2655 #[allow(unused_variables)]
2656 let next_out_of_line = decoder.next_out_of_line();
2657 let handles_before = decoder.remaining_handles();
2658 let (ordinal, inlined, num_bytes, num_handles) =
2659 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2660
2661 let member_inline_size = match ordinal {
2662 1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2663 2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2664 3 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2665 0 => return Err(fidl::Error::UnknownUnionTag),
2666 _ => num_bytes as usize,
2667 };
2668
2669 if inlined != (member_inline_size <= 4) {
2670 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2671 }
2672 let _inner_offset;
2673 if inlined {
2674 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2675 _inner_offset = offset + 8;
2676 } else {
2677 depth.increment()?;
2678 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2679 }
2680 match ordinal {
2681 1 => {
2682 #[allow(irrefutable_let_patterns)]
2683 if let EmptyResultWithErrorClassification::Success(_) = self {
2684 } else {
2686 *self =
2688 EmptyResultWithErrorClassification::Success(fidl::new_empty!(Empty, D));
2689 }
2690 #[allow(irrefutable_let_patterns)]
2691 if let EmptyResultWithErrorClassification::Success(ref mut val) = self {
2692 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
2693 } else {
2694 unreachable!()
2695 }
2696 }
2697 2 => {
2698 #[allow(irrefutable_let_patterns)]
2699 if let EmptyResultWithErrorClassification::ApplicationError(_) = self {
2700 } else {
2702 *self = EmptyResultWithErrorClassification::ApplicationError(
2704 fidl::new_empty!(i32, D),
2705 );
2706 }
2707 #[allow(irrefutable_let_patterns)]
2708 if let EmptyResultWithErrorClassification::ApplicationError(ref mut val) = self
2709 {
2710 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
2711 } else {
2712 unreachable!()
2713 }
2714 }
2715 3 => {
2716 #[allow(irrefutable_let_patterns)]
2717 if let EmptyResultWithErrorClassification::FidlError(_) = self {
2718 } else {
2720 *self = EmptyResultWithErrorClassification::FidlError(fidl::new_empty!(
2722 FidlErrorKind,
2723 D
2724 ));
2725 }
2726 #[allow(irrefutable_let_patterns)]
2727 if let EmptyResultWithErrorClassification::FidlError(ref mut val) = self {
2728 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
2729 } else {
2730 unreachable!()
2731 }
2732 }
2733 #[allow(deprecated)]
2734 ordinal => {
2735 for _ in 0..num_handles {
2736 decoder.drop_next_handle()?;
2737 }
2738 *self = EmptyResultWithErrorClassification::__SourceBreaking {
2739 unknown_ordinal: ordinal,
2740 };
2741 }
2742 }
2743 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2744 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2745 }
2746 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2747 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2748 }
2749 Ok(())
2750 }
2751 }
2752
2753 impl fidl::encoding::ValueTypeMarker for NonEmptyResultClassification {
2754 type Borrowed<'a> = &'a Self;
2755 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2756 value
2757 }
2758 }
2759
2760 unsafe impl fidl::encoding::TypeMarker for NonEmptyResultClassification {
2761 type Owned = Self;
2762
2763 #[inline(always)]
2764 fn inline_align(_context: fidl::encoding::Context) -> usize {
2765 8
2766 }
2767
2768 #[inline(always)]
2769 fn inline_size(_context: fidl::encoding::Context) -> usize {
2770 16
2771 }
2772 }
2773
2774 unsafe impl<D: fidl::encoding::ResourceDialect>
2775 fidl::encoding::Encode<NonEmptyResultClassification, D> for &NonEmptyResultClassification
2776 {
2777 #[inline]
2778 unsafe fn encode(
2779 self,
2780 encoder: &mut fidl::encoding::Encoder<'_, D>,
2781 offset: usize,
2782 _depth: fidl::encoding::Depth,
2783 ) -> fidl::Result<()> {
2784 encoder.debug_check_bounds::<NonEmptyResultClassification>(offset);
2785 encoder.write_num::<u64>(self.ordinal(), offset);
2786 match self {
2787 NonEmptyResultClassification::Success(ref val) => {
2788 fidl::encoding::encode_in_envelope::<NonEmptyPayload, D>(
2789 <NonEmptyPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
2790 encoder,
2791 offset + 8,
2792 _depth,
2793 )
2794 }
2795 NonEmptyResultClassification::FidlError(ref val) => {
2796 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
2797 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
2798 encoder,
2799 offset + 8,
2800 _depth,
2801 )
2802 }
2803 NonEmptyResultClassification::__SourceBreaking { .. } => {
2804 Err(fidl::Error::UnknownUnionTag)
2805 }
2806 }
2807 }
2808 }
2809
2810 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2811 for NonEmptyResultClassification
2812 {
2813 #[inline(always)]
2814 fn new_empty() -> Self {
2815 Self::__SourceBreaking { unknown_ordinal: 0 }
2816 }
2817
2818 #[inline]
2819 unsafe fn decode(
2820 &mut self,
2821 decoder: &mut fidl::encoding::Decoder<'_, D>,
2822 offset: usize,
2823 mut depth: fidl::encoding::Depth,
2824 ) -> fidl::Result<()> {
2825 decoder.debug_check_bounds::<Self>(offset);
2826 #[allow(unused_variables)]
2827 let next_out_of_line = decoder.next_out_of_line();
2828 let handles_before = decoder.remaining_handles();
2829 let (ordinal, inlined, num_bytes, num_handles) =
2830 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2831
2832 let member_inline_size = match ordinal {
2833 1 => <NonEmptyPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2834 3 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2835 0 => return Err(fidl::Error::UnknownUnionTag),
2836 _ => num_bytes as usize,
2837 };
2838
2839 if inlined != (member_inline_size <= 4) {
2840 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2841 }
2842 let _inner_offset;
2843 if inlined {
2844 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2845 _inner_offset = offset + 8;
2846 } else {
2847 depth.increment()?;
2848 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2849 }
2850 match ordinal {
2851 1 => {
2852 #[allow(irrefutable_let_patterns)]
2853 if let NonEmptyResultClassification::Success(_) = self {
2854 } else {
2856 *self = NonEmptyResultClassification::Success(fidl::new_empty!(
2858 NonEmptyPayload,
2859 D
2860 ));
2861 }
2862 #[allow(irrefutable_let_patterns)]
2863 if let NonEmptyResultClassification::Success(ref mut val) = self {
2864 fidl::decode!(NonEmptyPayload, D, val, decoder, _inner_offset, depth)?;
2865 } else {
2866 unreachable!()
2867 }
2868 }
2869 3 => {
2870 #[allow(irrefutable_let_patterns)]
2871 if let NonEmptyResultClassification::FidlError(_) = self {
2872 } else {
2874 *self = NonEmptyResultClassification::FidlError(fidl::new_empty!(
2876 FidlErrorKind,
2877 D
2878 ));
2879 }
2880 #[allow(irrefutable_let_patterns)]
2881 if let NonEmptyResultClassification::FidlError(ref mut val) = self {
2882 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
2883 } else {
2884 unreachable!()
2885 }
2886 }
2887 #[allow(deprecated)]
2888 ordinal => {
2889 for _ in 0..num_handles {
2890 decoder.drop_next_handle()?;
2891 }
2892 *self =
2893 NonEmptyResultClassification::__SourceBreaking { unknown_ordinal: ordinal };
2894 }
2895 }
2896 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2897 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2898 }
2899 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2900 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2901 }
2902 Ok(())
2903 }
2904 }
2905
2906 impl fidl::encoding::ValueTypeMarker for NonEmptyResultWithErrorClassification {
2907 type Borrowed<'a> = &'a Self;
2908 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2909 value
2910 }
2911 }
2912
2913 unsafe impl fidl::encoding::TypeMarker for NonEmptyResultWithErrorClassification {
2914 type Owned = Self;
2915
2916 #[inline(always)]
2917 fn inline_align(_context: fidl::encoding::Context) -> usize {
2918 8
2919 }
2920
2921 #[inline(always)]
2922 fn inline_size(_context: fidl::encoding::Context) -> usize {
2923 16
2924 }
2925 }
2926
2927 unsafe impl<D: fidl::encoding::ResourceDialect>
2928 fidl::encoding::Encode<NonEmptyResultWithErrorClassification, D>
2929 for &NonEmptyResultWithErrorClassification
2930 {
2931 #[inline]
2932 unsafe fn encode(
2933 self,
2934 encoder: &mut fidl::encoding::Encoder<'_, D>,
2935 offset: usize,
2936 _depth: fidl::encoding::Depth,
2937 ) -> fidl::Result<()> {
2938 encoder.debug_check_bounds::<NonEmptyResultWithErrorClassification>(offset);
2939 encoder.write_num::<u64>(self.ordinal(), offset);
2940 match self {
2941 NonEmptyResultWithErrorClassification::Success(ref val) => {
2942 fidl::encoding::encode_in_envelope::<NonEmptyPayload, D>(
2943 <NonEmptyPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
2944 encoder,
2945 offset + 8,
2946 _depth,
2947 )
2948 }
2949 NonEmptyResultWithErrorClassification::ApplicationError(ref val) => {
2950 fidl::encoding::encode_in_envelope::<i32, D>(
2951 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
2952 encoder,
2953 offset + 8,
2954 _depth,
2955 )
2956 }
2957 NonEmptyResultWithErrorClassification::FidlError(ref val) => {
2958 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
2959 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
2960 encoder,
2961 offset + 8,
2962 _depth,
2963 )
2964 }
2965 NonEmptyResultWithErrorClassification::__SourceBreaking { .. } => {
2966 Err(fidl::Error::UnknownUnionTag)
2967 }
2968 }
2969 }
2970 }
2971
2972 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2973 for NonEmptyResultWithErrorClassification
2974 {
2975 #[inline(always)]
2976 fn new_empty() -> Self {
2977 Self::__SourceBreaking { unknown_ordinal: 0 }
2978 }
2979
2980 #[inline]
2981 unsafe fn decode(
2982 &mut self,
2983 decoder: &mut fidl::encoding::Decoder<'_, D>,
2984 offset: usize,
2985 mut depth: fidl::encoding::Depth,
2986 ) -> fidl::Result<()> {
2987 decoder.debug_check_bounds::<Self>(offset);
2988 #[allow(unused_variables)]
2989 let next_out_of_line = decoder.next_out_of_line();
2990 let handles_before = decoder.remaining_handles();
2991 let (ordinal, inlined, num_bytes, num_handles) =
2992 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2993
2994 let member_inline_size = match ordinal {
2995 1 => <NonEmptyPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2996 2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2997 3 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2998 0 => return Err(fidl::Error::UnknownUnionTag),
2999 _ => num_bytes as usize,
3000 };
3001
3002 if inlined != (member_inline_size <= 4) {
3003 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3004 }
3005 let _inner_offset;
3006 if inlined {
3007 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3008 _inner_offset = offset + 8;
3009 } else {
3010 depth.increment()?;
3011 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3012 }
3013 match ordinal {
3014 1 => {
3015 #[allow(irrefutable_let_patterns)]
3016 if let NonEmptyResultWithErrorClassification::Success(_) = self {
3017 } else {
3019 *self = NonEmptyResultWithErrorClassification::Success(fidl::new_empty!(
3021 NonEmptyPayload,
3022 D
3023 ));
3024 }
3025 #[allow(irrefutable_let_patterns)]
3026 if let NonEmptyResultWithErrorClassification::Success(ref mut val) = self {
3027 fidl::decode!(NonEmptyPayload, D, val, decoder, _inner_offset, depth)?;
3028 } else {
3029 unreachable!()
3030 }
3031 }
3032 2 => {
3033 #[allow(irrefutable_let_patterns)]
3034 if let NonEmptyResultWithErrorClassification::ApplicationError(_) = self {
3035 } else {
3037 *self = NonEmptyResultWithErrorClassification::ApplicationError(
3039 fidl::new_empty!(i32, D),
3040 );
3041 }
3042 #[allow(irrefutable_let_patterns)]
3043 if let NonEmptyResultWithErrorClassification::ApplicationError(ref mut val) =
3044 self
3045 {
3046 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
3047 } else {
3048 unreachable!()
3049 }
3050 }
3051 3 => {
3052 #[allow(irrefutable_let_patterns)]
3053 if let NonEmptyResultWithErrorClassification::FidlError(_) = self {
3054 } else {
3056 *self = NonEmptyResultWithErrorClassification::FidlError(fidl::new_empty!(
3058 FidlErrorKind,
3059 D
3060 ));
3061 }
3062 #[allow(irrefutable_let_patterns)]
3063 if let NonEmptyResultWithErrorClassification::FidlError(ref mut val) = self {
3064 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
3065 } else {
3066 unreachable!()
3067 }
3068 }
3069 #[allow(deprecated)]
3070 ordinal => {
3071 for _ in 0..num_handles {
3072 decoder.drop_next_handle()?;
3073 }
3074 *self = NonEmptyResultWithErrorClassification::__SourceBreaking {
3075 unknown_ordinal: ordinal,
3076 };
3077 }
3078 }
3079 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3080 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3081 }
3082 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3083 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3084 }
3085 Ok(())
3086 }
3087 }
3088
3089 impl fidl::encoding::ValueTypeMarker for OpenTargetEventReport {
3090 type Borrowed<'a> = &'a Self;
3091 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3092 value
3093 }
3094 }
3095
3096 unsafe impl fidl::encoding::TypeMarker for OpenTargetEventReport {
3097 type Owned = Self;
3098
3099 #[inline(always)]
3100 fn inline_align(_context: fidl::encoding::Context) -> usize {
3101 8
3102 }
3103
3104 #[inline(always)]
3105 fn inline_size(_context: fidl::encoding::Context) -> usize {
3106 16
3107 }
3108 }
3109
3110 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OpenTargetEventReport, D>
3111 for &OpenTargetEventReport
3112 {
3113 #[inline]
3114 unsafe fn encode(
3115 self,
3116 encoder: &mut fidl::encoding::Encoder<'_, D>,
3117 offset: usize,
3118 _depth: fidl::encoding::Depth,
3119 ) -> fidl::Result<()> {
3120 encoder.debug_check_bounds::<OpenTargetEventReport>(offset);
3121 encoder.write_num::<u64>(self.ordinal(), offset);
3122 match self {
3123 OpenTargetEventReport::FidlError(ref val) => {
3124 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
3125 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
3126 encoder,
3127 offset + 8,
3128 _depth,
3129 )
3130 }
3131 OpenTargetEventReport::UnknownEvent(ref val) => {
3132 fidl::encoding::encode_in_envelope::<UnknownEvent, D>(
3133 <UnknownEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
3134 encoder,
3135 offset + 8,
3136 _depth,
3137 )
3138 }
3139 OpenTargetEventReport::StrictEvent(ref val) => {
3140 fidl::encoding::encode_in_envelope::<Empty, D>(
3141 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
3142 encoder,
3143 offset + 8,
3144 _depth,
3145 )
3146 }
3147 OpenTargetEventReport::FlexibleEvent(ref val) => {
3148 fidl::encoding::encode_in_envelope::<Empty, D>(
3149 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
3150 encoder,
3151 offset + 8,
3152 _depth,
3153 )
3154 }
3155 OpenTargetEventReport::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
3156 }
3157 }
3158 }
3159
3160 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenTargetEventReport {
3161 #[inline(always)]
3162 fn new_empty() -> Self {
3163 Self::__SourceBreaking { unknown_ordinal: 0 }
3164 }
3165
3166 #[inline]
3167 unsafe fn decode(
3168 &mut self,
3169 decoder: &mut fidl::encoding::Decoder<'_, D>,
3170 offset: usize,
3171 mut depth: fidl::encoding::Depth,
3172 ) -> fidl::Result<()> {
3173 decoder.debug_check_bounds::<Self>(offset);
3174 #[allow(unused_variables)]
3175 let next_out_of_line = decoder.next_out_of_line();
3176 let handles_before = decoder.remaining_handles();
3177 let (ordinal, inlined, num_bytes, num_handles) =
3178 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3179
3180 let member_inline_size = match ordinal {
3181 1 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3182 2 => <UnknownEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3183 3 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3184 4 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3185 0 => return Err(fidl::Error::UnknownUnionTag),
3186 _ => num_bytes as usize,
3187 };
3188
3189 if inlined != (member_inline_size <= 4) {
3190 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3191 }
3192 let _inner_offset;
3193 if inlined {
3194 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3195 _inner_offset = offset + 8;
3196 } else {
3197 depth.increment()?;
3198 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3199 }
3200 match ordinal {
3201 1 => {
3202 #[allow(irrefutable_let_patterns)]
3203 if let OpenTargetEventReport::FidlError(_) = self {
3204 } else {
3206 *self =
3208 OpenTargetEventReport::FidlError(fidl::new_empty!(FidlErrorKind, D));
3209 }
3210 #[allow(irrefutable_let_patterns)]
3211 if let OpenTargetEventReport::FidlError(ref mut val) = self {
3212 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
3213 } else {
3214 unreachable!()
3215 }
3216 }
3217 2 => {
3218 #[allow(irrefutable_let_patterns)]
3219 if let OpenTargetEventReport::UnknownEvent(_) = self {
3220 } else {
3222 *self =
3224 OpenTargetEventReport::UnknownEvent(fidl::new_empty!(UnknownEvent, D));
3225 }
3226 #[allow(irrefutable_let_patterns)]
3227 if let OpenTargetEventReport::UnknownEvent(ref mut val) = self {
3228 fidl::decode!(UnknownEvent, D, val, decoder, _inner_offset, depth)?;
3229 } else {
3230 unreachable!()
3231 }
3232 }
3233 3 => {
3234 #[allow(irrefutable_let_patterns)]
3235 if let OpenTargetEventReport::StrictEvent(_) = self {
3236 } else {
3238 *self = OpenTargetEventReport::StrictEvent(fidl::new_empty!(Empty, D));
3240 }
3241 #[allow(irrefutable_let_patterns)]
3242 if let OpenTargetEventReport::StrictEvent(ref mut val) = self {
3243 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
3244 } else {
3245 unreachable!()
3246 }
3247 }
3248 4 => {
3249 #[allow(irrefutable_let_patterns)]
3250 if let OpenTargetEventReport::FlexibleEvent(_) = self {
3251 } else {
3253 *self = OpenTargetEventReport::FlexibleEvent(fidl::new_empty!(Empty, D));
3255 }
3256 #[allow(irrefutable_let_patterns)]
3257 if let OpenTargetEventReport::FlexibleEvent(ref mut val) = self {
3258 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
3259 } else {
3260 unreachable!()
3261 }
3262 }
3263 #[allow(deprecated)]
3264 ordinal => {
3265 for _ in 0..num_handles {
3266 decoder.drop_next_handle()?;
3267 }
3268 *self = OpenTargetEventReport::__SourceBreaking { unknown_ordinal: ordinal };
3269 }
3270 }
3271 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3272 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3273 }
3274 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3275 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3276 }
3277 Ok(())
3278 }
3279 }
3280
3281 impl fidl::encoding::ValueTypeMarker for TableResultClassification {
3282 type Borrowed<'a> = &'a Self;
3283 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3284 value
3285 }
3286 }
3287
3288 unsafe impl fidl::encoding::TypeMarker for TableResultClassification {
3289 type Owned = Self;
3290
3291 #[inline(always)]
3292 fn inline_align(_context: fidl::encoding::Context) -> usize {
3293 8
3294 }
3295
3296 #[inline(always)]
3297 fn inline_size(_context: fidl::encoding::Context) -> usize {
3298 16
3299 }
3300 }
3301
3302 unsafe impl<D: fidl::encoding::ResourceDialect>
3303 fidl::encoding::Encode<TableResultClassification, D> for &TableResultClassification
3304 {
3305 #[inline]
3306 unsafe fn encode(
3307 self,
3308 encoder: &mut fidl::encoding::Encoder<'_, D>,
3309 offset: usize,
3310 _depth: fidl::encoding::Depth,
3311 ) -> fidl::Result<()> {
3312 encoder.debug_check_bounds::<TableResultClassification>(offset);
3313 encoder.write_num::<u64>(self.ordinal(), offset);
3314 match self {
3315 TableResultClassification::Success(ref val) => {
3316 fidl::encoding::encode_in_envelope::<TablePayload, D>(
3317 <TablePayload as fidl::encoding::ValueTypeMarker>::borrow(val),
3318 encoder,
3319 offset + 8,
3320 _depth,
3321 )
3322 }
3323 TableResultClassification::FidlError(ref val) => {
3324 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
3325 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
3326 encoder,
3327 offset + 8,
3328 _depth,
3329 )
3330 }
3331 TableResultClassification::__SourceBreaking { .. } => {
3332 Err(fidl::Error::UnknownUnionTag)
3333 }
3334 }
3335 }
3336 }
3337
3338 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3339 for TableResultClassification
3340 {
3341 #[inline(always)]
3342 fn new_empty() -> Self {
3343 Self::__SourceBreaking { unknown_ordinal: 0 }
3344 }
3345
3346 #[inline]
3347 unsafe fn decode(
3348 &mut self,
3349 decoder: &mut fidl::encoding::Decoder<'_, D>,
3350 offset: usize,
3351 mut depth: fidl::encoding::Depth,
3352 ) -> fidl::Result<()> {
3353 decoder.debug_check_bounds::<Self>(offset);
3354 #[allow(unused_variables)]
3355 let next_out_of_line = decoder.next_out_of_line();
3356 let handles_before = decoder.remaining_handles();
3357 let (ordinal, inlined, num_bytes, num_handles) =
3358 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3359
3360 let member_inline_size = match ordinal {
3361 1 => <TablePayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3362 3 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3363 0 => return Err(fidl::Error::UnknownUnionTag),
3364 _ => num_bytes as usize,
3365 };
3366
3367 if inlined != (member_inline_size <= 4) {
3368 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3369 }
3370 let _inner_offset;
3371 if inlined {
3372 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3373 _inner_offset = offset + 8;
3374 } else {
3375 depth.increment()?;
3376 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3377 }
3378 match ordinal {
3379 1 => {
3380 #[allow(irrefutable_let_patterns)]
3381 if let TableResultClassification::Success(_) = self {
3382 } else {
3384 *self =
3386 TableResultClassification::Success(fidl::new_empty!(TablePayload, D));
3387 }
3388 #[allow(irrefutable_let_patterns)]
3389 if let TableResultClassification::Success(ref mut val) = self {
3390 fidl::decode!(TablePayload, D, val, decoder, _inner_offset, depth)?;
3391 } else {
3392 unreachable!()
3393 }
3394 }
3395 3 => {
3396 #[allow(irrefutable_let_patterns)]
3397 if let TableResultClassification::FidlError(_) = self {
3398 } else {
3400 *self = TableResultClassification::FidlError(fidl::new_empty!(
3402 FidlErrorKind,
3403 D
3404 ));
3405 }
3406 #[allow(irrefutable_let_patterns)]
3407 if let TableResultClassification::FidlError(ref mut val) = self {
3408 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
3409 } else {
3410 unreachable!()
3411 }
3412 }
3413 #[allow(deprecated)]
3414 ordinal => {
3415 for _ in 0..num_handles {
3416 decoder.drop_next_handle()?;
3417 }
3418 *self =
3419 TableResultClassification::__SourceBreaking { unknown_ordinal: ordinal };
3420 }
3421 }
3422 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3424 }
3425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3427 }
3428 Ok(())
3429 }
3430 }
3431
3432 impl fidl::encoding::ValueTypeMarker for UnionPayload {
3433 type Borrowed<'a> = &'a Self;
3434 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3435 value
3436 }
3437 }
3438
3439 unsafe impl fidl::encoding::TypeMarker for UnionPayload {
3440 type Owned = Self;
3441
3442 #[inline(always)]
3443 fn inline_align(_context: fidl::encoding::Context) -> usize {
3444 8
3445 }
3446
3447 #[inline(always)]
3448 fn inline_size(_context: fidl::encoding::Context) -> usize {
3449 16
3450 }
3451 }
3452
3453 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnionPayload, D>
3454 for &UnionPayload
3455 {
3456 #[inline]
3457 unsafe fn encode(
3458 self,
3459 encoder: &mut fidl::encoding::Encoder<'_, D>,
3460 offset: usize,
3461 _depth: fidl::encoding::Depth,
3462 ) -> fidl::Result<()> {
3463 encoder.debug_check_bounds::<UnionPayload>(offset);
3464 encoder.write_num::<u64>(self.ordinal(), offset);
3465 match self {
3466 UnionPayload::SomeVariant(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
3467 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
3468 encoder,
3469 offset + 8,
3470 _depth,
3471 ),
3472 UnionPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
3473 }
3474 }
3475 }
3476
3477 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnionPayload {
3478 #[inline(always)]
3479 fn new_empty() -> Self {
3480 Self::__SourceBreaking { unknown_ordinal: 0 }
3481 }
3482
3483 #[inline]
3484 unsafe fn decode(
3485 &mut self,
3486 decoder: &mut fidl::encoding::Decoder<'_, D>,
3487 offset: usize,
3488 mut depth: fidl::encoding::Depth,
3489 ) -> fidl::Result<()> {
3490 decoder.debug_check_bounds::<Self>(offset);
3491 #[allow(unused_variables)]
3492 let next_out_of_line = decoder.next_out_of_line();
3493 let handles_before = decoder.remaining_handles();
3494 let (ordinal, inlined, num_bytes, num_handles) =
3495 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3496
3497 let member_inline_size = match ordinal {
3498 1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3499 0 => return Err(fidl::Error::UnknownUnionTag),
3500 _ => num_bytes as usize,
3501 };
3502
3503 if inlined != (member_inline_size <= 4) {
3504 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3505 }
3506 let _inner_offset;
3507 if inlined {
3508 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3509 _inner_offset = offset + 8;
3510 } else {
3511 depth.increment()?;
3512 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3513 }
3514 match ordinal {
3515 1 => {
3516 #[allow(irrefutable_let_patterns)]
3517 if let UnionPayload::SomeVariant(_) = self {
3518 } else {
3520 *self = UnionPayload::SomeVariant(fidl::new_empty!(i32, D));
3522 }
3523 #[allow(irrefutable_let_patterns)]
3524 if let UnionPayload::SomeVariant(ref mut val) = self {
3525 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
3526 } else {
3527 unreachable!()
3528 }
3529 }
3530 #[allow(deprecated)]
3531 ordinal => {
3532 for _ in 0..num_handles {
3533 decoder.drop_next_handle()?;
3534 }
3535 *self = UnionPayload::__SourceBreaking { unknown_ordinal: ordinal };
3536 }
3537 }
3538 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3539 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3540 }
3541 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3542 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3543 }
3544 Ok(())
3545 }
3546 }
3547
3548 impl fidl::encoding::ValueTypeMarker for UnionResultClassification {
3549 type Borrowed<'a> = &'a Self;
3550 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3551 value
3552 }
3553 }
3554
3555 unsafe impl fidl::encoding::TypeMarker for UnionResultClassification {
3556 type Owned = Self;
3557
3558 #[inline(always)]
3559 fn inline_align(_context: fidl::encoding::Context) -> usize {
3560 8
3561 }
3562
3563 #[inline(always)]
3564 fn inline_size(_context: fidl::encoding::Context) -> usize {
3565 16
3566 }
3567 }
3568
3569 unsafe impl<D: fidl::encoding::ResourceDialect>
3570 fidl::encoding::Encode<UnionResultClassification, D> for &UnionResultClassification
3571 {
3572 #[inline]
3573 unsafe fn encode(
3574 self,
3575 encoder: &mut fidl::encoding::Encoder<'_, D>,
3576 offset: usize,
3577 _depth: fidl::encoding::Depth,
3578 ) -> fidl::Result<()> {
3579 encoder.debug_check_bounds::<UnionResultClassification>(offset);
3580 encoder.write_num::<u64>(self.ordinal(), offset);
3581 match self {
3582 UnionResultClassification::Success(ref val) => {
3583 fidl::encoding::encode_in_envelope::<UnionPayload, D>(
3584 <UnionPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
3585 encoder,
3586 offset + 8,
3587 _depth,
3588 )
3589 }
3590 UnionResultClassification::FidlError(ref val) => {
3591 fidl::encoding::encode_in_envelope::<FidlErrorKind, D>(
3592 <FidlErrorKind as fidl::encoding::ValueTypeMarker>::borrow(val),
3593 encoder,
3594 offset + 8,
3595 _depth,
3596 )
3597 }
3598 UnionResultClassification::__SourceBreaking { .. } => {
3599 Err(fidl::Error::UnknownUnionTag)
3600 }
3601 }
3602 }
3603 }
3604
3605 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3606 for UnionResultClassification
3607 {
3608 #[inline(always)]
3609 fn new_empty() -> Self {
3610 Self::__SourceBreaking { unknown_ordinal: 0 }
3611 }
3612
3613 #[inline]
3614 unsafe fn decode(
3615 &mut self,
3616 decoder: &mut fidl::encoding::Decoder<'_, D>,
3617 offset: usize,
3618 mut depth: fidl::encoding::Depth,
3619 ) -> fidl::Result<()> {
3620 decoder.debug_check_bounds::<Self>(offset);
3621 #[allow(unused_variables)]
3622 let next_out_of_line = decoder.next_out_of_line();
3623 let handles_before = decoder.remaining_handles();
3624 let (ordinal, inlined, num_bytes, num_handles) =
3625 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3626
3627 let member_inline_size = match ordinal {
3628 1 => <UnionPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3629 3 => <FidlErrorKind as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3630 0 => return Err(fidl::Error::UnknownUnionTag),
3631 _ => num_bytes as usize,
3632 };
3633
3634 if inlined != (member_inline_size <= 4) {
3635 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3636 }
3637 let _inner_offset;
3638 if inlined {
3639 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3640 _inner_offset = offset + 8;
3641 } else {
3642 depth.increment()?;
3643 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3644 }
3645 match ordinal {
3646 1 => {
3647 #[allow(irrefutable_let_patterns)]
3648 if let UnionResultClassification::Success(_) = self {
3649 } else {
3651 *self =
3653 UnionResultClassification::Success(fidl::new_empty!(UnionPayload, D));
3654 }
3655 #[allow(irrefutable_let_patterns)]
3656 if let UnionResultClassification::Success(ref mut val) = self {
3657 fidl::decode!(UnionPayload, D, val, decoder, _inner_offset, depth)?;
3658 } else {
3659 unreachable!()
3660 }
3661 }
3662 3 => {
3663 #[allow(irrefutable_let_patterns)]
3664 if let UnionResultClassification::FidlError(_) = self {
3665 } else {
3667 *self = UnionResultClassification::FidlError(fidl::new_empty!(
3669 FidlErrorKind,
3670 D
3671 ));
3672 }
3673 #[allow(irrefutable_let_patterns)]
3674 if let UnionResultClassification::FidlError(ref mut val) = self {
3675 fidl::decode!(FidlErrorKind, D, val, decoder, _inner_offset, depth)?;
3676 } else {
3677 unreachable!()
3678 }
3679 }
3680 #[allow(deprecated)]
3681 ordinal => {
3682 for _ in 0..num_handles {
3683 decoder.drop_next_handle()?;
3684 }
3685 *self =
3686 UnionResultClassification::__SourceBreaking { unknown_ordinal: ordinal };
3687 }
3688 }
3689 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3690 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3691 }
3692 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3693 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3694 }
3695 Ok(())
3696 }
3697 }
3698}