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