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