fidl_fidl_clientsuite_common/
fidl_fidl_clientsuite_common.rs

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