fidl_fidl_test_compatibility_common/
fidl_fidl_test_compatibility_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const ARRAYS_SIZE: u32 = 3;
12
13pub const STRINGS_SIZE: u32 = 32;
14
15pub const VECTORS_SIZE: u32 = 3;
16
17bitflags! {
18    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
19    pub struct DefaultBits: u32 {
20        const ONE = 1;
21        const TWO = 2;
22    }
23}
24
25impl DefaultBits {
26    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
27    #[inline(always)]
28    pub fn has_unknown_bits(&self) -> bool {
29        false
30    }
31
32    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
33    #[inline(always)]
34    pub fn get_unknown_bits(&self) -> u32 {
35        0
36    }
37}
38
39bitflags! {
40    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
41    pub struct U16Bits: u16 {
42        const ONE = 1;
43        const TWO = 2;
44        const THREE = 4;
45        const FOUR = 8;
46        const FIVE = 16;
47        const SIX = 32;
48    }
49}
50
51impl U16Bits {
52    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
53    #[inline(always)]
54    pub fn has_unknown_bits(&self) -> bool {
55        false
56    }
57
58    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
59    #[inline(always)]
60    pub fn get_unknown_bits(&self) -> u16 {
61        0
62    }
63}
64
65bitflags! {
66    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
67    pub struct U32Bits: u32 {
68        const ONE = 1;
69        const TWO = 2;
70        const THREE = 4;
71        const FOUR = 8;
72        const FIVE = 16;
73        const SIX = 32;
74        const SEVEN = 64;
75    }
76}
77
78impl U32Bits {
79    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
80    #[inline(always)]
81    pub fn has_unknown_bits(&self) -> bool {
82        false
83    }
84
85    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
86    #[inline(always)]
87    pub fn get_unknown_bits(&self) -> u32 {
88        0
89    }
90}
91
92bitflags! {
93    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
94    pub struct U64Bits: u64 {
95        const ONE = 1;
96        const TWO = 2;
97        const THREE = 4;
98        const FOUR = 8;
99        const FIVE = 16;
100        const SIX = 32;
101        const SEVEN = 64;
102        const EIGHT = 128;
103    }
104}
105
106impl U64Bits {
107    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
108    #[inline(always)]
109    pub fn has_unknown_bits(&self) -> bool {
110        false
111    }
112
113    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
114    #[inline(always)]
115    pub fn get_unknown_bits(&self) -> u64 {
116        0
117    }
118}
119
120bitflags! {
121    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
122    pub struct U8Bits: u8 {
123        const ONE = 1;
124        const TWO = 2;
125        const THREE = 4;
126        const FOUR = 8;
127        const FIVE = 16;
128    }
129}
130
131impl U8Bits {
132    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
133    #[inline(always)]
134    pub fn has_unknown_bits(&self) -> bool {
135        false
136    }
137
138    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
139    #[inline(always)]
140    pub fn get_unknown_bits(&self) -> u8 {
141        0
142    }
143}
144
145#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
146#[repr(u32)]
147pub enum RespondWith {
148    Success = 1,
149    Err = 2,
150}
151
152impl RespondWith {
153    #[inline]
154    pub fn from_primitive(prim: u32) -> Option<Self> {
155        match prim {
156            1 => Some(Self::Success),
157            2 => Some(Self::Err),
158            _ => None,
159        }
160    }
161
162    #[inline]
163    pub const fn into_primitive(self) -> u32 {
164        self as u32
165    }
166
167    #[deprecated = "Strict enums should not use `is_unknown`"]
168    #[inline]
169    pub fn is_unknown(&self) -> bool {
170        false
171    }
172}
173
174#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
175#[repr(u32)]
176pub enum DefaultEnum {
177    KZero = 0,
178    KOne = 1,
179}
180
181impl DefaultEnum {
182    #[inline]
183    pub fn from_primitive(prim: u32) -> Option<Self> {
184        match prim {
185            0 => Some(Self::KZero),
186            1 => Some(Self::KOne),
187            _ => None,
188        }
189    }
190
191    #[inline]
192    pub const fn into_primitive(self) -> u32 {
193        self as u32
194    }
195
196    #[deprecated = "Strict enums should not use `is_unknown`"]
197    #[inline]
198    pub fn is_unknown(&self) -> bool {
199        false
200    }
201}
202
203#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
204#[repr(i16)]
205pub enum I16Enum {
206    KNegativeOne = -1,
207    KOne = 1,
208    KTwo = 2,
209}
210
211impl I16Enum {
212    #[inline]
213    pub fn from_primitive(prim: i16) -> Option<Self> {
214        match prim {
215            -1 => Some(Self::KNegativeOne),
216            1 => Some(Self::KOne),
217            2 => Some(Self::KTwo),
218            _ => None,
219        }
220    }
221
222    #[inline]
223    pub const fn into_primitive(self) -> i16 {
224        self as i16
225    }
226
227    #[deprecated = "Strict enums should not use `is_unknown`"]
228    #[inline]
229    pub fn is_unknown(&self) -> bool {
230        false
231    }
232}
233
234#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
235#[repr(i32)]
236pub enum I32Enum {
237    KNegativeOne = -1,
238    KOne = 1,
239    KTwo = 2,
240    KThree = 3,
241}
242
243impl I32Enum {
244    #[inline]
245    pub fn from_primitive(prim: i32) -> Option<Self> {
246        match prim {
247            -1 => Some(Self::KNegativeOne),
248            1 => Some(Self::KOne),
249            2 => Some(Self::KTwo),
250            3 => Some(Self::KThree),
251            _ => None,
252        }
253    }
254
255    #[inline]
256    pub const fn into_primitive(self) -> i32 {
257        self as i32
258    }
259
260    #[deprecated = "Strict enums should not use `is_unknown`"]
261    #[inline]
262    pub fn is_unknown(&self) -> bool {
263        false
264    }
265}
266
267#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
268#[repr(i64)]
269pub enum I64Enum {
270    KNegativeOne = -1,
271    KOne = 1,
272    KTwo = 2,
273    KThree = 3,
274    KFour = 4,
275}
276
277impl I64Enum {
278    #[inline]
279    pub fn from_primitive(prim: i64) -> Option<Self> {
280        match prim {
281            -1 => Some(Self::KNegativeOne),
282            1 => Some(Self::KOne),
283            2 => Some(Self::KTwo),
284            3 => Some(Self::KThree),
285            4 => Some(Self::KFour),
286            _ => None,
287        }
288    }
289
290    #[inline]
291    pub const fn into_primitive(self) -> i64 {
292        self as i64
293    }
294
295    #[deprecated = "Strict enums should not use `is_unknown`"]
296    #[inline]
297    pub fn is_unknown(&self) -> bool {
298        false
299    }
300}
301
302#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
303#[repr(i8)]
304pub enum I8Enum {
305    KNegativeOne = -1,
306    KOne = 1,
307}
308
309impl I8Enum {
310    #[inline]
311    pub fn from_primitive(prim: i8) -> Option<Self> {
312        match prim {
313            -1 => Some(Self::KNegativeOne),
314            1 => Some(Self::KOne),
315            _ => None,
316        }
317    }
318
319    #[inline]
320    pub const fn into_primitive(self) -> i8 {
321        self as i8
322    }
323
324    #[deprecated = "Strict enums should not use `is_unknown`"]
325    #[inline]
326    pub fn is_unknown(&self) -> bool {
327        false
328    }
329}
330
331#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
332#[repr(u16)]
333pub enum U16Enum {
334    KOne = 1,
335    KTwo = 2,
336    KThree = 3,
337    KFour = 4,
338    KFive = 5,
339    KSix = 6,
340}
341
342impl U16Enum {
343    #[inline]
344    pub fn from_primitive(prim: u16) -> Option<Self> {
345        match prim {
346            1 => Some(Self::KOne),
347            2 => Some(Self::KTwo),
348            3 => Some(Self::KThree),
349            4 => Some(Self::KFour),
350            5 => Some(Self::KFive),
351            6 => Some(Self::KSix),
352            _ => None,
353        }
354    }
355
356    #[inline]
357    pub const fn into_primitive(self) -> u16 {
358        self as u16
359    }
360
361    #[deprecated = "Strict enums should not use `is_unknown`"]
362    #[inline]
363    pub fn is_unknown(&self) -> bool {
364        false
365    }
366}
367
368#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
369#[repr(u32)]
370pub enum U32Enum {
371    KOne = 1,
372    KTwo = 2,
373    KThree = 3,
374    KFour = 4,
375    KFive = 5,
376    KSix = 6,
377    KSeven = 7,
378}
379
380impl U32Enum {
381    #[inline]
382    pub fn from_primitive(prim: u32) -> Option<Self> {
383        match prim {
384            1 => Some(Self::KOne),
385            2 => Some(Self::KTwo),
386            3 => Some(Self::KThree),
387            4 => Some(Self::KFour),
388            5 => Some(Self::KFive),
389            6 => Some(Self::KSix),
390            7 => Some(Self::KSeven),
391            _ => None,
392        }
393    }
394
395    #[inline]
396    pub const fn into_primitive(self) -> u32 {
397        self as u32
398    }
399
400    #[deprecated = "Strict enums should not use `is_unknown`"]
401    #[inline]
402    pub fn is_unknown(&self) -> bool {
403        false
404    }
405}
406
407#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
408#[repr(u64)]
409pub enum U64Enum {
410    KOne = 1,
411    KTwo = 2,
412    KThree = 3,
413    KFour = 4,
414    KFive = 5,
415    KSix = 6,
416    KSeven = 7,
417    KEight = 8,
418}
419
420impl U64Enum {
421    #[inline]
422    pub fn from_primitive(prim: u64) -> Option<Self> {
423        match prim {
424            1 => Some(Self::KOne),
425            2 => Some(Self::KTwo),
426            3 => Some(Self::KThree),
427            4 => Some(Self::KFour),
428            5 => Some(Self::KFive),
429            6 => Some(Self::KSix),
430            7 => Some(Self::KSeven),
431            8 => Some(Self::KEight),
432            _ => None,
433        }
434    }
435
436    #[inline]
437    pub const fn into_primitive(self) -> u64 {
438        self as u64
439    }
440
441    #[deprecated = "Strict enums should not use `is_unknown`"]
442    #[inline]
443    pub fn is_unknown(&self) -> bool {
444        false
445    }
446}
447
448#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
449#[repr(u8)]
450pub enum U8Enum {
451    KOne = 1,
452    KTwo = 2,
453    KThree = 3,
454    KFour = 4,
455    KFive = 5,
456}
457
458impl U8Enum {
459    #[inline]
460    pub fn from_primitive(prim: u8) -> Option<Self> {
461        match prim {
462            1 => Some(Self::KOne),
463            2 => Some(Self::KTwo),
464            3 => Some(Self::KThree),
465            4 => Some(Self::KFour),
466            5 => Some(Self::KFive),
467            _ => None,
468        }
469    }
470
471    #[inline]
472    pub const fn into_primitive(self) -> u8 {
473        self as u8
474    }
475
476    #[deprecated = "Strict enums should not use `is_unknown`"]
477    #[inline]
478    pub fn is_unknown(&self) -> bool {
479        false
480    }
481}
482
483#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
484pub struct ConfigGetImplsResponse {
485    pub impls: Vec<String>,
486}
487
488impl fidl::Persistable for ConfigGetImplsResponse {}
489
490#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
491pub struct EchoEchoMinimalNoRetValRequest {
492    pub forward_to_server: String,
493}
494
495impl fidl::Persistable for EchoEchoMinimalNoRetValRequest {}
496
497#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
498pub struct EchoEchoMinimalRequest {
499    pub forward_to_server: String,
500}
501
502impl fidl::Persistable for EchoEchoMinimalRequest {}
503
504#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
505pub struct EchoEchoMinimalWithErrorRequest {
506    pub forward_to_server: String,
507    pub result_variant: RespondWith,
508}
509
510impl fidl::Persistable for EchoEchoMinimalWithErrorRequest {}
511
512#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
513pub struct Signed {
514    pub value: i64,
515    pub forward_to_server: String,
516}
517
518impl fidl::Persistable for Signed {}
519
520#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
521pub struct SignedErrorable {
522    pub value: i64,
523    pub forward_to_server: String,
524    pub result_err: DefaultEnum,
525    pub result_variant: RespondWith,
526}
527
528impl fidl::Persistable for SignedErrorable {}
529
530#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
531pub struct Unsigned {
532    pub value: u64,
533    pub forward_to_server: String,
534}
535
536impl fidl::Persistable for Unsigned {}
537
538#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
539pub struct UnsignedErrorable {
540    pub value: u64,
541    pub forward_to_server: String,
542    pub result_err: DefaultEnum,
543    pub result_variant: RespondWith,
544}
545
546impl fidl::Persistable for UnsignedErrorable {}
547
548#[derive(Clone, Debug, PartialEq, PartialOrd)]
549pub struct DefaultValues {
550    pub b1: bool,
551    pub b2: bool,
552    pub i8: i8,
553    pub i16: i16,
554    pub i32: i32,
555    pub i64: i64,
556    pub u8: u8,
557    pub u16: u16,
558    pub u32: u32,
559    pub u64: u64,
560    pub f32: f32,
561    pub f64: f64,
562    pub s: String,
563}
564
565impl fidl::Persistable for DefaultValues {}
566
567#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
568pub struct PrimitiveTypes {
569    pub b: bool,
570    pub i8: i8,
571    pub i16: i16,
572    pub i32: i32,
573    pub i64: i64,
574    pub u8: u8,
575    pub u16: u16,
576    pub u32: u32,
577    pub u64: u64,
578    pub f32: f32,
579    pub f64: f64,
580}
581
582impl fidl::Persistable for PrimitiveTypes {}
583
584#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
585pub struct Strings {
586    pub s: String,
587    pub nullable_s: Option<String>,
588    pub size_0_s: String,
589    pub size_1_s: String,
590    pub nullable_size_0_s: Option<String>,
591    pub nullable_size_1_s: Option<String>,
592}
593
594impl fidl::Persistable for Strings {}
595
596#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
597pub struct Structs {
598    pub s: ThisIsAStruct,
599    pub nullable_s: Option<Box<ThisIsAStruct>>,
600    pub es: ThisIsAnEmptyStruct,
601}
602
603impl fidl::Persistable for Structs {}
604
605#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
606pub struct ThisIsAStruct {
607    pub s: String,
608}
609
610impl fidl::Persistable for ThisIsAStruct {}
611
612#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
613pub struct ThisIsAnEmptyStruct;
614
615impl fidl::Persistable for ThisIsAnEmptyStruct {}
616
617#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
618pub struct Unions {
619    pub u: ThisIsAUnion,
620    pub nullable_u: Option<Box<ThisIsAUnion>>,
621}
622
623impl fidl::Persistable for Unions {}
624
625#[derive(Clone, Debug, Default, PartialEq)]
626pub struct EchoEchoTablePayloadWithErrorRequest {
627    pub value: Option<u64>,
628    pub forward_to_server: Option<String>,
629    pub result_err: Option<DefaultEnum>,
630    pub result_variant: Option<RespondWith>,
631    #[doc(hidden)]
632    pub __source_breaking: fidl::marker::SourceBreaking,
633}
634
635impl fidl::Persistable for EchoEchoTablePayloadWithErrorRequest {}
636
637#[derive(Clone, Debug, Default, PartialEq)]
638pub struct RequestTable {
639    pub value: Option<u64>,
640    pub forward_to_server: Option<String>,
641    #[doc(hidden)]
642    pub __source_breaking: fidl::marker::SourceBreaking,
643}
644
645impl fidl::Persistable for RequestTable {}
646
647#[derive(Clone, Debug, Default, PartialEq)]
648pub struct ResponseTable {
649    pub value: Option<u64>,
650    #[doc(hidden)]
651    pub __source_breaking: fidl::marker::SourceBreaking,
652}
653
654impl fidl::Persistable for ResponseTable {}
655
656#[derive(Clone, Debug, Default, PartialEq)]
657pub struct ThisIsATable {
658    pub s: Option<String>,
659    #[doc(hidden)]
660    pub __source_breaking: fidl::marker::SourceBreaking,
661}
662
663impl fidl::Persistable for ThisIsATable {}
664
665#[derive(Clone, Debug)]
666pub enum EchoEchoUnionPayloadWithErrorRequest {
667    Unsigned(UnsignedErrorable),
668    Signed(SignedErrorable),
669    #[doc(hidden)]
670    __SourceBreaking {
671        unknown_ordinal: u64,
672    },
673}
674
675/// Pattern that matches an unknown `EchoEchoUnionPayloadWithErrorRequest` member.
676#[macro_export]
677macro_rules! EchoEchoUnionPayloadWithErrorRequestUnknown {
678    () => {
679        _
680    };
681}
682
683// Custom PartialEq so that unknown variants are not equal to themselves.
684impl PartialEq for EchoEchoUnionPayloadWithErrorRequest {
685    fn eq(&self, other: &Self) -> bool {
686        match (self, other) {
687            (Self::Unsigned(x), Self::Unsigned(y)) => *x == *y,
688            (Self::Signed(x), Self::Signed(y)) => *x == *y,
689            _ => false,
690        }
691    }
692}
693
694impl EchoEchoUnionPayloadWithErrorRequest {
695    #[inline]
696    pub fn ordinal(&self) -> u64 {
697        match *self {
698            Self::Unsigned(_) => 1,
699            Self::Signed(_) => 2,
700            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
701        }
702    }
703
704    #[inline]
705    pub fn unknown_variant_for_testing() -> Self {
706        Self::__SourceBreaking { unknown_ordinal: 0 }
707    }
708
709    #[inline]
710    pub fn is_unknown(&self) -> bool {
711        match self {
712            Self::__SourceBreaking { .. } => true,
713            _ => false,
714        }
715    }
716}
717
718impl fidl::Persistable for EchoEchoUnionPayloadWithErrorRequest {}
719
720#[derive(Clone, Debug)]
721pub enum RequestUnion {
722    Unsigned(Unsigned),
723    Signed(Signed),
724    #[doc(hidden)]
725    __SourceBreaking {
726        unknown_ordinal: u64,
727    },
728}
729
730/// Pattern that matches an unknown `RequestUnion` member.
731#[macro_export]
732macro_rules! RequestUnionUnknown {
733    () => {
734        _
735    };
736}
737
738// Custom PartialEq so that unknown variants are not equal to themselves.
739impl PartialEq for RequestUnion {
740    fn eq(&self, other: &Self) -> bool {
741        match (self, other) {
742            (Self::Unsigned(x), Self::Unsigned(y)) => *x == *y,
743            (Self::Signed(x), Self::Signed(y)) => *x == *y,
744            _ => false,
745        }
746    }
747}
748
749impl RequestUnion {
750    #[inline]
751    pub fn ordinal(&self) -> u64 {
752        match *self {
753            Self::Unsigned(_) => 1,
754            Self::Signed(_) => 2,
755            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
756        }
757    }
758
759    #[inline]
760    pub fn unknown_variant_for_testing() -> Self {
761        Self::__SourceBreaking { unknown_ordinal: 0 }
762    }
763
764    #[inline]
765    pub fn is_unknown(&self) -> bool {
766        match self {
767            Self::__SourceBreaking { .. } => true,
768            _ => false,
769        }
770    }
771}
772
773impl fidl::Persistable for RequestUnion {}
774
775#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
776pub enum ResponseUnion {
777    Unsigned(u64),
778    Signed(i64),
779}
780
781impl ResponseUnion {
782    #[inline]
783    pub fn ordinal(&self) -> u64 {
784        match *self {
785            Self::Unsigned(_) => 1,
786            Self::Signed(_) => 2,
787        }
788    }
789
790    #[deprecated = "Strict unions should not use `is_unknown`"]
791    #[inline]
792    pub fn is_unknown(&self) -> bool {
793        false
794    }
795}
796
797impl fidl::Persistable for ResponseUnion {}
798
799#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
800pub enum ThisIsAUnion {
801    S(String),
802    B(bool),
803}
804
805impl ThisIsAUnion {
806    #[inline]
807    pub fn ordinal(&self) -> u64 {
808        match *self {
809            Self::S(_) => 1,
810            Self::B(_) => 2,
811        }
812    }
813
814    #[deprecated = "Strict unions should not use `is_unknown`"]
815    #[inline]
816    pub fn is_unknown(&self) -> bool {
817        false
818    }
819}
820
821impl fidl::Persistable for ThisIsAUnion {}
822
823#[derive(Clone, Debug)]
824pub enum ThisIsAXunion {
825    S(String),
826    B(bool),
827    #[doc(hidden)]
828    __SourceBreaking {
829        unknown_ordinal: u64,
830    },
831}
832
833/// Pattern that matches an unknown `ThisIsAXunion` member.
834#[macro_export]
835macro_rules! ThisIsAXunionUnknown {
836    () => {
837        _
838    };
839}
840
841// Custom PartialEq so that unknown variants are not equal to themselves.
842impl PartialEq for ThisIsAXunion {
843    fn eq(&self, other: &Self) -> bool {
844        match (self, other) {
845            (Self::S(x), Self::S(y)) => *x == *y,
846            (Self::B(x), Self::B(y)) => *x == *y,
847            _ => false,
848        }
849    }
850}
851
852impl ThisIsAXunion {
853    #[inline]
854    pub fn ordinal(&self) -> u64 {
855        match *self {
856            Self::S(_) => 1,
857            Self::B(_) => 2,
858            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
859        }
860    }
861
862    #[inline]
863    pub fn unknown_variant_for_testing() -> Self {
864        Self::__SourceBreaking { unknown_ordinal: 0 }
865    }
866
867    #[inline]
868    pub fn is_unknown(&self) -> bool {
869        match self {
870            Self::__SourceBreaking { .. } => true,
871            _ => false,
872        }
873    }
874}
875
876impl fidl::Persistable for ThisIsAXunion {}
877
878mod internal {
879    use super::*;
880    unsafe impl fidl::encoding::TypeMarker for DefaultBits {
881        type Owned = Self;
882
883        #[inline(always)]
884        fn inline_align(_context: fidl::encoding::Context) -> usize {
885            4
886        }
887
888        #[inline(always)]
889        fn inline_size(_context: fidl::encoding::Context) -> usize {
890            4
891        }
892    }
893
894    impl fidl::encoding::ValueTypeMarker for DefaultBits {
895        type Borrowed<'a> = Self;
896        #[inline(always)]
897        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
898            *value
899        }
900    }
901
902    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DefaultBits {
903        #[inline]
904        unsafe fn encode(
905            self,
906            encoder: &mut fidl::encoding::Encoder<'_, D>,
907            offset: usize,
908            _depth: fidl::encoding::Depth,
909        ) -> fidl::Result<()> {
910            encoder.debug_check_bounds::<Self>(offset);
911            if self.bits() & Self::all().bits() != self.bits() {
912                return Err(fidl::Error::InvalidBitsValue);
913            }
914            encoder.write_num(self.bits(), offset);
915            Ok(())
916        }
917    }
918
919    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DefaultBits {
920        #[inline(always)]
921        fn new_empty() -> Self {
922            Self::empty()
923        }
924
925        #[inline]
926        unsafe fn decode(
927            &mut self,
928            decoder: &mut fidl::encoding::Decoder<'_, D>,
929            offset: usize,
930            _depth: fidl::encoding::Depth,
931        ) -> fidl::Result<()> {
932            decoder.debug_check_bounds::<Self>(offset);
933            let prim = decoder.read_num::<u32>(offset);
934            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
935            Ok(())
936        }
937    }
938    unsafe impl fidl::encoding::TypeMarker for U16Bits {
939        type Owned = Self;
940
941        #[inline(always)]
942        fn inline_align(_context: fidl::encoding::Context) -> usize {
943            2
944        }
945
946        #[inline(always)]
947        fn inline_size(_context: fidl::encoding::Context) -> usize {
948            2
949        }
950    }
951
952    impl fidl::encoding::ValueTypeMarker for U16Bits {
953        type Borrowed<'a> = Self;
954        #[inline(always)]
955        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
956            *value
957        }
958    }
959
960    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U16Bits {
961        #[inline]
962        unsafe fn encode(
963            self,
964            encoder: &mut fidl::encoding::Encoder<'_, D>,
965            offset: usize,
966            _depth: fidl::encoding::Depth,
967        ) -> fidl::Result<()> {
968            encoder.debug_check_bounds::<Self>(offset);
969            if self.bits() & Self::all().bits() != self.bits() {
970                return Err(fidl::Error::InvalidBitsValue);
971            }
972            encoder.write_num(self.bits(), offset);
973            Ok(())
974        }
975    }
976
977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U16Bits {
978        #[inline(always)]
979        fn new_empty() -> Self {
980            Self::empty()
981        }
982
983        #[inline]
984        unsafe fn decode(
985            &mut self,
986            decoder: &mut fidl::encoding::Decoder<'_, D>,
987            offset: usize,
988            _depth: fidl::encoding::Depth,
989        ) -> fidl::Result<()> {
990            decoder.debug_check_bounds::<Self>(offset);
991            let prim = decoder.read_num::<u16>(offset);
992            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
993            Ok(())
994        }
995    }
996    unsafe impl fidl::encoding::TypeMarker for U32Bits {
997        type Owned = Self;
998
999        #[inline(always)]
1000        fn inline_align(_context: fidl::encoding::Context) -> usize {
1001            4
1002        }
1003
1004        #[inline(always)]
1005        fn inline_size(_context: fidl::encoding::Context) -> usize {
1006            4
1007        }
1008    }
1009
1010    impl fidl::encoding::ValueTypeMarker for U32Bits {
1011        type Borrowed<'a> = Self;
1012        #[inline(always)]
1013        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1014            *value
1015        }
1016    }
1017
1018    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U32Bits {
1019        #[inline]
1020        unsafe fn encode(
1021            self,
1022            encoder: &mut fidl::encoding::Encoder<'_, D>,
1023            offset: usize,
1024            _depth: fidl::encoding::Depth,
1025        ) -> fidl::Result<()> {
1026            encoder.debug_check_bounds::<Self>(offset);
1027            if self.bits() & Self::all().bits() != self.bits() {
1028                return Err(fidl::Error::InvalidBitsValue);
1029            }
1030            encoder.write_num(self.bits(), offset);
1031            Ok(())
1032        }
1033    }
1034
1035    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U32Bits {
1036        #[inline(always)]
1037        fn new_empty() -> Self {
1038            Self::empty()
1039        }
1040
1041        #[inline]
1042        unsafe fn decode(
1043            &mut self,
1044            decoder: &mut fidl::encoding::Decoder<'_, D>,
1045            offset: usize,
1046            _depth: fidl::encoding::Depth,
1047        ) -> fidl::Result<()> {
1048            decoder.debug_check_bounds::<Self>(offset);
1049            let prim = decoder.read_num::<u32>(offset);
1050            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1051            Ok(())
1052        }
1053    }
1054    unsafe impl fidl::encoding::TypeMarker for U64Bits {
1055        type Owned = Self;
1056
1057        #[inline(always)]
1058        fn inline_align(_context: fidl::encoding::Context) -> usize {
1059            8
1060        }
1061
1062        #[inline(always)]
1063        fn inline_size(_context: fidl::encoding::Context) -> usize {
1064            8
1065        }
1066    }
1067
1068    impl fidl::encoding::ValueTypeMarker for U64Bits {
1069        type Borrowed<'a> = Self;
1070        #[inline(always)]
1071        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1072            *value
1073        }
1074    }
1075
1076    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U64Bits {
1077        #[inline]
1078        unsafe fn encode(
1079            self,
1080            encoder: &mut fidl::encoding::Encoder<'_, D>,
1081            offset: usize,
1082            _depth: fidl::encoding::Depth,
1083        ) -> fidl::Result<()> {
1084            encoder.debug_check_bounds::<Self>(offset);
1085            if self.bits() & Self::all().bits() != self.bits() {
1086                return Err(fidl::Error::InvalidBitsValue);
1087            }
1088            encoder.write_num(self.bits(), offset);
1089            Ok(())
1090        }
1091    }
1092
1093    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U64Bits {
1094        #[inline(always)]
1095        fn new_empty() -> Self {
1096            Self::empty()
1097        }
1098
1099        #[inline]
1100        unsafe fn decode(
1101            &mut self,
1102            decoder: &mut fidl::encoding::Decoder<'_, D>,
1103            offset: usize,
1104            _depth: fidl::encoding::Depth,
1105        ) -> fidl::Result<()> {
1106            decoder.debug_check_bounds::<Self>(offset);
1107            let prim = decoder.read_num::<u64>(offset);
1108            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1109            Ok(())
1110        }
1111    }
1112    unsafe impl fidl::encoding::TypeMarker for U8Bits {
1113        type Owned = Self;
1114
1115        #[inline(always)]
1116        fn inline_align(_context: fidl::encoding::Context) -> usize {
1117            1
1118        }
1119
1120        #[inline(always)]
1121        fn inline_size(_context: fidl::encoding::Context) -> usize {
1122            1
1123        }
1124    }
1125
1126    impl fidl::encoding::ValueTypeMarker for U8Bits {
1127        type Borrowed<'a> = Self;
1128        #[inline(always)]
1129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1130            *value
1131        }
1132    }
1133
1134    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U8Bits {
1135        #[inline]
1136        unsafe fn encode(
1137            self,
1138            encoder: &mut fidl::encoding::Encoder<'_, D>,
1139            offset: usize,
1140            _depth: fidl::encoding::Depth,
1141        ) -> fidl::Result<()> {
1142            encoder.debug_check_bounds::<Self>(offset);
1143            if self.bits() & Self::all().bits() != self.bits() {
1144                return Err(fidl::Error::InvalidBitsValue);
1145            }
1146            encoder.write_num(self.bits(), offset);
1147            Ok(())
1148        }
1149    }
1150
1151    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U8Bits {
1152        #[inline(always)]
1153        fn new_empty() -> Self {
1154            Self::empty()
1155        }
1156
1157        #[inline]
1158        unsafe fn decode(
1159            &mut self,
1160            decoder: &mut fidl::encoding::Decoder<'_, D>,
1161            offset: usize,
1162            _depth: fidl::encoding::Depth,
1163        ) -> fidl::Result<()> {
1164            decoder.debug_check_bounds::<Self>(offset);
1165            let prim = decoder.read_num::<u8>(offset);
1166            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1167            Ok(())
1168        }
1169    }
1170    unsafe impl fidl::encoding::TypeMarker for RespondWith {
1171        type Owned = Self;
1172
1173        #[inline(always)]
1174        fn inline_align(_context: fidl::encoding::Context) -> usize {
1175            std::mem::align_of::<u32>()
1176        }
1177
1178        #[inline(always)]
1179        fn inline_size(_context: fidl::encoding::Context) -> usize {
1180            std::mem::size_of::<u32>()
1181        }
1182
1183        #[inline(always)]
1184        fn encode_is_copy() -> bool {
1185            true
1186        }
1187
1188        #[inline(always)]
1189        fn decode_is_copy() -> bool {
1190            false
1191        }
1192    }
1193
1194    impl fidl::encoding::ValueTypeMarker for RespondWith {
1195        type Borrowed<'a> = Self;
1196        #[inline(always)]
1197        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1198            *value
1199        }
1200    }
1201
1202    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RespondWith {
1203        #[inline]
1204        unsafe fn encode(
1205            self,
1206            encoder: &mut fidl::encoding::Encoder<'_, D>,
1207            offset: usize,
1208            _depth: fidl::encoding::Depth,
1209        ) -> fidl::Result<()> {
1210            encoder.debug_check_bounds::<Self>(offset);
1211            encoder.write_num(self.into_primitive(), offset);
1212            Ok(())
1213        }
1214    }
1215
1216    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RespondWith {
1217        #[inline(always)]
1218        fn new_empty() -> Self {
1219            Self::Success
1220        }
1221
1222        #[inline]
1223        unsafe fn decode(
1224            &mut self,
1225            decoder: &mut fidl::encoding::Decoder<'_, D>,
1226            offset: usize,
1227            _depth: fidl::encoding::Depth,
1228        ) -> fidl::Result<()> {
1229            decoder.debug_check_bounds::<Self>(offset);
1230            let prim = decoder.read_num::<u32>(offset);
1231
1232            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1233            Ok(())
1234        }
1235    }
1236    unsafe impl fidl::encoding::TypeMarker for DefaultEnum {
1237        type Owned = Self;
1238
1239        #[inline(always)]
1240        fn inline_align(_context: fidl::encoding::Context) -> usize {
1241            std::mem::align_of::<u32>()
1242        }
1243
1244        #[inline(always)]
1245        fn inline_size(_context: fidl::encoding::Context) -> usize {
1246            std::mem::size_of::<u32>()
1247        }
1248
1249        #[inline(always)]
1250        fn encode_is_copy() -> bool {
1251            true
1252        }
1253
1254        #[inline(always)]
1255        fn decode_is_copy() -> bool {
1256            false
1257        }
1258    }
1259
1260    impl fidl::encoding::ValueTypeMarker for DefaultEnum {
1261        type Borrowed<'a> = Self;
1262        #[inline(always)]
1263        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1264            *value
1265        }
1266    }
1267
1268    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DefaultEnum {
1269        #[inline]
1270        unsafe fn encode(
1271            self,
1272            encoder: &mut fidl::encoding::Encoder<'_, D>,
1273            offset: usize,
1274            _depth: fidl::encoding::Depth,
1275        ) -> fidl::Result<()> {
1276            encoder.debug_check_bounds::<Self>(offset);
1277            encoder.write_num(self.into_primitive(), offset);
1278            Ok(())
1279        }
1280    }
1281
1282    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DefaultEnum {
1283        #[inline(always)]
1284        fn new_empty() -> Self {
1285            Self::KZero
1286        }
1287
1288        #[inline]
1289        unsafe fn decode(
1290            &mut self,
1291            decoder: &mut fidl::encoding::Decoder<'_, D>,
1292            offset: usize,
1293            _depth: fidl::encoding::Depth,
1294        ) -> fidl::Result<()> {
1295            decoder.debug_check_bounds::<Self>(offset);
1296            let prim = decoder.read_num::<u32>(offset);
1297
1298            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1299            Ok(())
1300        }
1301    }
1302    unsafe impl fidl::encoding::TypeMarker for I16Enum {
1303        type Owned = Self;
1304
1305        #[inline(always)]
1306        fn inline_align(_context: fidl::encoding::Context) -> usize {
1307            std::mem::align_of::<i16>()
1308        }
1309
1310        #[inline(always)]
1311        fn inline_size(_context: fidl::encoding::Context) -> usize {
1312            std::mem::size_of::<i16>()
1313        }
1314
1315        #[inline(always)]
1316        fn encode_is_copy() -> bool {
1317            true
1318        }
1319
1320        #[inline(always)]
1321        fn decode_is_copy() -> bool {
1322            false
1323        }
1324    }
1325
1326    impl fidl::encoding::ValueTypeMarker for I16Enum {
1327        type Borrowed<'a> = Self;
1328        #[inline(always)]
1329        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1330            *value
1331        }
1332    }
1333
1334    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for I16Enum {
1335        #[inline]
1336        unsafe fn encode(
1337            self,
1338            encoder: &mut fidl::encoding::Encoder<'_, D>,
1339            offset: usize,
1340            _depth: fidl::encoding::Depth,
1341        ) -> fidl::Result<()> {
1342            encoder.debug_check_bounds::<Self>(offset);
1343            encoder.write_num(self.into_primitive(), offset);
1344            Ok(())
1345        }
1346    }
1347
1348    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for I16Enum {
1349        #[inline(always)]
1350        fn new_empty() -> Self {
1351            Self::KNegativeOne
1352        }
1353
1354        #[inline]
1355        unsafe fn decode(
1356            &mut self,
1357            decoder: &mut fidl::encoding::Decoder<'_, D>,
1358            offset: usize,
1359            _depth: fidl::encoding::Depth,
1360        ) -> fidl::Result<()> {
1361            decoder.debug_check_bounds::<Self>(offset);
1362            let prim = decoder.read_num::<i16>(offset);
1363
1364            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1365            Ok(())
1366        }
1367    }
1368    unsafe impl fidl::encoding::TypeMarker for I32Enum {
1369        type Owned = Self;
1370
1371        #[inline(always)]
1372        fn inline_align(_context: fidl::encoding::Context) -> usize {
1373            std::mem::align_of::<i32>()
1374        }
1375
1376        #[inline(always)]
1377        fn inline_size(_context: fidl::encoding::Context) -> usize {
1378            std::mem::size_of::<i32>()
1379        }
1380
1381        #[inline(always)]
1382        fn encode_is_copy() -> bool {
1383            true
1384        }
1385
1386        #[inline(always)]
1387        fn decode_is_copy() -> bool {
1388            false
1389        }
1390    }
1391
1392    impl fidl::encoding::ValueTypeMarker for I32Enum {
1393        type Borrowed<'a> = Self;
1394        #[inline(always)]
1395        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1396            *value
1397        }
1398    }
1399
1400    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for I32Enum {
1401        #[inline]
1402        unsafe fn encode(
1403            self,
1404            encoder: &mut fidl::encoding::Encoder<'_, D>,
1405            offset: usize,
1406            _depth: fidl::encoding::Depth,
1407        ) -> fidl::Result<()> {
1408            encoder.debug_check_bounds::<Self>(offset);
1409            encoder.write_num(self.into_primitive(), offset);
1410            Ok(())
1411        }
1412    }
1413
1414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for I32Enum {
1415        #[inline(always)]
1416        fn new_empty() -> Self {
1417            Self::KNegativeOne
1418        }
1419
1420        #[inline]
1421        unsafe fn decode(
1422            &mut self,
1423            decoder: &mut fidl::encoding::Decoder<'_, D>,
1424            offset: usize,
1425            _depth: fidl::encoding::Depth,
1426        ) -> fidl::Result<()> {
1427            decoder.debug_check_bounds::<Self>(offset);
1428            let prim = decoder.read_num::<i32>(offset);
1429
1430            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1431            Ok(())
1432        }
1433    }
1434    unsafe impl fidl::encoding::TypeMarker for I64Enum {
1435        type Owned = Self;
1436
1437        #[inline(always)]
1438        fn inline_align(_context: fidl::encoding::Context) -> usize {
1439            std::mem::align_of::<i64>()
1440        }
1441
1442        #[inline(always)]
1443        fn inline_size(_context: fidl::encoding::Context) -> usize {
1444            std::mem::size_of::<i64>()
1445        }
1446
1447        #[inline(always)]
1448        fn encode_is_copy() -> bool {
1449            true
1450        }
1451
1452        #[inline(always)]
1453        fn decode_is_copy() -> bool {
1454            false
1455        }
1456    }
1457
1458    impl fidl::encoding::ValueTypeMarker for I64Enum {
1459        type Borrowed<'a> = Self;
1460        #[inline(always)]
1461        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1462            *value
1463        }
1464    }
1465
1466    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for I64Enum {
1467        #[inline]
1468        unsafe fn encode(
1469            self,
1470            encoder: &mut fidl::encoding::Encoder<'_, D>,
1471            offset: usize,
1472            _depth: fidl::encoding::Depth,
1473        ) -> fidl::Result<()> {
1474            encoder.debug_check_bounds::<Self>(offset);
1475            encoder.write_num(self.into_primitive(), offset);
1476            Ok(())
1477        }
1478    }
1479
1480    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for I64Enum {
1481        #[inline(always)]
1482        fn new_empty() -> Self {
1483            Self::KNegativeOne
1484        }
1485
1486        #[inline]
1487        unsafe fn decode(
1488            &mut self,
1489            decoder: &mut fidl::encoding::Decoder<'_, D>,
1490            offset: usize,
1491            _depth: fidl::encoding::Depth,
1492        ) -> fidl::Result<()> {
1493            decoder.debug_check_bounds::<Self>(offset);
1494            let prim = decoder.read_num::<i64>(offset);
1495
1496            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1497            Ok(())
1498        }
1499    }
1500    unsafe impl fidl::encoding::TypeMarker for I8Enum {
1501        type Owned = Self;
1502
1503        #[inline(always)]
1504        fn inline_align(_context: fidl::encoding::Context) -> usize {
1505            std::mem::align_of::<i8>()
1506        }
1507
1508        #[inline(always)]
1509        fn inline_size(_context: fidl::encoding::Context) -> usize {
1510            std::mem::size_of::<i8>()
1511        }
1512
1513        #[inline(always)]
1514        fn encode_is_copy() -> bool {
1515            true
1516        }
1517
1518        #[inline(always)]
1519        fn decode_is_copy() -> bool {
1520            false
1521        }
1522    }
1523
1524    impl fidl::encoding::ValueTypeMarker for I8Enum {
1525        type Borrowed<'a> = Self;
1526        #[inline(always)]
1527        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1528            *value
1529        }
1530    }
1531
1532    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for I8Enum {
1533        #[inline]
1534        unsafe fn encode(
1535            self,
1536            encoder: &mut fidl::encoding::Encoder<'_, D>,
1537            offset: usize,
1538            _depth: fidl::encoding::Depth,
1539        ) -> fidl::Result<()> {
1540            encoder.debug_check_bounds::<Self>(offset);
1541            encoder.write_num(self.into_primitive(), offset);
1542            Ok(())
1543        }
1544    }
1545
1546    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for I8Enum {
1547        #[inline(always)]
1548        fn new_empty() -> Self {
1549            Self::KNegativeOne
1550        }
1551
1552        #[inline]
1553        unsafe fn decode(
1554            &mut self,
1555            decoder: &mut fidl::encoding::Decoder<'_, D>,
1556            offset: usize,
1557            _depth: fidl::encoding::Depth,
1558        ) -> fidl::Result<()> {
1559            decoder.debug_check_bounds::<Self>(offset);
1560            let prim = decoder.read_num::<i8>(offset);
1561
1562            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1563            Ok(())
1564        }
1565    }
1566    unsafe impl fidl::encoding::TypeMarker for U16Enum {
1567        type Owned = Self;
1568
1569        #[inline(always)]
1570        fn inline_align(_context: fidl::encoding::Context) -> usize {
1571            std::mem::align_of::<u16>()
1572        }
1573
1574        #[inline(always)]
1575        fn inline_size(_context: fidl::encoding::Context) -> usize {
1576            std::mem::size_of::<u16>()
1577        }
1578
1579        #[inline(always)]
1580        fn encode_is_copy() -> bool {
1581            true
1582        }
1583
1584        #[inline(always)]
1585        fn decode_is_copy() -> bool {
1586            false
1587        }
1588    }
1589
1590    impl fidl::encoding::ValueTypeMarker for U16Enum {
1591        type Borrowed<'a> = Self;
1592        #[inline(always)]
1593        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1594            *value
1595        }
1596    }
1597
1598    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U16Enum {
1599        #[inline]
1600        unsafe fn encode(
1601            self,
1602            encoder: &mut fidl::encoding::Encoder<'_, D>,
1603            offset: usize,
1604            _depth: fidl::encoding::Depth,
1605        ) -> fidl::Result<()> {
1606            encoder.debug_check_bounds::<Self>(offset);
1607            encoder.write_num(self.into_primitive(), offset);
1608            Ok(())
1609        }
1610    }
1611
1612    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U16Enum {
1613        #[inline(always)]
1614        fn new_empty() -> Self {
1615            Self::KOne
1616        }
1617
1618        #[inline]
1619        unsafe fn decode(
1620            &mut self,
1621            decoder: &mut fidl::encoding::Decoder<'_, D>,
1622            offset: usize,
1623            _depth: fidl::encoding::Depth,
1624        ) -> fidl::Result<()> {
1625            decoder.debug_check_bounds::<Self>(offset);
1626            let prim = decoder.read_num::<u16>(offset);
1627
1628            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1629            Ok(())
1630        }
1631    }
1632    unsafe impl fidl::encoding::TypeMarker for U32Enum {
1633        type Owned = Self;
1634
1635        #[inline(always)]
1636        fn inline_align(_context: fidl::encoding::Context) -> usize {
1637            std::mem::align_of::<u32>()
1638        }
1639
1640        #[inline(always)]
1641        fn inline_size(_context: fidl::encoding::Context) -> usize {
1642            std::mem::size_of::<u32>()
1643        }
1644
1645        #[inline(always)]
1646        fn encode_is_copy() -> bool {
1647            true
1648        }
1649
1650        #[inline(always)]
1651        fn decode_is_copy() -> bool {
1652            false
1653        }
1654    }
1655
1656    impl fidl::encoding::ValueTypeMarker for U32Enum {
1657        type Borrowed<'a> = Self;
1658        #[inline(always)]
1659        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1660            *value
1661        }
1662    }
1663
1664    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U32Enum {
1665        #[inline]
1666        unsafe fn encode(
1667            self,
1668            encoder: &mut fidl::encoding::Encoder<'_, D>,
1669            offset: usize,
1670            _depth: fidl::encoding::Depth,
1671        ) -> fidl::Result<()> {
1672            encoder.debug_check_bounds::<Self>(offset);
1673            encoder.write_num(self.into_primitive(), offset);
1674            Ok(())
1675        }
1676    }
1677
1678    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U32Enum {
1679        #[inline(always)]
1680        fn new_empty() -> Self {
1681            Self::KOne
1682        }
1683
1684        #[inline]
1685        unsafe fn decode(
1686            &mut self,
1687            decoder: &mut fidl::encoding::Decoder<'_, D>,
1688            offset: usize,
1689            _depth: fidl::encoding::Depth,
1690        ) -> fidl::Result<()> {
1691            decoder.debug_check_bounds::<Self>(offset);
1692            let prim = decoder.read_num::<u32>(offset);
1693
1694            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1695            Ok(())
1696        }
1697    }
1698    unsafe impl fidl::encoding::TypeMarker for U64Enum {
1699        type Owned = Self;
1700
1701        #[inline(always)]
1702        fn inline_align(_context: fidl::encoding::Context) -> usize {
1703            std::mem::align_of::<u64>()
1704        }
1705
1706        #[inline(always)]
1707        fn inline_size(_context: fidl::encoding::Context) -> usize {
1708            std::mem::size_of::<u64>()
1709        }
1710
1711        #[inline(always)]
1712        fn encode_is_copy() -> bool {
1713            true
1714        }
1715
1716        #[inline(always)]
1717        fn decode_is_copy() -> bool {
1718            false
1719        }
1720    }
1721
1722    impl fidl::encoding::ValueTypeMarker for U64Enum {
1723        type Borrowed<'a> = Self;
1724        #[inline(always)]
1725        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1726            *value
1727        }
1728    }
1729
1730    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U64Enum {
1731        #[inline]
1732        unsafe fn encode(
1733            self,
1734            encoder: &mut fidl::encoding::Encoder<'_, D>,
1735            offset: usize,
1736            _depth: fidl::encoding::Depth,
1737        ) -> fidl::Result<()> {
1738            encoder.debug_check_bounds::<Self>(offset);
1739            encoder.write_num(self.into_primitive(), offset);
1740            Ok(())
1741        }
1742    }
1743
1744    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U64Enum {
1745        #[inline(always)]
1746        fn new_empty() -> Self {
1747            Self::KOne
1748        }
1749
1750        #[inline]
1751        unsafe fn decode(
1752            &mut self,
1753            decoder: &mut fidl::encoding::Decoder<'_, D>,
1754            offset: usize,
1755            _depth: fidl::encoding::Depth,
1756        ) -> fidl::Result<()> {
1757            decoder.debug_check_bounds::<Self>(offset);
1758            let prim = decoder.read_num::<u64>(offset);
1759
1760            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1761            Ok(())
1762        }
1763    }
1764    unsafe impl fidl::encoding::TypeMarker for U8Enum {
1765        type Owned = Self;
1766
1767        #[inline(always)]
1768        fn inline_align(_context: fidl::encoding::Context) -> usize {
1769            std::mem::align_of::<u8>()
1770        }
1771
1772        #[inline(always)]
1773        fn inline_size(_context: fidl::encoding::Context) -> usize {
1774            std::mem::size_of::<u8>()
1775        }
1776
1777        #[inline(always)]
1778        fn encode_is_copy() -> bool {
1779            true
1780        }
1781
1782        #[inline(always)]
1783        fn decode_is_copy() -> bool {
1784            false
1785        }
1786    }
1787
1788    impl fidl::encoding::ValueTypeMarker for U8Enum {
1789        type Borrowed<'a> = Self;
1790        #[inline(always)]
1791        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1792            *value
1793        }
1794    }
1795
1796    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for U8Enum {
1797        #[inline]
1798        unsafe fn encode(
1799            self,
1800            encoder: &mut fidl::encoding::Encoder<'_, D>,
1801            offset: usize,
1802            _depth: fidl::encoding::Depth,
1803        ) -> fidl::Result<()> {
1804            encoder.debug_check_bounds::<Self>(offset);
1805            encoder.write_num(self.into_primitive(), offset);
1806            Ok(())
1807        }
1808    }
1809
1810    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for U8Enum {
1811        #[inline(always)]
1812        fn new_empty() -> Self {
1813            Self::KOne
1814        }
1815
1816        #[inline]
1817        unsafe fn decode(
1818            &mut self,
1819            decoder: &mut fidl::encoding::Decoder<'_, D>,
1820            offset: usize,
1821            _depth: fidl::encoding::Depth,
1822        ) -> fidl::Result<()> {
1823            decoder.debug_check_bounds::<Self>(offset);
1824            let prim = decoder.read_num::<u8>(offset);
1825
1826            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1827            Ok(())
1828        }
1829    }
1830
1831    impl fidl::encoding::ValueTypeMarker for ConfigGetImplsResponse {
1832        type Borrowed<'a> = &'a Self;
1833        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1834            value
1835        }
1836    }
1837
1838    unsafe impl fidl::encoding::TypeMarker for ConfigGetImplsResponse {
1839        type Owned = Self;
1840
1841        #[inline(always)]
1842        fn inline_align(_context: fidl::encoding::Context) -> usize {
1843            8
1844        }
1845
1846        #[inline(always)]
1847        fn inline_size(_context: fidl::encoding::Context) -> usize {
1848            16
1849        }
1850    }
1851
1852    unsafe impl<D: fidl::encoding::ResourceDialect>
1853        fidl::encoding::Encode<ConfigGetImplsResponse, D> for &ConfigGetImplsResponse
1854    {
1855        #[inline]
1856        unsafe fn encode(
1857            self,
1858            encoder: &mut fidl::encoding::Encoder<'_, D>,
1859            offset: usize,
1860            _depth: fidl::encoding::Depth,
1861        ) -> fidl::Result<()> {
1862            encoder.debug_check_bounds::<ConfigGetImplsResponse>(offset);
1863            // Delegate to tuple encoding.
1864            fidl::encoding::Encode::<ConfigGetImplsResponse, D>::encode(
1865                (
1866                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>> as fidl::encoding::ValueTypeMarker>::borrow(&self.impls),
1867                ),
1868                encoder, offset, _depth
1869            )
1870        }
1871    }
1872    unsafe impl<
1873            D: fidl::encoding::ResourceDialect,
1874            T0: fidl::encoding::Encode<
1875                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1876                D,
1877            >,
1878        > fidl::encoding::Encode<ConfigGetImplsResponse, D> for (T0,)
1879    {
1880        #[inline]
1881        unsafe fn encode(
1882            self,
1883            encoder: &mut fidl::encoding::Encoder<'_, D>,
1884            offset: usize,
1885            depth: fidl::encoding::Depth,
1886        ) -> fidl::Result<()> {
1887            encoder.debug_check_bounds::<ConfigGetImplsResponse>(offset);
1888            // Zero out padding regions. There's no need to apply masks
1889            // because the unmasked parts will be overwritten by fields.
1890            // Write the fields.
1891            self.0.encode(encoder, offset + 0, depth)?;
1892            Ok(())
1893        }
1894    }
1895
1896    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1897        for ConfigGetImplsResponse
1898    {
1899        #[inline(always)]
1900        fn new_empty() -> Self {
1901            Self {
1902                impls: fidl::new_empty!(
1903                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1904                    D
1905                ),
1906            }
1907        }
1908
1909        #[inline]
1910        unsafe fn decode(
1911            &mut self,
1912            decoder: &mut fidl::encoding::Decoder<'_, D>,
1913            offset: usize,
1914            _depth: fidl::encoding::Depth,
1915        ) -> fidl::Result<()> {
1916            decoder.debug_check_bounds::<Self>(offset);
1917            // Verify that padding bytes are zero.
1918            fidl::decode!(
1919                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
1920                D,
1921                &mut self.impls,
1922                decoder,
1923                offset + 0,
1924                _depth
1925            )?;
1926            Ok(())
1927        }
1928    }
1929
1930    impl fidl::encoding::ValueTypeMarker for EchoEchoMinimalNoRetValRequest {
1931        type Borrowed<'a> = &'a Self;
1932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1933            value
1934        }
1935    }
1936
1937    unsafe impl fidl::encoding::TypeMarker for EchoEchoMinimalNoRetValRequest {
1938        type Owned = Self;
1939
1940        #[inline(always)]
1941        fn inline_align(_context: fidl::encoding::Context) -> usize {
1942            8
1943        }
1944
1945        #[inline(always)]
1946        fn inline_size(_context: fidl::encoding::Context) -> usize {
1947            16
1948        }
1949    }
1950
1951    unsafe impl<D: fidl::encoding::ResourceDialect>
1952        fidl::encoding::Encode<EchoEchoMinimalNoRetValRequest, D>
1953        for &EchoEchoMinimalNoRetValRequest
1954    {
1955        #[inline]
1956        unsafe fn encode(
1957            self,
1958            encoder: &mut fidl::encoding::Encoder<'_, D>,
1959            offset: usize,
1960            _depth: fidl::encoding::Depth,
1961        ) -> fidl::Result<()> {
1962            encoder.debug_check_bounds::<EchoEchoMinimalNoRetValRequest>(offset);
1963            // Delegate to tuple encoding.
1964            fidl::encoding::Encode::<EchoEchoMinimalNoRetValRequest, D>::encode(
1965                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1966                    &self.forward_to_server,
1967                ),),
1968                encoder,
1969                offset,
1970                _depth,
1971            )
1972        }
1973    }
1974    unsafe impl<
1975            D: fidl::encoding::ResourceDialect,
1976            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1977        > fidl::encoding::Encode<EchoEchoMinimalNoRetValRequest, D> for (T0,)
1978    {
1979        #[inline]
1980        unsafe fn encode(
1981            self,
1982            encoder: &mut fidl::encoding::Encoder<'_, D>,
1983            offset: usize,
1984            depth: fidl::encoding::Depth,
1985        ) -> fidl::Result<()> {
1986            encoder.debug_check_bounds::<EchoEchoMinimalNoRetValRequest>(offset);
1987            // Zero out padding regions. There's no need to apply masks
1988            // because the unmasked parts will be overwritten by fields.
1989            // Write the fields.
1990            self.0.encode(encoder, offset + 0, depth)?;
1991            Ok(())
1992        }
1993    }
1994
1995    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1996        for EchoEchoMinimalNoRetValRequest
1997    {
1998        #[inline(always)]
1999        fn new_empty() -> Self {
2000            Self { forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
2001        }
2002
2003        #[inline]
2004        unsafe fn decode(
2005            &mut self,
2006            decoder: &mut fidl::encoding::Decoder<'_, D>,
2007            offset: usize,
2008            _depth: fidl::encoding::Depth,
2009        ) -> fidl::Result<()> {
2010            decoder.debug_check_bounds::<Self>(offset);
2011            // Verify that padding bytes are zero.
2012            fidl::decode!(
2013                fidl::encoding::UnboundedString,
2014                D,
2015                &mut self.forward_to_server,
2016                decoder,
2017                offset + 0,
2018                _depth
2019            )?;
2020            Ok(())
2021        }
2022    }
2023
2024    impl fidl::encoding::ValueTypeMarker for EchoEchoMinimalRequest {
2025        type Borrowed<'a> = &'a Self;
2026        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2027            value
2028        }
2029    }
2030
2031    unsafe impl fidl::encoding::TypeMarker for EchoEchoMinimalRequest {
2032        type Owned = Self;
2033
2034        #[inline(always)]
2035        fn inline_align(_context: fidl::encoding::Context) -> usize {
2036            8
2037        }
2038
2039        #[inline(always)]
2040        fn inline_size(_context: fidl::encoding::Context) -> usize {
2041            16
2042        }
2043    }
2044
2045    unsafe impl<D: fidl::encoding::ResourceDialect>
2046        fidl::encoding::Encode<EchoEchoMinimalRequest, D> for &EchoEchoMinimalRequest
2047    {
2048        #[inline]
2049        unsafe fn encode(
2050            self,
2051            encoder: &mut fidl::encoding::Encoder<'_, D>,
2052            offset: usize,
2053            _depth: fidl::encoding::Depth,
2054        ) -> fidl::Result<()> {
2055            encoder.debug_check_bounds::<EchoEchoMinimalRequest>(offset);
2056            // Delegate to tuple encoding.
2057            fidl::encoding::Encode::<EchoEchoMinimalRequest, D>::encode(
2058                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2059                    &self.forward_to_server,
2060                ),),
2061                encoder,
2062                offset,
2063                _depth,
2064            )
2065        }
2066    }
2067    unsafe impl<
2068            D: fidl::encoding::ResourceDialect,
2069            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2070        > fidl::encoding::Encode<EchoEchoMinimalRequest, D> for (T0,)
2071    {
2072        #[inline]
2073        unsafe fn encode(
2074            self,
2075            encoder: &mut fidl::encoding::Encoder<'_, D>,
2076            offset: usize,
2077            depth: fidl::encoding::Depth,
2078        ) -> fidl::Result<()> {
2079            encoder.debug_check_bounds::<EchoEchoMinimalRequest>(offset);
2080            // Zero out padding regions. There's no need to apply masks
2081            // because the unmasked parts will be overwritten by fields.
2082            // Write the fields.
2083            self.0.encode(encoder, offset + 0, depth)?;
2084            Ok(())
2085        }
2086    }
2087
2088    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2089        for EchoEchoMinimalRequest
2090    {
2091        #[inline(always)]
2092        fn new_empty() -> Self {
2093            Self { forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
2094        }
2095
2096        #[inline]
2097        unsafe fn decode(
2098            &mut self,
2099            decoder: &mut fidl::encoding::Decoder<'_, D>,
2100            offset: usize,
2101            _depth: fidl::encoding::Depth,
2102        ) -> fidl::Result<()> {
2103            decoder.debug_check_bounds::<Self>(offset);
2104            // Verify that padding bytes are zero.
2105            fidl::decode!(
2106                fidl::encoding::UnboundedString,
2107                D,
2108                &mut self.forward_to_server,
2109                decoder,
2110                offset + 0,
2111                _depth
2112            )?;
2113            Ok(())
2114        }
2115    }
2116
2117    impl fidl::encoding::ValueTypeMarker for EchoEchoMinimalWithErrorRequest {
2118        type Borrowed<'a> = &'a Self;
2119        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2120            value
2121        }
2122    }
2123
2124    unsafe impl fidl::encoding::TypeMarker for EchoEchoMinimalWithErrorRequest {
2125        type Owned = Self;
2126
2127        #[inline(always)]
2128        fn inline_align(_context: fidl::encoding::Context) -> usize {
2129            8
2130        }
2131
2132        #[inline(always)]
2133        fn inline_size(_context: fidl::encoding::Context) -> usize {
2134            24
2135        }
2136    }
2137
2138    unsafe impl<D: fidl::encoding::ResourceDialect>
2139        fidl::encoding::Encode<EchoEchoMinimalWithErrorRequest, D>
2140        for &EchoEchoMinimalWithErrorRequest
2141    {
2142        #[inline]
2143        unsafe fn encode(
2144            self,
2145            encoder: &mut fidl::encoding::Encoder<'_, D>,
2146            offset: usize,
2147            _depth: fidl::encoding::Depth,
2148        ) -> fidl::Result<()> {
2149            encoder.debug_check_bounds::<EchoEchoMinimalWithErrorRequest>(offset);
2150            // Delegate to tuple encoding.
2151            fidl::encoding::Encode::<EchoEchoMinimalWithErrorRequest, D>::encode(
2152                (
2153                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2154                        &self.forward_to_server,
2155                    ),
2156                    <RespondWith as fidl::encoding::ValueTypeMarker>::borrow(&self.result_variant),
2157                ),
2158                encoder,
2159                offset,
2160                _depth,
2161            )
2162        }
2163    }
2164    unsafe impl<
2165            D: fidl::encoding::ResourceDialect,
2166            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2167            T1: fidl::encoding::Encode<RespondWith, D>,
2168        > fidl::encoding::Encode<EchoEchoMinimalWithErrorRequest, D> for (T0, T1)
2169    {
2170        #[inline]
2171        unsafe fn encode(
2172            self,
2173            encoder: &mut fidl::encoding::Encoder<'_, D>,
2174            offset: usize,
2175            depth: fidl::encoding::Depth,
2176        ) -> fidl::Result<()> {
2177            encoder.debug_check_bounds::<EchoEchoMinimalWithErrorRequest>(offset);
2178            // Zero out padding regions. There's no need to apply masks
2179            // because the unmasked parts will be overwritten by fields.
2180            unsafe {
2181                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2182                (ptr as *mut u64).write_unaligned(0);
2183            }
2184            // Write the fields.
2185            self.0.encode(encoder, offset + 0, depth)?;
2186            self.1.encode(encoder, offset + 16, depth)?;
2187            Ok(())
2188        }
2189    }
2190
2191    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2192        for EchoEchoMinimalWithErrorRequest
2193    {
2194        #[inline(always)]
2195        fn new_empty() -> Self {
2196            Self {
2197                forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D),
2198                result_variant: fidl::new_empty!(RespondWith, D),
2199            }
2200        }
2201
2202        #[inline]
2203        unsafe fn decode(
2204            &mut self,
2205            decoder: &mut fidl::encoding::Decoder<'_, D>,
2206            offset: usize,
2207            _depth: fidl::encoding::Depth,
2208        ) -> fidl::Result<()> {
2209            decoder.debug_check_bounds::<Self>(offset);
2210            // Verify that padding bytes are zero.
2211            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2212            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2213            let mask = 0xffffffff00000000u64;
2214            let maskedval = padval & mask;
2215            if maskedval != 0 {
2216                return Err(fidl::Error::NonZeroPadding {
2217                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2218                });
2219            }
2220            fidl::decode!(
2221                fidl::encoding::UnboundedString,
2222                D,
2223                &mut self.forward_to_server,
2224                decoder,
2225                offset + 0,
2226                _depth
2227            )?;
2228            fidl::decode!(RespondWith, D, &mut self.result_variant, decoder, offset + 16, _depth)?;
2229            Ok(())
2230        }
2231    }
2232
2233    impl fidl::encoding::ValueTypeMarker for Signed {
2234        type Borrowed<'a> = &'a Self;
2235        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2236            value
2237        }
2238    }
2239
2240    unsafe impl fidl::encoding::TypeMarker for Signed {
2241        type Owned = Self;
2242
2243        #[inline(always)]
2244        fn inline_align(_context: fidl::encoding::Context) -> usize {
2245            8
2246        }
2247
2248        #[inline(always)]
2249        fn inline_size(_context: fidl::encoding::Context) -> usize {
2250            24
2251        }
2252    }
2253
2254    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Signed, D> for &Signed {
2255        #[inline]
2256        unsafe fn encode(
2257            self,
2258            encoder: &mut fidl::encoding::Encoder<'_, D>,
2259            offset: usize,
2260            _depth: fidl::encoding::Depth,
2261        ) -> fidl::Result<()> {
2262            encoder.debug_check_bounds::<Signed>(offset);
2263            // Delegate to tuple encoding.
2264            fidl::encoding::Encode::<Signed, D>::encode(
2265                (
2266                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2267                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2268                        &self.forward_to_server,
2269                    ),
2270                ),
2271                encoder,
2272                offset,
2273                _depth,
2274            )
2275        }
2276    }
2277    unsafe impl<
2278            D: fidl::encoding::ResourceDialect,
2279            T0: fidl::encoding::Encode<i64, D>,
2280            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2281        > fidl::encoding::Encode<Signed, D> for (T0, T1)
2282    {
2283        #[inline]
2284        unsafe fn encode(
2285            self,
2286            encoder: &mut fidl::encoding::Encoder<'_, D>,
2287            offset: usize,
2288            depth: fidl::encoding::Depth,
2289        ) -> fidl::Result<()> {
2290            encoder.debug_check_bounds::<Signed>(offset);
2291            // Zero out padding regions. There's no need to apply masks
2292            // because the unmasked parts will be overwritten by fields.
2293            // Write the fields.
2294            self.0.encode(encoder, offset + 0, depth)?;
2295            self.1.encode(encoder, offset + 8, depth)?;
2296            Ok(())
2297        }
2298    }
2299
2300    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Signed {
2301        #[inline(always)]
2302        fn new_empty() -> Self {
2303            Self {
2304                value: fidl::new_empty!(i64, D),
2305                forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D),
2306            }
2307        }
2308
2309        #[inline]
2310        unsafe fn decode(
2311            &mut self,
2312            decoder: &mut fidl::encoding::Decoder<'_, D>,
2313            offset: usize,
2314            _depth: fidl::encoding::Depth,
2315        ) -> fidl::Result<()> {
2316            decoder.debug_check_bounds::<Self>(offset);
2317            // Verify that padding bytes are zero.
2318            fidl::decode!(i64, D, &mut self.value, decoder, offset + 0, _depth)?;
2319            fidl::decode!(
2320                fidl::encoding::UnboundedString,
2321                D,
2322                &mut self.forward_to_server,
2323                decoder,
2324                offset + 8,
2325                _depth
2326            )?;
2327            Ok(())
2328        }
2329    }
2330
2331    impl fidl::encoding::ValueTypeMarker for SignedErrorable {
2332        type Borrowed<'a> = &'a Self;
2333        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2334            value
2335        }
2336    }
2337
2338    unsafe impl fidl::encoding::TypeMarker for SignedErrorable {
2339        type Owned = Self;
2340
2341        #[inline(always)]
2342        fn inline_align(_context: fidl::encoding::Context) -> usize {
2343            8
2344        }
2345
2346        #[inline(always)]
2347        fn inline_size(_context: fidl::encoding::Context) -> usize {
2348            32
2349        }
2350    }
2351
2352    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SignedErrorable, D>
2353        for &SignedErrorable
2354    {
2355        #[inline]
2356        unsafe fn encode(
2357            self,
2358            encoder: &mut fidl::encoding::Encoder<'_, D>,
2359            offset: usize,
2360            _depth: fidl::encoding::Depth,
2361        ) -> fidl::Result<()> {
2362            encoder.debug_check_bounds::<SignedErrorable>(offset);
2363            // Delegate to tuple encoding.
2364            fidl::encoding::Encode::<SignedErrorable, D>::encode(
2365                (
2366                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2367                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2368                        &self.forward_to_server,
2369                    ),
2370                    <DefaultEnum as fidl::encoding::ValueTypeMarker>::borrow(&self.result_err),
2371                    <RespondWith as fidl::encoding::ValueTypeMarker>::borrow(&self.result_variant),
2372                ),
2373                encoder,
2374                offset,
2375                _depth,
2376            )
2377        }
2378    }
2379    unsafe impl<
2380            D: fidl::encoding::ResourceDialect,
2381            T0: fidl::encoding::Encode<i64, D>,
2382            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2383            T2: fidl::encoding::Encode<DefaultEnum, D>,
2384            T3: fidl::encoding::Encode<RespondWith, D>,
2385        > fidl::encoding::Encode<SignedErrorable, D> for (T0, T1, T2, T3)
2386    {
2387        #[inline]
2388        unsafe fn encode(
2389            self,
2390            encoder: &mut fidl::encoding::Encoder<'_, D>,
2391            offset: usize,
2392            depth: fidl::encoding::Depth,
2393        ) -> fidl::Result<()> {
2394            encoder.debug_check_bounds::<SignedErrorable>(offset);
2395            // Zero out padding regions. There's no need to apply masks
2396            // because the unmasked parts will be overwritten by fields.
2397            // Write the fields.
2398            self.0.encode(encoder, offset + 0, depth)?;
2399            self.1.encode(encoder, offset + 8, depth)?;
2400            self.2.encode(encoder, offset + 24, depth)?;
2401            self.3.encode(encoder, offset + 28, depth)?;
2402            Ok(())
2403        }
2404    }
2405
2406    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SignedErrorable {
2407        #[inline(always)]
2408        fn new_empty() -> Self {
2409            Self {
2410                value: fidl::new_empty!(i64, D),
2411                forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D),
2412                result_err: fidl::new_empty!(DefaultEnum, D),
2413                result_variant: fidl::new_empty!(RespondWith, D),
2414            }
2415        }
2416
2417        #[inline]
2418        unsafe fn decode(
2419            &mut self,
2420            decoder: &mut fidl::encoding::Decoder<'_, D>,
2421            offset: usize,
2422            _depth: fidl::encoding::Depth,
2423        ) -> fidl::Result<()> {
2424            decoder.debug_check_bounds::<Self>(offset);
2425            // Verify that padding bytes are zero.
2426            fidl::decode!(i64, D, &mut self.value, decoder, offset + 0, _depth)?;
2427            fidl::decode!(
2428                fidl::encoding::UnboundedString,
2429                D,
2430                &mut self.forward_to_server,
2431                decoder,
2432                offset + 8,
2433                _depth
2434            )?;
2435            fidl::decode!(DefaultEnum, D, &mut self.result_err, decoder, offset + 24, _depth)?;
2436            fidl::decode!(RespondWith, D, &mut self.result_variant, decoder, offset + 28, _depth)?;
2437            Ok(())
2438        }
2439    }
2440
2441    impl fidl::encoding::ValueTypeMarker for Unsigned {
2442        type Borrowed<'a> = &'a Self;
2443        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2444            value
2445        }
2446    }
2447
2448    unsafe impl fidl::encoding::TypeMarker for Unsigned {
2449        type Owned = Self;
2450
2451        #[inline(always)]
2452        fn inline_align(_context: fidl::encoding::Context) -> usize {
2453            8
2454        }
2455
2456        #[inline(always)]
2457        fn inline_size(_context: fidl::encoding::Context) -> usize {
2458            24
2459        }
2460    }
2461
2462    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unsigned, D> for &Unsigned {
2463        #[inline]
2464        unsafe fn encode(
2465            self,
2466            encoder: &mut fidl::encoding::Encoder<'_, D>,
2467            offset: usize,
2468            _depth: fidl::encoding::Depth,
2469        ) -> fidl::Result<()> {
2470            encoder.debug_check_bounds::<Unsigned>(offset);
2471            // Delegate to tuple encoding.
2472            fidl::encoding::Encode::<Unsigned, D>::encode(
2473                (
2474                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2475                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2476                        &self.forward_to_server,
2477                    ),
2478                ),
2479                encoder,
2480                offset,
2481                _depth,
2482            )
2483        }
2484    }
2485    unsafe impl<
2486            D: fidl::encoding::ResourceDialect,
2487            T0: fidl::encoding::Encode<u64, D>,
2488            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2489        > fidl::encoding::Encode<Unsigned, D> for (T0, T1)
2490    {
2491        #[inline]
2492        unsafe fn encode(
2493            self,
2494            encoder: &mut fidl::encoding::Encoder<'_, D>,
2495            offset: usize,
2496            depth: fidl::encoding::Depth,
2497        ) -> fidl::Result<()> {
2498            encoder.debug_check_bounds::<Unsigned>(offset);
2499            // Zero out padding regions. There's no need to apply masks
2500            // because the unmasked parts will be overwritten by fields.
2501            // Write the fields.
2502            self.0.encode(encoder, offset + 0, depth)?;
2503            self.1.encode(encoder, offset + 8, depth)?;
2504            Ok(())
2505        }
2506    }
2507
2508    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unsigned {
2509        #[inline(always)]
2510        fn new_empty() -> Self {
2511            Self {
2512                value: fidl::new_empty!(u64, D),
2513                forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D),
2514            }
2515        }
2516
2517        #[inline]
2518        unsafe fn decode(
2519            &mut self,
2520            decoder: &mut fidl::encoding::Decoder<'_, D>,
2521            offset: usize,
2522            _depth: fidl::encoding::Depth,
2523        ) -> fidl::Result<()> {
2524            decoder.debug_check_bounds::<Self>(offset);
2525            // Verify that padding bytes are zero.
2526            fidl::decode!(u64, D, &mut self.value, decoder, offset + 0, _depth)?;
2527            fidl::decode!(
2528                fidl::encoding::UnboundedString,
2529                D,
2530                &mut self.forward_to_server,
2531                decoder,
2532                offset + 8,
2533                _depth
2534            )?;
2535            Ok(())
2536        }
2537    }
2538
2539    impl fidl::encoding::ValueTypeMarker for UnsignedErrorable {
2540        type Borrowed<'a> = &'a Self;
2541        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2542            value
2543        }
2544    }
2545
2546    unsafe impl fidl::encoding::TypeMarker for UnsignedErrorable {
2547        type Owned = Self;
2548
2549        #[inline(always)]
2550        fn inline_align(_context: fidl::encoding::Context) -> usize {
2551            8
2552        }
2553
2554        #[inline(always)]
2555        fn inline_size(_context: fidl::encoding::Context) -> usize {
2556            32
2557        }
2558    }
2559
2560    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnsignedErrorable, D>
2561        for &UnsignedErrorable
2562    {
2563        #[inline]
2564        unsafe fn encode(
2565            self,
2566            encoder: &mut fidl::encoding::Encoder<'_, D>,
2567            offset: usize,
2568            _depth: fidl::encoding::Depth,
2569        ) -> fidl::Result<()> {
2570            encoder.debug_check_bounds::<UnsignedErrorable>(offset);
2571            // Delegate to tuple encoding.
2572            fidl::encoding::Encode::<UnsignedErrorable, D>::encode(
2573                (
2574                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2575                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2576                        &self.forward_to_server,
2577                    ),
2578                    <DefaultEnum as fidl::encoding::ValueTypeMarker>::borrow(&self.result_err),
2579                    <RespondWith as fidl::encoding::ValueTypeMarker>::borrow(&self.result_variant),
2580                ),
2581                encoder,
2582                offset,
2583                _depth,
2584            )
2585        }
2586    }
2587    unsafe impl<
2588            D: fidl::encoding::ResourceDialect,
2589            T0: fidl::encoding::Encode<u64, D>,
2590            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2591            T2: fidl::encoding::Encode<DefaultEnum, D>,
2592            T3: fidl::encoding::Encode<RespondWith, D>,
2593        > fidl::encoding::Encode<UnsignedErrorable, D> for (T0, T1, T2, T3)
2594    {
2595        #[inline]
2596        unsafe fn encode(
2597            self,
2598            encoder: &mut fidl::encoding::Encoder<'_, D>,
2599            offset: usize,
2600            depth: fidl::encoding::Depth,
2601        ) -> fidl::Result<()> {
2602            encoder.debug_check_bounds::<UnsignedErrorable>(offset);
2603            // Zero out padding regions. There's no need to apply masks
2604            // because the unmasked parts will be overwritten by fields.
2605            // Write the fields.
2606            self.0.encode(encoder, offset + 0, depth)?;
2607            self.1.encode(encoder, offset + 8, depth)?;
2608            self.2.encode(encoder, offset + 24, depth)?;
2609            self.3.encode(encoder, offset + 28, depth)?;
2610            Ok(())
2611        }
2612    }
2613
2614    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnsignedErrorable {
2615        #[inline(always)]
2616        fn new_empty() -> Self {
2617            Self {
2618                value: fidl::new_empty!(u64, D),
2619                forward_to_server: fidl::new_empty!(fidl::encoding::UnboundedString, D),
2620                result_err: fidl::new_empty!(DefaultEnum, D),
2621                result_variant: fidl::new_empty!(RespondWith, D),
2622            }
2623        }
2624
2625        #[inline]
2626        unsafe fn decode(
2627            &mut self,
2628            decoder: &mut fidl::encoding::Decoder<'_, D>,
2629            offset: usize,
2630            _depth: fidl::encoding::Depth,
2631        ) -> fidl::Result<()> {
2632            decoder.debug_check_bounds::<Self>(offset);
2633            // Verify that padding bytes are zero.
2634            fidl::decode!(u64, D, &mut self.value, decoder, offset + 0, _depth)?;
2635            fidl::decode!(
2636                fidl::encoding::UnboundedString,
2637                D,
2638                &mut self.forward_to_server,
2639                decoder,
2640                offset + 8,
2641                _depth
2642            )?;
2643            fidl::decode!(DefaultEnum, D, &mut self.result_err, decoder, offset + 24, _depth)?;
2644            fidl::decode!(RespondWith, D, &mut self.result_variant, decoder, offset + 28, _depth)?;
2645            Ok(())
2646        }
2647    }
2648
2649    impl fidl::encoding::ValueTypeMarker for DefaultValues {
2650        type Borrowed<'a> = &'a Self;
2651        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2652            value
2653        }
2654    }
2655
2656    unsafe impl fidl::encoding::TypeMarker for DefaultValues {
2657        type Owned = Self;
2658
2659        #[inline(always)]
2660        fn inline_align(_context: fidl::encoding::Context) -> usize {
2661            8
2662        }
2663
2664        #[inline(always)]
2665        fn inline_size(_context: fidl::encoding::Context) -> usize {
2666            72
2667        }
2668    }
2669
2670    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DefaultValues, D>
2671        for &DefaultValues
2672    {
2673        #[inline]
2674        unsafe fn encode(
2675            self,
2676            encoder: &mut fidl::encoding::Encoder<'_, D>,
2677            offset: usize,
2678            _depth: fidl::encoding::Depth,
2679        ) -> fidl::Result<()> {
2680            encoder.debug_check_bounds::<DefaultValues>(offset);
2681            // Delegate to tuple encoding.
2682            fidl::encoding::Encode::<DefaultValues, D>::encode(
2683                (
2684                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.b1),
2685                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.b2),
2686                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.i8),
2687                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.i16),
2688                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.i32),
2689                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.i64),
2690                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.u8),
2691                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.u16),
2692                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.u32),
2693                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.u64),
2694                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.f32),
2695                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.f64),
2696                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
2697                        &self.s,
2698                    ),
2699                ),
2700                encoder,
2701                offset,
2702                _depth,
2703            )
2704        }
2705    }
2706    unsafe impl<
2707            D: fidl::encoding::ResourceDialect,
2708            T0: fidl::encoding::Encode<bool, D>,
2709            T1: fidl::encoding::Encode<bool, D>,
2710            T2: fidl::encoding::Encode<i8, D>,
2711            T3: fidl::encoding::Encode<i16, D>,
2712            T4: fidl::encoding::Encode<i32, D>,
2713            T5: fidl::encoding::Encode<i64, D>,
2714            T6: fidl::encoding::Encode<u8, D>,
2715            T7: fidl::encoding::Encode<u16, D>,
2716            T8: fidl::encoding::Encode<u32, D>,
2717            T9: fidl::encoding::Encode<u64, D>,
2718            T10: fidl::encoding::Encode<f32, D>,
2719            T11: fidl::encoding::Encode<f64, D>,
2720            T12: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
2721        > fidl::encoding::Encode<DefaultValues, D>
2722        for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
2723    {
2724        #[inline]
2725        unsafe fn encode(
2726            self,
2727            encoder: &mut fidl::encoding::Encoder<'_, D>,
2728            offset: usize,
2729            depth: fidl::encoding::Depth,
2730        ) -> fidl::Result<()> {
2731            encoder.debug_check_bounds::<DefaultValues>(offset);
2732            // Zero out padding regions. There's no need to apply masks
2733            // because the unmasked parts will be overwritten by fields.
2734            unsafe {
2735                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2736                (ptr as *mut u64).write_unaligned(0);
2737            }
2738            unsafe {
2739                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2740                (ptr as *mut u64).write_unaligned(0);
2741            }
2742            unsafe {
2743                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
2744                (ptr as *mut u64).write_unaligned(0);
2745            }
2746            unsafe {
2747                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2748                (ptr as *mut u64).write_unaligned(0);
2749            }
2750            // Write the fields.
2751            self.0.encode(encoder, offset + 0, depth)?;
2752            self.1.encode(encoder, offset + 1, depth)?;
2753            self.2.encode(encoder, offset + 2, depth)?;
2754            self.3.encode(encoder, offset + 4, depth)?;
2755            self.4.encode(encoder, offset + 8, depth)?;
2756            self.5.encode(encoder, offset + 16, depth)?;
2757            self.6.encode(encoder, offset + 24, depth)?;
2758            self.7.encode(encoder, offset + 26, depth)?;
2759            self.8.encode(encoder, offset + 28, depth)?;
2760            self.9.encode(encoder, offset + 32, depth)?;
2761            self.10.encode(encoder, offset + 40, depth)?;
2762            self.11.encode(encoder, offset + 48, depth)?;
2763            self.12.encode(encoder, offset + 56, depth)?;
2764            Ok(())
2765        }
2766    }
2767
2768    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DefaultValues {
2769        #[inline(always)]
2770        fn new_empty() -> Self {
2771            Self {
2772                b1: fidl::new_empty!(bool, D),
2773                b2: fidl::new_empty!(bool, D),
2774                i8: fidl::new_empty!(i8, D),
2775                i16: fidl::new_empty!(i16, D),
2776                i32: fidl::new_empty!(i32, D),
2777                i64: fidl::new_empty!(i64, D),
2778                u8: fidl::new_empty!(u8, D),
2779                u16: fidl::new_empty!(u16, D),
2780                u32: fidl::new_empty!(u32, D),
2781                u64: fidl::new_empty!(u64, D),
2782                f32: fidl::new_empty!(f32, D),
2783                f64: fidl::new_empty!(f64, D),
2784                s: fidl::new_empty!(fidl::encoding::UnboundedString, D),
2785            }
2786        }
2787
2788        #[inline]
2789        unsafe fn decode(
2790            &mut self,
2791            decoder: &mut fidl::encoding::Decoder<'_, D>,
2792            offset: usize,
2793            _depth: fidl::encoding::Depth,
2794        ) -> fidl::Result<()> {
2795            decoder.debug_check_bounds::<Self>(offset);
2796            // Verify that padding bytes are zero.
2797            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2798            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2799            let mask = 0xffff0000ff000000u64;
2800            let maskedval = padval & mask;
2801            if maskedval != 0 {
2802                return Err(fidl::Error::NonZeroPadding {
2803                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2804                });
2805            }
2806            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2807            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2808            let mask = 0xffffffff00000000u64;
2809            let maskedval = padval & mask;
2810            if maskedval != 0 {
2811                return Err(fidl::Error::NonZeroPadding {
2812                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2813                });
2814            }
2815            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
2816            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2817            let mask = 0xff00u64;
2818            let maskedval = padval & mask;
2819            if maskedval != 0 {
2820                return Err(fidl::Error::NonZeroPadding {
2821                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
2822                });
2823            }
2824            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
2825            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2826            let mask = 0xffffffff00000000u64;
2827            let maskedval = padval & mask;
2828            if maskedval != 0 {
2829                return Err(fidl::Error::NonZeroPadding {
2830                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
2831                });
2832            }
2833            fidl::decode!(bool, D, &mut self.b1, decoder, offset + 0, _depth)?;
2834            fidl::decode!(bool, D, &mut self.b2, decoder, offset + 1, _depth)?;
2835            fidl::decode!(i8, D, &mut self.i8, decoder, offset + 2, _depth)?;
2836            fidl::decode!(i16, D, &mut self.i16, decoder, offset + 4, _depth)?;
2837            fidl::decode!(i32, D, &mut self.i32, decoder, offset + 8, _depth)?;
2838            fidl::decode!(i64, D, &mut self.i64, decoder, offset + 16, _depth)?;
2839            fidl::decode!(u8, D, &mut self.u8, decoder, offset + 24, _depth)?;
2840            fidl::decode!(u16, D, &mut self.u16, decoder, offset + 26, _depth)?;
2841            fidl::decode!(u32, D, &mut self.u32, decoder, offset + 28, _depth)?;
2842            fidl::decode!(u64, D, &mut self.u64, decoder, offset + 32, _depth)?;
2843            fidl::decode!(f32, D, &mut self.f32, decoder, offset + 40, _depth)?;
2844            fidl::decode!(f64, D, &mut self.f64, decoder, offset + 48, _depth)?;
2845            fidl::decode!(
2846                fidl::encoding::UnboundedString,
2847                D,
2848                &mut self.s,
2849                decoder,
2850                offset + 56,
2851                _depth
2852            )?;
2853            Ok(())
2854        }
2855    }
2856
2857    impl fidl::encoding::ValueTypeMarker for PrimitiveTypes {
2858        type Borrowed<'a> = &'a Self;
2859        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2860            value
2861        }
2862    }
2863
2864    unsafe impl fidl::encoding::TypeMarker for PrimitiveTypes {
2865        type Owned = Self;
2866
2867        #[inline(always)]
2868        fn inline_align(_context: fidl::encoding::Context) -> usize {
2869            8
2870        }
2871
2872        #[inline(always)]
2873        fn inline_size(_context: fidl::encoding::Context) -> usize {
2874            48
2875        }
2876    }
2877
2878    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrimitiveTypes, D>
2879        for &PrimitiveTypes
2880    {
2881        #[inline]
2882        unsafe fn encode(
2883            self,
2884            encoder: &mut fidl::encoding::Encoder<'_, D>,
2885            offset: usize,
2886            _depth: fidl::encoding::Depth,
2887        ) -> fidl::Result<()> {
2888            encoder.debug_check_bounds::<PrimitiveTypes>(offset);
2889            // Delegate to tuple encoding.
2890            fidl::encoding::Encode::<PrimitiveTypes, D>::encode(
2891                (
2892                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.b),
2893                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.i8),
2894                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.i16),
2895                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.i32),
2896                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.i64),
2897                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.u8),
2898                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.u16),
2899                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.u32),
2900                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.u64),
2901                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.f32),
2902                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.f64),
2903                ),
2904                encoder,
2905                offset,
2906                _depth,
2907            )
2908        }
2909    }
2910    unsafe impl<
2911            D: fidl::encoding::ResourceDialect,
2912            T0: fidl::encoding::Encode<bool, D>,
2913            T1: fidl::encoding::Encode<i8, D>,
2914            T2: fidl::encoding::Encode<i16, D>,
2915            T3: fidl::encoding::Encode<i32, D>,
2916            T4: fidl::encoding::Encode<i64, D>,
2917            T5: fidl::encoding::Encode<u8, D>,
2918            T6: fidl::encoding::Encode<u16, D>,
2919            T7: fidl::encoding::Encode<u32, D>,
2920            T8: fidl::encoding::Encode<u64, D>,
2921            T9: fidl::encoding::Encode<f32, D>,
2922            T10: fidl::encoding::Encode<f64, D>,
2923        > fidl::encoding::Encode<PrimitiveTypes, D>
2924        for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
2925    {
2926        #[inline]
2927        unsafe fn encode(
2928            self,
2929            encoder: &mut fidl::encoding::Encoder<'_, D>,
2930            offset: usize,
2931            depth: fidl::encoding::Depth,
2932        ) -> fidl::Result<()> {
2933            encoder.debug_check_bounds::<PrimitiveTypes>(offset);
2934            // Zero out padding regions. There's no need to apply masks
2935            // because the unmasked parts will be overwritten by fields.
2936            unsafe {
2937                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2938                (ptr as *mut u64).write_unaligned(0);
2939            }
2940            unsafe {
2941                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
2942                (ptr as *mut u64).write_unaligned(0);
2943            }
2944            // Write the fields.
2945            self.0.encode(encoder, offset + 0, depth)?;
2946            self.1.encode(encoder, offset + 1, depth)?;
2947            self.2.encode(encoder, offset + 2, depth)?;
2948            self.3.encode(encoder, offset + 4, depth)?;
2949            self.4.encode(encoder, offset + 8, depth)?;
2950            self.5.encode(encoder, offset + 16, depth)?;
2951            self.6.encode(encoder, offset + 18, depth)?;
2952            self.7.encode(encoder, offset + 20, depth)?;
2953            self.8.encode(encoder, offset + 24, depth)?;
2954            self.9.encode(encoder, offset + 32, depth)?;
2955            self.10.encode(encoder, offset + 40, depth)?;
2956            Ok(())
2957        }
2958    }
2959
2960    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrimitiveTypes {
2961        #[inline(always)]
2962        fn new_empty() -> Self {
2963            Self {
2964                b: fidl::new_empty!(bool, D),
2965                i8: fidl::new_empty!(i8, D),
2966                i16: fidl::new_empty!(i16, D),
2967                i32: fidl::new_empty!(i32, D),
2968                i64: fidl::new_empty!(i64, D),
2969                u8: fidl::new_empty!(u8, D),
2970                u16: fidl::new_empty!(u16, D),
2971                u32: fidl::new_empty!(u32, D),
2972                u64: fidl::new_empty!(u64, D),
2973                f32: fidl::new_empty!(f32, D),
2974                f64: fidl::new_empty!(f64, D),
2975            }
2976        }
2977
2978        #[inline]
2979        unsafe fn decode(
2980            &mut self,
2981            decoder: &mut fidl::encoding::Decoder<'_, D>,
2982            offset: usize,
2983            _depth: fidl::encoding::Depth,
2984        ) -> fidl::Result<()> {
2985            decoder.debug_check_bounds::<Self>(offset);
2986            // Verify that padding bytes are zero.
2987            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2988            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2989            let mask = 0xff00u64;
2990            let maskedval = padval & mask;
2991            if maskedval != 0 {
2992                return Err(fidl::Error::NonZeroPadding {
2993                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2994                });
2995            }
2996            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
2997            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2998            let mask = 0xffffffff00000000u64;
2999            let maskedval = padval & mask;
3000            if maskedval != 0 {
3001                return Err(fidl::Error::NonZeroPadding {
3002                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
3003                });
3004            }
3005            fidl::decode!(bool, D, &mut self.b, decoder, offset + 0, _depth)?;
3006            fidl::decode!(i8, D, &mut self.i8, decoder, offset + 1, _depth)?;
3007            fidl::decode!(i16, D, &mut self.i16, decoder, offset + 2, _depth)?;
3008            fidl::decode!(i32, D, &mut self.i32, decoder, offset + 4, _depth)?;
3009            fidl::decode!(i64, D, &mut self.i64, decoder, offset + 8, _depth)?;
3010            fidl::decode!(u8, D, &mut self.u8, decoder, offset + 16, _depth)?;
3011            fidl::decode!(u16, D, &mut self.u16, decoder, offset + 18, _depth)?;
3012            fidl::decode!(u32, D, &mut self.u32, decoder, offset + 20, _depth)?;
3013            fidl::decode!(u64, D, &mut self.u64, decoder, offset + 24, _depth)?;
3014            fidl::decode!(f32, D, &mut self.f32, decoder, offset + 32, _depth)?;
3015            fidl::decode!(f64, D, &mut self.f64, decoder, offset + 40, _depth)?;
3016            Ok(())
3017        }
3018    }
3019
3020    impl fidl::encoding::ValueTypeMarker for Strings {
3021        type Borrowed<'a> = &'a Self;
3022        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3023            value
3024        }
3025    }
3026
3027    unsafe impl fidl::encoding::TypeMarker for Strings {
3028        type Owned = Self;
3029
3030        #[inline(always)]
3031        fn inline_align(_context: fidl::encoding::Context) -> usize {
3032            8
3033        }
3034
3035        #[inline(always)]
3036        fn inline_size(_context: fidl::encoding::Context) -> usize {
3037            96
3038        }
3039    }
3040
3041    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Strings, D> for &Strings {
3042        #[inline]
3043        unsafe fn encode(
3044            self,
3045            encoder: &mut fidl::encoding::Encoder<'_, D>,
3046            offset: usize,
3047            _depth: fidl::encoding::Depth,
3048        ) -> fidl::Result<()> {
3049            encoder.debug_check_bounds::<Strings>(offset);
3050            // Delegate to tuple encoding.
3051            fidl::encoding::Encode::<Strings, D>::encode(
3052                (
3053                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
3054                    <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.nullable_s),
3055                    <fidl::encoding::BoundedString<2> as fidl::encoding::ValueTypeMarker>::borrow(&self.size_0_s),
3056                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.size_1_s),
3057                    <fidl::encoding::Optional<fidl::encoding::BoundedString<2>> as fidl::encoding::ValueTypeMarker>::borrow(&self.nullable_size_0_s),
3058                    <fidl::encoding::Optional<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.nullable_size_1_s),
3059                ),
3060                encoder, offset, _depth
3061            )
3062        }
3063    }
3064    unsafe impl<
3065            D: fidl::encoding::ResourceDialect,
3066            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3067            T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
3068            T2: fidl::encoding::Encode<fidl::encoding::BoundedString<2>, D>,
3069            T3: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
3070            T4: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<2>>, D>,
3071            T5: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<32>>, D>,
3072        > fidl::encoding::Encode<Strings, D> for (T0, T1, T2, T3, T4, T5)
3073    {
3074        #[inline]
3075        unsafe fn encode(
3076            self,
3077            encoder: &mut fidl::encoding::Encoder<'_, D>,
3078            offset: usize,
3079            depth: fidl::encoding::Depth,
3080        ) -> fidl::Result<()> {
3081            encoder.debug_check_bounds::<Strings>(offset);
3082            // Zero out padding regions. There's no need to apply masks
3083            // because the unmasked parts will be overwritten by fields.
3084            // Write the fields.
3085            self.0.encode(encoder, offset + 0, depth)?;
3086            self.1.encode(encoder, offset + 16, depth)?;
3087            self.2.encode(encoder, offset + 32, depth)?;
3088            self.3.encode(encoder, offset + 48, depth)?;
3089            self.4.encode(encoder, offset + 64, depth)?;
3090            self.5.encode(encoder, offset + 80, depth)?;
3091            Ok(())
3092        }
3093    }
3094
3095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Strings {
3096        #[inline(always)]
3097        fn new_empty() -> Self {
3098            Self {
3099                s: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3100                nullable_s: fidl::new_empty!(
3101                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
3102                    D
3103                ),
3104                size_0_s: fidl::new_empty!(fidl::encoding::BoundedString<2>, D),
3105                size_1_s: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
3106                nullable_size_0_s: fidl::new_empty!(
3107                    fidl::encoding::Optional<fidl::encoding::BoundedString<2>>,
3108                    D
3109                ),
3110                nullable_size_1_s: fidl::new_empty!(
3111                    fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
3112                    D
3113                ),
3114            }
3115        }
3116
3117        #[inline]
3118        unsafe fn decode(
3119            &mut self,
3120            decoder: &mut fidl::encoding::Decoder<'_, D>,
3121            offset: usize,
3122            _depth: fidl::encoding::Depth,
3123        ) -> fidl::Result<()> {
3124            decoder.debug_check_bounds::<Self>(offset);
3125            // Verify that padding bytes are zero.
3126            fidl::decode!(
3127                fidl::encoding::UnboundedString,
3128                D,
3129                &mut self.s,
3130                decoder,
3131                offset + 0,
3132                _depth
3133            )?;
3134            fidl::decode!(
3135                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
3136                D,
3137                &mut self.nullable_s,
3138                decoder,
3139                offset + 16,
3140                _depth
3141            )?;
3142            fidl::decode!(
3143                fidl::encoding::BoundedString<2>,
3144                D,
3145                &mut self.size_0_s,
3146                decoder,
3147                offset + 32,
3148                _depth
3149            )?;
3150            fidl::decode!(
3151                fidl::encoding::BoundedString<32>,
3152                D,
3153                &mut self.size_1_s,
3154                decoder,
3155                offset + 48,
3156                _depth
3157            )?;
3158            fidl::decode!(
3159                fidl::encoding::Optional<fidl::encoding::BoundedString<2>>,
3160                D,
3161                &mut self.nullable_size_0_s,
3162                decoder,
3163                offset + 64,
3164                _depth
3165            )?;
3166            fidl::decode!(
3167                fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
3168                D,
3169                &mut self.nullable_size_1_s,
3170                decoder,
3171                offset + 80,
3172                _depth
3173            )?;
3174            Ok(())
3175        }
3176    }
3177
3178    impl fidl::encoding::ValueTypeMarker for Structs {
3179        type Borrowed<'a> = &'a Self;
3180        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3181            value
3182        }
3183    }
3184
3185    unsafe impl fidl::encoding::TypeMarker for Structs {
3186        type Owned = Self;
3187
3188        #[inline(always)]
3189        fn inline_align(_context: fidl::encoding::Context) -> usize {
3190            8
3191        }
3192
3193        #[inline(always)]
3194        fn inline_size(_context: fidl::encoding::Context) -> usize {
3195            32
3196        }
3197    }
3198
3199    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Structs, D> for &Structs {
3200        #[inline]
3201        unsafe fn encode(
3202            self,
3203            encoder: &mut fidl::encoding::Encoder<'_, D>,
3204            offset: usize,
3205            _depth: fidl::encoding::Depth,
3206        ) -> fidl::Result<()> {
3207            encoder.debug_check_bounds::<Structs>(offset);
3208            // Delegate to tuple encoding.
3209            fidl::encoding::Encode::<Structs, D>::encode(
3210                (
3211                    <ThisIsAStruct as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
3212                    <fidl::encoding::Boxed<ThisIsAStruct> as fidl::encoding::ValueTypeMarker>::borrow(&self.nullable_s),
3213                    <ThisIsAnEmptyStruct as fidl::encoding::ValueTypeMarker>::borrow(&self.es),
3214                ),
3215                encoder, offset, _depth
3216            )
3217        }
3218    }
3219    unsafe impl<
3220            D: fidl::encoding::ResourceDialect,
3221            T0: fidl::encoding::Encode<ThisIsAStruct, D>,
3222            T1: fidl::encoding::Encode<fidl::encoding::Boxed<ThisIsAStruct>, D>,
3223            T2: fidl::encoding::Encode<ThisIsAnEmptyStruct, D>,
3224        > fidl::encoding::Encode<Structs, D> for (T0, T1, T2)
3225    {
3226        #[inline]
3227        unsafe fn encode(
3228            self,
3229            encoder: &mut fidl::encoding::Encoder<'_, D>,
3230            offset: usize,
3231            depth: fidl::encoding::Depth,
3232        ) -> fidl::Result<()> {
3233            encoder.debug_check_bounds::<Structs>(offset);
3234            // Zero out padding regions. There's no need to apply masks
3235            // because the unmasked parts will be overwritten by fields.
3236            unsafe {
3237                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
3238                (ptr as *mut u64).write_unaligned(0);
3239            }
3240            // Write the fields.
3241            self.0.encode(encoder, offset + 0, depth)?;
3242            self.1.encode(encoder, offset + 16, depth)?;
3243            self.2.encode(encoder, offset + 24, depth)?;
3244            Ok(())
3245        }
3246    }
3247
3248    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Structs {
3249        #[inline(always)]
3250        fn new_empty() -> Self {
3251            Self {
3252                s: fidl::new_empty!(ThisIsAStruct, D),
3253                nullable_s: fidl::new_empty!(fidl::encoding::Boxed<ThisIsAStruct>, D),
3254                es: fidl::new_empty!(ThisIsAnEmptyStruct, D),
3255            }
3256        }
3257
3258        #[inline]
3259        unsafe fn decode(
3260            &mut self,
3261            decoder: &mut fidl::encoding::Decoder<'_, D>,
3262            offset: usize,
3263            _depth: fidl::encoding::Depth,
3264        ) -> fidl::Result<()> {
3265            decoder.debug_check_bounds::<Self>(offset);
3266            // Verify that padding bytes are zero.
3267            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
3268            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3269            let mask = 0xffffffffffffff00u64;
3270            let maskedval = padval & mask;
3271            if maskedval != 0 {
3272                return Err(fidl::Error::NonZeroPadding {
3273                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
3274                });
3275            }
3276            fidl::decode!(ThisIsAStruct, D, &mut self.s, decoder, offset + 0, _depth)?;
3277            fidl::decode!(
3278                fidl::encoding::Boxed<ThisIsAStruct>,
3279                D,
3280                &mut self.nullable_s,
3281                decoder,
3282                offset + 16,
3283                _depth
3284            )?;
3285            fidl::decode!(ThisIsAnEmptyStruct, D, &mut self.es, decoder, offset + 24, _depth)?;
3286            Ok(())
3287        }
3288    }
3289
3290    impl fidl::encoding::ValueTypeMarker for ThisIsAStruct {
3291        type Borrowed<'a> = &'a Self;
3292        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3293            value
3294        }
3295    }
3296
3297    unsafe impl fidl::encoding::TypeMarker for ThisIsAStruct {
3298        type Owned = Self;
3299
3300        #[inline(always)]
3301        fn inline_align(_context: fidl::encoding::Context) -> usize {
3302            8
3303        }
3304
3305        #[inline(always)]
3306        fn inline_size(_context: fidl::encoding::Context) -> usize {
3307            16
3308        }
3309    }
3310
3311    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThisIsAStruct, D>
3312        for &ThisIsAStruct
3313    {
3314        #[inline]
3315        unsafe fn encode(
3316            self,
3317            encoder: &mut fidl::encoding::Encoder<'_, D>,
3318            offset: usize,
3319            _depth: fidl::encoding::Depth,
3320        ) -> fidl::Result<()> {
3321            encoder.debug_check_bounds::<ThisIsAStruct>(offset);
3322            // Delegate to tuple encoding.
3323            fidl::encoding::Encode::<ThisIsAStruct, D>::encode(
3324                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3325                    &self.s,
3326                ),),
3327                encoder,
3328                offset,
3329                _depth,
3330            )
3331        }
3332    }
3333    unsafe impl<
3334            D: fidl::encoding::ResourceDialect,
3335            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3336        > fidl::encoding::Encode<ThisIsAStruct, D> for (T0,)
3337    {
3338        #[inline]
3339        unsafe fn encode(
3340            self,
3341            encoder: &mut fidl::encoding::Encoder<'_, D>,
3342            offset: usize,
3343            depth: fidl::encoding::Depth,
3344        ) -> fidl::Result<()> {
3345            encoder.debug_check_bounds::<ThisIsAStruct>(offset);
3346            // Zero out padding regions. There's no need to apply masks
3347            // because the unmasked parts will be overwritten by fields.
3348            // Write the fields.
3349            self.0.encode(encoder, offset + 0, depth)?;
3350            Ok(())
3351        }
3352    }
3353
3354    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThisIsAStruct {
3355        #[inline(always)]
3356        fn new_empty() -> Self {
3357            Self { s: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
3358        }
3359
3360        #[inline]
3361        unsafe fn decode(
3362            &mut self,
3363            decoder: &mut fidl::encoding::Decoder<'_, D>,
3364            offset: usize,
3365            _depth: fidl::encoding::Depth,
3366        ) -> fidl::Result<()> {
3367            decoder.debug_check_bounds::<Self>(offset);
3368            // Verify that padding bytes are zero.
3369            fidl::decode!(
3370                fidl::encoding::UnboundedString,
3371                D,
3372                &mut self.s,
3373                decoder,
3374                offset + 0,
3375                _depth
3376            )?;
3377            Ok(())
3378        }
3379    }
3380
3381    impl fidl::encoding::ValueTypeMarker for ThisIsAnEmptyStruct {
3382        type Borrowed<'a> = &'a Self;
3383        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3384            value
3385        }
3386    }
3387
3388    unsafe impl fidl::encoding::TypeMarker for ThisIsAnEmptyStruct {
3389        type Owned = Self;
3390
3391        #[inline(always)]
3392        fn inline_align(_context: fidl::encoding::Context) -> usize {
3393            1
3394        }
3395
3396        #[inline(always)]
3397        fn inline_size(_context: fidl::encoding::Context) -> usize {
3398            1
3399        }
3400    }
3401
3402    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThisIsAnEmptyStruct, D>
3403        for &ThisIsAnEmptyStruct
3404    {
3405        #[inline]
3406        unsafe fn encode(
3407            self,
3408            encoder: &mut fidl::encoding::Encoder<'_, D>,
3409            offset: usize,
3410            _depth: fidl::encoding::Depth,
3411        ) -> fidl::Result<()> {
3412            encoder.debug_check_bounds::<ThisIsAnEmptyStruct>(offset);
3413            encoder.write_num(0u8, offset);
3414            Ok(())
3415        }
3416    }
3417
3418    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThisIsAnEmptyStruct {
3419        #[inline(always)]
3420        fn new_empty() -> Self {
3421            Self
3422        }
3423
3424        #[inline]
3425        unsafe fn decode(
3426            &mut self,
3427            decoder: &mut fidl::encoding::Decoder<'_, D>,
3428            offset: usize,
3429            _depth: fidl::encoding::Depth,
3430        ) -> fidl::Result<()> {
3431            decoder.debug_check_bounds::<Self>(offset);
3432            match decoder.read_num::<u8>(offset) {
3433                0 => Ok(()),
3434                _ => Err(fidl::Error::Invalid),
3435            }
3436        }
3437    }
3438
3439    impl fidl::encoding::ValueTypeMarker for Unions {
3440        type Borrowed<'a> = &'a Self;
3441        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3442            value
3443        }
3444    }
3445
3446    unsafe impl fidl::encoding::TypeMarker for Unions {
3447        type Owned = Self;
3448
3449        #[inline(always)]
3450        fn inline_align(_context: fidl::encoding::Context) -> usize {
3451            8
3452        }
3453
3454        #[inline(always)]
3455        fn inline_size(_context: fidl::encoding::Context) -> usize {
3456            32
3457        }
3458    }
3459
3460    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unions, D> for &Unions {
3461        #[inline]
3462        unsafe fn encode(
3463            self,
3464            encoder: &mut fidl::encoding::Encoder<'_, D>,
3465            offset: usize,
3466            _depth: fidl::encoding::Depth,
3467        ) -> fidl::Result<()> {
3468            encoder.debug_check_bounds::<Unions>(offset);
3469            // Delegate to tuple encoding.
3470            fidl::encoding::Encode::<Unions, D>::encode(
3471                (
3472                    <ThisIsAUnion as fidl::encoding::ValueTypeMarker>::borrow(&self.u),
3473                    <fidl::encoding::OptionalUnion<ThisIsAUnion> as fidl::encoding::ValueTypeMarker>::borrow(&self.nullable_u),
3474                ),
3475                encoder, offset, _depth
3476            )
3477        }
3478    }
3479    unsafe impl<
3480            D: fidl::encoding::ResourceDialect,
3481            T0: fidl::encoding::Encode<ThisIsAUnion, D>,
3482            T1: fidl::encoding::Encode<fidl::encoding::OptionalUnion<ThisIsAUnion>, D>,
3483        > fidl::encoding::Encode<Unions, D> for (T0, T1)
3484    {
3485        #[inline]
3486        unsafe fn encode(
3487            self,
3488            encoder: &mut fidl::encoding::Encoder<'_, D>,
3489            offset: usize,
3490            depth: fidl::encoding::Depth,
3491        ) -> fidl::Result<()> {
3492            encoder.debug_check_bounds::<Unions>(offset);
3493            // Zero out padding regions. There's no need to apply masks
3494            // because the unmasked parts will be overwritten by fields.
3495            // Write the fields.
3496            self.0.encode(encoder, offset + 0, depth)?;
3497            self.1.encode(encoder, offset + 16, depth)?;
3498            Ok(())
3499        }
3500    }
3501
3502    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unions {
3503        #[inline(always)]
3504        fn new_empty() -> Self {
3505            Self {
3506                u: fidl::new_empty!(ThisIsAUnion, D),
3507                nullable_u: fidl::new_empty!(fidl::encoding::OptionalUnion<ThisIsAUnion>, D),
3508            }
3509        }
3510
3511        #[inline]
3512        unsafe fn decode(
3513            &mut self,
3514            decoder: &mut fidl::encoding::Decoder<'_, D>,
3515            offset: usize,
3516            _depth: fidl::encoding::Depth,
3517        ) -> fidl::Result<()> {
3518            decoder.debug_check_bounds::<Self>(offset);
3519            // Verify that padding bytes are zero.
3520            fidl::decode!(ThisIsAUnion, D, &mut self.u, decoder, offset + 0, _depth)?;
3521            fidl::decode!(
3522                fidl::encoding::OptionalUnion<ThisIsAUnion>,
3523                D,
3524                &mut self.nullable_u,
3525                decoder,
3526                offset + 16,
3527                _depth
3528            )?;
3529            Ok(())
3530        }
3531    }
3532
3533    impl EchoEchoTablePayloadWithErrorRequest {
3534        #[inline(always)]
3535        fn max_ordinal_present(&self) -> u64 {
3536            if let Some(_) = self.result_variant {
3537                return 4;
3538            }
3539            if let Some(_) = self.result_err {
3540                return 3;
3541            }
3542            if let Some(_) = self.forward_to_server {
3543                return 2;
3544            }
3545            if let Some(_) = self.value {
3546                return 1;
3547            }
3548            0
3549        }
3550    }
3551
3552    impl fidl::encoding::ValueTypeMarker for EchoEchoTablePayloadWithErrorRequest {
3553        type Borrowed<'a> = &'a Self;
3554        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3555            value
3556        }
3557    }
3558
3559    unsafe impl fidl::encoding::TypeMarker for EchoEchoTablePayloadWithErrorRequest {
3560        type Owned = Self;
3561
3562        #[inline(always)]
3563        fn inline_align(_context: fidl::encoding::Context) -> usize {
3564            8
3565        }
3566
3567        #[inline(always)]
3568        fn inline_size(_context: fidl::encoding::Context) -> usize {
3569            16
3570        }
3571    }
3572
3573    unsafe impl<D: fidl::encoding::ResourceDialect>
3574        fidl::encoding::Encode<EchoEchoTablePayloadWithErrorRequest, D>
3575        for &EchoEchoTablePayloadWithErrorRequest
3576    {
3577        unsafe fn encode(
3578            self,
3579            encoder: &mut fidl::encoding::Encoder<'_, D>,
3580            offset: usize,
3581            mut depth: fidl::encoding::Depth,
3582        ) -> fidl::Result<()> {
3583            encoder.debug_check_bounds::<EchoEchoTablePayloadWithErrorRequest>(offset);
3584            // Vector header
3585            let max_ordinal: u64 = self.max_ordinal_present();
3586            encoder.write_num(max_ordinal, offset);
3587            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3588            // Calling encoder.out_of_line_offset(0) is not allowed.
3589            if max_ordinal == 0 {
3590                return Ok(());
3591            }
3592            depth.increment()?;
3593            let envelope_size = 8;
3594            let bytes_len = max_ordinal as usize * envelope_size;
3595            #[allow(unused_variables)]
3596            let offset = encoder.out_of_line_offset(bytes_len);
3597            let mut _prev_end_offset: usize = 0;
3598            if 1 > max_ordinal {
3599                return Ok(());
3600            }
3601
3602            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3603            // are envelope_size bytes.
3604            let cur_offset: usize = (1 - 1) * envelope_size;
3605
3606            // Zero reserved fields.
3607            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3608
3609            // Safety:
3610            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3611            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3612            //   envelope_size bytes, there is always sufficient room.
3613            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3614                self.value.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3615                encoder,
3616                offset + cur_offset,
3617                depth,
3618            )?;
3619
3620            _prev_end_offset = cur_offset + envelope_size;
3621            if 2 > max_ordinal {
3622                return Ok(());
3623            }
3624
3625            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3626            // are envelope_size bytes.
3627            let cur_offset: usize = (2 - 1) * envelope_size;
3628
3629            // Zero reserved fields.
3630            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3631
3632            // Safety:
3633            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3634            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3635            //   envelope_size bytes, there is always sufficient room.
3636            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
3637                self.forward_to_server.as_ref().map(
3638                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3639                ),
3640                encoder,
3641                offset + cur_offset,
3642                depth,
3643            )?;
3644
3645            _prev_end_offset = cur_offset + envelope_size;
3646            if 3 > max_ordinal {
3647                return Ok(());
3648            }
3649
3650            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3651            // are envelope_size bytes.
3652            let cur_offset: usize = (3 - 1) * envelope_size;
3653
3654            // Zero reserved fields.
3655            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3656
3657            // Safety:
3658            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3659            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3660            //   envelope_size bytes, there is always sufficient room.
3661            fidl::encoding::encode_in_envelope_optional::<DefaultEnum, D>(
3662                self.result_err
3663                    .as_ref()
3664                    .map(<DefaultEnum as fidl::encoding::ValueTypeMarker>::borrow),
3665                encoder,
3666                offset + cur_offset,
3667                depth,
3668            )?;
3669
3670            _prev_end_offset = cur_offset + envelope_size;
3671            if 4 > max_ordinal {
3672                return Ok(());
3673            }
3674
3675            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3676            // are envelope_size bytes.
3677            let cur_offset: usize = (4 - 1) * envelope_size;
3678
3679            // Zero reserved fields.
3680            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3681
3682            // Safety:
3683            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3684            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3685            //   envelope_size bytes, there is always sufficient room.
3686            fidl::encoding::encode_in_envelope_optional::<RespondWith, D>(
3687                self.result_variant
3688                    .as_ref()
3689                    .map(<RespondWith as fidl::encoding::ValueTypeMarker>::borrow),
3690                encoder,
3691                offset + cur_offset,
3692                depth,
3693            )?;
3694
3695            _prev_end_offset = cur_offset + envelope_size;
3696
3697            Ok(())
3698        }
3699    }
3700
3701    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3702        for EchoEchoTablePayloadWithErrorRequest
3703    {
3704        #[inline(always)]
3705        fn new_empty() -> Self {
3706            Self::default()
3707        }
3708
3709        unsafe fn decode(
3710            &mut self,
3711            decoder: &mut fidl::encoding::Decoder<'_, D>,
3712            offset: usize,
3713            mut depth: fidl::encoding::Depth,
3714        ) -> fidl::Result<()> {
3715            decoder.debug_check_bounds::<Self>(offset);
3716            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3717                None => return Err(fidl::Error::NotNullable),
3718                Some(len) => len,
3719            };
3720            // Calling decoder.out_of_line_offset(0) is not allowed.
3721            if len == 0 {
3722                return Ok(());
3723            };
3724            depth.increment()?;
3725            let envelope_size = 8;
3726            let bytes_len = len * envelope_size;
3727            let offset = decoder.out_of_line_offset(bytes_len)?;
3728            // Decode the envelope for each type.
3729            let mut _next_ordinal_to_read = 0;
3730            let mut next_offset = offset;
3731            let end_offset = offset + bytes_len;
3732            _next_ordinal_to_read += 1;
3733            if next_offset >= end_offset {
3734                return Ok(());
3735            }
3736
3737            // Decode unknown envelopes for gaps in ordinals.
3738            while _next_ordinal_to_read < 1 {
3739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3740                _next_ordinal_to_read += 1;
3741                next_offset += envelope_size;
3742            }
3743
3744            let next_out_of_line = decoder.next_out_of_line();
3745            let handles_before = decoder.remaining_handles();
3746            if let Some((inlined, num_bytes, num_handles)) =
3747                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3748            {
3749                let member_inline_size =
3750                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3751                if inlined != (member_inline_size <= 4) {
3752                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3753                }
3754                let inner_offset;
3755                let mut inner_depth = depth.clone();
3756                if inlined {
3757                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3758                    inner_offset = next_offset;
3759                } else {
3760                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3761                    inner_depth.increment()?;
3762                }
3763                let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(u64, D));
3764                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3765                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3766                {
3767                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3768                }
3769                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3770                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3771                }
3772            }
3773
3774            next_offset += envelope_size;
3775            _next_ordinal_to_read += 1;
3776            if next_offset >= end_offset {
3777                return Ok(());
3778            }
3779
3780            // Decode unknown envelopes for gaps in ordinals.
3781            while _next_ordinal_to_read < 2 {
3782                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3783                _next_ordinal_to_read += 1;
3784                next_offset += envelope_size;
3785            }
3786
3787            let next_out_of_line = decoder.next_out_of_line();
3788            let handles_before = decoder.remaining_handles();
3789            if let Some((inlined, num_bytes, num_handles)) =
3790                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3791            {
3792                let member_inline_size =
3793                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3794                        decoder.context,
3795                    );
3796                if inlined != (member_inline_size <= 4) {
3797                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3798                }
3799                let inner_offset;
3800                let mut inner_depth = depth.clone();
3801                if inlined {
3802                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3803                    inner_offset = next_offset;
3804                } else {
3805                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3806                    inner_depth.increment()?;
3807                }
3808                let val_ref = self
3809                    .forward_to_server
3810                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
3811                fidl::decode!(
3812                    fidl::encoding::UnboundedString,
3813                    D,
3814                    val_ref,
3815                    decoder,
3816                    inner_offset,
3817                    inner_depth
3818                )?;
3819                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3820                {
3821                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3822                }
3823                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3824                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3825                }
3826            }
3827
3828            next_offset += envelope_size;
3829            _next_ordinal_to_read += 1;
3830            if next_offset >= end_offset {
3831                return Ok(());
3832            }
3833
3834            // Decode unknown envelopes for gaps in ordinals.
3835            while _next_ordinal_to_read < 3 {
3836                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3837                _next_ordinal_to_read += 1;
3838                next_offset += envelope_size;
3839            }
3840
3841            let next_out_of_line = decoder.next_out_of_line();
3842            let handles_before = decoder.remaining_handles();
3843            if let Some((inlined, num_bytes, num_handles)) =
3844                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3845            {
3846                let member_inline_size =
3847                    <DefaultEnum as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3848                if inlined != (member_inline_size <= 4) {
3849                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3850                }
3851                let inner_offset;
3852                let mut inner_depth = depth.clone();
3853                if inlined {
3854                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3855                    inner_offset = next_offset;
3856                } else {
3857                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3858                    inner_depth.increment()?;
3859                }
3860                let val_ref =
3861                    self.result_err.get_or_insert_with(|| fidl::new_empty!(DefaultEnum, D));
3862                fidl::decode!(DefaultEnum, D, val_ref, decoder, inner_offset, inner_depth)?;
3863                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3864                {
3865                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3866                }
3867                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3868                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3869                }
3870            }
3871
3872            next_offset += envelope_size;
3873            _next_ordinal_to_read += 1;
3874            if next_offset >= end_offset {
3875                return Ok(());
3876            }
3877
3878            // Decode unknown envelopes for gaps in ordinals.
3879            while _next_ordinal_to_read < 4 {
3880                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3881                _next_ordinal_to_read += 1;
3882                next_offset += envelope_size;
3883            }
3884
3885            let next_out_of_line = decoder.next_out_of_line();
3886            let handles_before = decoder.remaining_handles();
3887            if let Some((inlined, num_bytes, num_handles)) =
3888                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3889            {
3890                let member_inline_size =
3891                    <RespondWith as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3892                if inlined != (member_inline_size <= 4) {
3893                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3894                }
3895                let inner_offset;
3896                let mut inner_depth = depth.clone();
3897                if inlined {
3898                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3899                    inner_offset = next_offset;
3900                } else {
3901                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3902                    inner_depth.increment()?;
3903                }
3904                let val_ref =
3905                    self.result_variant.get_or_insert_with(|| fidl::new_empty!(RespondWith, D));
3906                fidl::decode!(RespondWith, D, val_ref, decoder, inner_offset, inner_depth)?;
3907                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3908                {
3909                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3910                }
3911                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3912                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3913                }
3914            }
3915
3916            next_offset += envelope_size;
3917
3918            // Decode the remaining unknown envelopes.
3919            while next_offset < end_offset {
3920                _next_ordinal_to_read += 1;
3921                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3922                next_offset += envelope_size;
3923            }
3924
3925            Ok(())
3926        }
3927    }
3928
3929    impl RequestTable {
3930        #[inline(always)]
3931        fn max_ordinal_present(&self) -> u64 {
3932            if let Some(_) = self.forward_to_server {
3933                return 2;
3934            }
3935            if let Some(_) = self.value {
3936                return 1;
3937            }
3938            0
3939        }
3940    }
3941
3942    impl fidl::encoding::ValueTypeMarker for RequestTable {
3943        type Borrowed<'a> = &'a Self;
3944        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3945            value
3946        }
3947    }
3948
3949    unsafe impl fidl::encoding::TypeMarker for RequestTable {
3950        type Owned = Self;
3951
3952        #[inline(always)]
3953        fn inline_align(_context: fidl::encoding::Context) -> usize {
3954            8
3955        }
3956
3957        #[inline(always)]
3958        fn inline_size(_context: fidl::encoding::Context) -> usize {
3959            16
3960        }
3961    }
3962
3963    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RequestTable, D>
3964        for &RequestTable
3965    {
3966        unsafe fn encode(
3967            self,
3968            encoder: &mut fidl::encoding::Encoder<'_, D>,
3969            offset: usize,
3970            mut depth: fidl::encoding::Depth,
3971        ) -> fidl::Result<()> {
3972            encoder.debug_check_bounds::<RequestTable>(offset);
3973            // Vector header
3974            let max_ordinal: u64 = self.max_ordinal_present();
3975            encoder.write_num(max_ordinal, offset);
3976            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3977            // Calling encoder.out_of_line_offset(0) is not allowed.
3978            if max_ordinal == 0 {
3979                return Ok(());
3980            }
3981            depth.increment()?;
3982            let envelope_size = 8;
3983            let bytes_len = max_ordinal as usize * envelope_size;
3984            #[allow(unused_variables)]
3985            let offset = encoder.out_of_line_offset(bytes_len);
3986            let mut _prev_end_offset: usize = 0;
3987            if 1 > max_ordinal {
3988                return Ok(());
3989            }
3990
3991            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3992            // are envelope_size bytes.
3993            let cur_offset: usize = (1 - 1) * envelope_size;
3994
3995            // Zero reserved fields.
3996            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3997
3998            // Safety:
3999            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4000            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4001            //   envelope_size bytes, there is always sufficient room.
4002            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4003                self.value.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4004                encoder,
4005                offset + cur_offset,
4006                depth,
4007            )?;
4008
4009            _prev_end_offset = cur_offset + envelope_size;
4010            if 2 > max_ordinal {
4011                return Ok(());
4012            }
4013
4014            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4015            // are envelope_size bytes.
4016            let cur_offset: usize = (2 - 1) * envelope_size;
4017
4018            // Zero reserved fields.
4019            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4020
4021            // Safety:
4022            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4023            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4024            //   envelope_size bytes, there is always sufficient room.
4025            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4026                self.forward_to_server.as_ref().map(
4027                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4028                ),
4029                encoder,
4030                offset + cur_offset,
4031                depth,
4032            )?;
4033
4034            _prev_end_offset = cur_offset + envelope_size;
4035
4036            Ok(())
4037        }
4038    }
4039
4040    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RequestTable {
4041        #[inline(always)]
4042        fn new_empty() -> Self {
4043            Self::default()
4044        }
4045
4046        unsafe fn decode(
4047            &mut self,
4048            decoder: &mut fidl::encoding::Decoder<'_, D>,
4049            offset: usize,
4050            mut depth: fidl::encoding::Depth,
4051        ) -> fidl::Result<()> {
4052            decoder.debug_check_bounds::<Self>(offset);
4053            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4054                None => return Err(fidl::Error::NotNullable),
4055                Some(len) => len,
4056            };
4057            // Calling decoder.out_of_line_offset(0) is not allowed.
4058            if len == 0 {
4059                return Ok(());
4060            };
4061            depth.increment()?;
4062            let envelope_size = 8;
4063            let bytes_len = len * envelope_size;
4064            let offset = decoder.out_of_line_offset(bytes_len)?;
4065            // Decode the envelope for each type.
4066            let mut _next_ordinal_to_read = 0;
4067            let mut next_offset = offset;
4068            let end_offset = offset + bytes_len;
4069            _next_ordinal_to_read += 1;
4070            if next_offset >= end_offset {
4071                return Ok(());
4072            }
4073
4074            // Decode unknown envelopes for gaps in ordinals.
4075            while _next_ordinal_to_read < 1 {
4076                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4077                _next_ordinal_to_read += 1;
4078                next_offset += envelope_size;
4079            }
4080
4081            let next_out_of_line = decoder.next_out_of_line();
4082            let handles_before = decoder.remaining_handles();
4083            if let Some((inlined, num_bytes, num_handles)) =
4084                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4085            {
4086                let member_inline_size =
4087                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4088                if inlined != (member_inline_size <= 4) {
4089                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4090                }
4091                let inner_offset;
4092                let mut inner_depth = depth.clone();
4093                if inlined {
4094                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4095                    inner_offset = next_offset;
4096                } else {
4097                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4098                    inner_depth.increment()?;
4099                }
4100                let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(u64, D));
4101                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4102                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4103                {
4104                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4105                }
4106                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4107                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4108                }
4109            }
4110
4111            next_offset += envelope_size;
4112            _next_ordinal_to_read += 1;
4113            if next_offset >= end_offset {
4114                return Ok(());
4115            }
4116
4117            // Decode unknown envelopes for gaps in ordinals.
4118            while _next_ordinal_to_read < 2 {
4119                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4120                _next_ordinal_to_read += 1;
4121                next_offset += envelope_size;
4122            }
4123
4124            let next_out_of_line = decoder.next_out_of_line();
4125            let handles_before = decoder.remaining_handles();
4126            if let Some((inlined, num_bytes, num_handles)) =
4127                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4128            {
4129                let member_inline_size =
4130                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4131                        decoder.context,
4132                    );
4133                if inlined != (member_inline_size <= 4) {
4134                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4135                }
4136                let inner_offset;
4137                let mut inner_depth = depth.clone();
4138                if inlined {
4139                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4140                    inner_offset = next_offset;
4141                } else {
4142                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4143                    inner_depth.increment()?;
4144                }
4145                let val_ref = self
4146                    .forward_to_server
4147                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4148                fidl::decode!(
4149                    fidl::encoding::UnboundedString,
4150                    D,
4151                    val_ref,
4152                    decoder,
4153                    inner_offset,
4154                    inner_depth
4155                )?;
4156                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4157                {
4158                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4159                }
4160                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4161                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4162                }
4163            }
4164
4165            next_offset += envelope_size;
4166
4167            // Decode the remaining unknown envelopes.
4168            while next_offset < end_offset {
4169                _next_ordinal_to_read += 1;
4170                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4171                next_offset += envelope_size;
4172            }
4173
4174            Ok(())
4175        }
4176    }
4177
4178    impl ResponseTable {
4179        #[inline(always)]
4180        fn max_ordinal_present(&self) -> u64 {
4181            if let Some(_) = self.value {
4182                return 1;
4183            }
4184            0
4185        }
4186    }
4187
4188    impl fidl::encoding::ValueTypeMarker for ResponseTable {
4189        type Borrowed<'a> = &'a Self;
4190        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4191            value
4192        }
4193    }
4194
4195    unsafe impl fidl::encoding::TypeMarker for ResponseTable {
4196        type Owned = Self;
4197
4198        #[inline(always)]
4199        fn inline_align(_context: fidl::encoding::Context) -> usize {
4200            8
4201        }
4202
4203        #[inline(always)]
4204        fn inline_size(_context: fidl::encoding::Context) -> usize {
4205            16
4206        }
4207    }
4208
4209    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResponseTable, D>
4210        for &ResponseTable
4211    {
4212        unsafe fn encode(
4213            self,
4214            encoder: &mut fidl::encoding::Encoder<'_, D>,
4215            offset: usize,
4216            mut depth: fidl::encoding::Depth,
4217        ) -> fidl::Result<()> {
4218            encoder.debug_check_bounds::<ResponseTable>(offset);
4219            // Vector header
4220            let max_ordinal: u64 = self.max_ordinal_present();
4221            encoder.write_num(max_ordinal, offset);
4222            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4223            // Calling encoder.out_of_line_offset(0) is not allowed.
4224            if max_ordinal == 0 {
4225                return Ok(());
4226            }
4227            depth.increment()?;
4228            let envelope_size = 8;
4229            let bytes_len = max_ordinal as usize * envelope_size;
4230            #[allow(unused_variables)]
4231            let offset = encoder.out_of_line_offset(bytes_len);
4232            let mut _prev_end_offset: usize = 0;
4233            if 1 > max_ordinal {
4234                return Ok(());
4235            }
4236
4237            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4238            // are envelope_size bytes.
4239            let cur_offset: usize = (1 - 1) * envelope_size;
4240
4241            // Zero reserved fields.
4242            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4243
4244            // Safety:
4245            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4246            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4247            //   envelope_size bytes, there is always sufficient room.
4248            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4249                self.value.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4250                encoder,
4251                offset + cur_offset,
4252                depth,
4253            )?;
4254
4255            _prev_end_offset = cur_offset + envelope_size;
4256
4257            Ok(())
4258        }
4259    }
4260
4261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResponseTable {
4262        #[inline(always)]
4263        fn new_empty() -> Self {
4264            Self::default()
4265        }
4266
4267        unsafe fn decode(
4268            &mut self,
4269            decoder: &mut fidl::encoding::Decoder<'_, D>,
4270            offset: usize,
4271            mut depth: fidl::encoding::Depth,
4272        ) -> fidl::Result<()> {
4273            decoder.debug_check_bounds::<Self>(offset);
4274            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4275                None => return Err(fidl::Error::NotNullable),
4276                Some(len) => len,
4277            };
4278            // Calling decoder.out_of_line_offset(0) is not allowed.
4279            if len == 0 {
4280                return Ok(());
4281            };
4282            depth.increment()?;
4283            let envelope_size = 8;
4284            let bytes_len = len * envelope_size;
4285            let offset = decoder.out_of_line_offset(bytes_len)?;
4286            // Decode the envelope for each type.
4287            let mut _next_ordinal_to_read = 0;
4288            let mut next_offset = offset;
4289            let end_offset = offset + bytes_len;
4290            _next_ordinal_to_read += 1;
4291            if next_offset >= end_offset {
4292                return Ok(());
4293            }
4294
4295            // Decode unknown envelopes for gaps in ordinals.
4296            while _next_ordinal_to_read < 1 {
4297                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4298                _next_ordinal_to_read += 1;
4299                next_offset += envelope_size;
4300            }
4301
4302            let next_out_of_line = decoder.next_out_of_line();
4303            let handles_before = decoder.remaining_handles();
4304            if let Some((inlined, num_bytes, num_handles)) =
4305                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4306            {
4307                let member_inline_size =
4308                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4309                if inlined != (member_inline_size <= 4) {
4310                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4311                }
4312                let inner_offset;
4313                let mut inner_depth = depth.clone();
4314                if inlined {
4315                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4316                    inner_offset = next_offset;
4317                } else {
4318                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4319                    inner_depth.increment()?;
4320                }
4321                let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(u64, D));
4322                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4323                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4324                {
4325                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4326                }
4327                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4328                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4329                }
4330            }
4331
4332            next_offset += envelope_size;
4333
4334            // Decode the remaining unknown envelopes.
4335            while next_offset < end_offset {
4336                _next_ordinal_to_read += 1;
4337                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4338                next_offset += envelope_size;
4339            }
4340
4341            Ok(())
4342        }
4343    }
4344
4345    impl ThisIsATable {
4346        #[inline(always)]
4347        fn max_ordinal_present(&self) -> u64 {
4348            if let Some(_) = self.s {
4349                return 1;
4350            }
4351            0
4352        }
4353    }
4354
4355    impl fidl::encoding::ValueTypeMarker for ThisIsATable {
4356        type Borrowed<'a> = &'a Self;
4357        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4358            value
4359        }
4360    }
4361
4362    unsafe impl fidl::encoding::TypeMarker for ThisIsATable {
4363        type Owned = Self;
4364
4365        #[inline(always)]
4366        fn inline_align(_context: fidl::encoding::Context) -> usize {
4367            8
4368        }
4369
4370        #[inline(always)]
4371        fn inline_size(_context: fidl::encoding::Context) -> usize {
4372            16
4373        }
4374    }
4375
4376    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThisIsATable, D>
4377        for &ThisIsATable
4378    {
4379        unsafe fn encode(
4380            self,
4381            encoder: &mut fidl::encoding::Encoder<'_, D>,
4382            offset: usize,
4383            mut depth: fidl::encoding::Depth,
4384        ) -> fidl::Result<()> {
4385            encoder.debug_check_bounds::<ThisIsATable>(offset);
4386            // Vector header
4387            let max_ordinal: u64 = self.max_ordinal_present();
4388            encoder.write_num(max_ordinal, offset);
4389            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4390            // Calling encoder.out_of_line_offset(0) is not allowed.
4391            if max_ordinal == 0 {
4392                return Ok(());
4393            }
4394            depth.increment()?;
4395            let envelope_size = 8;
4396            let bytes_len = max_ordinal as usize * envelope_size;
4397            #[allow(unused_variables)]
4398            let offset = encoder.out_of_line_offset(bytes_len);
4399            let mut _prev_end_offset: usize = 0;
4400            if 1 > max_ordinal {
4401                return Ok(());
4402            }
4403
4404            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4405            // are envelope_size bytes.
4406            let cur_offset: usize = (1 - 1) * envelope_size;
4407
4408            // Zero reserved fields.
4409            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4410
4411            // Safety:
4412            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4413            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4414            //   envelope_size bytes, there is always sufficient room.
4415            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4416                self.s.as_ref().map(
4417                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4418                ),
4419                encoder,
4420                offset + cur_offset,
4421                depth,
4422            )?;
4423
4424            _prev_end_offset = cur_offset + envelope_size;
4425
4426            Ok(())
4427        }
4428    }
4429
4430    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThisIsATable {
4431        #[inline(always)]
4432        fn new_empty() -> Self {
4433            Self::default()
4434        }
4435
4436        unsafe fn decode(
4437            &mut self,
4438            decoder: &mut fidl::encoding::Decoder<'_, D>,
4439            offset: usize,
4440            mut depth: fidl::encoding::Depth,
4441        ) -> fidl::Result<()> {
4442            decoder.debug_check_bounds::<Self>(offset);
4443            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4444                None => return Err(fidl::Error::NotNullable),
4445                Some(len) => len,
4446            };
4447            // Calling decoder.out_of_line_offset(0) is not allowed.
4448            if len == 0 {
4449                return Ok(());
4450            };
4451            depth.increment()?;
4452            let envelope_size = 8;
4453            let bytes_len = len * envelope_size;
4454            let offset = decoder.out_of_line_offset(bytes_len)?;
4455            // Decode the envelope for each type.
4456            let mut _next_ordinal_to_read = 0;
4457            let mut next_offset = offset;
4458            let end_offset = offset + bytes_len;
4459            _next_ordinal_to_read += 1;
4460            if next_offset >= end_offset {
4461                return Ok(());
4462            }
4463
4464            // Decode unknown envelopes for gaps in ordinals.
4465            while _next_ordinal_to_read < 1 {
4466                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4467                _next_ordinal_to_read += 1;
4468                next_offset += envelope_size;
4469            }
4470
4471            let next_out_of_line = decoder.next_out_of_line();
4472            let handles_before = decoder.remaining_handles();
4473            if let Some((inlined, num_bytes, num_handles)) =
4474                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4475            {
4476                let member_inline_size =
4477                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4478                        decoder.context,
4479                    );
4480                if inlined != (member_inline_size <= 4) {
4481                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4482                }
4483                let inner_offset;
4484                let mut inner_depth = depth.clone();
4485                if inlined {
4486                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4487                    inner_offset = next_offset;
4488                } else {
4489                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4490                    inner_depth.increment()?;
4491                }
4492                let val_ref = self
4493                    .s
4494                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4495                fidl::decode!(
4496                    fidl::encoding::UnboundedString,
4497                    D,
4498                    val_ref,
4499                    decoder,
4500                    inner_offset,
4501                    inner_depth
4502                )?;
4503                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4504                {
4505                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4506                }
4507                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4508                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4509                }
4510            }
4511
4512            next_offset += envelope_size;
4513
4514            // Decode the remaining unknown envelopes.
4515            while next_offset < end_offset {
4516                _next_ordinal_to_read += 1;
4517                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4518                next_offset += envelope_size;
4519            }
4520
4521            Ok(())
4522        }
4523    }
4524
4525    impl fidl::encoding::ValueTypeMarker for EchoEchoUnionPayloadWithErrorRequest {
4526        type Borrowed<'a> = &'a Self;
4527        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4528            value
4529        }
4530    }
4531
4532    unsafe impl fidl::encoding::TypeMarker for EchoEchoUnionPayloadWithErrorRequest {
4533        type Owned = Self;
4534
4535        #[inline(always)]
4536        fn inline_align(_context: fidl::encoding::Context) -> usize {
4537            8
4538        }
4539
4540        #[inline(always)]
4541        fn inline_size(_context: fidl::encoding::Context) -> usize {
4542            16
4543        }
4544    }
4545
4546    unsafe impl<D: fidl::encoding::ResourceDialect>
4547        fidl::encoding::Encode<EchoEchoUnionPayloadWithErrorRequest, D>
4548        for &EchoEchoUnionPayloadWithErrorRequest
4549    {
4550        #[inline]
4551        unsafe fn encode(
4552            self,
4553            encoder: &mut fidl::encoding::Encoder<'_, D>,
4554            offset: usize,
4555            _depth: fidl::encoding::Depth,
4556        ) -> fidl::Result<()> {
4557            encoder.debug_check_bounds::<EchoEchoUnionPayloadWithErrorRequest>(offset);
4558            encoder.write_num::<u64>(self.ordinal(), offset);
4559            match self {
4560                EchoEchoUnionPayloadWithErrorRequest::Unsigned(ref val) => {
4561                    fidl::encoding::encode_in_envelope::<UnsignedErrorable, D>(
4562                        <UnsignedErrorable as fidl::encoding::ValueTypeMarker>::borrow(val),
4563                        encoder,
4564                        offset + 8,
4565                        _depth,
4566                    )
4567                }
4568                EchoEchoUnionPayloadWithErrorRequest::Signed(ref val) => {
4569                    fidl::encoding::encode_in_envelope::<SignedErrorable, D>(
4570                        <SignedErrorable as fidl::encoding::ValueTypeMarker>::borrow(val),
4571                        encoder,
4572                        offset + 8,
4573                        _depth,
4574                    )
4575                }
4576                EchoEchoUnionPayloadWithErrorRequest::__SourceBreaking { .. } => {
4577                    Err(fidl::Error::UnknownUnionTag)
4578                }
4579            }
4580        }
4581    }
4582
4583    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4584        for EchoEchoUnionPayloadWithErrorRequest
4585    {
4586        #[inline(always)]
4587        fn new_empty() -> Self {
4588            Self::__SourceBreaking { unknown_ordinal: 0 }
4589        }
4590
4591        #[inline]
4592        unsafe fn decode(
4593            &mut self,
4594            decoder: &mut fidl::encoding::Decoder<'_, D>,
4595            offset: usize,
4596            mut depth: fidl::encoding::Depth,
4597        ) -> fidl::Result<()> {
4598            decoder.debug_check_bounds::<Self>(offset);
4599            #[allow(unused_variables)]
4600            let next_out_of_line = decoder.next_out_of_line();
4601            let handles_before = decoder.remaining_handles();
4602            let (ordinal, inlined, num_bytes, num_handles) =
4603                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4604
4605            let member_inline_size = match ordinal {
4606                1 => {
4607                    <UnsignedErrorable as fidl::encoding::TypeMarker>::inline_size(decoder.context)
4608                }
4609                2 => <SignedErrorable as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4610                0 => return Err(fidl::Error::UnknownUnionTag),
4611                _ => num_bytes as usize,
4612            };
4613
4614            if inlined != (member_inline_size <= 4) {
4615                return Err(fidl::Error::InvalidInlineBitInEnvelope);
4616            }
4617            let _inner_offset;
4618            if inlined {
4619                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4620                _inner_offset = offset + 8;
4621            } else {
4622                depth.increment()?;
4623                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4624            }
4625            match ordinal {
4626                1 => {
4627                    #[allow(irrefutable_let_patterns)]
4628                    if let EchoEchoUnionPayloadWithErrorRequest::Unsigned(_) = self {
4629                        // Do nothing, read the value into the object
4630                    } else {
4631                        // Initialize `self` to the right variant
4632                        *self = EchoEchoUnionPayloadWithErrorRequest::Unsigned(fidl::new_empty!(
4633                            UnsignedErrorable,
4634                            D
4635                        ));
4636                    }
4637                    #[allow(irrefutable_let_patterns)]
4638                    if let EchoEchoUnionPayloadWithErrorRequest::Unsigned(ref mut val) = self {
4639                        fidl::decode!(UnsignedErrorable, D, val, decoder, _inner_offset, depth)?;
4640                    } else {
4641                        unreachable!()
4642                    }
4643                }
4644                2 => {
4645                    #[allow(irrefutable_let_patterns)]
4646                    if let EchoEchoUnionPayloadWithErrorRequest::Signed(_) = self {
4647                        // Do nothing, read the value into the object
4648                    } else {
4649                        // Initialize `self` to the right variant
4650                        *self = EchoEchoUnionPayloadWithErrorRequest::Signed(fidl::new_empty!(
4651                            SignedErrorable,
4652                            D
4653                        ));
4654                    }
4655                    #[allow(irrefutable_let_patterns)]
4656                    if let EchoEchoUnionPayloadWithErrorRequest::Signed(ref mut val) = self {
4657                        fidl::decode!(SignedErrorable, D, val, decoder, _inner_offset, depth)?;
4658                    } else {
4659                        unreachable!()
4660                    }
4661                }
4662                #[allow(deprecated)]
4663                ordinal => {
4664                    for _ in 0..num_handles {
4665                        decoder.drop_next_handle()?;
4666                    }
4667                    *self = EchoEchoUnionPayloadWithErrorRequest::__SourceBreaking {
4668                        unknown_ordinal: ordinal,
4669                    };
4670                }
4671            }
4672            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4673                return Err(fidl::Error::InvalidNumBytesInEnvelope);
4674            }
4675            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4676                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4677            }
4678            Ok(())
4679        }
4680    }
4681
4682    impl fidl::encoding::ValueTypeMarker for RequestUnion {
4683        type Borrowed<'a> = &'a Self;
4684        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4685            value
4686        }
4687    }
4688
4689    unsafe impl fidl::encoding::TypeMarker for RequestUnion {
4690        type Owned = Self;
4691
4692        #[inline(always)]
4693        fn inline_align(_context: fidl::encoding::Context) -> usize {
4694            8
4695        }
4696
4697        #[inline(always)]
4698        fn inline_size(_context: fidl::encoding::Context) -> usize {
4699            16
4700        }
4701    }
4702
4703    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RequestUnion, D>
4704        for &RequestUnion
4705    {
4706        #[inline]
4707        unsafe fn encode(
4708            self,
4709            encoder: &mut fidl::encoding::Encoder<'_, D>,
4710            offset: usize,
4711            _depth: fidl::encoding::Depth,
4712        ) -> fidl::Result<()> {
4713            encoder.debug_check_bounds::<RequestUnion>(offset);
4714            encoder.write_num::<u64>(self.ordinal(), offset);
4715            match self {
4716                RequestUnion::Unsigned(ref val) => {
4717                    fidl::encoding::encode_in_envelope::<Unsigned, D>(
4718                        <Unsigned as fidl::encoding::ValueTypeMarker>::borrow(val),
4719                        encoder,
4720                        offset + 8,
4721                        _depth,
4722                    )
4723                }
4724                RequestUnion::Signed(ref val) => fidl::encoding::encode_in_envelope::<Signed, D>(
4725                    <Signed as fidl::encoding::ValueTypeMarker>::borrow(val),
4726                    encoder,
4727                    offset + 8,
4728                    _depth,
4729                ),
4730                RequestUnion::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4731            }
4732        }
4733    }
4734
4735    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RequestUnion {
4736        #[inline(always)]
4737        fn new_empty() -> Self {
4738            Self::__SourceBreaking { unknown_ordinal: 0 }
4739        }
4740
4741        #[inline]
4742        unsafe fn decode(
4743            &mut self,
4744            decoder: &mut fidl::encoding::Decoder<'_, D>,
4745            offset: usize,
4746            mut depth: fidl::encoding::Depth,
4747        ) -> fidl::Result<()> {
4748            decoder.debug_check_bounds::<Self>(offset);
4749            #[allow(unused_variables)]
4750            let next_out_of_line = decoder.next_out_of_line();
4751            let handles_before = decoder.remaining_handles();
4752            let (ordinal, inlined, num_bytes, num_handles) =
4753                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4754
4755            let member_inline_size = match ordinal {
4756                1 => <Unsigned as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4757                2 => <Signed as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4758                0 => return Err(fidl::Error::UnknownUnionTag),
4759                _ => num_bytes as usize,
4760            };
4761
4762            if inlined != (member_inline_size <= 4) {
4763                return Err(fidl::Error::InvalidInlineBitInEnvelope);
4764            }
4765            let _inner_offset;
4766            if inlined {
4767                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4768                _inner_offset = offset + 8;
4769            } else {
4770                depth.increment()?;
4771                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4772            }
4773            match ordinal {
4774                1 => {
4775                    #[allow(irrefutable_let_patterns)]
4776                    if let RequestUnion::Unsigned(_) = self {
4777                        // Do nothing, read the value into the object
4778                    } else {
4779                        // Initialize `self` to the right variant
4780                        *self = RequestUnion::Unsigned(fidl::new_empty!(Unsigned, D));
4781                    }
4782                    #[allow(irrefutable_let_patterns)]
4783                    if let RequestUnion::Unsigned(ref mut val) = self {
4784                        fidl::decode!(Unsigned, D, val, decoder, _inner_offset, depth)?;
4785                    } else {
4786                        unreachable!()
4787                    }
4788                }
4789                2 => {
4790                    #[allow(irrefutable_let_patterns)]
4791                    if let RequestUnion::Signed(_) = self {
4792                        // Do nothing, read the value into the object
4793                    } else {
4794                        // Initialize `self` to the right variant
4795                        *self = RequestUnion::Signed(fidl::new_empty!(Signed, D));
4796                    }
4797                    #[allow(irrefutable_let_patterns)]
4798                    if let RequestUnion::Signed(ref mut val) = self {
4799                        fidl::decode!(Signed, D, val, decoder, _inner_offset, depth)?;
4800                    } else {
4801                        unreachable!()
4802                    }
4803                }
4804                #[allow(deprecated)]
4805                ordinal => {
4806                    for _ in 0..num_handles {
4807                        decoder.drop_next_handle()?;
4808                    }
4809                    *self = RequestUnion::__SourceBreaking { unknown_ordinal: ordinal };
4810                }
4811            }
4812            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4813                return Err(fidl::Error::InvalidNumBytesInEnvelope);
4814            }
4815            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4816                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4817            }
4818            Ok(())
4819        }
4820    }
4821
4822    impl fidl::encoding::ValueTypeMarker for ResponseUnion {
4823        type Borrowed<'a> = &'a Self;
4824        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4825            value
4826        }
4827    }
4828
4829    unsafe impl fidl::encoding::TypeMarker for ResponseUnion {
4830        type Owned = Self;
4831
4832        #[inline(always)]
4833        fn inline_align(_context: fidl::encoding::Context) -> usize {
4834            8
4835        }
4836
4837        #[inline(always)]
4838        fn inline_size(_context: fidl::encoding::Context) -> usize {
4839            16
4840        }
4841    }
4842
4843    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResponseUnion, D>
4844        for &ResponseUnion
4845    {
4846        #[inline]
4847        unsafe fn encode(
4848            self,
4849            encoder: &mut fidl::encoding::Encoder<'_, D>,
4850            offset: usize,
4851            _depth: fidl::encoding::Depth,
4852        ) -> fidl::Result<()> {
4853            encoder.debug_check_bounds::<ResponseUnion>(offset);
4854            encoder.write_num::<u64>(self.ordinal(), offset);
4855            match self {
4856                ResponseUnion::Unsigned(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
4857                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
4858                    encoder,
4859                    offset + 8,
4860                    _depth,
4861                ),
4862                ResponseUnion::Signed(ref val) => fidl::encoding::encode_in_envelope::<i64, D>(
4863                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
4864                    encoder,
4865                    offset + 8,
4866                    _depth,
4867                ),
4868            }
4869        }
4870    }
4871
4872    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResponseUnion {
4873        #[inline(always)]
4874        fn new_empty() -> Self {
4875            Self::Unsigned(fidl::new_empty!(u64, D))
4876        }
4877
4878        #[inline]
4879        unsafe fn decode(
4880            &mut self,
4881            decoder: &mut fidl::encoding::Decoder<'_, D>,
4882            offset: usize,
4883            mut depth: fidl::encoding::Depth,
4884        ) -> fidl::Result<()> {
4885            decoder.debug_check_bounds::<Self>(offset);
4886            #[allow(unused_variables)]
4887            let next_out_of_line = decoder.next_out_of_line();
4888            let handles_before = decoder.remaining_handles();
4889            let (ordinal, inlined, num_bytes, num_handles) =
4890                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4891
4892            let member_inline_size = match ordinal {
4893                1 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4894                2 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4895                _ => return Err(fidl::Error::UnknownUnionTag),
4896            };
4897
4898            if inlined != (member_inline_size <= 4) {
4899                return Err(fidl::Error::InvalidInlineBitInEnvelope);
4900            }
4901            let _inner_offset;
4902            if inlined {
4903                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4904                _inner_offset = offset + 8;
4905            } else {
4906                depth.increment()?;
4907                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4908            }
4909            match ordinal {
4910                1 => {
4911                    #[allow(irrefutable_let_patterns)]
4912                    if let ResponseUnion::Unsigned(_) = self {
4913                        // Do nothing, read the value into the object
4914                    } else {
4915                        // Initialize `self` to the right variant
4916                        *self = ResponseUnion::Unsigned(fidl::new_empty!(u64, D));
4917                    }
4918                    #[allow(irrefutable_let_patterns)]
4919                    if let ResponseUnion::Unsigned(ref mut val) = self {
4920                        fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
4921                    } else {
4922                        unreachable!()
4923                    }
4924                }
4925                2 => {
4926                    #[allow(irrefutable_let_patterns)]
4927                    if let ResponseUnion::Signed(_) = self {
4928                        // Do nothing, read the value into the object
4929                    } else {
4930                        // Initialize `self` to the right variant
4931                        *self = ResponseUnion::Signed(fidl::new_empty!(i64, D));
4932                    }
4933                    #[allow(irrefutable_let_patterns)]
4934                    if let ResponseUnion::Signed(ref mut val) = self {
4935                        fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
4936                    } else {
4937                        unreachable!()
4938                    }
4939                }
4940                ordinal => panic!("unexpected ordinal {:?}", ordinal),
4941            }
4942            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4943                return Err(fidl::Error::InvalidNumBytesInEnvelope);
4944            }
4945            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4946                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4947            }
4948            Ok(())
4949        }
4950    }
4951
4952    impl fidl::encoding::ValueTypeMarker for ThisIsAUnion {
4953        type Borrowed<'a> = &'a Self;
4954        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4955            value
4956        }
4957    }
4958
4959    unsafe impl fidl::encoding::TypeMarker for ThisIsAUnion {
4960        type Owned = Self;
4961
4962        #[inline(always)]
4963        fn inline_align(_context: fidl::encoding::Context) -> usize {
4964            8
4965        }
4966
4967        #[inline(always)]
4968        fn inline_size(_context: fidl::encoding::Context) -> usize {
4969            16
4970        }
4971    }
4972
4973    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThisIsAUnion, D>
4974        for &ThisIsAUnion
4975    {
4976        #[inline]
4977        unsafe fn encode(
4978            self,
4979            encoder: &mut fidl::encoding::Encoder<'_, D>,
4980            offset: usize,
4981            _depth: fidl::encoding::Depth,
4982        ) -> fidl::Result<()> {
4983            encoder.debug_check_bounds::<ThisIsAUnion>(offset);
4984            encoder.write_num::<u64>(self.ordinal(), offset);
4985            match self {
4986                ThisIsAUnion::S(ref val) => fidl::encoding::encode_in_envelope::<
4987                    fidl::encoding::UnboundedString,
4988                    D,
4989                >(
4990                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
4991                        val,
4992                    ),
4993                    encoder,
4994                    offset + 8,
4995                    _depth,
4996                ),
4997                ThisIsAUnion::B(ref val) => fidl::encoding::encode_in_envelope::<bool, D>(
4998                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
4999                    encoder,
5000                    offset + 8,
5001                    _depth,
5002                ),
5003            }
5004        }
5005    }
5006
5007    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThisIsAUnion {
5008        #[inline(always)]
5009        fn new_empty() -> Self {
5010            Self::S(fidl::new_empty!(fidl::encoding::UnboundedString, D))
5011        }
5012
5013        #[inline]
5014        unsafe fn decode(
5015            &mut self,
5016            decoder: &mut fidl::encoding::Decoder<'_, D>,
5017            offset: usize,
5018            mut depth: fidl::encoding::Depth,
5019        ) -> fidl::Result<()> {
5020            decoder.debug_check_bounds::<Self>(offset);
5021            #[allow(unused_variables)]
5022            let next_out_of_line = decoder.next_out_of_line();
5023            let handles_before = decoder.remaining_handles();
5024            let (ordinal, inlined, num_bytes, num_handles) =
5025                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5026
5027            let member_inline_size = match ordinal {
5028                1 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
5029                    decoder.context,
5030                ),
5031                2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5032                _ => return Err(fidl::Error::UnknownUnionTag),
5033            };
5034
5035            if inlined != (member_inline_size <= 4) {
5036                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5037            }
5038            let _inner_offset;
5039            if inlined {
5040                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5041                _inner_offset = offset + 8;
5042            } else {
5043                depth.increment()?;
5044                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5045            }
5046            match ordinal {
5047                1 => {
5048                    #[allow(irrefutable_let_patterns)]
5049                    if let ThisIsAUnion::S(_) = self {
5050                        // Do nothing, read the value into the object
5051                    } else {
5052                        // Initialize `self` to the right variant
5053                        *self =
5054                            ThisIsAUnion::S(fidl::new_empty!(fidl::encoding::UnboundedString, D));
5055                    }
5056                    #[allow(irrefutable_let_patterns)]
5057                    if let ThisIsAUnion::S(ref mut val) = self {
5058                        fidl::decode!(
5059                            fidl::encoding::UnboundedString,
5060                            D,
5061                            val,
5062                            decoder,
5063                            _inner_offset,
5064                            depth
5065                        )?;
5066                    } else {
5067                        unreachable!()
5068                    }
5069                }
5070                2 => {
5071                    #[allow(irrefutable_let_patterns)]
5072                    if let ThisIsAUnion::B(_) = self {
5073                        // Do nothing, read the value into the object
5074                    } else {
5075                        // Initialize `self` to the right variant
5076                        *self = ThisIsAUnion::B(fidl::new_empty!(bool, D));
5077                    }
5078                    #[allow(irrefutable_let_patterns)]
5079                    if let ThisIsAUnion::B(ref mut val) = self {
5080                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
5081                    } else {
5082                        unreachable!()
5083                    }
5084                }
5085                ordinal => panic!("unexpected ordinal {:?}", ordinal),
5086            }
5087            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5088                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5089            }
5090            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5091                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5092            }
5093            Ok(())
5094        }
5095    }
5096
5097    impl fidl::encoding::ValueTypeMarker for ThisIsAXunion {
5098        type Borrowed<'a> = &'a Self;
5099        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5100            value
5101        }
5102    }
5103
5104    unsafe impl fidl::encoding::TypeMarker for ThisIsAXunion {
5105        type Owned = Self;
5106
5107        #[inline(always)]
5108        fn inline_align(_context: fidl::encoding::Context) -> usize {
5109            8
5110        }
5111
5112        #[inline(always)]
5113        fn inline_size(_context: fidl::encoding::Context) -> usize {
5114            16
5115        }
5116    }
5117
5118    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThisIsAXunion, D>
5119        for &ThisIsAXunion
5120    {
5121        #[inline]
5122        unsafe fn encode(
5123            self,
5124            encoder: &mut fidl::encoding::Encoder<'_, D>,
5125            offset: usize,
5126            _depth: fidl::encoding::Depth,
5127        ) -> fidl::Result<()> {
5128            encoder.debug_check_bounds::<ThisIsAXunion>(offset);
5129            encoder.write_num::<u64>(self.ordinal(), offset);
5130            match self {
5131                ThisIsAXunion::S(ref val) => fidl::encoding::encode_in_envelope::<
5132                    fidl::encoding::UnboundedString,
5133                    D,
5134                >(
5135                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
5136                        val,
5137                    ),
5138                    encoder,
5139                    offset + 8,
5140                    _depth,
5141                ),
5142                ThisIsAXunion::B(ref val) => fidl::encoding::encode_in_envelope::<bool, D>(
5143                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
5144                    encoder,
5145                    offset + 8,
5146                    _depth,
5147                ),
5148                ThisIsAXunion::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5149            }
5150        }
5151    }
5152
5153    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThisIsAXunion {
5154        #[inline(always)]
5155        fn new_empty() -> Self {
5156            Self::__SourceBreaking { unknown_ordinal: 0 }
5157        }
5158
5159        #[inline]
5160        unsafe fn decode(
5161            &mut self,
5162            decoder: &mut fidl::encoding::Decoder<'_, D>,
5163            offset: usize,
5164            mut depth: fidl::encoding::Depth,
5165        ) -> fidl::Result<()> {
5166            decoder.debug_check_bounds::<Self>(offset);
5167            #[allow(unused_variables)]
5168            let next_out_of_line = decoder.next_out_of_line();
5169            let handles_before = decoder.remaining_handles();
5170            let (ordinal, inlined, num_bytes, num_handles) =
5171                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5172
5173            let member_inline_size = match ordinal {
5174                1 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
5175                    decoder.context,
5176                ),
5177                2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5178                0 => return Err(fidl::Error::UnknownUnionTag),
5179                _ => num_bytes as usize,
5180            };
5181
5182            if inlined != (member_inline_size <= 4) {
5183                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5184            }
5185            let _inner_offset;
5186            if inlined {
5187                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5188                _inner_offset = offset + 8;
5189            } else {
5190                depth.increment()?;
5191                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5192            }
5193            match ordinal {
5194                1 => {
5195                    #[allow(irrefutable_let_patterns)]
5196                    if let ThisIsAXunion::S(_) = self {
5197                        // Do nothing, read the value into the object
5198                    } else {
5199                        // Initialize `self` to the right variant
5200                        *self =
5201                            ThisIsAXunion::S(fidl::new_empty!(fidl::encoding::UnboundedString, D));
5202                    }
5203                    #[allow(irrefutable_let_patterns)]
5204                    if let ThisIsAXunion::S(ref mut val) = self {
5205                        fidl::decode!(
5206                            fidl::encoding::UnboundedString,
5207                            D,
5208                            val,
5209                            decoder,
5210                            _inner_offset,
5211                            depth
5212                        )?;
5213                    } else {
5214                        unreachable!()
5215                    }
5216                }
5217                2 => {
5218                    #[allow(irrefutable_let_patterns)]
5219                    if let ThisIsAXunion::B(_) = self {
5220                        // Do nothing, read the value into the object
5221                    } else {
5222                        // Initialize `self` to the right variant
5223                        *self = ThisIsAXunion::B(fidl::new_empty!(bool, D));
5224                    }
5225                    #[allow(irrefutable_let_patterns)]
5226                    if let ThisIsAXunion::B(ref mut val) = self {
5227                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
5228                    } else {
5229                        unreachable!()
5230                    }
5231                }
5232                #[allow(deprecated)]
5233                ordinal => {
5234                    for _ in 0..num_handles {
5235                        decoder.drop_next_handle()?;
5236                    }
5237                    *self = ThisIsAXunion::__SourceBreaking { unknown_ordinal: ordinal };
5238                }
5239            }
5240            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5241                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5242            }
5243            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5244                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5245            }
5246            Ok(())
5247        }
5248    }
5249}