fidl_fuchsia_fdomain__common/
fidl_fuchsia_fdomain__common.rs

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