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