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<
3914        D: fidl::encoding::ResourceDialect,
3915        T0: fidl::encoding::Encode<SocketDisposition, D>,
3916    > fidl::encoding::Encode<SocketDispositionUnknown, D> for (T0,)
3917    {
3918        #[inline]
3919        unsafe fn encode(
3920            self,
3921            encoder: &mut fidl::encoding::Encoder<'_, D>,
3922            offset: usize,
3923            depth: fidl::encoding::Depth,
3924        ) -> fidl::Result<()> {
3925            encoder.debug_check_bounds::<SocketDispositionUnknown>(offset);
3926            // Zero out padding regions. There's no need to apply masks
3927            // because the unmasked parts will be overwritten by fields.
3928            // Write the fields.
3929            self.0.encode(encoder, offset + 0, depth)?;
3930            Ok(())
3931        }
3932    }
3933
3934    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3935        for SocketDispositionUnknown
3936    {
3937        #[inline(always)]
3938        fn new_empty() -> Self {
3939            Self { disposition: fidl::new_empty!(SocketDisposition, D) }
3940        }
3941
3942        #[inline]
3943        unsafe fn decode(
3944            &mut self,
3945            decoder: &mut fidl::encoding::Decoder<'_, D>,
3946            offset: usize,
3947            _depth: fidl::encoding::Depth,
3948        ) -> fidl::Result<()> {
3949            decoder.debug_check_bounds::<Self>(offset);
3950            // Verify that padding bytes are zero.
3951            fidl::decode!(
3952                SocketDisposition,
3953                D,
3954                &mut self.disposition,
3955                decoder,
3956                offset + 0,
3957                _depth
3958            )?;
3959            Ok(())
3960        }
3961    }
3962
3963    impl fidl::encoding::ValueTypeMarker for SocketOnSocketStreamingDataRequest {
3964        type Borrowed<'a> = &'a Self;
3965        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3966            value
3967        }
3968    }
3969
3970    unsafe impl fidl::encoding::TypeMarker for SocketOnSocketStreamingDataRequest {
3971        type Owned = Self;
3972
3973        #[inline(always)]
3974        fn inline_align(_context: fidl::encoding::Context) -> usize {
3975            8
3976        }
3977
3978        #[inline(always)]
3979        fn inline_size(_context: fidl::encoding::Context) -> usize {
3980            24
3981        }
3982    }
3983
3984    unsafe impl<D: fidl::encoding::ResourceDialect>
3985        fidl::encoding::Encode<SocketOnSocketStreamingDataRequest, D>
3986        for &SocketOnSocketStreamingDataRequest
3987    {
3988        #[inline]
3989        unsafe fn encode(
3990            self,
3991            encoder: &mut fidl::encoding::Encoder<'_, D>,
3992            offset: usize,
3993            _depth: fidl::encoding::Depth,
3994        ) -> fidl::Result<()> {
3995            encoder.debug_check_bounds::<SocketOnSocketStreamingDataRequest>(offset);
3996            // Delegate to tuple encoding.
3997            fidl::encoding::Encode::<SocketOnSocketStreamingDataRequest, D>::encode(
3998                (
3999                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4000                    <SocketMessage as fidl::encoding::ValueTypeMarker>::borrow(
4001                        &self.socket_message,
4002                    ),
4003                ),
4004                encoder,
4005                offset,
4006                _depth,
4007            )
4008        }
4009    }
4010    unsafe impl<
4011        D: fidl::encoding::ResourceDialect,
4012        T0: fidl::encoding::Encode<HandleId, D>,
4013        T1: fidl::encoding::Encode<SocketMessage, D>,
4014    > fidl::encoding::Encode<SocketOnSocketStreamingDataRequest, D> for (T0, T1)
4015    {
4016        #[inline]
4017        unsafe fn encode(
4018            self,
4019            encoder: &mut fidl::encoding::Encoder<'_, D>,
4020            offset: usize,
4021            depth: fidl::encoding::Depth,
4022        ) -> fidl::Result<()> {
4023            encoder.debug_check_bounds::<SocketOnSocketStreamingDataRequest>(offset);
4024            // Zero out padding regions. There's no need to apply masks
4025            // because the unmasked parts will be overwritten by fields.
4026            unsafe {
4027                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4028                (ptr as *mut u64).write_unaligned(0);
4029            }
4030            // Write the fields.
4031            self.0.encode(encoder, offset + 0, depth)?;
4032            self.1.encode(encoder, offset + 8, depth)?;
4033            Ok(())
4034        }
4035    }
4036
4037    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4038        for SocketOnSocketStreamingDataRequest
4039    {
4040        #[inline(always)]
4041        fn new_empty() -> Self {
4042            Self {
4043                handle: fidl::new_empty!(HandleId, D),
4044                socket_message: fidl::new_empty!(SocketMessage, D),
4045            }
4046        }
4047
4048        #[inline]
4049        unsafe fn decode(
4050            &mut self,
4051            decoder: &mut fidl::encoding::Decoder<'_, D>,
4052            offset: usize,
4053            _depth: fidl::encoding::Depth,
4054        ) -> fidl::Result<()> {
4055            decoder.debug_check_bounds::<Self>(offset);
4056            // Verify that padding bytes are zero.
4057            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4058            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4059            let mask = 0xffffffff00000000u64;
4060            let maskedval = padval & mask;
4061            if maskedval != 0 {
4062                return Err(fidl::Error::NonZeroPadding {
4063                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4064                });
4065            }
4066            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4067            fidl::decode!(SocketMessage, D, &mut self.socket_message, decoder, offset + 8, _depth)?;
4068            Ok(())
4069        }
4070    }
4071
4072    impl fidl::encoding::ValueTypeMarker for SocketReadSocketRequest {
4073        type Borrowed<'a> = &'a Self;
4074        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4075            value
4076        }
4077    }
4078
4079    unsafe impl fidl::encoding::TypeMarker for SocketReadSocketRequest {
4080        type Owned = Self;
4081
4082        #[inline(always)]
4083        fn inline_align(_context: fidl::encoding::Context) -> usize {
4084            8
4085        }
4086
4087        #[inline(always)]
4088        fn inline_size(_context: fidl::encoding::Context) -> usize {
4089            16
4090        }
4091    }
4092
4093    unsafe impl<D: fidl::encoding::ResourceDialect>
4094        fidl::encoding::Encode<SocketReadSocketRequest, D> for &SocketReadSocketRequest
4095    {
4096        #[inline]
4097        unsafe fn encode(
4098            self,
4099            encoder: &mut fidl::encoding::Encoder<'_, D>,
4100            offset: usize,
4101            _depth: fidl::encoding::Depth,
4102        ) -> fidl::Result<()> {
4103            encoder.debug_check_bounds::<SocketReadSocketRequest>(offset);
4104            unsafe {
4105                // Copy the object into the buffer.
4106                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4107                (buf_ptr as *mut SocketReadSocketRequest)
4108                    .write_unaligned((self as *const SocketReadSocketRequest).read());
4109                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4110                // done second because the memcpy will write garbage to these bytes.
4111                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4112                let padding_mask = 0xffffffff00000000u64;
4113                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4114            }
4115            Ok(())
4116        }
4117    }
4118    unsafe impl<
4119        D: fidl::encoding::ResourceDialect,
4120        T0: fidl::encoding::Encode<HandleId, D>,
4121        T1: fidl::encoding::Encode<u64, D>,
4122    > fidl::encoding::Encode<SocketReadSocketRequest, D> for (T0, T1)
4123    {
4124        #[inline]
4125        unsafe fn encode(
4126            self,
4127            encoder: &mut fidl::encoding::Encoder<'_, D>,
4128            offset: usize,
4129            depth: fidl::encoding::Depth,
4130        ) -> fidl::Result<()> {
4131            encoder.debug_check_bounds::<SocketReadSocketRequest>(offset);
4132            // Zero out padding regions. There's no need to apply masks
4133            // because the unmasked parts will be overwritten by fields.
4134            unsafe {
4135                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4136                (ptr as *mut u64).write_unaligned(0);
4137            }
4138            // Write the fields.
4139            self.0.encode(encoder, offset + 0, depth)?;
4140            self.1.encode(encoder, offset + 8, depth)?;
4141            Ok(())
4142        }
4143    }
4144
4145    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4146        for SocketReadSocketRequest
4147    {
4148        #[inline(always)]
4149        fn new_empty() -> Self {
4150            Self { handle: fidl::new_empty!(HandleId, D), max_bytes: fidl::new_empty!(u64, D) }
4151        }
4152
4153        #[inline]
4154        unsafe fn decode(
4155            &mut self,
4156            decoder: &mut fidl::encoding::Decoder<'_, D>,
4157            offset: usize,
4158            _depth: fidl::encoding::Depth,
4159        ) -> fidl::Result<()> {
4160            decoder.debug_check_bounds::<Self>(offset);
4161            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4162            // Verify that padding bytes are zero.
4163            let ptr = unsafe { buf_ptr.offset(0) };
4164            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4165            let mask = 0xffffffff00000000u64;
4166            let maskedval = padval & mask;
4167            if maskedval != 0 {
4168                return Err(fidl::Error::NonZeroPadding {
4169                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4170                });
4171            }
4172            // Copy from the buffer into the object.
4173            unsafe {
4174                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4175            }
4176            Ok(())
4177        }
4178    }
4179
4180    impl fidl::encoding::ValueTypeMarker for SocketReadSocketStreamingStartRequest {
4181        type Borrowed<'a> = &'a Self;
4182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4183            value
4184        }
4185    }
4186
4187    unsafe impl fidl::encoding::TypeMarker for SocketReadSocketStreamingStartRequest {
4188        type Owned = Self;
4189
4190        #[inline(always)]
4191        fn inline_align(_context: fidl::encoding::Context) -> usize {
4192            4
4193        }
4194
4195        #[inline(always)]
4196        fn inline_size(_context: fidl::encoding::Context) -> usize {
4197            4
4198        }
4199        #[inline(always)]
4200        fn encode_is_copy() -> bool {
4201            true
4202        }
4203
4204        #[inline(always)]
4205        fn decode_is_copy() -> bool {
4206            true
4207        }
4208    }
4209
4210    unsafe impl<D: fidl::encoding::ResourceDialect>
4211        fidl::encoding::Encode<SocketReadSocketStreamingStartRequest, D>
4212        for &SocketReadSocketStreamingStartRequest
4213    {
4214        #[inline]
4215        unsafe fn encode(
4216            self,
4217            encoder: &mut fidl::encoding::Encoder<'_, D>,
4218            offset: usize,
4219            _depth: fidl::encoding::Depth,
4220        ) -> fidl::Result<()> {
4221            encoder.debug_check_bounds::<SocketReadSocketStreamingStartRequest>(offset);
4222            unsafe {
4223                // Copy the object into the buffer.
4224                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4225                (buf_ptr as *mut SocketReadSocketStreamingStartRequest)
4226                    .write_unaligned((self as *const SocketReadSocketStreamingStartRequest).read());
4227                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4228                // done second because the memcpy will write garbage to these bytes.
4229            }
4230            Ok(())
4231        }
4232    }
4233    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
4234        fidl::encoding::Encode<SocketReadSocketStreamingStartRequest, D> for (T0,)
4235    {
4236        #[inline]
4237        unsafe fn encode(
4238            self,
4239            encoder: &mut fidl::encoding::Encoder<'_, D>,
4240            offset: usize,
4241            depth: fidl::encoding::Depth,
4242        ) -> fidl::Result<()> {
4243            encoder.debug_check_bounds::<SocketReadSocketStreamingStartRequest>(offset);
4244            // Zero out padding regions. There's no need to apply masks
4245            // because the unmasked parts will be overwritten by fields.
4246            // Write the fields.
4247            self.0.encode(encoder, offset + 0, depth)?;
4248            Ok(())
4249        }
4250    }
4251
4252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4253        for SocketReadSocketStreamingStartRequest
4254    {
4255        #[inline(always)]
4256        fn new_empty() -> Self {
4257            Self { handle: fidl::new_empty!(HandleId, D) }
4258        }
4259
4260        #[inline]
4261        unsafe fn decode(
4262            &mut self,
4263            decoder: &mut fidl::encoding::Decoder<'_, D>,
4264            offset: usize,
4265            _depth: fidl::encoding::Depth,
4266        ) -> fidl::Result<()> {
4267            decoder.debug_check_bounds::<Self>(offset);
4268            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4269            // Verify that padding bytes are zero.
4270            // Copy from the buffer into the object.
4271            unsafe {
4272                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4273            }
4274            Ok(())
4275        }
4276    }
4277
4278    impl fidl::encoding::ValueTypeMarker for SocketReadSocketStreamingStopRequest {
4279        type Borrowed<'a> = &'a Self;
4280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4281            value
4282        }
4283    }
4284
4285    unsafe impl fidl::encoding::TypeMarker for SocketReadSocketStreamingStopRequest {
4286        type Owned = Self;
4287
4288        #[inline(always)]
4289        fn inline_align(_context: fidl::encoding::Context) -> usize {
4290            4
4291        }
4292
4293        #[inline(always)]
4294        fn inline_size(_context: fidl::encoding::Context) -> usize {
4295            4
4296        }
4297        #[inline(always)]
4298        fn encode_is_copy() -> bool {
4299            true
4300        }
4301
4302        #[inline(always)]
4303        fn decode_is_copy() -> bool {
4304            true
4305        }
4306    }
4307
4308    unsafe impl<D: fidl::encoding::ResourceDialect>
4309        fidl::encoding::Encode<SocketReadSocketStreamingStopRequest, D>
4310        for &SocketReadSocketStreamingStopRequest
4311    {
4312        #[inline]
4313        unsafe fn encode(
4314            self,
4315            encoder: &mut fidl::encoding::Encoder<'_, D>,
4316            offset: usize,
4317            _depth: fidl::encoding::Depth,
4318        ) -> fidl::Result<()> {
4319            encoder.debug_check_bounds::<SocketReadSocketStreamingStopRequest>(offset);
4320            unsafe {
4321                // Copy the object into the buffer.
4322                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4323                (buf_ptr as *mut SocketReadSocketStreamingStopRequest)
4324                    .write_unaligned((self as *const SocketReadSocketStreamingStopRequest).read());
4325                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4326                // done second because the memcpy will write garbage to these bytes.
4327            }
4328            Ok(())
4329        }
4330    }
4331    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
4332        fidl::encoding::Encode<SocketReadSocketStreamingStopRequest, D> for (T0,)
4333    {
4334        #[inline]
4335        unsafe fn encode(
4336            self,
4337            encoder: &mut fidl::encoding::Encoder<'_, D>,
4338            offset: usize,
4339            depth: fidl::encoding::Depth,
4340        ) -> fidl::Result<()> {
4341            encoder.debug_check_bounds::<SocketReadSocketStreamingStopRequest>(offset);
4342            // Zero out padding regions. There's no need to apply masks
4343            // because the unmasked parts will be overwritten by fields.
4344            // Write the fields.
4345            self.0.encode(encoder, offset + 0, depth)?;
4346            Ok(())
4347        }
4348    }
4349
4350    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4351        for SocketReadSocketStreamingStopRequest
4352    {
4353        #[inline(always)]
4354        fn new_empty() -> Self {
4355            Self { handle: fidl::new_empty!(HandleId, D) }
4356        }
4357
4358        #[inline]
4359        unsafe fn decode(
4360            &mut self,
4361            decoder: &mut fidl::encoding::Decoder<'_, D>,
4362            offset: usize,
4363            _depth: fidl::encoding::Depth,
4364        ) -> fidl::Result<()> {
4365            decoder.debug_check_bounds::<Self>(offset);
4366            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4367            // Verify that padding bytes are zero.
4368            // Copy from the buffer into the object.
4369            unsafe {
4370                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4371            }
4372            Ok(())
4373        }
4374    }
4375
4376    impl fidl::encoding::ValueTypeMarker for SocketSetSocketDispositionRequest {
4377        type Borrowed<'a> = &'a Self;
4378        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4379            value
4380        }
4381    }
4382
4383    unsafe impl fidl::encoding::TypeMarker for SocketSetSocketDispositionRequest {
4384        type Owned = Self;
4385
4386        #[inline(always)]
4387        fn inline_align(_context: fidl::encoding::Context) -> usize {
4388            4
4389        }
4390
4391        #[inline(always)]
4392        fn inline_size(_context: fidl::encoding::Context) -> usize {
4393            12
4394        }
4395    }
4396
4397    unsafe impl<D: fidl::encoding::ResourceDialect>
4398        fidl::encoding::Encode<SocketSetSocketDispositionRequest, D>
4399        for &SocketSetSocketDispositionRequest
4400    {
4401        #[inline]
4402        unsafe fn encode(
4403            self,
4404            encoder: &mut fidl::encoding::Encoder<'_, D>,
4405            offset: usize,
4406            _depth: fidl::encoding::Depth,
4407        ) -> fidl::Result<()> {
4408            encoder.debug_check_bounds::<SocketSetSocketDispositionRequest>(offset);
4409            // Delegate to tuple encoding.
4410            fidl::encoding::Encode::<SocketSetSocketDispositionRequest, D>::encode(
4411                (
4412                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4413                    <SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(
4414                        &self.disposition,
4415                    ),
4416                    <SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(
4417                        &self.disposition_peer,
4418                    ),
4419                ),
4420                encoder,
4421                offset,
4422                _depth,
4423            )
4424        }
4425    }
4426    unsafe impl<
4427        D: fidl::encoding::ResourceDialect,
4428        T0: fidl::encoding::Encode<HandleId, D>,
4429        T1: fidl::encoding::Encode<SocketDisposition, D>,
4430        T2: fidl::encoding::Encode<SocketDisposition, D>,
4431    > fidl::encoding::Encode<SocketSetSocketDispositionRequest, D> for (T0, T1, T2)
4432    {
4433        #[inline]
4434        unsafe fn encode(
4435            self,
4436            encoder: &mut fidl::encoding::Encoder<'_, D>,
4437            offset: usize,
4438            depth: fidl::encoding::Depth,
4439        ) -> fidl::Result<()> {
4440            encoder.debug_check_bounds::<SocketSetSocketDispositionRequest>(offset);
4441            // Zero out padding regions. There's no need to apply masks
4442            // because the unmasked parts will be overwritten by fields.
4443            // Write the fields.
4444            self.0.encode(encoder, offset + 0, depth)?;
4445            self.1.encode(encoder, offset + 4, depth)?;
4446            self.2.encode(encoder, offset + 8, depth)?;
4447            Ok(())
4448        }
4449    }
4450
4451    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4452        for SocketSetSocketDispositionRequest
4453    {
4454        #[inline(always)]
4455        fn new_empty() -> Self {
4456            Self {
4457                handle: fidl::new_empty!(HandleId, D),
4458                disposition: fidl::new_empty!(SocketDisposition, D),
4459                disposition_peer: fidl::new_empty!(SocketDisposition, D),
4460            }
4461        }
4462
4463        #[inline]
4464        unsafe fn decode(
4465            &mut self,
4466            decoder: &mut fidl::encoding::Decoder<'_, D>,
4467            offset: usize,
4468            _depth: fidl::encoding::Depth,
4469        ) -> fidl::Result<()> {
4470            decoder.debug_check_bounds::<Self>(offset);
4471            // Verify that padding bytes are zero.
4472            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4473            fidl::decode!(
4474                SocketDisposition,
4475                D,
4476                &mut self.disposition,
4477                decoder,
4478                offset + 4,
4479                _depth
4480            )?;
4481            fidl::decode!(
4482                SocketDisposition,
4483                D,
4484                &mut self.disposition_peer,
4485                decoder,
4486                offset + 8,
4487                _depth
4488            )?;
4489            Ok(())
4490        }
4491    }
4492
4493    impl fidl::encoding::ValueTypeMarker for SocketTypeUnknown {
4494        type Borrowed<'a> = &'a Self;
4495        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4496            value
4497        }
4498    }
4499
4500    unsafe impl fidl::encoding::TypeMarker for SocketTypeUnknown {
4501        type Owned = Self;
4502
4503        #[inline(always)]
4504        fn inline_align(_context: fidl::encoding::Context) -> usize {
4505            4
4506        }
4507
4508        #[inline(always)]
4509        fn inline_size(_context: fidl::encoding::Context) -> usize {
4510            4
4511        }
4512    }
4513
4514    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketTypeUnknown, D>
4515        for &SocketTypeUnknown
4516    {
4517        #[inline]
4518        unsafe fn encode(
4519            self,
4520            encoder: &mut fidl::encoding::Encoder<'_, D>,
4521            offset: usize,
4522            _depth: fidl::encoding::Depth,
4523        ) -> fidl::Result<()> {
4524            encoder.debug_check_bounds::<SocketTypeUnknown>(offset);
4525            // Delegate to tuple encoding.
4526            fidl::encoding::Encode::<SocketTypeUnknown, D>::encode(
4527                (<SocketType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
4528                encoder,
4529                offset,
4530                _depth,
4531            )
4532        }
4533    }
4534    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SocketType, D>>
4535        fidl::encoding::Encode<SocketTypeUnknown, D> for (T0,)
4536    {
4537        #[inline]
4538        unsafe fn encode(
4539            self,
4540            encoder: &mut fidl::encoding::Encoder<'_, D>,
4541            offset: usize,
4542            depth: fidl::encoding::Depth,
4543        ) -> fidl::Result<()> {
4544            encoder.debug_check_bounds::<SocketTypeUnknown>(offset);
4545            // Zero out padding regions. There's no need to apply masks
4546            // because the unmasked parts will be overwritten by fields.
4547            // Write the fields.
4548            self.0.encode(encoder, offset + 0, depth)?;
4549            Ok(())
4550        }
4551    }
4552
4553    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketTypeUnknown {
4554        #[inline(always)]
4555        fn new_empty() -> Self {
4556            Self { type_: fidl::new_empty!(SocketType, D) }
4557        }
4558
4559        #[inline]
4560        unsafe fn decode(
4561            &mut self,
4562            decoder: &mut fidl::encoding::Decoder<'_, D>,
4563            offset: usize,
4564            _depth: fidl::encoding::Depth,
4565        ) -> fidl::Result<()> {
4566            decoder.debug_check_bounds::<Self>(offset);
4567            // Verify that padding bytes are zero.
4568            fidl::decode!(SocketType, D, &mut self.type_, decoder, offset + 0, _depth)?;
4569            Ok(())
4570        }
4571    }
4572
4573    impl fidl::encoding::ValueTypeMarker for SocketWriteSocketRequest {
4574        type Borrowed<'a> = &'a Self;
4575        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4576            value
4577        }
4578    }
4579
4580    unsafe impl fidl::encoding::TypeMarker for SocketWriteSocketRequest {
4581        type Owned = Self;
4582
4583        #[inline(always)]
4584        fn inline_align(_context: fidl::encoding::Context) -> usize {
4585            8
4586        }
4587
4588        #[inline(always)]
4589        fn inline_size(_context: fidl::encoding::Context) -> usize {
4590            24
4591        }
4592    }
4593
4594    unsafe impl<D: fidl::encoding::ResourceDialect>
4595        fidl::encoding::Encode<SocketWriteSocketRequest, D> for &SocketWriteSocketRequest
4596    {
4597        #[inline]
4598        unsafe fn encode(
4599            self,
4600            encoder: &mut fidl::encoding::Encoder<'_, D>,
4601            offset: usize,
4602            _depth: fidl::encoding::Depth,
4603        ) -> fidl::Result<()> {
4604            encoder.debug_check_bounds::<SocketWriteSocketRequest>(offset);
4605            // Delegate to tuple encoding.
4606            fidl::encoding::Encode::<SocketWriteSocketRequest, D>::encode(
4607                (
4608                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4609                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
4610                ),
4611                encoder, offset, _depth
4612            )
4613        }
4614    }
4615    unsafe impl<
4616        D: fidl::encoding::ResourceDialect,
4617        T0: fidl::encoding::Encode<HandleId, D>,
4618        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
4619    > fidl::encoding::Encode<SocketWriteSocketRequest, D> for (T0, T1)
4620    {
4621        #[inline]
4622        unsafe fn encode(
4623            self,
4624            encoder: &mut fidl::encoding::Encoder<'_, D>,
4625            offset: usize,
4626            depth: fidl::encoding::Depth,
4627        ) -> fidl::Result<()> {
4628            encoder.debug_check_bounds::<SocketWriteSocketRequest>(offset);
4629            // Zero out padding regions. There's no need to apply masks
4630            // because the unmasked parts will be overwritten by fields.
4631            unsafe {
4632                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4633                (ptr as *mut u64).write_unaligned(0);
4634            }
4635            // Write the fields.
4636            self.0.encode(encoder, offset + 0, depth)?;
4637            self.1.encode(encoder, offset + 8, depth)?;
4638            Ok(())
4639        }
4640    }
4641
4642    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4643        for SocketWriteSocketRequest
4644    {
4645        #[inline(always)]
4646        fn new_empty() -> Self {
4647            Self {
4648                handle: fidl::new_empty!(HandleId, D),
4649                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
4650            }
4651        }
4652
4653        #[inline]
4654        unsafe fn decode(
4655            &mut self,
4656            decoder: &mut fidl::encoding::Decoder<'_, D>,
4657            offset: usize,
4658            _depth: fidl::encoding::Depth,
4659        ) -> fidl::Result<()> {
4660            decoder.debug_check_bounds::<Self>(offset);
4661            // Verify that padding bytes are zero.
4662            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4663            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4664            let mask = 0xffffffff00000000u64;
4665            let maskedval = padval & mask;
4666            if maskedval != 0 {
4667                return Err(fidl::Error::NonZeroPadding {
4668                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4669                });
4670            }
4671            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4672            fidl::decode!(
4673                fidl::encoding::UnboundedVector<u8>,
4674                D,
4675                &mut self.data,
4676                decoder,
4677                offset + 8,
4678                _depth
4679            )?;
4680            Ok(())
4681        }
4682    }
4683
4684    impl fidl::encoding::ValueTypeMarker for SocketWriteSocketResponse {
4685        type Borrowed<'a> = &'a Self;
4686        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4687            value
4688        }
4689    }
4690
4691    unsafe impl fidl::encoding::TypeMarker for SocketWriteSocketResponse {
4692        type Owned = Self;
4693
4694        #[inline(always)]
4695        fn inline_align(_context: fidl::encoding::Context) -> usize {
4696            8
4697        }
4698
4699        #[inline(always)]
4700        fn inline_size(_context: fidl::encoding::Context) -> usize {
4701            8
4702        }
4703        #[inline(always)]
4704        fn encode_is_copy() -> bool {
4705            true
4706        }
4707
4708        #[inline(always)]
4709        fn decode_is_copy() -> bool {
4710            true
4711        }
4712    }
4713
4714    unsafe impl<D: fidl::encoding::ResourceDialect>
4715        fidl::encoding::Encode<SocketWriteSocketResponse, D> for &SocketWriteSocketResponse
4716    {
4717        #[inline]
4718        unsafe fn encode(
4719            self,
4720            encoder: &mut fidl::encoding::Encoder<'_, D>,
4721            offset: usize,
4722            _depth: fidl::encoding::Depth,
4723        ) -> fidl::Result<()> {
4724            encoder.debug_check_bounds::<SocketWriteSocketResponse>(offset);
4725            unsafe {
4726                // Copy the object into the buffer.
4727                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4728                (buf_ptr as *mut SocketWriteSocketResponse)
4729                    .write_unaligned((self as *const SocketWriteSocketResponse).read());
4730                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4731                // done second because the memcpy will write garbage to these bytes.
4732            }
4733            Ok(())
4734        }
4735    }
4736    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4737        fidl::encoding::Encode<SocketWriteSocketResponse, D> for (T0,)
4738    {
4739        #[inline]
4740        unsafe fn encode(
4741            self,
4742            encoder: &mut fidl::encoding::Encoder<'_, D>,
4743            offset: usize,
4744            depth: fidl::encoding::Depth,
4745        ) -> fidl::Result<()> {
4746            encoder.debug_check_bounds::<SocketWriteSocketResponse>(offset);
4747            // Zero out padding regions. There's no need to apply masks
4748            // because the unmasked parts will be overwritten by fields.
4749            // Write the fields.
4750            self.0.encode(encoder, offset + 0, depth)?;
4751            Ok(())
4752        }
4753    }
4754
4755    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4756        for SocketWriteSocketResponse
4757    {
4758        #[inline(always)]
4759        fn new_empty() -> Self {
4760            Self { wrote: fidl::new_empty!(u64, D) }
4761        }
4762
4763        #[inline]
4764        unsafe fn decode(
4765            &mut self,
4766            decoder: &mut fidl::encoding::Decoder<'_, D>,
4767            offset: usize,
4768            _depth: fidl::encoding::Depth,
4769        ) -> fidl::Result<()> {
4770            decoder.debug_check_bounds::<Self>(offset);
4771            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4772            // Verify that padding bytes are zero.
4773            // Copy from the buffer into the object.
4774            unsafe {
4775                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4776            }
4777            Ok(())
4778        }
4779    }
4780
4781    impl fidl::encoding::ValueTypeMarker for StreamingReadInProgress {
4782        type Borrowed<'a> = &'a Self;
4783        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4784            value
4785        }
4786    }
4787
4788    unsafe impl fidl::encoding::TypeMarker for StreamingReadInProgress {
4789        type Owned = Self;
4790
4791        #[inline(always)]
4792        fn inline_align(_context: fidl::encoding::Context) -> usize {
4793            1
4794        }
4795
4796        #[inline(always)]
4797        fn inline_size(_context: fidl::encoding::Context) -> usize {
4798            1
4799        }
4800    }
4801
4802    unsafe impl<D: fidl::encoding::ResourceDialect>
4803        fidl::encoding::Encode<StreamingReadInProgress, D> for &StreamingReadInProgress
4804    {
4805        #[inline]
4806        unsafe fn encode(
4807            self,
4808            encoder: &mut fidl::encoding::Encoder<'_, D>,
4809            offset: usize,
4810            _depth: fidl::encoding::Depth,
4811        ) -> fidl::Result<()> {
4812            encoder.debug_check_bounds::<StreamingReadInProgress>(offset);
4813            encoder.write_num(0u8, offset);
4814            Ok(())
4815        }
4816    }
4817
4818    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4819        for StreamingReadInProgress
4820    {
4821        #[inline(always)]
4822        fn new_empty() -> Self {
4823            Self
4824        }
4825
4826        #[inline]
4827        unsafe fn decode(
4828            &mut self,
4829            decoder: &mut fidl::encoding::Decoder<'_, D>,
4830            offset: usize,
4831            _depth: fidl::encoding::Depth,
4832        ) -> fidl::Result<()> {
4833            decoder.debug_check_bounds::<Self>(offset);
4834            match decoder.read_num::<u8>(offset) {
4835                0 => Ok(()),
4836                _ => Err(fidl::Error::Invalid),
4837            }
4838        }
4839    }
4840
4841    impl fidl::encoding::ValueTypeMarker for WriteSocketError {
4842        type Borrowed<'a> = &'a Self;
4843        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4844            value
4845        }
4846    }
4847
4848    unsafe impl fidl::encoding::TypeMarker for WriteSocketError {
4849        type Owned = Self;
4850
4851        #[inline(always)]
4852        fn inline_align(_context: fidl::encoding::Context) -> usize {
4853            8
4854        }
4855
4856        #[inline(always)]
4857        fn inline_size(_context: fidl::encoding::Context) -> usize {
4858            24
4859        }
4860    }
4861
4862    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteSocketError, D>
4863        for &WriteSocketError
4864    {
4865        #[inline]
4866        unsafe fn encode(
4867            self,
4868            encoder: &mut fidl::encoding::Encoder<'_, D>,
4869            offset: usize,
4870            _depth: fidl::encoding::Depth,
4871        ) -> fidl::Result<()> {
4872            encoder.debug_check_bounds::<WriteSocketError>(offset);
4873            // Delegate to tuple encoding.
4874            fidl::encoding::Encode::<WriteSocketError, D>::encode(
4875                (
4876                    <Error as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
4877                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wrote),
4878                ),
4879                encoder,
4880                offset,
4881                _depth,
4882            )
4883        }
4884    }
4885    unsafe impl<
4886        D: fidl::encoding::ResourceDialect,
4887        T0: fidl::encoding::Encode<Error, D>,
4888        T1: fidl::encoding::Encode<u64, D>,
4889    > fidl::encoding::Encode<WriteSocketError, D> for (T0, T1)
4890    {
4891        #[inline]
4892        unsafe fn encode(
4893            self,
4894            encoder: &mut fidl::encoding::Encoder<'_, D>,
4895            offset: usize,
4896            depth: fidl::encoding::Depth,
4897        ) -> fidl::Result<()> {
4898            encoder.debug_check_bounds::<WriteSocketError>(offset);
4899            // Zero out padding regions. There's no need to apply masks
4900            // because the unmasked parts will be overwritten by fields.
4901            // Write the fields.
4902            self.0.encode(encoder, offset + 0, depth)?;
4903            self.1.encode(encoder, offset + 16, depth)?;
4904            Ok(())
4905        }
4906    }
4907
4908    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteSocketError {
4909        #[inline(always)]
4910        fn new_empty() -> Self {
4911            Self { error: fidl::new_empty!(Error, D), wrote: fidl::new_empty!(u64, D) }
4912        }
4913
4914        #[inline]
4915        unsafe fn decode(
4916            &mut self,
4917            decoder: &mut fidl::encoding::Decoder<'_, D>,
4918            offset: usize,
4919            _depth: fidl::encoding::Depth,
4920        ) -> fidl::Result<()> {
4921            decoder.debug_check_bounds::<Self>(offset);
4922            // Verify that padding bytes are zero.
4923            fidl::decode!(Error, D, &mut self.error, decoder, offset + 0, _depth)?;
4924            fidl::decode!(u64, D, &mut self.wrote, decoder, offset + 16, _depth)?;
4925            Ok(())
4926        }
4927    }
4928
4929    impl fidl::encoding::ValueTypeMarker for WrongHandleType {
4930        type Borrowed<'a> = &'a Self;
4931        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4932            value
4933        }
4934    }
4935
4936    unsafe impl fidl::encoding::TypeMarker for WrongHandleType {
4937        type Owned = Self;
4938
4939        #[inline(always)]
4940        fn inline_align(_context: fidl::encoding::Context) -> usize {
4941            4
4942        }
4943
4944        #[inline(always)]
4945        fn inline_size(_context: fidl::encoding::Context) -> usize {
4946            8
4947        }
4948    }
4949
4950    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WrongHandleType, D>
4951        for &WrongHandleType
4952    {
4953        #[inline]
4954        unsafe fn encode(
4955            self,
4956            encoder: &mut fidl::encoding::Encoder<'_, D>,
4957            offset: usize,
4958            _depth: fidl::encoding::Depth,
4959        ) -> fidl::Result<()> {
4960            encoder.debug_check_bounds::<WrongHandleType>(offset);
4961            // Delegate to tuple encoding.
4962            fidl::encoding::Encode::<WrongHandleType, D>::encode(
4963                (
4964                    <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.expected),
4965                    <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.got),
4966                ),
4967                encoder,
4968                offset,
4969                _depth,
4970            )
4971        }
4972    }
4973    unsafe impl<
4974        D: fidl::encoding::ResourceDialect,
4975        T0: fidl::encoding::Encode<fidl::ObjectType, D>,
4976        T1: fidl::encoding::Encode<fidl::ObjectType, D>,
4977    > fidl::encoding::Encode<WrongHandleType, D> for (T0, T1)
4978    {
4979        #[inline]
4980        unsafe fn encode(
4981            self,
4982            encoder: &mut fidl::encoding::Encoder<'_, D>,
4983            offset: usize,
4984            depth: fidl::encoding::Depth,
4985        ) -> fidl::Result<()> {
4986            encoder.debug_check_bounds::<WrongHandleType>(offset);
4987            // Zero out padding regions. There's no need to apply masks
4988            // because the unmasked parts will be overwritten by fields.
4989            // Write the fields.
4990            self.0.encode(encoder, offset + 0, depth)?;
4991            self.1.encode(encoder, offset + 4, depth)?;
4992            Ok(())
4993        }
4994    }
4995
4996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WrongHandleType {
4997        #[inline(always)]
4998        fn new_empty() -> Self {
4999            Self {
5000                expected: fidl::new_empty!(fidl::ObjectType, D),
5001                got: fidl::new_empty!(fidl::ObjectType, D),
5002            }
5003        }
5004
5005        #[inline]
5006        unsafe fn decode(
5007            &mut self,
5008            decoder: &mut fidl::encoding::Decoder<'_, D>,
5009            offset: usize,
5010            _depth: fidl::encoding::Depth,
5011        ) -> fidl::Result<()> {
5012            decoder.debug_check_bounds::<Self>(offset);
5013            // Verify that padding bytes are zero.
5014            fidl::decode!(fidl::ObjectType, D, &mut self.expected, decoder, offset + 0, _depth)?;
5015            fidl::decode!(fidl::ObjectType, D, &mut self.got, decoder, offset + 4, _depth)?;
5016            Ok(())
5017        }
5018    }
5019
5020    impl fidl::encoding::ValueTypeMarker for WroteToSelf {
5021        type Borrowed<'a> = &'a Self;
5022        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5023            value
5024        }
5025    }
5026
5027    unsafe impl fidl::encoding::TypeMarker for WroteToSelf {
5028        type Owned = Self;
5029
5030        #[inline(always)]
5031        fn inline_align(_context: fidl::encoding::Context) -> usize {
5032            1
5033        }
5034
5035        #[inline(always)]
5036        fn inline_size(_context: fidl::encoding::Context) -> usize {
5037            1
5038        }
5039    }
5040
5041    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WroteToSelf, D>
5042        for &WroteToSelf
5043    {
5044        #[inline]
5045        unsafe fn encode(
5046            self,
5047            encoder: &mut fidl::encoding::Encoder<'_, D>,
5048            offset: usize,
5049            _depth: fidl::encoding::Depth,
5050        ) -> fidl::Result<()> {
5051            encoder.debug_check_bounds::<WroteToSelf>(offset);
5052            encoder.write_num(0u8, offset);
5053            Ok(())
5054        }
5055    }
5056
5057    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WroteToSelf {
5058        #[inline(always)]
5059        fn new_empty() -> Self {
5060            Self
5061        }
5062
5063        #[inline]
5064        unsafe fn decode(
5065            &mut self,
5066            decoder: &mut fidl::encoding::Decoder<'_, D>,
5067            offset: usize,
5068            _depth: fidl::encoding::Depth,
5069        ) -> fidl::Result<()> {
5070            decoder.debug_check_bounds::<Self>(offset);
5071            match decoder.read_num::<u8>(offset) {
5072                0 => Ok(()),
5073                _ => Err(fidl::Error::Invalid),
5074            }
5075        }
5076    }
5077
5078    impl fidl::encoding::ValueTypeMarker for ChannelSent {
5079        type Borrowed<'a> = &'a Self;
5080        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5081            value
5082        }
5083    }
5084
5085    unsafe impl fidl::encoding::TypeMarker for ChannelSent {
5086        type Owned = Self;
5087
5088        #[inline(always)]
5089        fn inline_align(_context: fidl::encoding::Context) -> usize {
5090            8
5091        }
5092
5093        #[inline(always)]
5094        fn inline_size(_context: fidl::encoding::Context) -> usize {
5095            16
5096        }
5097    }
5098
5099    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelSent, D>
5100        for &ChannelSent
5101    {
5102        #[inline]
5103        unsafe fn encode(
5104            self,
5105            encoder: &mut fidl::encoding::Encoder<'_, D>,
5106            offset: usize,
5107            _depth: fidl::encoding::Depth,
5108        ) -> fidl::Result<()> {
5109            encoder.debug_check_bounds::<ChannelSent>(offset);
5110            encoder.write_num::<u64>(self.ordinal(), offset);
5111            match self {
5112                ChannelSent::Message(ref val) => {
5113                    fidl::encoding::encode_in_envelope::<ChannelMessage, D>(
5114                        <ChannelMessage as fidl::encoding::ValueTypeMarker>::borrow(val),
5115                        encoder,
5116                        offset + 8,
5117                        _depth,
5118                    )
5119                }
5120                ChannelSent::Stopped(ref val) => {
5121                    fidl::encoding::encode_in_envelope::<AioStopped, D>(
5122                        <AioStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
5123                        encoder,
5124                        offset + 8,
5125                        _depth,
5126                    )
5127                }
5128                ChannelSent::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5129            }
5130        }
5131    }
5132
5133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelSent {
5134        #[inline(always)]
5135        fn new_empty() -> Self {
5136            Self::__SourceBreaking { unknown_ordinal: 0 }
5137        }
5138
5139        #[inline]
5140        unsafe fn decode(
5141            &mut self,
5142            decoder: &mut fidl::encoding::Decoder<'_, D>,
5143            offset: usize,
5144            mut depth: fidl::encoding::Depth,
5145        ) -> fidl::Result<()> {
5146            decoder.debug_check_bounds::<Self>(offset);
5147            #[allow(unused_variables)]
5148            let next_out_of_line = decoder.next_out_of_line();
5149            let handles_before = decoder.remaining_handles();
5150            let (ordinal, inlined, num_bytes, num_handles) =
5151                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5152
5153            let member_inline_size = match ordinal {
5154                1 => <ChannelMessage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5155                2 => <AioStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5156                0 => return Err(fidl::Error::UnknownUnionTag),
5157                _ => num_bytes as usize,
5158            };
5159
5160            if inlined != (member_inline_size <= 4) {
5161                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5162            }
5163            let _inner_offset;
5164            if inlined {
5165                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5166                _inner_offset = offset + 8;
5167            } else {
5168                depth.increment()?;
5169                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5170            }
5171            match ordinal {
5172                1 => {
5173                    #[allow(irrefutable_let_patterns)]
5174                    if let ChannelSent::Message(_) = self {
5175                        // Do nothing, read the value into the object
5176                    } else {
5177                        // Initialize `self` to the right variant
5178                        *self = ChannelSent::Message(fidl::new_empty!(ChannelMessage, D));
5179                    }
5180                    #[allow(irrefutable_let_patterns)]
5181                    if let ChannelSent::Message(ref mut val) = self {
5182                        fidl::decode!(ChannelMessage, D, val, decoder, _inner_offset, depth)?;
5183                    } else {
5184                        unreachable!()
5185                    }
5186                }
5187                2 => {
5188                    #[allow(irrefutable_let_patterns)]
5189                    if let ChannelSent::Stopped(_) = self {
5190                        // Do nothing, read the value into the object
5191                    } else {
5192                        // Initialize `self` to the right variant
5193                        *self = ChannelSent::Stopped(fidl::new_empty!(AioStopped, D));
5194                    }
5195                    #[allow(irrefutable_let_patterns)]
5196                    if let ChannelSent::Stopped(ref mut val) = self {
5197                        fidl::decode!(AioStopped, D, val, decoder, _inner_offset, depth)?;
5198                    } else {
5199                        unreachable!()
5200                    }
5201                }
5202                #[allow(deprecated)]
5203                ordinal => {
5204                    for _ in 0..num_handles {
5205                        decoder.drop_next_handle()?;
5206                    }
5207                    *self = ChannelSent::__SourceBreaking { unknown_ordinal: ordinal };
5208                }
5209            }
5210            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5211                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5212            }
5213            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5214                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5215            }
5216            Ok(())
5217        }
5218    }
5219
5220    impl fidl::encoding::ValueTypeMarker for Error {
5221        type Borrowed<'a> = &'a Self;
5222        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5223            value
5224        }
5225    }
5226
5227    unsafe impl fidl::encoding::TypeMarker for Error {
5228        type Owned = Self;
5229
5230        #[inline(always)]
5231        fn inline_align(_context: fidl::encoding::Context) -> usize {
5232            8
5233        }
5234
5235        #[inline(always)]
5236        fn inline_size(_context: fidl::encoding::Context) -> usize {
5237            16
5238        }
5239    }
5240
5241    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Error, D> for &Error {
5242        #[inline]
5243        unsafe fn encode(
5244            self,
5245            encoder: &mut fidl::encoding::Encoder<'_, D>,
5246            offset: usize,
5247            _depth: fidl::encoding::Depth,
5248        ) -> fidl::Result<()> {
5249            encoder.debug_check_bounds::<Error>(offset);
5250            encoder.write_num::<u64>(self.ordinal(), offset);
5251            match self {
5252                Error::TargetError(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
5253                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
5254                    encoder,
5255                    offset + 8,
5256                    _depth,
5257                ),
5258                Error::BadHandleId(ref val) => {
5259                    fidl::encoding::encode_in_envelope::<BadHandleId, D>(
5260                        <BadHandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
5261                        encoder,
5262                        offset + 8,
5263                        _depth,
5264                    )
5265                }
5266                Error::NewHandleIdOutOfRange(ref val) => {
5267                    fidl::encoding::encode_in_envelope::<NewHandleIdOutOfRange, D>(
5268                        <NewHandleIdOutOfRange as fidl::encoding::ValueTypeMarker>::borrow(val),
5269                        encoder,
5270                        offset + 8,
5271                        _depth,
5272                    )
5273                }
5274                Error::NewHandleIdReused(ref val) => {
5275                    fidl::encoding::encode_in_envelope::<NewHandleIdReused, D>(
5276                        <NewHandleIdReused as fidl::encoding::ValueTypeMarker>::borrow(val),
5277                        encoder,
5278                        offset + 8,
5279                        _depth,
5280                    )
5281                }
5282                Error::WrongHandleType(ref val) => {
5283                    fidl::encoding::encode_in_envelope::<WrongHandleType, D>(
5284                        <WrongHandleType as fidl::encoding::ValueTypeMarker>::borrow(val),
5285                        encoder,
5286                        offset + 8,
5287                        _depth,
5288                    )
5289                }
5290                Error::StreamingReadInProgress(ref val) => {
5291                    fidl::encoding::encode_in_envelope::<StreamingReadInProgress, D>(
5292                        <StreamingReadInProgress as fidl::encoding::ValueTypeMarker>::borrow(val),
5293                        encoder,
5294                        offset + 8,
5295                        _depth,
5296                    )
5297                }
5298                Error::NoReadInProgress(ref val) => {
5299                    fidl::encoding::encode_in_envelope::<NoReadInProgress, D>(
5300                        <NoReadInProgress as fidl::encoding::ValueTypeMarker>::borrow(val),
5301                        encoder,
5302                        offset + 8,
5303                        _depth,
5304                    )
5305                }
5306                Error::WroteToSelf(ref val) => {
5307                    fidl::encoding::encode_in_envelope::<WroteToSelf, D>(
5308                        <WroteToSelf as fidl::encoding::ValueTypeMarker>::borrow(val),
5309                        encoder,
5310                        offset + 8,
5311                        _depth,
5312                    )
5313                }
5314                Error::ClosedDuringRead(ref val) => {
5315                    fidl::encoding::encode_in_envelope::<ClosedDuringRead, D>(
5316                        <ClosedDuringRead as fidl::encoding::ValueTypeMarker>::borrow(val),
5317                        encoder,
5318                        offset + 8,
5319                        _depth,
5320                    )
5321                }
5322                Error::SignalsUnknown(ref val) => {
5323                    fidl::encoding::encode_in_envelope::<SignalsUnknown, D>(
5324                        <SignalsUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5325                        encoder,
5326                        offset + 8,
5327                        _depth,
5328                    )
5329                }
5330                Error::RightsUnknown(ref val) => {
5331                    fidl::encoding::encode_in_envelope::<RightsUnknown, D>(
5332                        <RightsUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5333                        encoder,
5334                        offset + 8,
5335                        _depth,
5336                    )
5337                }
5338                Error::SocketDispositionUnknown(ref val) => {
5339                    fidl::encoding::encode_in_envelope::<SocketDispositionUnknown, D>(
5340                        <SocketDispositionUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5341                        encoder,
5342                        offset + 8,
5343                        _depth,
5344                    )
5345                }
5346                Error::SocketTypeUnknown(ref val) => {
5347                    fidl::encoding::encode_in_envelope::<SocketTypeUnknown, D>(
5348                        <SocketTypeUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5349                        encoder,
5350                        offset + 8,
5351                        _depth,
5352                    )
5353                }
5354                Error::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5355            }
5356        }
5357    }
5358
5359    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
5360        #[inline(always)]
5361        fn new_empty() -> Self {
5362            Self::__SourceBreaking { unknown_ordinal: 0 }
5363        }
5364
5365        #[inline]
5366        unsafe fn decode(
5367            &mut self,
5368            decoder: &mut fidl::encoding::Decoder<'_, D>,
5369            offset: usize,
5370            mut depth: fidl::encoding::Depth,
5371        ) -> fidl::Result<()> {
5372            decoder.debug_check_bounds::<Self>(offset);
5373            #[allow(unused_variables)]
5374            let next_out_of_line = decoder.next_out_of_line();
5375            let handles_before = decoder.remaining_handles();
5376            let (ordinal, inlined, num_bytes, num_handles) =
5377                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5378
5379            let member_inline_size = match ordinal {
5380                1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5381                2 => <BadHandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5382                3 => <NewHandleIdOutOfRange as fidl::encoding::TypeMarker>::inline_size(
5383                    decoder.context,
5384                ),
5385                4 => {
5386                    <NewHandleIdReused as fidl::encoding::TypeMarker>::inline_size(decoder.context)
5387                }
5388                5 => <WrongHandleType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5389                6 => <StreamingReadInProgress as fidl::encoding::TypeMarker>::inline_size(
5390                    decoder.context,
5391                ),
5392                7 => <NoReadInProgress as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5393                8 => <WroteToSelf as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5394                9 => <ClosedDuringRead as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5395                10 => <SignalsUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5396                11 => <RightsUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5397                12 => <SocketDispositionUnknown as fidl::encoding::TypeMarker>::inline_size(
5398                    decoder.context,
5399                ),
5400                13 => {
5401                    <SocketTypeUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context)
5402                }
5403                0 => return Err(fidl::Error::UnknownUnionTag),
5404                _ => num_bytes as usize,
5405            };
5406
5407            if inlined != (member_inline_size <= 4) {
5408                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5409            }
5410            let _inner_offset;
5411            if inlined {
5412                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5413                _inner_offset = offset + 8;
5414            } else {
5415                depth.increment()?;
5416                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5417            }
5418            match ordinal {
5419                1 => {
5420                    #[allow(irrefutable_let_patterns)]
5421                    if let Error::TargetError(_) = self {
5422                        // Do nothing, read the value into the object
5423                    } else {
5424                        // Initialize `self` to the right variant
5425                        *self = Error::TargetError(fidl::new_empty!(i32, D));
5426                    }
5427                    #[allow(irrefutable_let_patterns)]
5428                    if let Error::TargetError(ref mut val) = self {
5429                        fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
5430                    } else {
5431                        unreachable!()
5432                    }
5433                }
5434                2 => {
5435                    #[allow(irrefutable_let_patterns)]
5436                    if let Error::BadHandleId(_) = self {
5437                        // Do nothing, read the value into the object
5438                    } else {
5439                        // Initialize `self` to the right variant
5440                        *self = Error::BadHandleId(fidl::new_empty!(BadHandleId, D));
5441                    }
5442                    #[allow(irrefutable_let_patterns)]
5443                    if let Error::BadHandleId(ref mut val) = self {
5444                        fidl::decode!(BadHandleId, D, val, decoder, _inner_offset, depth)?;
5445                    } else {
5446                        unreachable!()
5447                    }
5448                }
5449                3 => {
5450                    #[allow(irrefutable_let_patterns)]
5451                    if let Error::NewHandleIdOutOfRange(_) = self {
5452                        // Do nothing, read the value into the object
5453                    } else {
5454                        // Initialize `self` to the right variant
5455                        *self = Error::NewHandleIdOutOfRange(fidl::new_empty!(
5456                            NewHandleIdOutOfRange,
5457                            D
5458                        ));
5459                    }
5460                    #[allow(irrefutable_let_patterns)]
5461                    if let Error::NewHandleIdOutOfRange(ref mut val) = self {
5462                        fidl::decode!(
5463                            NewHandleIdOutOfRange,
5464                            D,
5465                            val,
5466                            decoder,
5467                            _inner_offset,
5468                            depth
5469                        )?;
5470                    } else {
5471                        unreachable!()
5472                    }
5473                }
5474                4 => {
5475                    #[allow(irrefutable_let_patterns)]
5476                    if let Error::NewHandleIdReused(_) = self {
5477                        // Do nothing, read the value into the object
5478                    } else {
5479                        // Initialize `self` to the right variant
5480                        *self = Error::NewHandleIdReused(fidl::new_empty!(NewHandleIdReused, D));
5481                    }
5482                    #[allow(irrefutable_let_patterns)]
5483                    if let Error::NewHandleIdReused(ref mut val) = self {
5484                        fidl::decode!(NewHandleIdReused, D, val, decoder, _inner_offset, depth)?;
5485                    } else {
5486                        unreachable!()
5487                    }
5488                }
5489                5 => {
5490                    #[allow(irrefutable_let_patterns)]
5491                    if let Error::WrongHandleType(_) = self {
5492                        // Do nothing, read the value into the object
5493                    } else {
5494                        // Initialize `self` to the right variant
5495                        *self = Error::WrongHandleType(fidl::new_empty!(WrongHandleType, D));
5496                    }
5497                    #[allow(irrefutable_let_patterns)]
5498                    if let Error::WrongHandleType(ref mut val) = self {
5499                        fidl::decode!(WrongHandleType, D, val, decoder, _inner_offset, depth)?;
5500                    } else {
5501                        unreachable!()
5502                    }
5503                }
5504                6 => {
5505                    #[allow(irrefutable_let_patterns)]
5506                    if let Error::StreamingReadInProgress(_) = self {
5507                        // Do nothing, read the value into the object
5508                    } else {
5509                        // Initialize `self` to the right variant
5510                        *self = Error::StreamingReadInProgress(fidl::new_empty!(
5511                            StreamingReadInProgress,
5512                            D
5513                        ));
5514                    }
5515                    #[allow(irrefutable_let_patterns)]
5516                    if let Error::StreamingReadInProgress(ref mut val) = self {
5517                        fidl::decode!(
5518                            StreamingReadInProgress,
5519                            D,
5520                            val,
5521                            decoder,
5522                            _inner_offset,
5523                            depth
5524                        )?;
5525                    } else {
5526                        unreachable!()
5527                    }
5528                }
5529                7 => {
5530                    #[allow(irrefutable_let_patterns)]
5531                    if let Error::NoReadInProgress(_) = self {
5532                        // Do nothing, read the value into the object
5533                    } else {
5534                        // Initialize `self` to the right variant
5535                        *self = Error::NoReadInProgress(fidl::new_empty!(NoReadInProgress, D));
5536                    }
5537                    #[allow(irrefutable_let_patterns)]
5538                    if let Error::NoReadInProgress(ref mut val) = self {
5539                        fidl::decode!(NoReadInProgress, D, val, decoder, _inner_offset, depth)?;
5540                    } else {
5541                        unreachable!()
5542                    }
5543                }
5544                8 => {
5545                    #[allow(irrefutable_let_patterns)]
5546                    if let Error::WroteToSelf(_) = self {
5547                        // Do nothing, read the value into the object
5548                    } else {
5549                        // Initialize `self` to the right variant
5550                        *self = Error::WroteToSelf(fidl::new_empty!(WroteToSelf, D));
5551                    }
5552                    #[allow(irrefutable_let_patterns)]
5553                    if let Error::WroteToSelf(ref mut val) = self {
5554                        fidl::decode!(WroteToSelf, D, val, decoder, _inner_offset, depth)?;
5555                    } else {
5556                        unreachable!()
5557                    }
5558                }
5559                9 => {
5560                    #[allow(irrefutable_let_patterns)]
5561                    if let Error::ClosedDuringRead(_) = self {
5562                        // Do nothing, read the value into the object
5563                    } else {
5564                        // Initialize `self` to the right variant
5565                        *self = Error::ClosedDuringRead(fidl::new_empty!(ClosedDuringRead, D));
5566                    }
5567                    #[allow(irrefutable_let_patterns)]
5568                    if let Error::ClosedDuringRead(ref mut val) = self {
5569                        fidl::decode!(ClosedDuringRead, D, val, decoder, _inner_offset, depth)?;
5570                    } else {
5571                        unreachable!()
5572                    }
5573                }
5574                10 => {
5575                    #[allow(irrefutable_let_patterns)]
5576                    if let Error::SignalsUnknown(_) = self {
5577                        // Do nothing, read the value into the object
5578                    } else {
5579                        // Initialize `self` to the right variant
5580                        *self = Error::SignalsUnknown(fidl::new_empty!(SignalsUnknown, D));
5581                    }
5582                    #[allow(irrefutable_let_patterns)]
5583                    if let Error::SignalsUnknown(ref mut val) = self {
5584                        fidl::decode!(SignalsUnknown, D, val, decoder, _inner_offset, depth)?;
5585                    } else {
5586                        unreachable!()
5587                    }
5588                }
5589                11 => {
5590                    #[allow(irrefutable_let_patterns)]
5591                    if let Error::RightsUnknown(_) = self {
5592                        // Do nothing, read the value into the object
5593                    } else {
5594                        // Initialize `self` to the right variant
5595                        *self = Error::RightsUnknown(fidl::new_empty!(RightsUnknown, D));
5596                    }
5597                    #[allow(irrefutable_let_patterns)]
5598                    if let Error::RightsUnknown(ref mut val) = self {
5599                        fidl::decode!(RightsUnknown, D, val, decoder, _inner_offset, depth)?;
5600                    } else {
5601                        unreachable!()
5602                    }
5603                }
5604                12 => {
5605                    #[allow(irrefutable_let_patterns)]
5606                    if let Error::SocketDispositionUnknown(_) = self {
5607                        // Do nothing, read the value into the object
5608                    } else {
5609                        // Initialize `self` to the right variant
5610                        *self = Error::SocketDispositionUnknown(fidl::new_empty!(
5611                            SocketDispositionUnknown,
5612                            D
5613                        ));
5614                    }
5615                    #[allow(irrefutable_let_patterns)]
5616                    if let Error::SocketDispositionUnknown(ref mut val) = self {
5617                        fidl::decode!(
5618                            SocketDispositionUnknown,
5619                            D,
5620                            val,
5621                            decoder,
5622                            _inner_offset,
5623                            depth
5624                        )?;
5625                    } else {
5626                        unreachable!()
5627                    }
5628                }
5629                13 => {
5630                    #[allow(irrefutable_let_patterns)]
5631                    if let Error::SocketTypeUnknown(_) = self {
5632                        // Do nothing, read the value into the object
5633                    } else {
5634                        // Initialize `self` to the right variant
5635                        *self = Error::SocketTypeUnknown(fidl::new_empty!(SocketTypeUnknown, D));
5636                    }
5637                    #[allow(irrefutable_let_patterns)]
5638                    if let Error::SocketTypeUnknown(ref mut val) = self {
5639                        fidl::decode!(SocketTypeUnknown, D, val, decoder, _inner_offset, depth)?;
5640                    } else {
5641                        unreachable!()
5642                    }
5643                }
5644                #[allow(deprecated)]
5645                ordinal => {
5646                    for _ in 0..num_handles {
5647                        decoder.drop_next_handle()?;
5648                    }
5649                    *self = Error::__SourceBreaking { unknown_ordinal: ordinal };
5650                }
5651            }
5652            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5653                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5654            }
5655            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5656                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5657            }
5658            Ok(())
5659        }
5660    }
5661
5662    impl fidl::encoding::ValueTypeMarker for HandleOp {
5663        type Borrowed<'a> = &'a Self;
5664        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5665            value
5666        }
5667    }
5668
5669    unsafe impl fidl::encoding::TypeMarker for HandleOp {
5670        type Owned = Self;
5671
5672        #[inline(always)]
5673        fn inline_align(_context: fidl::encoding::Context) -> usize {
5674            8
5675        }
5676
5677        #[inline(always)]
5678        fn inline_size(_context: fidl::encoding::Context) -> usize {
5679            16
5680        }
5681    }
5682
5683    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleOp, D> for &HandleOp {
5684        #[inline]
5685        unsafe fn encode(
5686            self,
5687            encoder: &mut fidl::encoding::Encoder<'_, D>,
5688            offset: usize,
5689            _depth: fidl::encoding::Depth,
5690        ) -> fidl::Result<()> {
5691            encoder.debug_check_bounds::<HandleOp>(offset);
5692            encoder.write_num::<u64>(self.ordinal(), offset);
5693            match self {
5694                HandleOp::Move_(ref val) => fidl::encoding::encode_in_envelope::<HandleId, D>(
5695                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
5696                    encoder,
5697                    offset + 8,
5698                    _depth,
5699                ),
5700                HandleOp::Duplicate(ref val) => fidl::encoding::encode_in_envelope::<HandleId, D>(
5701                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
5702                    encoder,
5703                    offset + 8,
5704                    _depth,
5705                ),
5706            }
5707        }
5708    }
5709
5710    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleOp {
5711        #[inline(always)]
5712        fn new_empty() -> Self {
5713            Self::Move_(fidl::new_empty!(HandleId, D))
5714        }
5715
5716        #[inline]
5717        unsafe fn decode(
5718            &mut self,
5719            decoder: &mut fidl::encoding::Decoder<'_, D>,
5720            offset: usize,
5721            mut depth: fidl::encoding::Depth,
5722        ) -> fidl::Result<()> {
5723            decoder.debug_check_bounds::<Self>(offset);
5724            #[allow(unused_variables)]
5725            let next_out_of_line = decoder.next_out_of_line();
5726            let handles_before = decoder.remaining_handles();
5727            let (ordinal, inlined, num_bytes, num_handles) =
5728                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5729
5730            let member_inline_size = match ordinal {
5731                1 => <HandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5732                2 => <HandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5733                _ => return Err(fidl::Error::UnknownUnionTag),
5734            };
5735
5736            if inlined != (member_inline_size <= 4) {
5737                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5738            }
5739            let _inner_offset;
5740            if inlined {
5741                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5742                _inner_offset = offset + 8;
5743            } else {
5744                depth.increment()?;
5745                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5746            }
5747            match ordinal {
5748                1 => {
5749                    #[allow(irrefutable_let_patterns)]
5750                    if let HandleOp::Move_(_) = self {
5751                        // Do nothing, read the value into the object
5752                    } else {
5753                        // Initialize `self` to the right variant
5754                        *self = HandleOp::Move_(fidl::new_empty!(HandleId, D));
5755                    }
5756                    #[allow(irrefutable_let_patterns)]
5757                    if let HandleOp::Move_(ref mut val) = self {
5758                        fidl::decode!(HandleId, D, val, decoder, _inner_offset, depth)?;
5759                    } else {
5760                        unreachable!()
5761                    }
5762                }
5763                2 => {
5764                    #[allow(irrefutable_let_patterns)]
5765                    if let HandleOp::Duplicate(_) = self {
5766                        // Do nothing, read the value into the object
5767                    } else {
5768                        // Initialize `self` to the right variant
5769                        *self = HandleOp::Duplicate(fidl::new_empty!(HandleId, D));
5770                    }
5771                    #[allow(irrefutable_let_patterns)]
5772                    if let HandleOp::Duplicate(ref mut val) = self {
5773                        fidl::decode!(HandleId, D, val, decoder, _inner_offset, depth)?;
5774                    } else {
5775                        unreachable!()
5776                    }
5777                }
5778                ordinal => panic!("unexpected ordinal {:?}", ordinal),
5779            }
5780            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5781                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5782            }
5783            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5784                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5785            }
5786            Ok(())
5787        }
5788    }
5789
5790    impl fidl::encoding::ValueTypeMarker for Handles {
5791        type Borrowed<'a> = &'a Self;
5792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5793            value
5794        }
5795    }
5796
5797    unsafe impl fidl::encoding::TypeMarker for Handles {
5798        type Owned = Self;
5799
5800        #[inline(always)]
5801        fn inline_align(_context: fidl::encoding::Context) -> usize {
5802            8
5803        }
5804
5805        #[inline(always)]
5806        fn inline_size(_context: fidl::encoding::Context) -> usize {
5807            16
5808        }
5809    }
5810
5811    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Handles, D> for &Handles {
5812        #[inline]
5813        unsafe fn encode(
5814            self,
5815            encoder: &mut fidl::encoding::Encoder<'_, D>,
5816            offset: usize,
5817            _depth: fidl::encoding::Depth,
5818        ) -> fidl::Result<()> {
5819            encoder.debug_check_bounds::<Handles>(offset);
5820            encoder.write_num::<u64>(self.ordinal(), offset);
5821            match self {
5822            Handles::Handles(ref val) => {
5823                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<HandleId, 64>, D>(
5824                    <fidl::encoding::Vector<HandleId, 64> as fidl::encoding::ValueTypeMarker>::borrow(val),
5825                    encoder, offset + 8, _depth
5826                )
5827            }
5828            Handles::Dispositions(ref val) => {
5829                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<HandleDisposition, 64>, D>(
5830                    <fidl::encoding::Vector<HandleDisposition, 64> as fidl::encoding::ValueTypeMarker>::borrow(val),
5831                    encoder, offset + 8, _depth
5832                )
5833            }
5834        }
5835        }
5836    }
5837
5838    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Handles {
5839        #[inline(always)]
5840        fn new_empty() -> Self {
5841            Self::Handles(fidl::new_empty!(fidl::encoding::Vector<HandleId, 64>, D))
5842        }
5843
5844        #[inline]
5845        unsafe fn decode(
5846            &mut self,
5847            decoder: &mut fidl::encoding::Decoder<'_, D>,
5848            offset: usize,
5849            mut depth: fidl::encoding::Depth,
5850        ) -> fidl::Result<()> {
5851            decoder.debug_check_bounds::<Self>(offset);
5852            #[allow(unused_variables)]
5853            let next_out_of_line = decoder.next_out_of_line();
5854            let handles_before = decoder.remaining_handles();
5855            let (ordinal, inlined, num_bytes, num_handles) =
5856                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5857
5858            let member_inline_size = match ordinal {
5859            1 => <fidl::encoding::Vector<HandleId, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5860            2 => <fidl::encoding::Vector<HandleDisposition, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5861            _ => return Err(fidl::Error::UnknownUnionTag),
5862        };
5863
5864            if inlined != (member_inline_size <= 4) {
5865                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5866            }
5867            let _inner_offset;
5868            if inlined {
5869                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5870                _inner_offset = offset + 8;
5871            } else {
5872                depth.increment()?;
5873                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5874            }
5875            match ordinal {
5876                1 => {
5877                    #[allow(irrefutable_let_patterns)]
5878                    if let Handles::Handles(_) = self {
5879                        // Do nothing, read the value into the object
5880                    } else {
5881                        // Initialize `self` to the right variant
5882                        *self = Handles::Handles(
5883                            fidl::new_empty!(fidl::encoding::Vector<HandleId, 64>, D),
5884                        );
5885                    }
5886                    #[allow(irrefutable_let_patterns)]
5887                    if let Handles::Handles(ref mut val) = self {
5888                        fidl::decode!(fidl::encoding::Vector<HandleId, 64>, D, val, decoder, _inner_offset, depth)?;
5889                    } else {
5890                        unreachable!()
5891                    }
5892                }
5893                2 => {
5894                    #[allow(irrefutable_let_patterns)]
5895                    if let Handles::Dispositions(_) = self {
5896                        // Do nothing, read the value into the object
5897                    } else {
5898                        // Initialize `self` to the right variant
5899                        *self = Handles::Dispositions(
5900                            fidl::new_empty!(fidl::encoding::Vector<HandleDisposition, 64>, D),
5901                        );
5902                    }
5903                    #[allow(irrefutable_let_patterns)]
5904                    if let Handles::Dispositions(ref mut val) = self {
5905                        fidl::decode!(fidl::encoding::Vector<HandleDisposition, 64>, D, val, decoder, _inner_offset, depth)?;
5906                    } else {
5907                        unreachable!()
5908                    }
5909                }
5910                ordinal => panic!("unexpected ordinal {:?}", ordinal),
5911            }
5912            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5913                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5914            }
5915            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5916                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5917            }
5918            Ok(())
5919        }
5920    }
5921
5922    impl fidl::encoding::ValueTypeMarker for SocketMessage {
5923        type Borrowed<'a> = &'a Self;
5924        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5925            value
5926        }
5927    }
5928
5929    unsafe impl fidl::encoding::TypeMarker for SocketMessage {
5930        type Owned = Self;
5931
5932        #[inline(always)]
5933        fn inline_align(_context: fidl::encoding::Context) -> usize {
5934            8
5935        }
5936
5937        #[inline(always)]
5938        fn inline_size(_context: fidl::encoding::Context) -> usize {
5939            16
5940        }
5941    }
5942
5943    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketMessage, D>
5944        for &SocketMessage
5945    {
5946        #[inline]
5947        unsafe fn encode(
5948            self,
5949            encoder: &mut fidl::encoding::Encoder<'_, D>,
5950            offset: usize,
5951            _depth: fidl::encoding::Depth,
5952        ) -> fidl::Result<()> {
5953            encoder.debug_check_bounds::<SocketMessage>(offset);
5954            encoder.write_num::<u64>(self.ordinal(), offset);
5955            match self {
5956                SocketMessage::Data(ref val) => {
5957                    fidl::encoding::encode_in_envelope::<SocketData, D>(
5958                        <SocketData as fidl::encoding::ValueTypeMarker>::borrow(val),
5959                        encoder,
5960                        offset + 8,
5961                        _depth,
5962                    )
5963                }
5964                SocketMessage::Stopped(ref val) => {
5965                    fidl::encoding::encode_in_envelope::<AioStopped, D>(
5966                        <AioStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
5967                        encoder,
5968                        offset + 8,
5969                        _depth,
5970                    )
5971                }
5972                SocketMessage::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5973            }
5974        }
5975    }
5976
5977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketMessage {
5978        #[inline(always)]
5979        fn new_empty() -> Self {
5980            Self::__SourceBreaking { unknown_ordinal: 0 }
5981        }
5982
5983        #[inline]
5984        unsafe fn decode(
5985            &mut self,
5986            decoder: &mut fidl::encoding::Decoder<'_, D>,
5987            offset: usize,
5988            mut depth: fidl::encoding::Depth,
5989        ) -> fidl::Result<()> {
5990            decoder.debug_check_bounds::<Self>(offset);
5991            #[allow(unused_variables)]
5992            let next_out_of_line = decoder.next_out_of_line();
5993            let handles_before = decoder.remaining_handles();
5994            let (ordinal, inlined, num_bytes, num_handles) =
5995                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5996
5997            let member_inline_size = match ordinal {
5998                1 => <SocketData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5999                2 => <AioStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6000                0 => return Err(fidl::Error::UnknownUnionTag),
6001                _ => num_bytes as usize,
6002            };
6003
6004            if inlined != (member_inline_size <= 4) {
6005                return Err(fidl::Error::InvalidInlineBitInEnvelope);
6006            }
6007            let _inner_offset;
6008            if inlined {
6009                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6010                _inner_offset = offset + 8;
6011            } else {
6012                depth.increment()?;
6013                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6014            }
6015            match ordinal {
6016                1 => {
6017                    #[allow(irrefutable_let_patterns)]
6018                    if let SocketMessage::Data(_) = self {
6019                        // Do nothing, read the value into the object
6020                    } else {
6021                        // Initialize `self` to the right variant
6022                        *self = SocketMessage::Data(fidl::new_empty!(SocketData, D));
6023                    }
6024                    #[allow(irrefutable_let_patterns)]
6025                    if let SocketMessage::Data(ref mut val) = self {
6026                        fidl::decode!(SocketData, D, val, decoder, _inner_offset, depth)?;
6027                    } else {
6028                        unreachable!()
6029                    }
6030                }
6031                2 => {
6032                    #[allow(irrefutable_let_patterns)]
6033                    if let SocketMessage::Stopped(_) = self {
6034                        // Do nothing, read the value into the object
6035                    } else {
6036                        // Initialize `self` to the right variant
6037                        *self = SocketMessage::Stopped(fidl::new_empty!(AioStopped, D));
6038                    }
6039                    #[allow(irrefutable_let_patterns)]
6040                    if let SocketMessage::Stopped(ref mut val) = self {
6041                        fidl::decode!(AioStopped, D, val, decoder, _inner_offset, depth)?;
6042                    } else {
6043                        unreachable!()
6044                    }
6045                }
6046                #[allow(deprecated)]
6047                ordinal => {
6048                    for _ in 0..num_handles {
6049                        decoder.drop_next_handle()?;
6050                    }
6051                    *self = SocketMessage::__SourceBreaking { unknown_ordinal: ordinal };
6052                }
6053            }
6054            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6055                return Err(fidl::Error::InvalidNumBytesInEnvelope);
6056            }
6057            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6058                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6059            }
6060            Ok(())
6061        }
6062    }
6063
6064    impl fidl::encoding::ValueTypeMarker for WriteChannelError {
6065        type Borrowed<'a> = &'a Self;
6066        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6067            value
6068        }
6069    }
6070
6071    unsafe impl fidl::encoding::TypeMarker for WriteChannelError {
6072        type Owned = Self;
6073
6074        #[inline(always)]
6075        fn inline_align(_context: fidl::encoding::Context) -> usize {
6076            8
6077        }
6078
6079        #[inline(always)]
6080        fn inline_size(_context: fidl::encoding::Context) -> usize {
6081            16
6082        }
6083    }
6084
6085    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteChannelError, D>
6086        for &WriteChannelError
6087    {
6088        #[inline]
6089        unsafe fn encode(
6090            self,
6091            encoder: &mut fidl::encoding::Encoder<'_, D>,
6092            offset: usize,
6093            _depth: fidl::encoding::Depth,
6094        ) -> fidl::Result<()> {
6095            encoder.debug_check_bounds::<WriteChannelError>(offset);
6096            encoder.write_num::<u64>(self.ordinal(), offset);
6097            match self {
6098            WriteChannelError::Error(ref val) => {
6099                fidl::encoding::encode_in_envelope::<Error, D>(
6100                    <Error as fidl::encoding::ValueTypeMarker>::borrow(val),
6101                    encoder, offset + 8, _depth
6102                )
6103            }
6104            WriteChannelError::OpErrors(ref val) => {
6105                fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>, D>(
6106                    <fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>> as fidl::encoding::ValueTypeMarker>::borrow(val),
6107                    encoder, offset + 8, _depth
6108                )
6109            }
6110        }
6111        }
6112    }
6113
6114    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteChannelError {
6115        #[inline(always)]
6116        fn new_empty() -> Self {
6117            Self::Error(fidl::new_empty!(Error, D))
6118        }
6119
6120        #[inline]
6121        unsafe fn decode(
6122            &mut self,
6123            decoder: &mut fidl::encoding::Decoder<'_, D>,
6124            offset: usize,
6125            mut depth: fidl::encoding::Depth,
6126        ) -> fidl::Result<()> {
6127            decoder.debug_check_bounds::<Self>(offset);
6128            #[allow(unused_variables)]
6129            let next_out_of_line = decoder.next_out_of_line();
6130            let handles_before = decoder.remaining_handles();
6131            let (ordinal, inlined, num_bytes, num_handles) =
6132                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6133
6134            let member_inline_size = match ordinal {
6135            1 => <Error as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6136            2 => <fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6137            _ => return Err(fidl::Error::UnknownUnionTag),
6138        };
6139
6140            if inlined != (member_inline_size <= 4) {
6141                return Err(fidl::Error::InvalidInlineBitInEnvelope);
6142            }
6143            let _inner_offset;
6144            if inlined {
6145                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6146                _inner_offset = offset + 8;
6147            } else {
6148                depth.increment()?;
6149                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6150            }
6151            match ordinal {
6152                1 => {
6153                    #[allow(irrefutable_let_patterns)]
6154                    if let WriteChannelError::Error(_) = self {
6155                        // Do nothing, read the value into the object
6156                    } else {
6157                        // Initialize `self` to the right variant
6158                        *self = WriteChannelError::Error(fidl::new_empty!(Error, D));
6159                    }
6160                    #[allow(irrefutable_let_patterns)]
6161                    if let WriteChannelError::Error(ref mut val) = self {
6162                        fidl::decode!(Error, D, val, decoder, _inner_offset, depth)?;
6163                    } else {
6164                        unreachable!()
6165                    }
6166                }
6167                2 => {
6168                    #[allow(irrefutable_let_patterns)]
6169                    if let WriteChannelError::OpErrors(_) = self {
6170                        // Do nothing, read the value into the object
6171                    } else {
6172                        // Initialize `self` to the right variant
6173                        *self = WriteChannelError::OpErrors(fidl::new_empty!(
6174                            fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>,
6175                            D
6176                        ));
6177                    }
6178                    #[allow(irrefutable_let_patterns)]
6179                    if let WriteChannelError::OpErrors(ref mut val) = self {
6180                        fidl::decode!(
6181                            fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>,
6182                            D,
6183                            val,
6184                            decoder,
6185                            _inner_offset,
6186                            depth
6187                        )?;
6188                    } else {
6189                        unreachable!()
6190                    }
6191                }
6192                ordinal => panic!("unexpected ordinal {:?}", ordinal),
6193            }
6194            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6195                return Err(fidl::Error::InvalidNumBytesInEnvelope);
6196            }
6197            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6198                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6199            }
6200            Ok(())
6201        }
6202    }
6203}