Skip to main content

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
14bitflags! {
15    /// Options for creating a VMO.
16    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
17    pub struct VmoOptions: u32 {
18        const RESIZABLE = 2;
19        const TRAP_DIRTY = 8;
20        const UNBOUNDED = 16;
21    }
22}
23
24impl VmoOptions {
25    #[inline(always)]
26    pub fn from_bits_allow_unknown(bits: u32) -> Self {
27        Self::from_bits_retain(bits)
28    }
29
30    #[inline(always)]
31    pub fn has_unknown_bits(&self) -> bool {
32        self.get_unknown_bits() != 0
33    }
34
35    #[inline(always)]
36    pub fn get_unknown_bits(&self) -> u32 {
37        self.bits() & !Self::all().bits()
38    }
39}
40
41/// Socket disposition.
42#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
43pub enum SocketDisposition {
44    NoChange,
45    WriteEnabled,
46    WriteDisabled,
47    #[doc(hidden)]
48    __SourceBreaking {
49        unknown_ordinal: u32,
50    },
51}
52
53/// Pattern that matches an unknown `SocketDisposition` member.
54#[macro_export]
55macro_rules! SocketDispositionUnknown {
56    () => {
57        _
58    };
59}
60
61impl SocketDisposition {
62    #[inline]
63    pub fn from_primitive(prim: u32) -> Option<Self> {
64        match prim {
65            0 => Some(Self::NoChange),
66            1 => Some(Self::WriteEnabled),
67            2 => Some(Self::WriteDisabled),
68            _ => None,
69        }
70    }
71
72    #[inline]
73    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
74        match prim {
75            0 => Self::NoChange,
76            1 => Self::WriteEnabled,
77            2 => Self::WriteDisabled,
78            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
79        }
80    }
81
82    #[inline]
83    pub fn unknown() -> Self {
84        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
85    }
86
87    #[inline]
88    pub const fn into_primitive(self) -> u32 {
89        match self {
90            Self::NoChange => 0,
91            Self::WriteEnabled => 1,
92            Self::WriteDisabled => 2,
93            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
94        }
95    }
96
97    #[inline]
98    pub fn is_unknown(&self) -> bool {
99        match self {
100            Self::__SourceBreaking { unknown_ordinal: _ } => true,
101            _ => false,
102        }
103    }
104}
105
106/// Socket type.
107#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
108pub enum SocketType {
109    Stream,
110    Datagram,
111    #[doc(hidden)]
112    __SourceBreaking {
113        unknown_ordinal: u32,
114    },
115}
116
117/// Pattern that matches an unknown `SocketType` member.
118#[macro_export]
119macro_rules! SocketTypeUnknown {
120    () => {
121        _
122    };
123}
124
125impl SocketType {
126    #[inline]
127    pub fn from_primitive(prim: u32) -> Option<Self> {
128        match prim {
129            0 => Some(Self::Stream),
130            1 => Some(Self::Datagram),
131            _ => None,
132        }
133    }
134
135    #[inline]
136    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
137        match prim {
138            0 => Self::Stream,
139            1 => Self::Datagram,
140            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
141        }
142    }
143
144    #[inline]
145    pub fn unknown() -> Self {
146        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
147    }
148
149    #[inline]
150    pub const fn into_primitive(self) -> u32 {
151        match self {
152            Self::Stream => 0,
153            Self::Datagram => 1,
154            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
155        }
156    }
157
158    #[inline]
159    pub fn is_unknown(&self) -> bool {
160        match self {
161            Self::__SourceBreaking { unknown_ordinal: _ } => true,
162            _ => false,
163        }
164    }
165}
166
167/// A return value indicating asynchronous IO has stopped, optionally with an error.
168#[derive(Clone, Debug, PartialEq)]
169pub struct AioStopped {
170    pub error: Option<Box<Error>>,
171}
172
173impl fidl::Persistable for AioStopped {}
174
175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176#[repr(C)]
177pub struct BadHandleId {
178    pub id: u32,
179}
180
181impl fidl::Persistable for BadHandleId {}
182
183#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
184#[repr(C)]
185pub struct ChannelCreateChannelRequest {
186    pub handles: [NewHandleId; 2],
187}
188
189impl fidl::Persistable for ChannelCreateChannelRequest {}
190
191/// Message received through a channel.
192#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
193pub struct ChannelMessage {
194    pub data: Vec<u8>,
195    pub handles: Vec<HandleInfo>,
196}
197
198impl fidl::Persistable for ChannelMessage {}
199
200#[derive(Clone, Debug, PartialEq)]
201pub struct ChannelOnChannelStreamingDataRequest {
202    pub handle: HandleId,
203    pub channel_sent: ChannelSent,
204}
205
206impl fidl::Persistable for ChannelOnChannelStreamingDataRequest {}
207
208#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209#[repr(C)]
210pub struct ChannelReadChannelRequest {
211    pub handle: HandleId,
212}
213
214impl fidl::Persistable for ChannelReadChannelRequest {}
215
216#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
217#[repr(C)]
218pub struct ChannelReadChannelStreamingStartRequest {
219    pub handle: HandleId,
220}
221
222impl fidl::Persistable for ChannelReadChannelStreamingStartRequest {}
223
224#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
225#[repr(C)]
226pub struct ChannelReadChannelStreamingStopRequest {
227    pub handle: HandleId,
228}
229
230impl fidl::Persistable for ChannelReadChannelStreamingStopRequest {}
231
232#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
233pub struct ChannelWriteChannelRequest {
234    pub handle: HandleId,
235    pub data: Vec<u8>,
236    pub handles: Handles,
237}
238
239impl fidl::Persistable for ChannelWriteChannelRequest {}
240
241#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
242pub struct ClosedDuringRead;
243
244impl fidl::Persistable for ClosedDuringRead {}
245
246#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
247#[repr(C)]
248pub struct EventCreateEventRequest {
249    pub handle: NewHandleId,
250}
251
252impl fidl::Persistable for EventCreateEventRequest {}
253
254#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
255#[repr(C)]
256pub struct EventPairCreateEventPairRequest {
257    pub handles: [NewHandleId; 2],
258}
259
260impl fidl::Persistable for EventPairCreateEventPairRequest {}
261
262#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
263pub struct FDomainCloseRequest {
264    pub handles: Vec<HandleId>,
265}
266
267impl fidl::Persistable for FDomainCloseRequest {}
268
269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
270pub struct FDomainDuplicateRequest {
271    pub handle: HandleId,
272    pub new_handle: NewHandleId,
273    pub rights: fidl::Rights,
274}
275
276impl fidl::Persistable for FDomainDuplicateRequest {}
277
278#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
279#[repr(C)]
280pub struct FDomainGetKoidRequest {
281    pub handle: HandleId,
282}
283
284impl fidl::Persistable for FDomainGetKoidRequest {}
285
286#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
287#[repr(C)]
288pub struct FDomainGetNamespaceRequest {
289    pub new_handle: NewHandleId,
290}
291
292impl fidl::Persistable for FDomainGetNamespaceRequest {}
293
294#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
295pub struct FDomainReplaceRequest {
296    pub handle: HandleId,
297    pub new_handle: NewHandleId,
298    pub rights: fidl::Rights,
299}
300
301impl fidl::Persistable for FDomainReplaceRequest {}
302
303#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
304#[repr(C)]
305pub struct FDomainSignalPeerRequest {
306    pub handle: HandleId,
307    pub set: u32,
308    pub clear: u32,
309}
310
311impl fidl::Persistable for FDomainSignalPeerRequest {}
312
313#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
314#[repr(C)]
315pub struct FDomainSignalRequest {
316    pub handle: HandleId,
317    pub set: u32,
318    pub clear: u32,
319}
320
321impl fidl::Persistable for FDomainSignalRequest {}
322
323#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
324#[repr(C)]
325pub struct FDomainWaitForSignalsRequest {
326    pub handle: HandleId,
327    pub signals: u32,
328}
329
330impl fidl::Persistable for FDomainWaitForSignalsRequest {}
331
332#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
333#[repr(C)]
334pub struct FDomainGetKoidResponse {
335    pub koid: u64,
336}
337
338impl fidl::Persistable for FDomainGetKoidResponse {}
339
340#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
341#[repr(C)]
342pub struct FDomainWaitForSignalsResponse {
343    pub signals: u32,
344}
345
346impl fidl::Persistable for FDomainWaitForSignalsResponse {}
347
348/// A handle disposition. Contains a handle to be written to a channel, as well
349/// as an operation to perform before writing.
350#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
351pub struct HandleDisposition {
352    pub handle: HandleOp,
353    pub rights: fidl::Rights,
354}
355
356impl fidl::Persistable for HandleDisposition {}
357
358/// A handle ID. This is the same size as an actual Zircon handle, and refers to
359/// one conceptually, but internally it is not actually a Zircon handle number.
360#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
361#[repr(C)]
362pub struct HandleId {
363    pub id: u32,
364}
365
366impl fidl::Persistable for HandleId {}
367
368/// A handle, and the rights that handle is known to possess. This is meant to be
369/// a direct analogue to `zx_handle_info_t` as described in
370/// https://fuchsia.dev/reference/syscalls/channel_read_etc
371#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
372pub struct HandleInfo {
373    pub handle: HandleId,
374    pub type_: fidl::ObjectType,
375    pub rights: fidl::Rights,
376}
377
378impl fidl::Persistable for HandleInfo {}
379
380/// A new handle ID. The ID should be a handle ID that has not been used before
381/// in this session. The call this is passed to will presumably make a handle at
382/// this ID, and it can be used as a `HandleId` in subsequent calls.
383#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
384#[repr(C)]
385pub struct NewHandleId {
386    pub id: u32,
387}
388
389impl fidl::Persistable for NewHandleId {}
390
391#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
392#[repr(C)]
393pub struct NewHandleIdOutOfRange {
394    pub id: u32,
395}
396
397impl fidl::Persistable for NewHandleIdOutOfRange {}
398
399#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
400pub struct NewHandleIdReused {
401    pub id: u32,
402    /// Indicates this `NewHandleId` did not collide before the method was called,
403    /// but we passed the same `NewHandleId` to the method twice.
404    pub same_call: bool,
405}
406
407impl fidl::Persistable for NewHandleIdReused {}
408
409#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
410pub struct NoReadInProgress;
411
412impl fidl::Persistable for NoReadInProgress {}
413
414#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
415pub struct RightsUnknown {
416    pub rights: fidl::Rights,
417}
418
419impl fidl::Persistable for RightsUnknown {}
420
421#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
422#[repr(C)]
423pub struct SignalsUnknown {
424    pub signals: u32,
425}
426
427impl fidl::Persistable for SignalsUnknown {}
428
429#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
430pub struct SocketCreateSocketRequest {
431    pub options: SocketType,
432    pub handles: [NewHandleId; 2],
433}
434
435impl fidl::Persistable for SocketCreateSocketRequest {}
436
437/// Data resulting from reading a socket.
438#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
439pub struct SocketData {
440    pub data: Vec<u8>,
441    pub is_datagram: bool,
442}
443
444impl fidl::Persistable for SocketData {}
445
446#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
447pub struct SocketDispositionUnknown {
448    pub disposition: SocketDisposition,
449}
450
451impl fidl::Persistable for SocketDispositionUnknown {}
452
453#[derive(Clone, Debug, PartialEq)]
454pub struct SocketOnSocketStreamingDataRequest {
455    pub handle: HandleId,
456    pub socket_message: SocketMessage,
457}
458
459impl fidl::Persistable for SocketOnSocketStreamingDataRequest {}
460
461#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
462#[repr(C)]
463pub struct SocketReadSocketRequest {
464    pub handle: HandleId,
465    pub max_bytes: u64,
466}
467
468impl fidl::Persistable for SocketReadSocketRequest {}
469
470#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
471#[repr(C)]
472pub struct SocketReadSocketStreamingStartRequest {
473    pub handle: HandleId,
474}
475
476impl fidl::Persistable for SocketReadSocketStreamingStartRequest {}
477
478#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
479#[repr(C)]
480pub struct SocketReadSocketStreamingStopRequest {
481    pub handle: HandleId,
482}
483
484impl fidl::Persistable for SocketReadSocketStreamingStopRequest {}
485
486#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
487pub struct SocketSetSocketDispositionRequest {
488    pub handle: HandleId,
489    pub disposition: SocketDisposition,
490    pub disposition_peer: SocketDisposition,
491}
492
493impl fidl::Persistable for SocketSetSocketDispositionRequest {}
494
495#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
496pub struct SocketTypeUnknown {
497    pub type_: SocketType,
498}
499
500impl fidl::Persistable for SocketTypeUnknown {}
501
502#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
503pub struct SocketWriteSocketRequest {
504    pub handle: HandleId,
505    pub data: Vec<u8>,
506}
507
508impl fidl::Persistable for SocketWriteSocketRequest {}
509
510#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
511#[repr(C)]
512pub struct SocketWriteSocketResponse {
513    pub wrote: u64,
514}
515
516impl fidl::Persistable for SocketWriteSocketResponse {}
517
518#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
519pub struct StreamingReadInProgress;
520
521impl fidl::Persistable for StreamingReadInProgress {}
522
523#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
524pub struct VmoCreateVmoRequest {
525    pub size: u64,
526    pub options: VmoOptions,
527    pub handle: NewHandleId,
528}
529
530impl fidl::Persistable for VmoCreateVmoRequest {}
531
532#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
533#[repr(C)]
534pub struct VmoGetVmoSizeRequest {
535    pub handle: HandleId,
536}
537
538impl fidl::Persistable for VmoGetVmoSizeRequest {}
539
540#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
541#[repr(C)]
542pub struct VmoGetVmoStreamSizeRequest {
543    pub handle: HandleId,
544}
545
546impl fidl::Persistable for VmoGetVmoStreamSizeRequest {}
547
548#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
549#[repr(C)]
550pub struct VmoReadVmoRequest {
551    pub handle: HandleId,
552    pub offset: u64,
553    pub size: u64,
554}
555
556impl fidl::Persistable for VmoReadVmoRequest {}
557
558#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
559#[repr(C)]
560pub struct VmoSetVmoSizeRequest {
561    pub handle: HandleId,
562    pub size: u64,
563}
564
565impl fidl::Persistable for VmoSetVmoSizeRequest {}
566
567#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
568#[repr(C)]
569pub struct VmoSetVmoStreamSizeRequest {
570    pub handle: HandleId,
571    pub size: u64,
572}
573
574impl fidl::Persistable for VmoSetVmoStreamSizeRequest {}
575
576#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
577pub struct VmoWriteVmoRequest {
578    pub handle: HandleId,
579    pub offset: u64,
580    pub data: Vec<u8>,
581}
582
583impl fidl::Persistable for VmoWriteVmoRequest {}
584
585#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
586#[repr(C)]
587pub struct VmoGetVmoSizeResponse {
588    pub size: u64,
589}
590
591impl fidl::Persistable for VmoGetVmoSizeResponse {}
592
593#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
594#[repr(C)]
595pub struct VmoGetVmoStreamSizeResponse {
596    pub size: u64,
597}
598
599impl fidl::Persistable for VmoGetVmoStreamSizeResponse {}
600
601#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
602pub struct VmoReadVmoResponse {
603    pub data: Vec<u8>,
604}
605
606impl fidl::Persistable for VmoReadVmoResponse {}
607
608/// Result from a socket write operation.
609#[derive(Clone, Debug, PartialEq)]
610pub struct WriteSocketError {
611    pub error: Error,
612    pub wrote: u64,
613}
614
615impl fidl::Persistable for WriteSocketError {}
616
617#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
618pub struct WrongHandleType {
619    pub expected: fidl::ObjectType,
620    pub got: fidl::ObjectType,
621}
622
623impl fidl::Persistable for WrongHandleType {}
624
625#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
626pub struct WroteToSelf;
627
628impl fidl::Persistable for WroteToSelf {}
629
630#[derive(Clone, Debug)]
631pub enum ChannelSent {
632    Message(ChannelMessage),
633    Stopped(AioStopped),
634    #[doc(hidden)]
635    __SourceBreaking {
636        unknown_ordinal: u64,
637    },
638}
639
640/// Pattern that matches an unknown `ChannelSent` member.
641#[macro_export]
642macro_rules! ChannelSentUnknown {
643    () => {
644        _
645    };
646}
647
648// Custom PartialEq so that unknown variants are not equal to themselves.
649impl PartialEq for ChannelSent {
650    fn eq(&self, other: &Self) -> bool {
651        match (self, other) {
652            (Self::Message(x), Self::Message(y)) => *x == *y,
653            (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
654            _ => false,
655        }
656    }
657}
658
659impl ChannelSent {
660    #[inline]
661    pub fn ordinal(&self) -> u64 {
662        match *self {
663            Self::Message(_) => 1,
664            Self::Stopped(_) => 2,
665            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
666        }
667    }
668
669    #[inline]
670    pub fn unknown_variant_for_testing() -> Self {
671        Self::__SourceBreaking { unknown_ordinal: 0 }
672    }
673
674    #[inline]
675    pub fn is_unknown(&self) -> bool {
676        match self {
677            Self::__SourceBreaking { .. } => true,
678            _ => false,
679        }
680    }
681}
682
683impl fidl::Persistable for ChannelSent {}
684
685#[derive(Clone, Debug)]
686pub enum Error {
687    /// An error produced by interacting with the handle itself.
688    TargetError(i32),
689    /// An invalid handle ID was given.
690    BadHandleId(BadHandleId),
691    /// We passed a `NewHandleId` that contained an ID with a 1 in the most
692    /// significant bit.
693    NewHandleIdOutOfRange(NewHandleIdOutOfRange),
694    /// We passed a `NewHandleId` that collides with an already-allocated handle.
695    NewHandleIdReused(NewHandleIdReused),
696    /// The handle used is not of the right type for the operation requested.
697    WrongHandleType(WrongHandleType),
698    /// Occurs when we try to start streaming reading twice on the same handle,
699    /// or try to directly read from a handle which we are already
700    /// streaming reading from.
701    StreamingReadInProgress(StreamingReadInProgress),
702    /// We tried to stop streaming reading on a handle we weren't streaming reads
703    /// from to begin with.
704    NoReadInProgress(NoReadInProgress),
705    /// We tried to write a channel into itself.
706    WroteToSelf(WroteToSelf),
707    /// We received a request to close or transfer a handle while we were waiting
708    /// to read from it.
709    ClosedDuringRead(ClosedDuringRead),
710    /// The flexible features of this protocol allowed the client to send us
711    /// signals that we didn't actually understand, and we couldn't proceed
712    /// safely without knowing what they were. The signals field should contain
713    /// only the signals that weren't understood.
714    SignalsUnknown(SignalsUnknown),
715    /// The flexible features of this protocol allowed the client to send us
716    /// rights that we didn't actually understand, and we couldn't proceed safely
717    /// without knowing what they were. The rights field should contain only the
718    /// rights that weren't understood.
719    RightsUnknown(RightsUnknown),
720    /// The client used a socket disposition that the FDomain did not recognize.
721    SocketDispositionUnknown(SocketDispositionUnknown),
722    /// The client used a socket type that the FDomain did not recognize.
723    SocketTypeUnknown(SocketTypeUnknown),
724    #[doc(hidden)]
725    __SourceBreaking { unknown_ordinal: u64 },
726}
727
728/// Pattern that matches an unknown `Error` member.
729#[macro_export]
730macro_rules! ErrorUnknown {
731    () => {
732        _
733    };
734}
735
736// Custom PartialEq so that unknown variants are not equal to themselves.
737impl PartialEq for Error {
738    fn eq(&self, other: &Self) -> bool {
739        match (self, other) {
740            (Self::TargetError(x), Self::TargetError(y)) => *x == *y,
741            (Self::BadHandleId(x), Self::BadHandleId(y)) => *x == *y,
742            (Self::NewHandleIdOutOfRange(x), Self::NewHandleIdOutOfRange(y)) => *x == *y,
743            (Self::NewHandleIdReused(x), Self::NewHandleIdReused(y)) => *x == *y,
744            (Self::WrongHandleType(x), Self::WrongHandleType(y)) => *x == *y,
745            (Self::StreamingReadInProgress(x), Self::StreamingReadInProgress(y)) => *x == *y,
746            (Self::NoReadInProgress(x), Self::NoReadInProgress(y)) => *x == *y,
747            (Self::WroteToSelf(x), Self::WroteToSelf(y)) => *x == *y,
748            (Self::ClosedDuringRead(x), Self::ClosedDuringRead(y)) => *x == *y,
749            (Self::SignalsUnknown(x), Self::SignalsUnknown(y)) => *x == *y,
750            (Self::RightsUnknown(x), Self::RightsUnknown(y)) => *x == *y,
751            (Self::SocketDispositionUnknown(x), Self::SocketDispositionUnknown(y)) => *x == *y,
752            (Self::SocketTypeUnknown(x), Self::SocketTypeUnknown(y)) => *x == *y,
753            _ => false,
754        }
755    }
756}
757
758impl Error {
759    #[inline]
760    pub fn ordinal(&self) -> u64 {
761        match *self {
762            Self::TargetError(_) => 1,
763            Self::BadHandleId(_) => 2,
764            Self::NewHandleIdOutOfRange(_) => 3,
765            Self::NewHandleIdReused(_) => 4,
766            Self::WrongHandleType(_) => 5,
767            Self::StreamingReadInProgress(_) => 6,
768            Self::NoReadInProgress(_) => 7,
769            Self::WroteToSelf(_) => 8,
770            Self::ClosedDuringRead(_) => 9,
771            Self::SignalsUnknown(_) => 10,
772            Self::RightsUnknown(_) => 11,
773            Self::SocketDispositionUnknown(_) => 12,
774            Self::SocketTypeUnknown(_) => 13,
775            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
776        }
777    }
778
779    #[inline]
780    pub fn unknown_variant_for_testing() -> Self {
781        Self::__SourceBreaking { unknown_ordinal: 0 }
782    }
783
784    #[inline]
785    pub fn is_unknown(&self) -> bool {
786        match self {
787            Self::__SourceBreaking { .. } => true,
788            _ => false,
789        }
790    }
791}
792
793impl fidl::Persistable for Error {}
794
795/// A handle, paired with an operation to perform on that handle (move or
796/// duplicate).
797#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
798pub enum HandleOp {
799    Move_(HandleId),
800    Duplicate(HandleId),
801}
802
803impl HandleOp {
804    #[inline]
805    pub fn ordinal(&self) -> u64 {
806        match *self {
807            Self::Move_(_) => 1,
808            Self::Duplicate(_) => 2,
809        }
810    }
811}
812
813impl fidl::Persistable for HandleOp {}
814
815#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
816pub enum Handles {
817    Handles(Vec<HandleId>),
818    Dispositions(Vec<HandleDisposition>),
819}
820
821impl Handles {
822    #[inline]
823    pub fn ordinal(&self) -> u64 {
824        match *self {
825            Self::Handles(_) => 1,
826            Self::Dispositions(_) => 2,
827        }
828    }
829}
830
831impl fidl::Persistable for Handles {}
832
833#[derive(Clone, Debug)]
834pub enum SocketMessage {
835    Data(SocketData),
836    Stopped(AioStopped),
837    #[doc(hidden)]
838    __SourceBreaking {
839        unknown_ordinal: u64,
840    },
841}
842
843/// Pattern that matches an unknown `SocketMessage` member.
844#[macro_export]
845macro_rules! SocketMessageUnknown {
846    () => {
847        _
848    };
849}
850
851// Custom PartialEq so that unknown variants are not equal to themselves.
852impl PartialEq for SocketMessage {
853    fn eq(&self, other: &Self) -> bool {
854        match (self, other) {
855            (Self::Data(x), Self::Data(y)) => *x == *y,
856            (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
857            _ => false,
858        }
859    }
860}
861
862impl SocketMessage {
863    #[inline]
864    pub fn ordinal(&self) -> u64 {
865        match *self {
866            Self::Data(_) => 1,
867            Self::Stopped(_) => 2,
868            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
869        }
870    }
871
872    #[inline]
873    pub fn unknown_variant_for_testing() -> Self {
874        Self::__SourceBreaking { unknown_ordinal: 0 }
875    }
876
877    #[inline]
878    pub fn is_unknown(&self) -> bool {
879        match self {
880            Self::__SourceBreaking { .. } => true,
881            _ => false,
882        }
883    }
884}
885
886impl fidl::Persistable for SocketMessage {}
887
888/// Result from a channel write operation.
889#[derive(Clone, Debug, PartialEq)]
890pub enum WriteChannelError {
891    Error(Error),
892    OpErrors(Vec<Option<Box<Error>>>),
893}
894
895impl WriteChannelError {
896    #[inline]
897    pub fn ordinal(&self) -> u64 {
898        match *self {
899            Self::Error(_) => 1,
900            Self::OpErrors(_) => 2,
901        }
902    }
903}
904
905impl fidl::Persistable for WriteChannelError {}
906
907pub mod channel_ordinals {
908    pub const CREATE_CHANNEL: u64 = 0x182d38bfe88673b5;
909    pub const READ_CHANNEL: u64 = 0x6ef47bf27bf7d050;
910    pub const WRITE_CHANNEL: u64 = 0x75a2559b945d5eb5;
911    pub const READ_CHANNEL_STREAMING_START: u64 = 0x3c73e85476a203df;
912    pub const READ_CHANNEL_STREAMING_STOP: u64 = 0x56f21d6ed68186e0;
913    pub const ON_CHANNEL_STREAMING_DATA: u64 = 0x7d4431805202dfe1;
914}
915
916pub mod event_ordinals {
917    pub const CREATE_EVENT: u64 = 0x7b05b3f262635987;
918}
919
920pub mod event_pair_ordinals {
921    pub const CREATE_EVENT_PAIR: u64 = 0x7aef61effa65656d;
922}
923
924pub mod f_domain_ordinals {
925    pub const CREATE_CHANNEL: u64 = 0x182d38bfe88673b5;
926    pub const READ_CHANNEL: u64 = 0x6ef47bf27bf7d050;
927    pub const WRITE_CHANNEL: u64 = 0x75a2559b945d5eb5;
928    pub const READ_CHANNEL_STREAMING_START: u64 = 0x3c73e85476a203df;
929    pub const READ_CHANNEL_STREAMING_STOP: u64 = 0x56f21d6ed68186e0;
930    pub const ON_CHANNEL_STREAMING_DATA: u64 = 0x7d4431805202dfe1;
931    pub const CREATE_EVENT: u64 = 0x7b05b3f262635987;
932    pub const CREATE_EVENT_PAIR: u64 = 0x7aef61effa65656d;
933    pub const CREATE_SOCKET: u64 = 0x200bf0ea21932de0;
934    pub const SET_SOCKET_DISPOSITION: u64 = 0x60d3c7ccb17f9bdf;
935    pub const READ_SOCKET: u64 = 0x1da8aabec249c02e;
936    pub const WRITE_SOCKET: u64 = 0x5b541623cbbbf683;
937    pub const READ_SOCKET_STREAMING_START: u64 = 0x2a592748d5f33445;
938    pub const READ_SOCKET_STREAMING_STOP: u64 = 0x53e5cade5f4d22e7;
939    pub const ON_SOCKET_STREAMING_DATA: u64 = 0x998b5e66b3c80a2;
940    pub const CREATE_VMO: u64 = 0x392dcaac1ddd8868;
941    pub const READ_VMO: u64 = 0x62690ec76b0f2fe6;
942    pub const WRITE_VMO: u64 = 0x2f6ac299380e486e;
943    pub const GET_VMO_SIZE: u64 = 0x717f9f3a9ff6906e;
944    pub const SET_VMO_SIZE: u64 = 0x7f6f77ac37afe38b;
945    pub const GET_VMO_STREAM_SIZE: u64 = 0x54020f4280cb038;
946    pub const SET_VMO_STREAM_SIZE: u64 = 0x3bdb108fb18002eb;
947    pub const GET_NAMESPACE: u64 = 0x74f2e74d9f53e11e;
948    pub const CLOSE: u64 = 0x5ef8c24362964257;
949    pub const DUPLICATE: u64 = 0x7a85b94bd1777ab9;
950    pub const REPLACE: u64 = 0x32fa64625a5bd3be;
951    pub const SIGNAL: u64 = 0xe8352fb978996d9;
952    pub const SIGNAL_PEER: u64 = 0x7e84ec8ca7eabaf8;
953    pub const WAIT_FOR_SIGNALS: u64 = 0x8f72d9b4b85c1eb;
954    pub const GET_KOID: u64 = 0x437db979a63402c3;
955}
956
957pub mod socket_ordinals {
958    pub const CREATE_SOCKET: u64 = 0x200bf0ea21932de0;
959    pub const SET_SOCKET_DISPOSITION: u64 = 0x60d3c7ccb17f9bdf;
960    pub const READ_SOCKET: u64 = 0x1da8aabec249c02e;
961    pub const WRITE_SOCKET: u64 = 0x5b541623cbbbf683;
962    pub const READ_SOCKET_STREAMING_START: u64 = 0x2a592748d5f33445;
963    pub const READ_SOCKET_STREAMING_STOP: u64 = 0x53e5cade5f4d22e7;
964    pub const ON_SOCKET_STREAMING_DATA: u64 = 0x998b5e66b3c80a2;
965}
966
967pub mod vmo_ordinals {
968    pub const CREATE_VMO: u64 = 0x392dcaac1ddd8868;
969    pub const READ_VMO: u64 = 0x62690ec76b0f2fe6;
970    pub const WRITE_VMO: u64 = 0x2f6ac299380e486e;
971    pub const GET_VMO_SIZE: u64 = 0x717f9f3a9ff6906e;
972    pub const SET_VMO_SIZE: u64 = 0x7f6f77ac37afe38b;
973    pub const GET_VMO_STREAM_SIZE: u64 = 0x54020f4280cb038;
974    pub const SET_VMO_STREAM_SIZE: u64 = 0x3bdb108fb18002eb;
975}
976
977mod internal {
978    use super::*;
979    unsafe impl fidl::encoding::TypeMarker for VmoOptions {
980        type Owned = Self;
981
982        #[inline(always)]
983        fn inline_align(_context: fidl::encoding::Context) -> usize {
984            4
985        }
986
987        #[inline(always)]
988        fn inline_size(_context: fidl::encoding::Context) -> usize {
989            4
990        }
991    }
992
993    impl fidl::encoding::ValueTypeMarker for VmoOptions {
994        type Borrowed<'a> = Self;
995        #[inline(always)]
996        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
997            *value
998        }
999    }
1000
1001    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VmoOptions {
1002        #[inline]
1003        unsafe fn encode(
1004            self,
1005            encoder: &mut fidl::encoding::Encoder<'_, D>,
1006            offset: usize,
1007            _depth: fidl::encoding::Depth,
1008        ) -> fidl::Result<()> {
1009            encoder.debug_check_bounds::<Self>(offset);
1010            encoder.write_num(self.bits(), offset);
1011            Ok(())
1012        }
1013    }
1014
1015    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoOptions {
1016        #[inline(always)]
1017        fn new_empty() -> Self {
1018            Self::empty()
1019        }
1020
1021        #[inline]
1022        unsafe fn decode(
1023            &mut self,
1024            decoder: &mut fidl::encoding::Decoder<'_, D>,
1025            offset: usize,
1026            _depth: fidl::encoding::Depth,
1027        ) -> fidl::Result<()> {
1028            decoder.debug_check_bounds::<Self>(offset);
1029            let prim = decoder.read_num::<u32>(offset);
1030            *self = Self::from_bits_allow_unknown(prim);
1031            Ok(())
1032        }
1033    }
1034    unsafe impl fidl::encoding::TypeMarker for SocketDisposition {
1035        type Owned = Self;
1036
1037        #[inline(always)]
1038        fn inline_align(_context: fidl::encoding::Context) -> usize {
1039            std::mem::align_of::<u32>()
1040        }
1041
1042        #[inline(always)]
1043        fn inline_size(_context: fidl::encoding::Context) -> usize {
1044            std::mem::size_of::<u32>()
1045        }
1046
1047        #[inline(always)]
1048        fn encode_is_copy() -> bool {
1049            false
1050        }
1051
1052        #[inline(always)]
1053        fn decode_is_copy() -> bool {
1054            false
1055        }
1056    }
1057
1058    impl fidl::encoding::ValueTypeMarker for SocketDisposition {
1059        type Borrowed<'a> = Self;
1060        #[inline(always)]
1061        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1062            *value
1063        }
1064    }
1065
1066    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1067        for SocketDisposition
1068    {
1069        #[inline]
1070        unsafe fn encode(
1071            self,
1072            encoder: &mut fidl::encoding::Encoder<'_, D>,
1073            offset: usize,
1074            _depth: fidl::encoding::Depth,
1075        ) -> fidl::Result<()> {
1076            encoder.debug_check_bounds::<Self>(offset);
1077            encoder.write_num(self.into_primitive(), offset);
1078            Ok(())
1079        }
1080    }
1081
1082    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketDisposition {
1083        #[inline(always)]
1084        fn new_empty() -> Self {
1085            Self::unknown()
1086        }
1087
1088        #[inline]
1089        unsafe fn decode(
1090            &mut self,
1091            decoder: &mut fidl::encoding::Decoder<'_, D>,
1092            offset: usize,
1093            _depth: fidl::encoding::Depth,
1094        ) -> fidl::Result<()> {
1095            decoder.debug_check_bounds::<Self>(offset);
1096            let prim = decoder.read_num::<u32>(offset);
1097
1098            *self = Self::from_primitive_allow_unknown(prim);
1099            Ok(())
1100        }
1101    }
1102    unsafe impl fidl::encoding::TypeMarker for SocketType {
1103        type Owned = Self;
1104
1105        #[inline(always)]
1106        fn inline_align(_context: fidl::encoding::Context) -> usize {
1107            std::mem::align_of::<u32>()
1108        }
1109
1110        #[inline(always)]
1111        fn inline_size(_context: fidl::encoding::Context) -> usize {
1112            std::mem::size_of::<u32>()
1113        }
1114
1115        #[inline(always)]
1116        fn encode_is_copy() -> bool {
1117            false
1118        }
1119
1120        #[inline(always)]
1121        fn decode_is_copy() -> bool {
1122            false
1123        }
1124    }
1125
1126    impl fidl::encoding::ValueTypeMarker for SocketType {
1127        type Borrowed<'a> = Self;
1128        #[inline(always)]
1129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1130            *value
1131        }
1132    }
1133
1134    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SocketType {
1135        #[inline]
1136        unsafe fn encode(
1137            self,
1138            encoder: &mut fidl::encoding::Encoder<'_, D>,
1139            offset: usize,
1140            _depth: fidl::encoding::Depth,
1141        ) -> fidl::Result<()> {
1142            encoder.debug_check_bounds::<Self>(offset);
1143            encoder.write_num(self.into_primitive(), offset);
1144            Ok(())
1145        }
1146    }
1147
1148    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketType {
1149        #[inline(always)]
1150        fn new_empty() -> Self {
1151            Self::unknown()
1152        }
1153
1154        #[inline]
1155        unsafe fn decode(
1156            &mut self,
1157            decoder: &mut fidl::encoding::Decoder<'_, D>,
1158            offset: usize,
1159            _depth: fidl::encoding::Depth,
1160        ) -> fidl::Result<()> {
1161            decoder.debug_check_bounds::<Self>(offset);
1162            let prim = decoder.read_num::<u32>(offset);
1163
1164            *self = Self::from_primitive_allow_unknown(prim);
1165            Ok(())
1166        }
1167    }
1168
1169    impl fidl::encoding::ValueTypeMarker for AioStopped {
1170        type Borrowed<'a> = &'a Self;
1171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1172            value
1173        }
1174    }
1175
1176    unsafe impl fidl::encoding::TypeMarker for AioStopped {
1177        type Owned = Self;
1178
1179        #[inline(always)]
1180        fn inline_align(_context: fidl::encoding::Context) -> usize {
1181            8
1182        }
1183
1184        #[inline(always)]
1185        fn inline_size(_context: fidl::encoding::Context) -> usize {
1186            16
1187        }
1188    }
1189
1190    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AioStopped, D>
1191        for &AioStopped
1192    {
1193        #[inline]
1194        unsafe fn encode(
1195            self,
1196            encoder: &mut fidl::encoding::Encoder<'_, D>,
1197            offset: usize,
1198            _depth: fidl::encoding::Depth,
1199        ) -> fidl::Result<()> {
1200            encoder.debug_check_bounds::<AioStopped>(offset);
1201            // Delegate to tuple encoding.
1202            fidl::encoding::Encode::<AioStopped, D>::encode(
1203                (
1204                    <fidl::encoding::OptionalUnion<Error> as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
1205                ),
1206                encoder, offset, _depth
1207            )
1208        }
1209    }
1210    unsafe impl<
1211        D: fidl::encoding::ResourceDialect,
1212        T0: fidl::encoding::Encode<fidl::encoding::OptionalUnion<Error>, D>,
1213    > fidl::encoding::Encode<AioStopped, D> for (T0,)
1214    {
1215        #[inline]
1216        unsafe fn encode(
1217            self,
1218            encoder: &mut fidl::encoding::Encoder<'_, D>,
1219            offset: usize,
1220            depth: fidl::encoding::Depth,
1221        ) -> fidl::Result<()> {
1222            encoder.debug_check_bounds::<AioStopped>(offset);
1223            // Zero out padding regions. There's no need to apply masks
1224            // because the unmasked parts will be overwritten by fields.
1225            // Write the fields.
1226            self.0.encode(encoder, offset + 0, depth)?;
1227            Ok(())
1228        }
1229    }
1230
1231    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AioStopped {
1232        #[inline(always)]
1233        fn new_empty() -> Self {
1234            Self { error: fidl::new_empty!(fidl::encoding::OptionalUnion<Error>, D) }
1235        }
1236
1237        #[inline]
1238        unsafe fn decode(
1239            &mut self,
1240            decoder: &mut fidl::encoding::Decoder<'_, D>,
1241            offset: usize,
1242            _depth: fidl::encoding::Depth,
1243        ) -> fidl::Result<()> {
1244            decoder.debug_check_bounds::<Self>(offset);
1245            // Verify that padding bytes are zero.
1246            fidl::decode!(
1247                fidl::encoding::OptionalUnion<Error>,
1248                D,
1249                &mut self.error,
1250                decoder,
1251                offset + 0,
1252                _depth
1253            )?;
1254            Ok(())
1255        }
1256    }
1257
1258    impl fidl::encoding::ValueTypeMarker for BadHandleId {
1259        type Borrowed<'a> = &'a Self;
1260        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1261            value
1262        }
1263    }
1264
1265    unsafe impl fidl::encoding::TypeMarker for BadHandleId {
1266        type Owned = Self;
1267
1268        #[inline(always)]
1269        fn inline_align(_context: fidl::encoding::Context) -> usize {
1270            4
1271        }
1272
1273        #[inline(always)]
1274        fn inline_size(_context: fidl::encoding::Context) -> usize {
1275            4
1276        }
1277        #[inline(always)]
1278        fn encode_is_copy() -> bool {
1279            true
1280        }
1281
1282        #[inline(always)]
1283        fn decode_is_copy() -> bool {
1284            true
1285        }
1286    }
1287
1288    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BadHandleId, D>
1289        for &BadHandleId
1290    {
1291        #[inline]
1292        unsafe fn encode(
1293            self,
1294            encoder: &mut fidl::encoding::Encoder<'_, D>,
1295            offset: usize,
1296            _depth: fidl::encoding::Depth,
1297        ) -> fidl::Result<()> {
1298            encoder.debug_check_bounds::<BadHandleId>(offset);
1299            unsafe {
1300                // Copy the object into the buffer.
1301                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1302                (buf_ptr as *mut BadHandleId).write_unaligned((self as *const BadHandleId).read());
1303                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1304                // done second because the memcpy will write garbage to these bytes.
1305            }
1306            Ok(())
1307        }
1308    }
1309    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1310        fidl::encoding::Encode<BadHandleId, D> for (T0,)
1311    {
1312        #[inline]
1313        unsafe fn encode(
1314            self,
1315            encoder: &mut fidl::encoding::Encoder<'_, D>,
1316            offset: usize,
1317            depth: fidl::encoding::Depth,
1318        ) -> fidl::Result<()> {
1319            encoder.debug_check_bounds::<BadHandleId>(offset);
1320            // Zero out padding regions. There's no need to apply masks
1321            // because the unmasked parts will be overwritten by fields.
1322            // Write the fields.
1323            self.0.encode(encoder, offset + 0, depth)?;
1324            Ok(())
1325        }
1326    }
1327
1328    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BadHandleId {
1329        #[inline(always)]
1330        fn new_empty() -> Self {
1331            Self { id: fidl::new_empty!(u32, D) }
1332        }
1333
1334        #[inline]
1335        unsafe fn decode(
1336            &mut self,
1337            decoder: &mut fidl::encoding::Decoder<'_, D>,
1338            offset: usize,
1339            _depth: fidl::encoding::Depth,
1340        ) -> fidl::Result<()> {
1341            decoder.debug_check_bounds::<Self>(offset);
1342            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1343            // Verify that padding bytes are zero.
1344            // Copy from the buffer into the object.
1345            unsafe {
1346                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1347            }
1348            Ok(())
1349        }
1350    }
1351
1352    impl fidl::encoding::ValueTypeMarker for ChannelCreateChannelRequest {
1353        type Borrowed<'a> = &'a Self;
1354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1355            value
1356        }
1357    }
1358
1359    unsafe impl fidl::encoding::TypeMarker for ChannelCreateChannelRequest {
1360        type Owned = Self;
1361
1362        #[inline(always)]
1363        fn inline_align(_context: fidl::encoding::Context) -> usize {
1364            4
1365        }
1366
1367        #[inline(always)]
1368        fn inline_size(_context: fidl::encoding::Context) -> usize {
1369            8
1370        }
1371        #[inline(always)]
1372        fn encode_is_copy() -> bool {
1373            true
1374        }
1375
1376        #[inline(always)]
1377        fn decode_is_copy() -> bool {
1378            true
1379        }
1380    }
1381
1382    unsafe impl<D: fidl::encoding::ResourceDialect>
1383        fidl::encoding::Encode<ChannelCreateChannelRequest, D> for &ChannelCreateChannelRequest
1384    {
1385        #[inline]
1386        unsafe fn encode(
1387            self,
1388            encoder: &mut fidl::encoding::Encoder<'_, D>,
1389            offset: usize,
1390            _depth: fidl::encoding::Depth,
1391        ) -> fidl::Result<()> {
1392            encoder.debug_check_bounds::<ChannelCreateChannelRequest>(offset);
1393            unsafe {
1394                // Copy the object into the buffer.
1395                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1396                (buf_ptr as *mut ChannelCreateChannelRequest)
1397                    .write_unaligned((self as *const ChannelCreateChannelRequest).read());
1398                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1399                // done second because the memcpy will write garbage to these bytes.
1400            }
1401            Ok(())
1402        }
1403    }
1404    unsafe impl<
1405        D: fidl::encoding::ResourceDialect,
1406        T0: fidl::encoding::Encode<fidl::encoding::Array<NewHandleId, 2>, D>,
1407    > fidl::encoding::Encode<ChannelCreateChannelRequest, D> for (T0,)
1408    {
1409        #[inline]
1410        unsafe fn encode(
1411            self,
1412            encoder: &mut fidl::encoding::Encoder<'_, D>,
1413            offset: usize,
1414            depth: fidl::encoding::Depth,
1415        ) -> fidl::Result<()> {
1416            encoder.debug_check_bounds::<ChannelCreateChannelRequest>(offset);
1417            // Zero out padding regions. There's no need to apply masks
1418            // because the unmasked parts will be overwritten by fields.
1419            // Write the fields.
1420            self.0.encode(encoder, offset + 0, depth)?;
1421            Ok(())
1422        }
1423    }
1424
1425    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1426        for ChannelCreateChannelRequest
1427    {
1428        #[inline(always)]
1429        fn new_empty() -> Self {
1430            Self { handles: fidl::new_empty!(fidl::encoding::Array<NewHandleId, 2>, D) }
1431        }
1432
1433        #[inline]
1434        unsafe fn decode(
1435            &mut self,
1436            decoder: &mut fidl::encoding::Decoder<'_, D>,
1437            offset: usize,
1438            _depth: fidl::encoding::Depth,
1439        ) -> fidl::Result<()> {
1440            decoder.debug_check_bounds::<Self>(offset);
1441            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1442            // Verify that padding bytes are zero.
1443            // Copy from the buffer into the object.
1444            unsafe {
1445                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1446            }
1447            Ok(())
1448        }
1449    }
1450
1451    impl fidl::encoding::ValueTypeMarker for ChannelMessage {
1452        type Borrowed<'a> = &'a Self;
1453        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1454            value
1455        }
1456    }
1457
1458    unsafe impl fidl::encoding::TypeMarker for ChannelMessage {
1459        type Owned = Self;
1460
1461        #[inline(always)]
1462        fn inline_align(_context: fidl::encoding::Context) -> usize {
1463            8
1464        }
1465
1466        #[inline(always)]
1467        fn inline_size(_context: fidl::encoding::Context) -> usize {
1468            32
1469        }
1470    }
1471
1472    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelMessage, D>
1473        for &ChannelMessage
1474    {
1475        #[inline]
1476        unsafe fn encode(
1477            self,
1478            encoder: &mut fidl::encoding::Encoder<'_, D>,
1479            offset: usize,
1480            _depth: fidl::encoding::Depth,
1481        ) -> fidl::Result<()> {
1482            encoder.debug_check_bounds::<ChannelMessage>(offset);
1483            // Delegate to tuple encoding.
1484            fidl::encoding::Encode::<ChannelMessage, D>::encode(
1485                (
1486                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1487                    <fidl::encoding::Vector<HandleInfo, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
1488                ),
1489                encoder, offset, _depth
1490            )
1491        }
1492    }
1493    unsafe impl<
1494        D: fidl::encoding::ResourceDialect,
1495        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 65536>, D>,
1496        T1: fidl::encoding::Encode<fidl::encoding::Vector<HandleInfo, 64>, D>,
1497    > fidl::encoding::Encode<ChannelMessage, D> for (T0, T1)
1498    {
1499        #[inline]
1500        unsafe fn encode(
1501            self,
1502            encoder: &mut fidl::encoding::Encoder<'_, D>,
1503            offset: usize,
1504            depth: fidl::encoding::Depth,
1505        ) -> fidl::Result<()> {
1506            encoder.debug_check_bounds::<ChannelMessage>(offset);
1507            // Zero out padding regions. There's no need to apply masks
1508            // because the unmasked parts will be overwritten by fields.
1509            // Write the fields.
1510            self.0.encode(encoder, offset + 0, depth)?;
1511            self.1.encode(encoder, offset + 16, depth)?;
1512            Ok(())
1513        }
1514    }
1515
1516    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelMessage {
1517        #[inline(always)]
1518        fn new_empty() -> Self {
1519            Self {
1520                data: fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D),
1521                handles: fidl::new_empty!(fidl::encoding::Vector<HandleInfo, 64>, D),
1522            }
1523        }
1524
1525        #[inline]
1526        unsafe fn decode(
1527            &mut self,
1528            decoder: &mut fidl::encoding::Decoder<'_, D>,
1529            offset: usize,
1530            _depth: fidl::encoding::Depth,
1531        ) -> fidl::Result<()> {
1532            decoder.debug_check_bounds::<Self>(offset);
1533            // Verify that padding bytes are zero.
1534            fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, &mut self.data, decoder, offset + 0, _depth)?;
1535            fidl::decode!(fidl::encoding::Vector<HandleInfo, 64>, D, &mut self.handles, decoder, offset + 16, _depth)?;
1536            Ok(())
1537        }
1538    }
1539
1540    impl fidl::encoding::ValueTypeMarker for ChannelOnChannelStreamingDataRequest {
1541        type Borrowed<'a> = &'a Self;
1542        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1543            value
1544        }
1545    }
1546
1547    unsafe impl fidl::encoding::TypeMarker for ChannelOnChannelStreamingDataRequest {
1548        type Owned = Self;
1549
1550        #[inline(always)]
1551        fn inline_align(_context: fidl::encoding::Context) -> usize {
1552            8
1553        }
1554
1555        #[inline(always)]
1556        fn inline_size(_context: fidl::encoding::Context) -> usize {
1557            24
1558        }
1559    }
1560
1561    unsafe impl<D: fidl::encoding::ResourceDialect>
1562        fidl::encoding::Encode<ChannelOnChannelStreamingDataRequest, D>
1563        for &ChannelOnChannelStreamingDataRequest
1564    {
1565        #[inline]
1566        unsafe fn encode(
1567            self,
1568            encoder: &mut fidl::encoding::Encoder<'_, D>,
1569            offset: usize,
1570            _depth: fidl::encoding::Depth,
1571        ) -> fidl::Result<()> {
1572            encoder.debug_check_bounds::<ChannelOnChannelStreamingDataRequest>(offset);
1573            // Delegate to tuple encoding.
1574            fidl::encoding::Encode::<ChannelOnChannelStreamingDataRequest, D>::encode(
1575                (
1576                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
1577                    <ChannelSent as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_sent),
1578                ),
1579                encoder,
1580                offset,
1581                _depth,
1582            )
1583        }
1584    }
1585    unsafe impl<
1586        D: fidl::encoding::ResourceDialect,
1587        T0: fidl::encoding::Encode<HandleId, D>,
1588        T1: fidl::encoding::Encode<ChannelSent, D>,
1589    > fidl::encoding::Encode<ChannelOnChannelStreamingDataRequest, D> for (T0, T1)
1590    {
1591        #[inline]
1592        unsafe fn encode(
1593            self,
1594            encoder: &mut fidl::encoding::Encoder<'_, D>,
1595            offset: usize,
1596            depth: fidl::encoding::Depth,
1597        ) -> fidl::Result<()> {
1598            encoder.debug_check_bounds::<ChannelOnChannelStreamingDataRequest>(offset);
1599            // Zero out padding regions. There's no need to apply masks
1600            // because the unmasked parts will be overwritten by fields.
1601            unsafe {
1602                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1603                (ptr as *mut u64).write_unaligned(0);
1604            }
1605            // Write the fields.
1606            self.0.encode(encoder, offset + 0, depth)?;
1607            self.1.encode(encoder, offset + 8, depth)?;
1608            Ok(())
1609        }
1610    }
1611
1612    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1613        for ChannelOnChannelStreamingDataRequest
1614    {
1615        #[inline(always)]
1616        fn new_empty() -> Self {
1617            Self {
1618                handle: fidl::new_empty!(HandleId, D),
1619                channel_sent: fidl::new_empty!(ChannelSent, D),
1620            }
1621        }
1622
1623        #[inline]
1624        unsafe fn decode(
1625            &mut self,
1626            decoder: &mut fidl::encoding::Decoder<'_, D>,
1627            offset: usize,
1628            _depth: fidl::encoding::Depth,
1629        ) -> fidl::Result<()> {
1630            decoder.debug_check_bounds::<Self>(offset);
1631            // Verify that padding bytes are zero.
1632            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1633            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1634            let mask = 0xffffffff00000000u64;
1635            let maskedval = padval & mask;
1636            if maskedval != 0 {
1637                return Err(fidl::Error::NonZeroPadding {
1638                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1639                });
1640            }
1641            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
1642            fidl::decode!(ChannelSent, D, &mut self.channel_sent, decoder, offset + 8, _depth)?;
1643            Ok(())
1644        }
1645    }
1646
1647    impl fidl::encoding::ValueTypeMarker for ChannelReadChannelRequest {
1648        type Borrowed<'a> = &'a Self;
1649        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1650            value
1651        }
1652    }
1653
1654    unsafe impl fidl::encoding::TypeMarker for ChannelReadChannelRequest {
1655        type Owned = Self;
1656
1657        #[inline(always)]
1658        fn inline_align(_context: fidl::encoding::Context) -> usize {
1659            4
1660        }
1661
1662        #[inline(always)]
1663        fn inline_size(_context: fidl::encoding::Context) -> usize {
1664            4
1665        }
1666        #[inline(always)]
1667        fn encode_is_copy() -> bool {
1668            true
1669        }
1670
1671        #[inline(always)]
1672        fn decode_is_copy() -> bool {
1673            true
1674        }
1675    }
1676
1677    unsafe impl<D: fidl::encoding::ResourceDialect>
1678        fidl::encoding::Encode<ChannelReadChannelRequest, D> for &ChannelReadChannelRequest
1679    {
1680        #[inline]
1681        unsafe fn encode(
1682            self,
1683            encoder: &mut fidl::encoding::Encoder<'_, D>,
1684            offset: usize,
1685            _depth: fidl::encoding::Depth,
1686        ) -> fidl::Result<()> {
1687            encoder.debug_check_bounds::<ChannelReadChannelRequest>(offset);
1688            unsafe {
1689                // Copy the object into the buffer.
1690                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1691                (buf_ptr as *mut ChannelReadChannelRequest)
1692                    .write_unaligned((self as *const ChannelReadChannelRequest).read());
1693                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1694                // done second because the memcpy will write garbage to these bytes.
1695            }
1696            Ok(())
1697        }
1698    }
1699    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
1700        fidl::encoding::Encode<ChannelReadChannelRequest, D> for (T0,)
1701    {
1702        #[inline]
1703        unsafe fn encode(
1704            self,
1705            encoder: &mut fidl::encoding::Encoder<'_, D>,
1706            offset: usize,
1707            depth: fidl::encoding::Depth,
1708        ) -> fidl::Result<()> {
1709            encoder.debug_check_bounds::<ChannelReadChannelRequest>(offset);
1710            // Zero out padding regions. There's no need to apply masks
1711            // because the unmasked parts will be overwritten by fields.
1712            // Write the fields.
1713            self.0.encode(encoder, offset + 0, depth)?;
1714            Ok(())
1715        }
1716    }
1717
1718    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1719        for ChannelReadChannelRequest
1720    {
1721        #[inline(always)]
1722        fn new_empty() -> Self {
1723            Self { handle: fidl::new_empty!(HandleId, D) }
1724        }
1725
1726        #[inline]
1727        unsafe fn decode(
1728            &mut self,
1729            decoder: &mut fidl::encoding::Decoder<'_, D>,
1730            offset: usize,
1731            _depth: fidl::encoding::Depth,
1732        ) -> fidl::Result<()> {
1733            decoder.debug_check_bounds::<Self>(offset);
1734            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1735            // Verify that padding bytes are zero.
1736            // Copy from the buffer into the object.
1737            unsafe {
1738                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1739            }
1740            Ok(())
1741        }
1742    }
1743
1744    impl fidl::encoding::ValueTypeMarker for ChannelReadChannelStreamingStartRequest {
1745        type Borrowed<'a> = &'a Self;
1746        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1747            value
1748        }
1749    }
1750
1751    unsafe impl fidl::encoding::TypeMarker for ChannelReadChannelStreamingStartRequest {
1752        type Owned = Self;
1753
1754        #[inline(always)]
1755        fn inline_align(_context: fidl::encoding::Context) -> usize {
1756            4
1757        }
1758
1759        #[inline(always)]
1760        fn inline_size(_context: fidl::encoding::Context) -> usize {
1761            4
1762        }
1763        #[inline(always)]
1764        fn encode_is_copy() -> bool {
1765            true
1766        }
1767
1768        #[inline(always)]
1769        fn decode_is_copy() -> bool {
1770            true
1771        }
1772    }
1773
1774    unsafe impl<D: fidl::encoding::ResourceDialect>
1775        fidl::encoding::Encode<ChannelReadChannelStreamingStartRequest, D>
1776        for &ChannelReadChannelStreamingStartRequest
1777    {
1778        #[inline]
1779        unsafe fn encode(
1780            self,
1781            encoder: &mut fidl::encoding::Encoder<'_, D>,
1782            offset: usize,
1783            _depth: fidl::encoding::Depth,
1784        ) -> fidl::Result<()> {
1785            encoder.debug_check_bounds::<ChannelReadChannelStreamingStartRequest>(offset);
1786            unsafe {
1787                // Copy the object into the buffer.
1788                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1789                (buf_ptr as *mut ChannelReadChannelStreamingStartRequest).write_unaligned(
1790                    (self as *const ChannelReadChannelStreamingStartRequest).read(),
1791                );
1792                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1793                // done second because the memcpy will write garbage to these bytes.
1794            }
1795            Ok(())
1796        }
1797    }
1798    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
1799        fidl::encoding::Encode<ChannelReadChannelStreamingStartRequest, D> for (T0,)
1800    {
1801        #[inline]
1802        unsafe fn encode(
1803            self,
1804            encoder: &mut fidl::encoding::Encoder<'_, D>,
1805            offset: usize,
1806            depth: fidl::encoding::Depth,
1807        ) -> fidl::Result<()> {
1808            encoder.debug_check_bounds::<ChannelReadChannelStreamingStartRequest>(offset);
1809            // Zero out padding regions. There's no need to apply masks
1810            // because the unmasked parts will be overwritten by fields.
1811            // Write the fields.
1812            self.0.encode(encoder, offset + 0, depth)?;
1813            Ok(())
1814        }
1815    }
1816
1817    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1818        for ChannelReadChannelStreamingStartRequest
1819    {
1820        #[inline(always)]
1821        fn new_empty() -> Self {
1822            Self { handle: fidl::new_empty!(HandleId, D) }
1823        }
1824
1825        #[inline]
1826        unsafe fn decode(
1827            &mut self,
1828            decoder: &mut fidl::encoding::Decoder<'_, D>,
1829            offset: usize,
1830            _depth: fidl::encoding::Depth,
1831        ) -> fidl::Result<()> {
1832            decoder.debug_check_bounds::<Self>(offset);
1833            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1834            // Verify that padding bytes are zero.
1835            // Copy from the buffer into the object.
1836            unsafe {
1837                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1838            }
1839            Ok(())
1840        }
1841    }
1842
1843    impl fidl::encoding::ValueTypeMarker for ChannelReadChannelStreamingStopRequest {
1844        type Borrowed<'a> = &'a Self;
1845        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1846            value
1847        }
1848    }
1849
1850    unsafe impl fidl::encoding::TypeMarker for ChannelReadChannelStreamingStopRequest {
1851        type Owned = Self;
1852
1853        #[inline(always)]
1854        fn inline_align(_context: fidl::encoding::Context) -> usize {
1855            4
1856        }
1857
1858        #[inline(always)]
1859        fn inline_size(_context: fidl::encoding::Context) -> usize {
1860            4
1861        }
1862        #[inline(always)]
1863        fn encode_is_copy() -> bool {
1864            true
1865        }
1866
1867        #[inline(always)]
1868        fn decode_is_copy() -> bool {
1869            true
1870        }
1871    }
1872
1873    unsafe impl<D: fidl::encoding::ResourceDialect>
1874        fidl::encoding::Encode<ChannelReadChannelStreamingStopRequest, D>
1875        for &ChannelReadChannelStreamingStopRequest
1876    {
1877        #[inline]
1878        unsafe fn encode(
1879            self,
1880            encoder: &mut fidl::encoding::Encoder<'_, D>,
1881            offset: usize,
1882            _depth: fidl::encoding::Depth,
1883        ) -> fidl::Result<()> {
1884            encoder.debug_check_bounds::<ChannelReadChannelStreamingStopRequest>(offset);
1885            unsafe {
1886                // Copy the object into the buffer.
1887                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1888                (buf_ptr as *mut ChannelReadChannelStreamingStopRequest).write_unaligned(
1889                    (self as *const ChannelReadChannelStreamingStopRequest).read(),
1890                );
1891                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1892                // done second because the memcpy will write garbage to these bytes.
1893            }
1894            Ok(())
1895        }
1896    }
1897    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
1898        fidl::encoding::Encode<ChannelReadChannelStreamingStopRequest, D> for (T0,)
1899    {
1900        #[inline]
1901        unsafe fn encode(
1902            self,
1903            encoder: &mut fidl::encoding::Encoder<'_, D>,
1904            offset: usize,
1905            depth: fidl::encoding::Depth,
1906        ) -> fidl::Result<()> {
1907            encoder.debug_check_bounds::<ChannelReadChannelStreamingStopRequest>(offset);
1908            // Zero out padding regions. There's no need to apply masks
1909            // because the unmasked parts will be overwritten by fields.
1910            // Write the fields.
1911            self.0.encode(encoder, offset + 0, depth)?;
1912            Ok(())
1913        }
1914    }
1915
1916    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1917        for ChannelReadChannelStreamingStopRequest
1918    {
1919        #[inline(always)]
1920        fn new_empty() -> Self {
1921            Self { handle: fidl::new_empty!(HandleId, D) }
1922        }
1923
1924        #[inline]
1925        unsafe fn decode(
1926            &mut self,
1927            decoder: &mut fidl::encoding::Decoder<'_, D>,
1928            offset: usize,
1929            _depth: fidl::encoding::Depth,
1930        ) -> fidl::Result<()> {
1931            decoder.debug_check_bounds::<Self>(offset);
1932            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1933            // Verify that padding bytes are zero.
1934            // Copy from the buffer into the object.
1935            unsafe {
1936                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1937            }
1938            Ok(())
1939        }
1940    }
1941
1942    impl fidl::encoding::ValueTypeMarker for ChannelWriteChannelRequest {
1943        type Borrowed<'a> = &'a Self;
1944        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1945            value
1946        }
1947    }
1948
1949    unsafe impl fidl::encoding::TypeMarker for ChannelWriteChannelRequest {
1950        type Owned = Self;
1951
1952        #[inline(always)]
1953        fn inline_align(_context: fidl::encoding::Context) -> usize {
1954            8
1955        }
1956
1957        #[inline(always)]
1958        fn inline_size(_context: fidl::encoding::Context) -> usize {
1959            40
1960        }
1961    }
1962
1963    unsafe impl<D: fidl::encoding::ResourceDialect>
1964        fidl::encoding::Encode<ChannelWriteChannelRequest, D> for &ChannelWriteChannelRequest
1965    {
1966        #[inline]
1967        unsafe fn encode(
1968            self,
1969            encoder: &mut fidl::encoding::Encoder<'_, D>,
1970            offset: usize,
1971            _depth: fidl::encoding::Depth,
1972        ) -> fidl::Result<()> {
1973            encoder.debug_check_bounds::<ChannelWriteChannelRequest>(offset);
1974            // Delegate to tuple encoding.
1975            fidl::encoding::Encode::<ChannelWriteChannelRequest, D>::encode(
1976                (
1977                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
1978                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow(
1979                        &self.data,
1980                    ),
1981                    <Handles as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
1982                ),
1983                encoder,
1984                offset,
1985                _depth,
1986            )
1987        }
1988    }
1989    unsafe impl<
1990        D: fidl::encoding::ResourceDialect,
1991        T0: fidl::encoding::Encode<HandleId, D>,
1992        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 65536>, D>,
1993        T2: fidl::encoding::Encode<Handles, D>,
1994    > fidl::encoding::Encode<ChannelWriteChannelRequest, D> for (T0, T1, T2)
1995    {
1996        #[inline]
1997        unsafe fn encode(
1998            self,
1999            encoder: &mut fidl::encoding::Encoder<'_, D>,
2000            offset: usize,
2001            depth: fidl::encoding::Depth,
2002        ) -> fidl::Result<()> {
2003            encoder.debug_check_bounds::<ChannelWriteChannelRequest>(offset);
2004            // Zero out padding regions. There's no need to apply masks
2005            // because the unmasked parts will be overwritten by fields.
2006            unsafe {
2007                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2008                (ptr as *mut u64).write_unaligned(0);
2009            }
2010            // Write the fields.
2011            self.0.encode(encoder, offset + 0, depth)?;
2012            self.1.encode(encoder, offset + 8, depth)?;
2013            self.2.encode(encoder, offset + 24, depth)?;
2014            Ok(())
2015        }
2016    }
2017
2018    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2019        for ChannelWriteChannelRequest
2020    {
2021        #[inline(always)]
2022        fn new_empty() -> Self {
2023            Self {
2024                handle: fidl::new_empty!(HandleId, D),
2025                data: fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D),
2026                handles: fidl::new_empty!(Handles, D),
2027            }
2028        }
2029
2030        #[inline]
2031        unsafe fn decode(
2032            &mut self,
2033            decoder: &mut fidl::encoding::Decoder<'_, D>,
2034            offset: usize,
2035            _depth: fidl::encoding::Depth,
2036        ) -> fidl::Result<()> {
2037            decoder.debug_check_bounds::<Self>(offset);
2038            // Verify that padding bytes are zero.
2039            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2040            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2041            let mask = 0xffffffff00000000u64;
2042            let maskedval = padval & mask;
2043            if maskedval != 0 {
2044                return Err(fidl::Error::NonZeroPadding {
2045                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2046                });
2047            }
2048            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
2049            fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, &mut self.data, decoder, offset + 8, _depth)?;
2050            fidl::decode!(Handles, D, &mut self.handles, decoder, offset + 24, _depth)?;
2051            Ok(())
2052        }
2053    }
2054
2055    impl fidl::encoding::ValueTypeMarker for ClosedDuringRead {
2056        type Borrowed<'a> = &'a Self;
2057        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2058            value
2059        }
2060    }
2061
2062    unsafe impl fidl::encoding::TypeMarker for ClosedDuringRead {
2063        type Owned = Self;
2064
2065        #[inline(always)]
2066        fn inline_align(_context: fidl::encoding::Context) -> usize {
2067            1
2068        }
2069
2070        #[inline(always)]
2071        fn inline_size(_context: fidl::encoding::Context) -> usize {
2072            1
2073        }
2074    }
2075
2076    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClosedDuringRead, D>
2077        for &ClosedDuringRead
2078    {
2079        #[inline]
2080        unsafe fn encode(
2081            self,
2082            encoder: &mut fidl::encoding::Encoder<'_, D>,
2083            offset: usize,
2084            _depth: fidl::encoding::Depth,
2085        ) -> fidl::Result<()> {
2086            encoder.debug_check_bounds::<ClosedDuringRead>(offset);
2087            encoder.write_num(0u8, offset);
2088            Ok(())
2089        }
2090    }
2091
2092    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClosedDuringRead {
2093        #[inline(always)]
2094        fn new_empty() -> Self {
2095            Self
2096        }
2097
2098        #[inline]
2099        unsafe fn decode(
2100            &mut self,
2101            decoder: &mut fidl::encoding::Decoder<'_, D>,
2102            offset: usize,
2103            _depth: fidl::encoding::Depth,
2104        ) -> fidl::Result<()> {
2105            decoder.debug_check_bounds::<Self>(offset);
2106            match decoder.read_num::<u8>(offset) {
2107                0 => Ok(()),
2108                _ => Err(fidl::Error::Invalid),
2109            }
2110        }
2111    }
2112
2113    impl fidl::encoding::ValueTypeMarker for EventCreateEventRequest {
2114        type Borrowed<'a> = &'a Self;
2115        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2116            value
2117        }
2118    }
2119
2120    unsafe impl fidl::encoding::TypeMarker for EventCreateEventRequest {
2121        type Owned = Self;
2122
2123        #[inline(always)]
2124        fn inline_align(_context: fidl::encoding::Context) -> usize {
2125            4
2126        }
2127
2128        #[inline(always)]
2129        fn inline_size(_context: fidl::encoding::Context) -> usize {
2130            4
2131        }
2132        #[inline(always)]
2133        fn encode_is_copy() -> bool {
2134            true
2135        }
2136
2137        #[inline(always)]
2138        fn decode_is_copy() -> bool {
2139            true
2140        }
2141    }
2142
2143    unsafe impl<D: fidl::encoding::ResourceDialect>
2144        fidl::encoding::Encode<EventCreateEventRequest, D> for &EventCreateEventRequest
2145    {
2146        #[inline]
2147        unsafe fn encode(
2148            self,
2149            encoder: &mut fidl::encoding::Encoder<'_, D>,
2150            offset: usize,
2151            _depth: fidl::encoding::Depth,
2152        ) -> fidl::Result<()> {
2153            encoder.debug_check_bounds::<EventCreateEventRequest>(offset);
2154            unsafe {
2155                // Copy the object into the buffer.
2156                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2157                (buf_ptr as *mut EventCreateEventRequest)
2158                    .write_unaligned((self as *const EventCreateEventRequest).read());
2159                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2160                // done second because the memcpy will write garbage to these bytes.
2161            }
2162            Ok(())
2163        }
2164    }
2165    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NewHandleId, D>>
2166        fidl::encoding::Encode<EventCreateEventRequest, D> for (T0,)
2167    {
2168        #[inline]
2169        unsafe fn encode(
2170            self,
2171            encoder: &mut fidl::encoding::Encoder<'_, D>,
2172            offset: usize,
2173            depth: fidl::encoding::Depth,
2174        ) -> fidl::Result<()> {
2175            encoder.debug_check_bounds::<EventCreateEventRequest>(offset);
2176            // Zero out padding regions. There's no need to apply masks
2177            // because the unmasked parts will be overwritten by fields.
2178            // Write the fields.
2179            self.0.encode(encoder, offset + 0, depth)?;
2180            Ok(())
2181        }
2182    }
2183
2184    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2185        for EventCreateEventRequest
2186    {
2187        #[inline(always)]
2188        fn new_empty() -> Self {
2189            Self { handle: fidl::new_empty!(NewHandleId, D) }
2190        }
2191
2192        #[inline]
2193        unsafe fn decode(
2194            &mut self,
2195            decoder: &mut fidl::encoding::Decoder<'_, D>,
2196            offset: usize,
2197            _depth: fidl::encoding::Depth,
2198        ) -> fidl::Result<()> {
2199            decoder.debug_check_bounds::<Self>(offset);
2200            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2201            // Verify that padding bytes are zero.
2202            // Copy from the buffer into the object.
2203            unsafe {
2204                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2205            }
2206            Ok(())
2207        }
2208    }
2209
2210    impl fidl::encoding::ValueTypeMarker for EventPairCreateEventPairRequest {
2211        type Borrowed<'a> = &'a Self;
2212        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2213            value
2214        }
2215    }
2216
2217    unsafe impl fidl::encoding::TypeMarker for EventPairCreateEventPairRequest {
2218        type Owned = Self;
2219
2220        #[inline(always)]
2221        fn inline_align(_context: fidl::encoding::Context) -> usize {
2222            4
2223        }
2224
2225        #[inline(always)]
2226        fn inline_size(_context: fidl::encoding::Context) -> usize {
2227            8
2228        }
2229        #[inline(always)]
2230        fn encode_is_copy() -> bool {
2231            true
2232        }
2233
2234        #[inline(always)]
2235        fn decode_is_copy() -> bool {
2236            true
2237        }
2238    }
2239
2240    unsafe impl<D: fidl::encoding::ResourceDialect>
2241        fidl::encoding::Encode<EventPairCreateEventPairRequest, D>
2242        for &EventPairCreateEventPairRequest
2243    {
2244        #[inline]
2245        unsafe fn encode(
2246            self,
2247            encoder: &mut fidl::encoding::Encoder<'_, D>,
2248            offset: usize,
2249            _depth: fidl::encoding::Depth,
2250        ) -> fidl::Result<()> {
2251            encoder.debug_check_bounds::<EventPairCreateEventPairRequest>(offset);
2252            unsafe {
2253                // Copy the object into the buffer.
2254                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2255                (buf_ptr as *mut EventPairCreateEventPairRequest)
2256                    .write_unaligned((self as *const EventPairCreateEventPairRequest).read());
2257                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2258                // done second because the memcpy will write garbage to these bytes.
2259            }
2260            Ok(())
2261        }
2262    }
2263    unsafe impl<
2264        D: fidl::encoding::ResourceDialect,
2265        T0: fidl::encoding::Encode<fidl::encoding::Array<NewHandleId, 2>, D>,
2266    > fidl::encoding::Encode<EventPairCreateEventPairRequest, D> for (T0,)
2267    {
2268        #[inline]
2269        unsafe fn encode(
2270            self,
2271            encoder: &mut fidl::encoding::Encoder<'_, D>,
2272            offset: usize,
2273            depth: fidl::encoding::Depth,
2274        ) -> fidl::Result<()> {
2275            encoder.debug_check_bounds::<EventPairCreateEventPairRequest>(offset);
2276            // Zero out padding regions. There's no need to apply masks
2277            // because the unmasked parts will be overwritten by fields.
2278            // Write the fields.
2279            self.0.encode(encoder, offset + 0, depth)?;
2280            Ok(())
2281        }
2282    }
2283
2284    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2285        for EventPairCreateEventPairRequest
2286    {
2287        #[inline(always)]
2288        fn new_empty() -> Self {
2289            Self { handles: fidl::new_empty!(fidl::encoding::Array<NewHandleId, 2>, D) }
2290        }
2291
2292        #[inline]
2293        unsafe fn decode(
2294            &mut self,
2295            decoder: &mut fidl::encoding::Decoder<'_, D>,
2296            offset: usize,
2297            _depth: fidl::encoding::Depth,
2298        ) -> fidl::Result<()> {
2299            decoder.debug_check_bounds::<Self>(offset);
2300            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2301            // Verify that padding bytes are zero.
2302            // Copy from the buffer into the object.
2303            unsafe {
2304                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2305            }
2306            Ok(())
2307        }
2308    }
2309
2310    impl fidl::encoding::ValueTypeMarker for FDomainCloseRequest {
2311        type Borrowed<'a> = &'a Self;
2312        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2313            value
2314        }
2315    }
2316
2317    unsafe impl fidl::encoding::TypeMarker for FDomainCloseRequest {
2318        type Owned = Self;
2319
2320        #[inline(always)]
2321        fn inline_align(_context: fidl::encoding::Context) -> usize {
2322            8
2323        }
2324
2325        #[inline(always)]
2326        fn inline_size(_context: fidl::encoding::Context) -> usize {
2327            16
2328        }
2329    }
2330
2331    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainCloseRequest, D>
2332        for &FDomainCloseRequest
2333    {
2334        #[inline]
2335        unsafe fn encode(
2336            self,
2337            encoder: &mut fidl::encoding::Encoder<'_, D>,
2338            offset: usize,
2339            _depth: fidl::encoding::Depth,
2340        ) -> fidl::Result<()> {
2341            encoder.debug_check_bounds::<FDomainCloseRequest>(offset);
2342            // Delegate to tuple encoding.
2343            fidl::encoding::Encode::<FDomainCloseRequest, D>::encode(
2344                (
2345                    <fidl::encoding::UnboundedVector<HandleId> as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
2346                ),
2347                encoder, offset, _depth
2348            )
2349        }
2350    }
2351    unsafe impl<
2352        D: fidl::encoding::ResourceDialect,
2353        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<HandleId>, D>,
2354    > fidl::encoding::Encode<FDomainCloseRequest, D> for (T0,)
2355    {
2356        #[inline]
2357        unsafe fn encode(
2358            self,
2359            encoder: &mut fidl::encoding::Encoder<'_, D>,
2360            offset: usize,
2361            depth: fidl::encoding::Depth,
2362        ) -> fidl::Result<()> {
2363            encoder.debug_check_bounds::<FDomainCloseRequest>(offset);
2364            // Zero out padding regions. There's no need to apply masks
2365            // because the unmasked parts will be overwritten by fields.
2366            // Write the fields.
2367            self.0.encode(encoder, offset + 0, depth)?;
2368            Ok(())
2369        }
2370    }
2371
2372    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainCloseRequest {
2373        #[inline(always)]
2374        fn new_empty() -> Self {
2375            Self { handles: fidl::new_empty!(fidl::encoding::UnboundedVector<HandleId>, D) }
2376        }
2377
2378        #[inline]
2379        unsafe fn decode(
2380            &mut self,
2381            decoder: &mut fidl::encoding::Decoder<'_, D>,
2382            offset: usize,
2383            _depth: fidl::encoding::Depth,
2384        ) -> fidl::Result<()> {
2385            decoder.debug_check_bounds::<Self>(offset);
2386            // Verify that padding bytes are zero.
2387            fidl::decode!(
2388                fidl::encoding::UnboundedVector<HandleId>,
2389                D,
2390                &mut self.handles,
2391                decoder,
2392                offset + 0,
2393                _depth
2394            )?;
2395            Ok(())
2396        }
2397    }
2398
2399    impl fidl::encoding::ValueTypeMarker for FDomainDuplicateRequest {
2400        type Borrowed<'a> = &'a Self;
2401        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2402            value
2403        }
2404    }
2405
2406    unsafe impl fidl::encoding::TypeMarker for FDomainDuplicateRequest {
2407        type Owned = Self;
2408
2409        #[inline(always)]
2410        fn inline_align(_context: fidl::encoding::Context) -> usize {
2411            4
2412        }
2413
2414        #[inline(always)]
2415        fn inline_size(_context: fidl::encoding::Context) -> usize {
2416            12
2417        }
2418    }
2419
2420    unsafe impl<D: fidl::encoding::ResourceDialect>
2421        fidl::encoding::Encode<FDomainDuplicateRequest, D> for &FDomainDuplicateRequest
2422    {
2423        #[inline]
2424        unsafe fn encode(
2425            self,
2426            encoder: &mut fidl::encoding::Encoder<'_, D>,
2427            offset: usize,
2428            _depth: fidl::encoding::Depth,
2429        ) -> fidl::Result<()> {
2430            encoder.debug_check_bounds::<FDomainDuplicateRequest>(offset);
2431            // Delegate to tuple encoding.
2432            fidl::encoding::Encode::<FDomainDuplicateRequest, D>::encode(
2433                (
2434                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
2435                    <NewHandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.new_handle),
2436                    <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
2437                ),
2438                encoder,
2439                offset,
2440                _depth,
2441            )
2442        }
2443    }
2444    unsafe impl<
2445        D: fidl::encoding::ResourceDialect,
2446        T0: fidl::encoding::Encode<HandleId, D>,
2447        T1: fidl::encoding::Encode<NewHandleId, D>,
2448        T2: fidl::encoding::Encode<fidl::Rights, D>,
2449    > fidl::encoding::Encode<FDomainDuplicateRequest, D> for (T0, T1, T2)
2450    {
2451        #[inline]
2452        unsafe fn encode(
2453            self,
2454            encoder: &mut fidl::encoding::Encoder<'_, D>,
2455            offset: usize,
2456            depth: fidl::encoding::Depth,
2457        ) -> fidl::Result<()> {
2458            encoder.debug_check_bounds::<FDomainDuplicateRequest>(offset);
2459            // Zero out padding regions. There's no need to apply masks
2460            // because the unmasked parts will be overwritten by fields.
2461            // Write the fields.
2462            self.0.encode(encoder, offset + 0, depth)?;
2463            self.1.encode(encoder, offset + 4, depth)?;
2464            self.2.encode(encoder, offset + 8, depth)?;
2465            Ok(())
2466        }
2467    }
2468
2469    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2470        for FDomainDuplicateRequest
2471    {
2472        #[inline(always)]
2473        fn new_empty() -> Self {
2474            Self {
2475                handle: fidl::new_empty!(HandleId, D),
2476                new_handle: fidl::new_empty!(NewHandleId, D),
2477                rights: fidl::new_empty!(fidl::Rights, D),
2478            }
2479        }
2480
2481        #[inline]
2482        unsafe fn decode(
2483            &mut self,
2484            decoder: &mut fidl::encoding::Decoder<'_, D>,
2485            offset: usize,
2486            _depth: fidl::encoding::Depth,
2487        ) -> fidl::Result<()> {
2488            decoder.debug_check_bounds::<Self>(offset);
2489            // Verify that padding bytes are zero.
2490            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
2491            fidl::decode!(NewHandleId, D, &mut self.new_handle, decoder, offset + 4, _depth)?;
2492            fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 8, _depth)?;
2493            Ok(())
2494        }
2495    }
2496
2497    impl fidl::encoding::ValueTypeMarker for FDomainGetKoidRequest {
2498        type Borrowed<'a> = &'a Self;
2499        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2500            value
2501        }
2502    }
2503
2504    unsafe impl fidl::encoding::TypeMarker for FDomainGetKoidRequest {
2505        type Owned = Self;
2506
2507        #[inline(always)]
2508        fn inline_align(_context: fidl::encoding::Context) -> usize {
2509            4
2510        }
2511
2512        #[inline(always)]
2513        fn inline_size(_context: fidl::encoding::Context) -> usize {
2514            4
2515        }
2516        #[inline(always)]
2517        fn encode_is_copy() -> bool {
2518            true
2519        }
2520
2521        #[inline(always)]
2522        fn decode_is_copy() -> bool {
2523            true
2524        }
2525    }
2526
2527    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainGetKoidRequest, D>
2528        for &FDomainGetKoidRequest
2529    {
2530        #[inline]
2531        unsafe fn encode(
2532            self,
2533            encoder: &mut fidl::encoding::Encoder<'_, D>,
2534            offset: usize,
2535            _depth: fidl::encoding::Depth,
2536        ) -> fidl::Result<()> {
2537            encoder.debug_check_bounds::<FDomainGetKoidRequest>(offset);
2538            unsafe {
2539                // Copy the object into the buffer.
2540                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2541                (buf_ptr as *mut FDomainGetKoidRequest)
2542                    .write_unaligned((self as *const FDomainGetKoidRequest).read());
2543                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2544                // done second because the memcpy will write garbage to these bytes.
2545            }
2546            Ok(())
2547        }
2548    }
2549    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
2550        fidl::encoding::Encode<FDomainGetKoidRequest, D> for (T0,)
2551    {
2552        #[inline]
2553        unsafe fn encode(
2554            self,
2555            encoder: &mut fidl::encoding::Encoder<'_, D>,
2556            offset: usize,
2557            depth: fidl::encoding::Depth,
2558        ) -> fidl::Result<()> {
2559            encoder.debug_check_bounds::<FDomainGetKoidRequest>(offset);
2560            // Zero out padding regions. There's no need to apply masks
2561            // because the unmasked parts will be overwritten by fields.
2562            // Write the fields.
2563            self.0.encode(encoder, offset + 0, depth)?;
2564            Ok(())
2565        }
2566    }
2567
2568    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainGetKoidRequest {
2569        #[inline(always)]
2570        fn new_empty() -> Self {
2571            Self { handle: fidl::new_empty!(HandleId, D) }
2572        }
2573
2574        #[inline]
2575        unsafe fn decode(
2576            &mut self,
2577            decoder: &mut fidl::encoding::Decoder<'_, D>,
2578            offset: usize,
2579            _depth: fidl::encoding::Depth,
2580        ) -> fidl::Result<()> {
2581            decoder.debug_check_bounds::<Self>(offset);
2582            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2583            // Verify that padding bytes are zero.
2584            // Copy from the buffer into the object.
2585            unsafe {
2586                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2587            }
2588            Ok(())
2589        }
2590    }
2591
2592    impl fidl::encoding::ValueTypeMarker for FDomainGetNamespaceRequest {
2593        type Borrowed<'a> = &'a Self;
2594        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2595            value
2596        }
2597    }
2598
2599    unsafe impl fidl::encoding::TypeMarker for FDomainGetNamespaceRequest {
2600        type Owned = Self;
2601
2602        #[inline(always)]
2603        fn inline_align(_context: fidl::encoding::Context) -> usize {
2604            4
2605        }
2606
2607        #[inline(always)]
2608        fn inline_size(_context: fidl::encoding::Context) -> usize {
2609            4
2610        }
2611        #[inline(always)]
2612        fn encode_is_copy() -> bool {
2613            true
2614        }
2615
2616        #[inline(always)]
2617        fn decode_is_copy() -> bool {
2618            true
2619        }
2620    }
2621
2622    unsafe impl<D: fidl::encoding::ResourceDialect>
2623        fidl::encoding::Encode<FDomainGetNamespaceRequest, D> for &FDomainGetNamespaceRequest
2624    {
2625        #[inline]
2626        unsafe fn encode(
2627            self,
2628            encoder: &mut fidl::encoding::Encoder<'_, D>,
2629            offset: usize,
2630            _depth: fidl::encoding::Depth,
2631        ) -> fidl::Result<()> {
2632            encoder.debug_check_bounds::<FDomainGetNamespaceRequest>(offset);
2633            unsafe {
2634                // Copy the object into the buffer.
2635                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2636                (buf_ptr as *mut FDomainGetNamespaceRequest)
2637                    .write_unaligned((self as *const FDomainGetNamespaceRequest).read());
2638                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2639                // done second because the memcpy will write garbage to these bytes.
2640            }
2641            Ok(())
2642        }
2643    }
2644    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NewHandleId, D>>
2645        fidl::encoding::Encode<FDomainGetNamespaceRequest, D> for (T0,)
2646    {
2647        #[inline]
2648        unsafe fn encode(
2649            self,
2650            encoder: &mut fidl::encoding::Encoder<'_, D>,
2651            offset: usize,
2652            depth: fidl::encoding::Depth,
2653        ) -> fidl::Result<()> {
2654            encoder.debug_check_bounds::<FDomainGetNamespaceRequest>(offset);
2655            // Zero out padding regions. There's no need to apply masks
2656            // because the unmasked parts will be overwritten by fields.
2657            // Write the fields.
2658            self.0.encode(encoder, offset + 0, depth)?;
2659            Ok(())
2660        }
2661    }
2662
2663    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2664        for FDomainGetNamespaceRequest
2665    {
2666        #[inline(always)]
2667        fn new_empty() -> Self {
2668            Self { new_handle: fidl::new_empty!(NewHandleId, D) }
2669        }
2670
2671        #[inline]
2672        unsafe fn decode(
2673            &mut self,
2674            decoder: &mut fidl::encoding::Decoder<'_, D>,
2675            offset: usize,
2676            _depth: fidl::encoding::Depth,
2677        ) -> fidl::Result<()> {
2678            decoder.debug_check_bounds::<Self>(offset);
2679            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2680            // Verify that padding bytes are zero.
2681            // Copy from the buffer into the object.
2682            unsafe {
2683                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2684            }
2685            Ok(())
2686        }
2687    }
2688
2689    impl fidl::encoding::ValueTypeMarker for FDomainReplaceRequest {
2690        type Borrowed<'a> = &'a Self;
2691        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2692            value
2693        }
2694    }
2695
2696    unsafe impl fidl::encoding::TypeMarker for FDomainReplaceRequest {
2697        type Owned = Self;
2698
2699        #[inline(always)]
2700        fn inline_align(_context: fidl::encoding::Context) -> usize {
2701            4
2702        }
2703
2704        #[inline(always)]
2705        fn inline_size(_context: fidl::encoding::Context) -> usize {
2706            12
2707        }
2708    }
2709
2710    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainReplaceRequest, D>
2711        for &FDomainReplaceRequest
2712    {
2713        #[inline]
2714        unsafe fn encode(
2715            self,
2716            encoder: &mut fidl::encoding::Encoder<'_, D>,
2717            offset: usize,
2718            _depth: fidl::encoding::Depth,
2719        ) -> fidl::Result<()> {
2720            encoder.debug_check_bounds::<FDomainReplaceRequest>(offset);
2721            // Delegate to tuple encoding.
2722            fidl::encoding::Encode::<FDomainReplaceRequest, D>::encode(
2723                (
2724                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
2725                    <NewHandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.new_handle),
2726                    <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
2727                ),
2728                encoder,
2729                offset,
2730                _depth,
2731            )
2732        }
2733    }
2734    unsafe impl<
2735        D: fidl::encoding::ResourceDialect,
2736        T0: fidl::encoding::Encode<HandleId, D>,
2737        T1: fidl::encoding::Encode<NewHandleId, D>,
2738        T2: fidl::encoding::Encode<fidl::Rights, D>,
2739    > fidl::encoding::Encode<FDomainReplaceRequest, D> for (T0, T1, T2)
2740    {
2741        #[inline]
2742        unsafe fn encode(
2743            self,
2744            encoder: &mut fidl::encoding::Encoder<'_, D>,
2745            offset: usize,
2746            depth: fidl::encoding::Depth,
2747        ) -> fidl::Result<()> {
2748            encoder.debug_check_bounds::<FDomainReplaceRequest>(offset);
2749            // Zero out padding regions. There's no need to apply masks
2750            // because the unmasked parts will be overwritten by fields.
2751            // Write the fields.
2752            self.0.encode(encoder, offset + 0, depth)?;
2753            self.1.encode(encoder, offset + 4, depth)?;
2754            self.2.encode(encoder, offset + 8, depth)?;
2755            Ok(())
2756        }
2757    }
2758
2759    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainReplaceRequest {
2760        #[inline(always)]
2761        fn new_empty() -> Self {
2762            Self {
2763                handle: fidl::new_empty!(HandleId, D),
2764                new_handle: fidl::new_empty!(NewHandleId, D),
2765                rights: fidl::new_empty!(fidl::Rights, D),
2766            }
2767        }
2768
2769        #[inline]
2770        unsafe fn decode(
2771            &mut self,
2772            decoder: &mut fidl::encoding::Decoder<'_, D>,
2773            offset: usize,
2774            _depth: fidl::encoding::Depth,
2775        ) -> fidl::Result<()> {
2776            decoder.debug_check_bounds::<Self>(offset);
2777            // Verify that padding bytes are zero.
2778            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
2779            fidl::decode!(NewHandleId, D, &mut self.new_handle, decoder, offset + 4, _depth)?;
2780            fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 8, _depth)?;
2781            Ok(())
2782        }
2783    }
2784
2785    impl fidl::encoding::ValueTypeMarker for FDomainSignalPeerRequest {
2786        type Borrowed<'a> = &'a Self;
2787        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2788            value
2789        }
2790    }
2791
2792    unsafe impl fidl::encoding::TypeMarker for FDomainSignalPeerRequest {
2793        type Owned = Self;
2794
2795        #[inline(always)]
2796        fn inline_align(_context: fidl::encoding::Context) -> usize {
2797            4
2798        }
2799
2800        #[inline(always)]
2801        fn inline_size(_context: fidl::encoding::Context) -> usize {
2802            12
2803        }
2804        #[inline(always)]
2805        fn encode_is_copy() -> bool {
2806            true
2807        }
2808
2809        #[inline(always)]
2810        fn decode_is_copy() -> bool {
2811            true
2812        }
2813    }
2814
2815    unsafe impl<D: fidl::encoding::ResourceDialect>
2816        fidl::encoding::Encode<FDomainSignalPeerRequest, D> for &FDomainSignalPeerRequest
2817    {
2818        #[inline]
2819        unsafe fn encode(
2820            self,
2821            encoder: &mut fidl::encoding::Encoder<'_, D>,
2822            offset: usize,
2823            _depth: fidl::encoding::Depth,
2824        ) -> fidl::Result<()> {
2825            encoder.debug_check_bounds::<FDomainSignalPeerRequest>(offset);
2826            unsafe {
2827                // Copy the object into the buffer.
2828                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2829                (buf_ptr as *mut FDomainSignalPeerRequest)
2830                    .write_unaligned((self as *const FDomainSignalPeerRequest).read());
2831                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2832                // done second because the memcpy will write garbage to these bytes.
2833            }
2834            Ok(())
2835        }
2836    }
2837    unsafe impl<
2838        D: fidl::encoding::ResourceDialect,
2839        T0: fidl::encoding::Encode<HandleId, D>,
2840        T1: fidl::encoding::Encode<u32, D>,
2841        T2: fidl::encoding::Encode<u32, D>,
2842    > fidl::encoding::Encode<FDomainSignalPeerRequest, D> for (T0, T1, T2)
2843    {
2844        #[inline]
2845        unsafe fn encode(
2846            self,
2847            encoder: &mut fidl::encoding::Encoder<'_, D>,
2848            offset: usize,
2849            depth: fidl::encoding::Depth,
2850        ) -> fidl::Result<()> {
2851            encoder.debug_check_bounds::<FDomainSignalPeerRequest>(offset);
2852            // Zero out padding regions. There's no need to apply masks
2853            // because the unmasked parts will be overwritten by fields.
2854            // Write the fields.
2855            self.0.encode(encoder, offset + 0, depth)?;
2856            self.1.encode(encoder, offset + 4, depth)?;
2857            self.2.encode(encoder, offset + 8, depth)?;
2858            Ok(())
2859        }
2860    }
2861
2862    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2863        for FDomainSignalPeerRequest
2864    {
2865        #[inline(always)]
2866        fn new_empty() -> Self {
2867            Self {
2868                handle: fidl::new_empty!(HandleId, D),
2869                set: fidl::new_empty!(u32, D),
2870                clear: fidl::new_empty!(u32, D),
2871            }
2872        }
2873
2874        #[inline]
2875        unsafe fn decode(
2876            &mut self,
2877            decoder: &mut fidl::encoding::Decoder<'_, D>,
2878            offset: usize,
2879            _depth: fidl::encoding::Depth,
2880        ) -> fidl::Result<()> {
2881            decoder.debug_check_bounds::<Self>(offset);
2882            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2883            // Verify that padding bytes are zero.
2884            // Copy from the buffer into the object.
2885            unsafe {
2886                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
2887            }
2888            Ok(())
2889        }
2890    }
2891
2892    impl fidl::encoding::ValueTypeMarker for FDomainSignalRequest {
2893        type Borrowed<'a> = &'a Self;
2894        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2895            value
2896        }
2897    }
2898
2899    unsafe impl fidl::encoding::TypeMarker for FDomainSignalRequest {
2900        type Owned = Self;
2901
2902        #[inline(always)]
2903        fn inline_align(_context: fidl::encoding::Context) -> usize {
2904            4
2905        }
2906
2907        #[inline(always)]
2908        fn inline_size(_context: fidl::encoding::Context) -> usize {
2909            12
2910        }
2911        #[inline(always)]
2912        fn encode_is_copy() -> bool {
2913            true
2914        }
2915
2916        #[inline(always)]
2917        fn decode_is_copy() -> bool {
2918            true
2919        }
2920    }
2921
2922    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainSignalRequest, D>
2923        for &FDomainSignalRequest
2924    {
2925        #[inline]
2926        unsafe fn encode(
2927            self,
2928            encoder: &mut fidl::encoding::Encoder<'_, D>,
2929            offset: usize,
2930            _depth: fidl::encoding::Depth,
2931        ) -> fidl::Result<()> {
2932            encoder.debug_check_bounds::<FDomainSignalRequest>(offset);
2933            unsafe {
2934                // Copy the object into the buffer.
2935                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2936                (buf_ptr as *mut FDomainSignalRequest)
2937                    .write_unaligned((self as *const FDomainSignalRequest).read());
2938                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2939                // done second because the memcpy will write garbage to these bytes.
2940            }
2941            Ok(())
2942        }
2943    }
2944    unsafe impl<
2945        D: fidl::encoding::ResourceDialect,
2946        T0: fidl::encoding::Encode<HandleId, D>,
2947        T1: fidl::encoding::Encode<u32, D>,
2948        T2: fidl::encoding::Encode<u32, D>,
2949    > fidl::encoding::Encode<FDomainSignalRequest, D> for (T0, T1, T2)
2950    {
2951        #[inline]
2952        unsafe fn encode(
2953            self,
2954            encoder: &mut fidl::encoding::Encoder<'_, D>,
2955            offset: usize,
2956            depth: fidl::encoding::Depth,
2957        ) -> fidl::Result<()> {
2958            encoder.debug_check_bounds::<FDomainSignalRequest>(offset);
2959            // Zero out padding regions. There's no need to apply masks
2960            // because the unmasked parts will be overwritten by fields.
2961            // Write the fields.
2962            self.0.encode(encoder, offset + 0, depth)?;
2963            self.1.encode(encoder, offset + 4, depth)?;
2964            self.2.encode(encoder, offset + 8, depth)?;
2965            Ok(())
2966        }
2967    }
2968
2969    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainSignalRequest {
2970        #[inline(always)]
2971        fn new_empty() -> Self {
2972            Self {
2973                handle: fidl::new_empty!(HandleId, D),
2974                set: fidl::new_empty!(u32, D),
2975                clear: fidl::new_empty!(u32, D),
2976            }
2977        }
2978
2979        #[inline]
2980        unsafe fn decode(
2981            &mut self,
2982            decoder: &mut fidl::encoding::Decoder<'_, D>,
2983            offset: usize,
2984            _depth: fidl::encoding::Depth,
2985        ) -> fidl::Result<()> {
2986            decoder.debug_check_bounds::<Self>(offset);
2987            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2988            // Verify that padding bytes are zero.
2989            // Copy from the buffer into the object.
2990            unsafe {
2991                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
2992            }
2993            Ok(())
2994        }
2995    }
2996
2997    impl fidl::encoding::ValueTypeMarker for FDomainWaitForSignalsRequest {
2998        type Borrowed<'a> = &'a Self;
2999        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3000            value
3001        }
3002    }
3003
3004    unsafe impl fidl::encoding::TypeMarker for FDomainWaitForSignalsRequest {
3005        type Owned = Self;
3006
3007        #[inline(always)]
3008        fn inline_align(_context: fidl::encoding::Context) -> usize {
3009            4
3010        }
3011
3012        #[inline(always)]
3013        fn inline_size(_context: fidl::encoding::Context) -> usize {
3014            8
3015        }
3016        #[inline(always)]
3017        fn encode_is_copy() -> bool {
3018            true
3019        }
3020
3021        #[inline(always)]
3022        fn decode_is_copy() -> bool {
3023            true
3024        }
3025    }
3026
3027    unsafe impl<D: fidl::encoding::ResourceDialect>
3028        fidl::encoding::Encode<FDomainWaitForSignalsRequest, D> for &FDomainWaitForSignalsRequest
3029    {
3030        #[inline]
3031        unsafe fn encode(
3032            self,
3033            encoder: &mut fidl::encoding::Encoder<'_, D>,
3034            offset: usize,
3035            _depth: fidl::encoding::Depth,
3036        ) -> fidl::Result<()> {
3037            encoder.debug_check_bounds::<FDomainWaitForSignalsRequest>(offset);
3038            unsafe {
3039                // Copy the object into the buffer.
3040                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3041                (buf_ptr as *mut FDomainWaitForSignalsRequest)
3042                    .write_unaligned((self as *const FDomainWaitForSignalsRequest).read());
3043                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3044                // done second because the memcpy will write garbage to these bytes.
3045            }
3046            Ok(())
3047        }
3048    }
3049    unsafe impl<
3050        D: fidl::encoding::ResourceDialect,
3051        T0: fidl::encoding::Encode<HandleId, D>,
3052        T1: fidl::encoding::Encode<u32, D>,
3053    > fidl::encoding::Encode<FDomainWaitForSignalsRequest, D> for (T0, T1)
3054    {
3055        #[inline]
3056        unsafe fn encode(
3057            self,
3058            encoder: &mut fidl::encoding::Encoder<'_, D>,
3059            offset: usize,
3060            depth: fidl::encoding::Depth,
3061        ) -> fidl::Result<()> {
3062            encoder.debug_check_bounds::<FDomainWaitForSignalsRequest>(offset);
3063            // Zero out padding regions. There's no need to apply masks
3064            // because the unmasked parts will be overwritten by fields.
3065            // Write the fields.
3066            self.0.encode(encoder, offset + 0, depth)?;
3067            self.1.encode(encoder, offset + 4, depth)?;
3068            Ok(())
3069        }
3070    }
3071
3072    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3073        for FDomainWaitForSignalsRequest
3074    {
3075        #[inline(always)]
3076        fn new_empty() -> Self {
3077            Self { handle: fidl::new_empty!(HandleId, D), signals: fidl::new_empty!(u32, D) }
3078        }
3079
3080        #[inline]
3081        unsafe fn decode(
3082            &mut self,
3083            decoder: &mut fidl::encoding::Decoder<'_, D>,
3084            offset: usize,
3085            _depth: fidl::encoding::Depth,
3086        ) -> fidl::Result<()> {
3087            decoder.debug_check_bounds::<Self>(offset);
3088            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3089            // Verify that padding bytes are zero.
3090            // Copy from the buffer into the object.
3091            unsafe {
3092                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3093            }
3094            Ok(())
3095        }
3096    }
3097
3098    impl fidl::encoding::ValueTypeMarker for FDomainGetKoidResponse {
3099        type Borrowed<'a> = &'a Self;
3100        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3101            value
3102        }
3103    }
3104
3105    unsafe impl fidl::encoding::TypeMarker for FDomainGetKoidResponse {
3106        type Owned = Self;
3107
3108        #[inline(always)]
3109        fn inline_align(_context: fidl::encoding::Context) -> usize {
3110            8
3111        }
3112
3113        #[inline(always)]
3114        fn inline_size(_context: fidl::encoding::Context) -> usize {
3115            8
3116        }
3117        #[inline(always)]
3118        fn encode_is_copy() -> bool {
3119            true
3120        }
3121
3122        #[inline(always)]
3123        fn decode_is_copy() -> bool {
3124            true
3125        }
3126    }
3127
3128    unsafe impl<D: fidl::encoding::ResourceDialect>
3129        fidl::encoding::Encode<FDomainGetKoidResponse, D> for &FDomainGetKoidResponse
3130    {
3131        #[inline]
3132        unsafe fn encode(
3133            self,
3134            encoder: &mut fidl::encoding::Encoder<'_, D>,
3135            offset: usize,
3136            _depth: fidl::encoding::Depth,
3137        ) -> fidl::Result<()> {
3138            encoder.debug_check_bounds::<FDomainGetKoidResponse>(offset);
3139            unsafe {
3140                // Copy the object into the buffer.
3141                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3142                (buf_ptr as *mut FDomainGetKoidResponse)
3143                    .write_unaligned((self as *const FDomainGetKoidResponse).read());
3144                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3145                // done second because the memcpy will write garbage to these bytes.
3146            }
3147            Ok(())
3148        }
3149    }
3150    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3151        fidl::encoding::Encode<FDomainGetKoidResponse, D> for (T0,)
3152    {
3153        #[inline]
3154        unsafe fn encode(
3155            self,
3156            encoder: &mut fidl::encoding::Encoder<'_, D>,
3157            offset: usize,
3158            depth: fidl::encoding::Depth,
3159        ) -> fidl::Result<()> {
3160            encoder.debug_check_bounds::<FDomainGetKoidResponse>(offset);
3161            // Zero out padding regions. There's no need to apply masks
3162            // because the unmasked parts will be overwritten by fields.
3163            // Write the fields.
3164            self.0.encode(encoder, offset + 0, depth)?;
3165            Ok(())
3166        }
3167    }
3168
3169    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3170        for FDomainGetKoidResponse
3171    {
3172        #[inline(always)]
3173        fn new_empty() -> Self {
3174            Self { koid: fidl::new_empty!(u64, D) }
3175        }
3176
3177        #[inline]
3178        unsafe fn decode(
3179            &mut self,
3180            decoder: &mut fidl::encoding::Decoder<'_, D>,
3181            offset: usize,
3182            _depth: fidl::encoding::Depth,
3183        ) -> fidl::Result<()> {
3184            decoder.debug_check_bounds::<Self>(offset);
3185            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3186            // Verify that padding bytes are zero.
3187            // Copy from the buffer into the object.
3188            unsafe {
3189                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3190            }
3191            Ok(())
3192        }
3193    }
3194
3195    impl fidl::encoding::ValueTypeMarker for FDomainWaitForSignalsResponse {
3196        type Borrowed<'a> = &'a Self;
3197        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3198            value
3199        }
3200    }
3201
3202    unsafe impl fidl::encoding::TypeMarker for FDomainWaitForSignalsResponse {
3203        type Owned = Self;
3204
3205        #[inline(always)]
3206        fn inline_align(_context: fidl::encoding::Context) -> usize {
3207            4
3208        }
3209
3210        #[inline(always)]
3211        fn inline_size(_context: fidl::encoding::Context) -> usize {
3212            4
3213        }
3214        #[inline(always)]
3215        fn encode_is_copy() -> bool {
3216            true
3217        }
3218
3219        #[inline(always)]
3220        fn decode_is_copy() -> bool {
3221            true
3222        }
3223    }
3224
3225    unsafe impl<D: fidl::encoding::ResourceDialect>
3226        fidl::encoding::Encode<FDomainWaitForSignalsResponse, D>
3227        for &FDomainWaitForSignalsResponse
3228    {
3229        #[inline]
3230        unsafe fn encode(
3231            self,
3232            encoder: &mut fidl::encoding::Encoder<'_, D>,
3233            offset: usize,
3234            _depth: fidl::encoding::Depth,
3235        ) -> fidl::Result<()> {
3236            encoder.debug_check_bounds::<FDomainWaitForSignalsResponse>(offset);
3237            unsafe {
3238                // Copy the object into the buffer.
3239                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3240                (buf_ptr as *mut FDomainWaitForSignalsResponse)
3241                    .write_unaligned((self as *const FDomainWaitForSignalsResponse).read());
3242                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3243                // done second because the memcpy will write garbage to these bytes.
3244            }
3245            Ok(())
3246        }
3247    }
3248    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3249        fidl::encoding::Encode<FDomainWaitForSignalsResponse, D> for (T0,)
3250    {
3251        #[inline]
3252        unsafe fn encode(
3253            self,
3254            encoder: &mut fidl::encoding::Encoder<'_, D>,
3255            offset: usize,
3256            depth: fidl::encoding::Depth,
3257        ) -> fidl::Result<()> {
3258            encoder.debug_check_bounds::<FDomainWaitForSignalsResponse>(offset);
3259            // Zero out padding regions. There's no need to apply masks
3260            // because the unmasked parts will be overwritten by fields.
3261            // Write the fields.
3262            self.0.encode(encoder, offset + 0, depth)?;
3263            Ok(())
3264        }
3265    }
3266
3267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3268        for FDomainWaitForSignalsResponse
3269    {
3270        #[inline(always)]
3271        fn new_empty() -> Self {
3272            Self { signals: fidl::new_empty!(u32, D) }
3273        }
3274
3275        #[inline]
3276        unsafe fn decode(
3277            &mut self,
3278            decoder: &mut fidl::encoding::Decoder<'_, D>,
3279            offset: usize,
3280            _depth: fidl::encoding::Depth,
3281        ) -> fidl::Result<()> {
3282            decoder.debug_check_bounds::<Self>(offset);
3283            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3284            // Verify that padding bytes are zero.
3285            // Copy from the buffer into the object.
3286            unsafe {
3287                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3288            }
3289            Ok(())
3290        }
3291    }
3292
3293    impl fidl::encoding::ValueTypeMarker for HandleDisposition {
3294        type Borrowed<'a> = &'a Self;
3295        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3296            value
3297        }
3298    }
3299
3300    unsafe impl fidl::encoding::TypeMarker for HandleDisposition {
3301        type Owned = Self;
3302
3303        #[inline(always)]
3304        fn inline_align(_context: fidl::encoding::Context) -> usize {
3305            8
3306        }
3307
3308        #[inline(always)]
3309        fn inline_size(_context: fidl::encoding::Context) -> usize {
3310            24
3311        }
3312    }
3313
3314    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleDisposition, D>
3315        for &HandleDisposition
3316    {
3317        #[inline]
3318        unsafe fn encode(
3319            self,
3320            encoder: &mut fidl::encoding::Encoder<'_, D>,
3321            offset: usize,
3322            _depth: fidl::encoding::Depth,
3323        ) -> fidl::Result<()> {
3324            encoder.debug_check_bounds::<HandleDisposition>(offset);
3325            // Delegate to tuple encoding.
3326            fidl::encoding::Encode::<HandleDisposition, D>::encode(
3327                (
3328                    <HandleOp as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
3329                    <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
3330                ),
3331                encoder,
3332                offset,
3333                _depth,
3334            )
3335        }
3336    }
3337    unsafe impl<
3338        D: fidl::encoding::ResourceDialect,
3339        T0: fidl::encoding::Encode<HandleOp, D>,
3340        T1: fidl::encoding::Encode<fidl::Rights, D>,
3341    > fidl::encoding::Encode<HandleDisposition, D> for (T0, T1)
3342    {
3343        #[inline]
3344        unsafe fn encode(
3345            self,
3346            encoder: &mut fidl::encoding::Encoder<'_, D>,
3347            offset: usize,
3348            depth: fidl::encoding::Depth,
3349        ) -> fidl::Result<()> {
3350            encoder.debug_check_bounds::<HandleDisposition>(offset);
3351            // Zero out padding regions. There's no need to apply masks
3352            // because the unmasked parts will be overwritten by fields.
3353            unsafe {
3354                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3355                (ptr as *mut u64).write_unaligned(0);
3356            }
3357            // Write the fields.
3358            self.0.encode(encoder, offset + 0, depth)?;
3359            self.1.encode(encoder, offset + 16, depth)?;
3360            Ok(())
3361        }
3362    }
3363
3364    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleDisposition {
3365        #[inline(always)]
3366        fn new_empty() -> Self {
3367            Self {
3368                handle: fidl::new_empty!(HandleOp, D),
3369                rights: fidl::new_empty!(fidl::Rights, D),
3370            }
3371        }
3372
3373        #[inline]
3374        unsafe fn decode(
3375            &mut self,
3376            decoder: &mut fidl::encoding::Decoder<'_, D>,
3377            offset: usize,
3378            _depth: fidl::encoding::Depth,
3379        ) -> fidl::Result<()> {
3380            decoder.debug_check_bounds::<Self>(offset);
3381            // Verify that padding bytes are zero.
3382            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3383            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3384            let mask = 0xffffffff00000000u64;
3385            let maskedval = padval & mask;
3386            if maskedval != 0 {
3387                return Err(fidl::Error::NonZeroPadding {
3388                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3389                });
3390            }
3391            fidl::decode!(HandleOp, D, &mut self.handle, decoder, offset + 0, _depth)?;
3392            fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 16, _depth)?;
3393            Ok(())
3394        }
3395    }
3396
3397    impl fidl::encoding::ValueTypeMarker for HandleId {
3398        type Borrowed<'a> = &'a Self;
3399        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3400            value
3401        }
3402    }
3403
3404    unsafe impl fidl::encoding::TypeMarker for HandleId {
3405        type Owned = Self;
3406
3407        #[inline(always)]
3408        fn inline_align(_context: fidl::encoding::Context) -> usize {
3409            4
3410        }
3411
3412        #[inline(always)]
3413        fn inline_size(_context: fidl::encoding::Context) -> usize {
3414            4
3415        }
3416        #[inline(always)]
3417        fn encode_is_copy() -> bool {
3418            true
3419        }
3420
3421        #[inline(always)]
3422        fn decode_is_copy() -> bool {
3423            true
3424        }
3425    }
3426
3427    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleId, D> for &HandleId {
3428        #[inline]
3429        unsafe fn encode(
3430            self,
3431            encoder: &mut fidl::encoding::Encoder<'_, D>,
3432            offset: usize,
3433            _depth: fidl::encoding::Depth,
3434        ) -> fidl::Result<()> {
3435            encoder.debug_check_bounds::<HandleId>(offset);
3436            unsafe {
3437                // Copy the object into the buffer.
3438                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3439                (buf_ptr as *mut HandleId).write_unaligned((self as *const HandleId).read());
3440                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3441                // done second because the memcpy will write garbage to these bytes.
3442            }
3443            Ok(())
3444        }
3445    }
3446    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3447        fidl::encoding::Encode<HandleId, D> for (T0,)
3448    {
3449        #[inline]
3450        unsafe fn encode(
3451            self,
3452            encoder: &mut fidl::encoding::Encoder<'_, D>,
3453            offset: usize,
3454            depth: fidl::encoding::Depth,
3455        ) -> fidl::Result<()> {
3456            encoder.debug_check_bounds::<HandleId>(offset);
3457            // Zero out padding regions. There's no need to apply masks
3458            // because the unmasked parts will be overwritten by fields.
3459            // Write the fields.
3460            self.0.encode(encoder, offset + 0, depth)?;
3461            Ok(())
3462        }
3463    }
3464
3465    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleId {
3466        #[inline(always)]
3467        fn new_empty() -> Self {
3468            Self { id: fidl::new_empty!(u32, D) }
3469        }
3470
3471        #[inline]
3472        unsafe fn decode(
3473            &mut self,
3474            decoder: &mut fidl::encoding::Decoder<'_, D>,
3475            offset: usize,
3476            _depth: fidl::encoding::Depth,
3477        ) -> fidl::Result<()> {
3478            decoder.debug_check_bounds::<Self>(offset);
3479            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3480            // Verify that padding bytes are zero.
3481            // Copy from the buffer into the object.
3482            unsafe {
3483                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3484            }
3485            Ok(())
3486        }
3487    }
3488
3489    impl fidl::encoding::ValueTypeMarker for HandleInfo {
3490        type Borrowed<'a> = &'a Self;
3491        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3492            value
3493        }
3494    }
3495
3496    unsafe impl fidl::encoding::TypeMarker for HandleInfo {
3497        type Owned = Self;
3498
3499        #[inline(always)]
3500        fn inline_align(_context: fidl::encoding::Context) -> usize {
3501            4
3502        }
3503
3504        #[inline(always)]
3505        fn inline_size(_context: fidl::encoding::Context) -> usize {
3506            12
3507        }
3508    }
3509
3510    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleInfo, D>
3511        for &HandleInfo
3512    {
3513        #[inline]
3514        unsafe fn encode(
3515            self,
3516            encoder: &mut fidl::encoding::Encoder<'_, D>,
3517            offset: usize,
3518            _depth: fidl::encoding::Depth,
3519        ) -> fidl::Result<()> {
3520            encoder.debug_check_bounds::<HandleInfo>(offset);
3521            // Delegate to tuple encoding.
3522            fidl::encoding::Encode::<HandleInfo, D>::encode(
3523                (
3524                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
3525                    <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
3526                    <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
3527                ),
3528                encoder,
3529                offset,
3530                _depth,
3531            )
3532        }
3533    }
3534    unsafe impl<
3535        D: fidl::encoding::ResourceDialect,
3536        T0: fidl::encoding::Encode<HandleId, D>,
3537        T1: fidl::encoding::Encode<fidl::ObjectType, D>,
3538        T2: fidl::encoding::Encode<fidl::Rights, D>,
3539    > fidl::encoding::Encode<HandleInfo, D> for (T0, T1, T2)
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::<HandleInfo>(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            self.1.encode(encoder, offset + 4, depth)?;
3554            self.2.encode(encoder, offset + 8, depth)?;
3555            Ok(())
3556        }
3557    }
3558
3559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleInfo {
3560        #[inline(always)]
3561        fn new_empty() -> Self {
3562            Self {
3563                handle: fidl::new_empty!(HandleId, D),
3564                type_: fidl::new_empty!(fidl::ObjectType, D),
3565                rights: fidl::new_empty!(fidl::Rights, D),
3566            }
3567        }
3568
3569        #[inline]
3570        unsafe fn decode(
3571            &mut self,
3572            decoder: &mut fidl::encoding::Decoder<'_, D>,
3573            offset: usize,
3574            _depth: fidl::encoding::Depth,
3575        ) -> fidl::Result<()> {
3576            decoder.debug_check_bounds::<Self>(offset);
3577            // Verify that padding bytes are zero.
3578            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
3579            fidl::decode!(fidl::ObjectType, D, &mut self.type_, decoder, offset + 4, _depth)?;
3580            fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 8, _depth)?;
3581            Ok(())
3582        }
3583    }
3584
3585    impl fidl::encoding::ValueTypeMarker for NewHandleId {
3586        type Borrowed<'a> = &'a Self;
3587        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3588            value
3589        }
3590    }
3591
3592    unsafe impl fidl::encoding::TypeMarker for NewHandleId {
3593        type Owned = Self;
3594
3595        #[inline(always)]
3596        fn inline_align(_context: fidl::encoding::Context) -> usize {
3597            4
3598        }
3599
3600        #[inline(always)]
3601        fn inline_size(_context: fidl::encoding::Context) -> usize {
3602            4
3603        }
3604        #[inline(always)]
3605        fn encode_is_copy() -> bool {
3606            true
3607        }
3608
3609        #[inline(always)]
3610        fn decode_is_copy() -> bool {
3611            true
3612        }
3613    }
3614
3615    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NewHandleId, D>
3616        for &NewHandleId
3617    {
3618        #[inline]
3619        unsafe fn encode(
3620            self,
3621            encoder: &mut fidl::encoding::Encoder<'_, D>,
3622            offset: usize,
3623            _depth: fidl::encoding::Depth,
3624        ) -> fidl::Result<()> {
3625            encoder.debug_check_bounds::<NewHandleId>(offset);
3626            unsafe {
3627                // Copy the object into the buffer.
3628                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3629                (buf_ptr as *mut NewHandleId).write_unaligned((self as *const NewHandleId).read());
3630                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3631                // done second because the memcpy will write garbage to these bytes.
3632            }
3633            Ok(())
3634        }
3635    }
3636    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3637        fidl::encoding::Encode<NewHandleId, D> for (T0,)
3638    {
3639        #[inline]
3640        unsafe fn encode(
3641            self,
3642            encoder: &mut fidl::encoding::Encoder<'_, D>,
3643            offset: usize,
3644            depth: fidl::encoding::Depth,
3645        ) -> fidl::Result<()> {
3646            encoder.debug_check_bounds::<NewHandleId>(offset);
3647            // Zero out padding regions. There's no need to apply masks
3648            // because the unmasked parts will be overwritten by fields.
3649            // Write the fields.
3650            self.0.encode(encoder, offset + 0, depth)?;
3651            Ok(())
3652        }
3653    }
3654
3655    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NewHandleId {
3656        #[inline(always)]
3657        fn new_empty() -> Self {
3658            Self { id: fidl::new_empty!(u32, D) }
3659        }
3660
3661        #[inline]
3662        unsafe fn decode(
3663            &mut self,
3664            decoder: &mut fidl::encoding::Decoder<'_, D>,
3665            offset: usize,
3666            _depth: fidl::encoding::Depth,
3667        ) -> fidl::Result<()> {
3668            decoder.debug_check_bounds::<Self>(offset);
3669            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3670            // Verify that padding bytes are zero.
3671            // Copy from the buffer into the object.
3672            unsafe {
3673                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3674            }
3675            Ok(())
3676        }
3677    }
3678
3679    impl fidl::encoding::ValueTypeMarker for NewHandleIdOutOfRange {
3680        type Borrowed<'a> = &'a Self;
3681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3682            value
3683        }
3684    }
3685
3686    unsafe impl fidl::encoding::TypeMarker for NewHandleIdOutOfRange {
3687        type Owned = Self;
3688
3689        #[inline(always)]
3690        fn inline_align(_context: fidl::encoding::Context) -> usize {
3691            4
3692        }
3693
3694        #[inline(always)]
3695        fn inline_size(_context: fidl::encoding::Context) -> usize {
3696            4
3697        }
3698        #[inline(always)]
3699        fn encode_is_copy() -> bool {
3700            true
3701        }
3702
3703        #[inline(always)]
3704        fn decode_is_copy() -> bool {
3705            true
3706        }
3707    }
3708
3709    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NewHandleIdOutOfRange, D>
3710        for &NewHandleIdOutOfRange
3711    {
3712        #[inline]
3713        unsafe fn encode(
3714            self,
3715            encoder: &mut fidl::encoding::Encoder<'_, D>,
3716            offset: usize,
3717            _depth: fidl::encoding::Depth,
3718        ) -> fidl::Result<()> {
3719            encoder.debug_check_bounds::<NewHandleIdOutOfRange>(offset);
3720            unsafe {
3721                // Copy the object into the buffer.
3722                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3723                (buf_ptr as *mut NewHandleIdOutOfRange)
3724                    .write_unaligned((self as *const NewHandleIdOutOfRange).read());
3725                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3726                // done second because the memcpy will write garbage to these bytes.
3727            }
3728            Ok(())
3729        }
3730    }
3731    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3732        fidl::encoding::Encode<NewHandleIdOutOfRange, D> for (T0,)
3733    {
3734        #[inline]
3735        unsafe fn encode(
3736            self,
3737            encoder: &mut fidl::encoding::Encoder<'_, D>,
3738            offset: usize,
3739            depth: fidl::encoding::Depth,
3740        ) -> fidl::Result<()> {
3741            encoder.debug_check_bounds::<NewHandleIdOutOfRange>(offset);
3742            // Zero out padding regions. There's no need to apply masks
3743            // because the unmasked parts will be overwritten by fields.
3744            // Write the fields.
3745            self.0.encode(encoder, offset + 0, depth)?;
3746            Ok(())
3747        }
3748    }
3749
3750    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NewHandleIdOutOfRange {
3751        #[inline(always)]
3752        fn new_empty() -> Self {
3753            Self { id: fidl::new_empty!(u32, D) }
3754        }
3755
3756        #[inline]
3757        unsafe fn decode(
3758            &mut self,
3759            decoder: &mut fidl::encoding::Decoder<'_, D>,
3760            offset: usize,
3761            _depth: fidl::encoding::Depth,
3762        ) -> fidl::Result<()> {
3763            decoder.debug_check_bounds::<Self>(offset);
3764            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3765            // Verify that padding bytes are zero.
3766            // Copy from the buffer into the object.
3767            unsafe {
3768                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3769            }
3770            Ok(())
3771        }
3772    }
3773
3774    impl fidl::encoding::ValueTypeMarker for NewHandleIdReused {
3775        type Borrowed<'a> = &'a Self;
3776        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3777            value
3778        }
3779    }
3780
3781    unsafe impl fidl::encoding::TypeMarker for NewHandleIdReused {
3782        type Owned = Self;
3783
3784        #[inline(always)]
3785        fn inline_align(_context: fidl::encoding::Context) -> usize {
3786            4
3787        }
3788
3789        #[inline(always)]
3790        fn inline_size(_context: fidl::encoding::Context) -> usize {
3791            8
3792        }
3793    }
3794
3795    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NewHandleIdReused, D>
3796        for &NewHandleIdReused
3797    {
3798        #[inline]
3799        unsafe fn encode(
3800            self,
3801            encoder: &mut fidl::encoding::Encoder<'_, D>,
3802            offset: usize,
3803            _depth: fidl::encoding::Depth,
3804        ) -> fidl::Result<()> {
3805            encoder.debug_check_bounds::<NewHandleIdReused>(offset);
3806            // Delegate to tuple encoding.
3807            fidl::encoding::Encode::<NewHandleIdReused, D>::encode(
3808                (
3809                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3810                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.same_call),
3811                ),
3812                encoder,
3813                offset,
3814                _depth,
3815            )
3816        }
3817    }
3818    unsafe impl<
3819        D: fidl::encoding::ResourceDialect,
3820        T0: fidl::encoding::Encode<u32, D>,
3821        T1: fidl::encoding::Encode<bool, D>,
3822    > fidl::encoding::Encode<NewHandleIdReused, D> for (T0, T1)
3823    {
3824        #[inline]
3825        unsafe fn encode(
3826            self,
3827            encoder: &mut fidl::encoding::Encoder<'_, D>,
3828            offset: usize,
3829            depth: fidl::encoding::Depth,
3830        ) -> fidl::Result<()> {
3831            encoder.debug_check_bounds::<NewHandleIdReused>(offset);
3832            // Zero out padding regions. There's no need to apply masks
3833            // because the unmasked parts will be overwritten by fields.
3834            unsafe {
3835                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
3836                (ptr as *mut u32).write_unaligned(0);
3837            }
3838            // Write the fields.
3839            self.0.encode(encoder, offset + 0, depth)?;
3840            self.1.encode(encoder, offset + 4, depth)?;
3841            Ok(())
3842        }
3843    }
3844
3845    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NewHandleIdReused {
3846        #[inline(always)]
3847        fn new_empty() -> Self {
3848            Self { id: fidl::new_empty!(u32, D), same_call: fidl::new_empty!(bool, D) }
3849        }
3850
3851        #[inline]
3852        unsafe fn decode(
3853            &mut self,
3854            decoder: &mut fidl::encoding::Decoder<'_, D>,
3855            offset: usize,
3856            _depth: fidl::encoding::Depth,
3857        ) -> fidl::Result<()> {
3858            decoder.debug_check_bounds::<Self>(offset);
3859            // Verify that padding bytes are zero.
3860            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
3861            let padval = unsafe { (ptr as *const u32).read_unaligned() };
3862            let mask = 0xffffff00u32;
3863            let maskedval = padval & mask;
3864            if maskedval != 0 {
3865                return Err(fidl::Error::NonZeroPadding {
3866                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
3867                });
3868            }
3869            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
3870            fidl::decode!(bool, D, &mut self.same_call, decoder, offset + 4, _depth)?;
3871            Ok(())
3872        }
3873    }
3874
3875    impl fidl::encoding::ValueTypeMarker for NoReadInProgress {
3876        type Borrowed<'a> = &'a Self;
3877        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3878            value
3879        }
3880    }
3881
3882    unsafe impl fidl::encoding::TypeMarker for NoReadInProgress {
3883        type Owned = Self;
3884
3885        #[inline(always)]
3886        fn inline_align(_context: fidl::encoding::Context) -> usize {
3887            1
3888        }
3889
3890        #[inline(always)]
3891        fn inline_size(_context: fidl::encoding::Context) -> usize {
3892            1
3893        }
3894    }
3895
3896    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NoReadInProgress, D>
3897        for &NoReadInProgress
3898    {
3899        #[inline]
3900        unsafe fn encode(
3901            self,
3902            encoder: &mut fidl::encoding::Encoder<'_, D>,
3903            offset: usize,
3904            _depth: fidl::encoding::Depth,
3905        ) -> fidl::Result<()> {
3906            encoder.debug_check_bounds::<NoReadInProgress>(offset);
3907            encoder.write_num(0u8, offset);
3908            Ok(())
3909        }
3910    }
3911
3912    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NoReadInProgress {
3913        #[inline(always)]
3914        fn new_empty() -> Self {
3915            Self
3916        }
3917
3918        #[inline]
3919        unsafe fn decode(
3920            &mut self,
3921            decoder: &mut fidl::encoding::Decoder<'_, D>,
3922            offset: usize,
3923            _depth: fidl::encoding::Depth,
3924        ) -> fidl::Result<()> {
3925            decoder.debug_check_bounds::<Self>(offset);
3926            match decoder.read_num::<u8>(offset) {
3927                0 => Ok(()),
3928                _ => Err(fidl::Error::Invalid),
3929            }
3930        }
3931    }
3932
3933    impl fidl::encoding::ValueTypeMarker for RightsUnknown {
3934        type Borrowed<'a> = &'a Self;
3935        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3936            value
3937        }
3938    }
3939
3940    unsafe impl fidl::encoding::TypeMarker for RightsUnknown {
3941        type Owned = Self;
3942
3943        #[inline(always)]
3944        fn inline_align(_context: fidl::encoding::Context) -> usize {
3945            4
3946        }
3947
3948        #[inline(always)]
3949        fn inline_size(_context: fidl::encoding::Context) -> usize {
3950            4
3951        }
3952    }
3953
3954    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RightsUnknown, D>
3955        for &RightsUnknown
3956    {
3957        #[inline]
3958        unsafe fn encode(
3959            self,
3960            encoder: &mut fidl::encoding::Encoder<'_, D>,
3961            offset: usize,
3962            _depth: fidl::encoding::Depth,
3963        ) -> fidl::Result<()> {
3964            encoder.debug_check_bounds::<RightsUnknown>(offset);
3965            // Delegate to tuple encoding.
3966            fidl::encoding::Encode::<RightsUnknown, D>::encode(
3967                (<fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),),
3968                encoder,
3969                offset,
3970                _depth,
3971            )
3972        }
3973    }
3974    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<fidl::Rights, D>>
3975        fidl::encoding::Encode<RightsUnknown, D> for (T0,)
3976    {
3977        #[inline]
3978        unsafe fn encode(
3979            self,
3980            encoder: &mut fidl::encoding::Encoder<'_, D>,
3981            offset: usize,
3982            depth: fidl::encoding::Depth,
3983        ) -> fidl::Result<()> {
3984            encoder.debug_check_bounds::<RightsUnknown>(offset);
3985            // Zero out padding regions. There's no need to apply masks
3986            // because the unmasked parts will be overwritten by fields.
3987            // Write the fields.
3988            self.0.encode(encoder, offset + 0, depth)?;
3989            Ok(())
3990        }
3991    }
3992
3993    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RightsUnknown {
3994        #[inline(always)]
3995        fn new_empty() -> Self {
3996            Self { rights: fidl::new_empty!(fidl::Rights, D) }
3997        }
3998
3999        #[inline]
4000        unsafe fn decode(
4001            &mut self,
4002            decoder: &mut fidl::encoding::Decoder<'_, D>,
4003            offset: usize,
4004            _depth: fidl::encoding::Depth,
4005        ) -> fidl::Result<()> {
4006            decoder.debug_check_bounds::<Self>(offset);
4007            // Verify that padding bytes are zero.
4008            fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 0, _depth)?;
4009            Ok(())
4010        }
4011    }
4012
4013    impl fidl::encoding::ValueTypeMarker for SignalsUnknown {
4014        type Borrowed<'a> = &'a Self;
4015        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4016            value
4017        }
4018    }
4019
4020    unsafe impl fidl::encoding::TypeMarker for SignalsUnknown {
4021        type Owned = Self;
4022
4023        #[inline(always)]
4024        fn inline_align(_context: fidl::encoding::Context) -> usize {
4025            4
4026        }
4027
4028        #[inline(always)]
4029        fn inline_size(_context: fidl::encoding::Context) -> usize {
4030            4
4031        }
4032        #[inline(always)]
4033        fn encode_is_copy() -> bool {
4034            true
4035        }
4036
4037        #[inline(always)]
4038        fn decode_is_copy() -> bool {
4039            true
4040        }
4041    }
4042
4043    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SignalsUnknown, D>
4044        for &SignalsUnknown
4045    {
4046        #[inline]
4047        unsafe fn encode(
4048            self,
4049            encoder: &mut fidl::encoding::Encoder<'_, D>,
4050            offset: usize,
4051            _depth: fidl::encoding::Depth,
4052        ) -> fidl::Result<()> {
4053            encoder.debug_check_bounds::<SignalsUnknown>(offset);
4054            unsafe {
4055                // Copy the object into the buffer.
4056                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4057                (buf_ptr as *mut SignalsUnknown)
4058                    .write_unaligned((self as *const SignalsUnknown).read());
4059                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4060                // done second because the memcpy will write garbage to these bytes.
4061            }
4062            Ok(())
4063        }
4064    }
4065    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4066        fidl::encoding::Encode<SignalsUnknown, D> for (T0,)
4067    {
4068        #[inline]
4069        unsafe fn encode(
4070            self,
4071            encoder: &mut fidl::encoding::Encoder<'_, D>,
4072            offset: usize,
4073            depth: fidl::encoding::Depth,
4074        ) -> fidl::Result<()> {
4075            encoder.debug_check_bounds::<SignalsUnknown>(offset);
4076            // Zero out padding regions. There's no need to apply masks
4077            // because the unmasked parts will be overwritten by fields.
4078            // Write the fields.
4079            self.0.encode(encoder, offset + 0, depth)?;
4080            Ok(())
4081        }
4082    }
4083
4084    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SignalsUnknown {
4085        #[inline(always)]
4086        fn new_empty() -> Self {
4087            Self { signals: fidl::new_empty!(u32, D) }
4088        }
4089
4090        #[inline]
4091        unsafe fn decode(
4092            &mut self,
4093            decoder: &mut fidl::encoding::Decoder<'_, D>,
4094            offset: usize,
4095            _depth: fidl::encoding::Depth,
4096        ) -> fidl::Result<()> {
4097            decoder.debug_check_bounds::<Self>(offset);
4098            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4099            // Verify that padding bytes are zero.
4100            // Copy from the buffer into the object.
4101            unsafe {
4102                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4103            }
4104            Ok(())
4105        }
4106    }
4107
4108    impl fidl::encoding::ValueTypeMarker for SocketCreateSocketRequest {
4109        type Borrowed<'a> = &'a Self;
4110        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4111            value
4112        }
4113    }
4114
4115    unsafe impl fidl::encoding::TypeMarker for SocketCreateSocketRequest {
4116        type Owned = Self;
4117
4118        #[inline(always)]
4119        fn inline_align(_context: fidl::encoding::Context) -> usize {
4120            4
4121        }
4122
4123        #[inline(always)]
4124        fn inline_size(_context: fidl::encoding::Context) -> usize {
4125            12
4126        }
4127    }
4128
4129    unsafe impl<D: fidl::encoding::ResourceDialect>
4130        fidl::encoding::Encode<SocketCreateSocketRequest, D> for &SocketCreateSocketRequest
4131    {
4132        #[inline]
4133        unsafe fn encode(
4134            self,
4135            encoder: &mut fidl::encoding::Encoder<'_, D>,
4136            offset: usize,
4137            _depth: fidl::encoding::Depth,
4138        ) -> fidl::Result<()> {
4139            encoder.debug_check_bounds::<SocketCreateSocketRequest>(offset);
4140            // Delegate to tuple encoding.
4141            fidl::encoding::Encode::<SocketCreateSocketRequest, D>::encode(
4142                (
4143                    <SocketType as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
4144                    <fidl::encoding::Array<NewHandleId, 2> as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
4145                ),
4146                encoder, offset, _depth
4147            )
4148        }
4149    }
4150    unsafe impl<
4151        D: fidl::encoding::ResourceDialect,
4152        T0: fidl::encoding::Encode<SocketType, D>,
4153        T1: fidl::encoding::Encode<fidl::encoding::Array<NewHandleId, 2>, D>,
4154    > fidl::encoding::Encode<SocketCreateSocketRequest, D> for (T0, T1)
4155    {
4156        #[inline]
4157        unsafe fn encode(
4158            self,
4159            encoder: &mut fidl::encoding::Encoder<'_, D>,
4160            offset: usize,
4161            depth: fidl::encoding::Depth,
4162        ) -> fidl::Result<()> {
4163            encoder.debug_check_bounds::<SocketCreateSocketRequest>(offset);
4164            // Zero out padding regions. There's no need to apply masks
4165            // because the unmasked parts will be overwritten by fields.
4166            // Write the fields.
4167            self.0.encode(encoder, offset + 0, depth)?;
4168            self.1.encode(encoder, offset + 4, depth)?;
4169            Ok(())
4170        }
4171    }
4172
4173    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4174        for SocketCreateSocketRequest
4175    {
4176        #[inline(always)]
4177        fn new_empty() -> Self {
4178            Self {
4179                options: fidl::new_empty!(SocketType, D),
4180                handles: fidl::new_empty!(fidl::encoding::Array<NewHandleId, 2>, D),
4181            }
4182        }
4183
4184        #[inline]
4185        unsafe fn decode(
4186            &mut self,
4187            decoder: &mut fidl::encoding::Decoder<'_, D>,
4188            offset: usize,
4189            _depth: fidl::encoding::Depth,
4190        ) -> fidl::Result<()> {
4191            decoder.debug_check_bounds::<Self>(offset);
4192            // Verify that padding bytes are zero.
4193            fidl::decode!(SocketType, D, &mut self.options, decoder, offset + 0, _depth)?;
4194            fidl::decode!(fidl::encoding::Array<NewHandleId, 2>, D, &mut self.handles, decoder, offset + 4, _depth)?;
4195            Ok(())
4196        }
4197    }
4198
4199    impl fidl::encoding::ValueTypeMarker for SocketData {
4200        type Borrowed<'a> = &'a Self;
4201        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4202            value
4203        }
4204    }
4205
4206    unsafe impl fidl::encoding::TypeMarker for SocketData {
4207        type Owned = Self;
4208
4209        #[inline(always)]
4210        fn inline_align(_context: fidl::encoding::Context) -> usize {
4211            8
4212        }
4213
4214        #[inline(always)]
4215        fn inline_size(_context: fidl::encoding::Context) -> usize {
4216            24
4217        }
4218    }
4219
4220    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketData, D>
4221        for &SocketData
4222    {
4223        #[inline]
4224        unsafe fn encode(
4225            self,
4226            encoder: &mut fidl::encoding::Encoder<'_, D>,
4227            offset: usize,
4228            _depth: fidl::encoding::Depth,
4229        ) -> fidl::Result<()> {
4230            encoder.debug_check_bounds::<SocketData>(offset);
4231            // Delegate to tuple encoding.
4232            fidl::encoding::Encode::<SocketData, D>::encode(
4233                (
4234                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
4235                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_datagram),
4236                ),
4237                encoder, offset, _depth
4238            )
4239        }
4240    }
4241    unsafe impl<
4242        D: fidl::encoding::ResourceDialect,
4243        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
4244        T1: fidl::encoding::Encode<bool, D>,
4245    > fidl::encoding::Encode<SocketData, D> for (T0, T1)
4246    {
4247        #[inline]
4248        unsafe fn encode(
4249            self,
4250            encoder: &mut fidl::encoding::Encoder<'_, D>,
4251            offset: usize,
4252            depth: fidl::encoding::Depth,
4253        ) -> fidl::Result<()> {
4254            encoder.debug_check_bounds::<SocketData>(offset);
4255            // Zero out padding regions. There's no need to apply masks
4256            // because the unmasked parts will be overwritten by fields.
4257            unsafe {
4258                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4259                (ptr as *mut u64).write_unaligned(0);
4260            }
4261            // Write the fields.
4262            self.0.encode(encoder, offset + 0, depth)?;
4263            self.1.encode(encoder, offset + 16, depth)?;
4264            Ok(())
4265        }
4266    }
4267
4268    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketData {
4269        #[inline(always)]
4270        fn new_empty() -> Self {
4271            Self {
4272                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
4273                is_datagram: fidl::new_empty!(bool, D),
4274            }
4275        }
4276
4277        #[inline]
4278        unsafe fn decode(
4279            &mut self,
4280            decoder: &mut fidl::encoding::Decoder<'_, D>,
4281            offset: usize,
4282            _depth: fidl::encoding::Depth,
4283        ) -> fidl::Result<()> {
4284            decoder.debug_check_bounds::<Self>(offset);
4285            // Verify that padding bytes are zero.
4286            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4287            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4288            let mask = 0xffffffffffffff00u64;
4289            let maskedval = padval & mask;
4290            if maskedval != 0 {
4291                return Err(fidl::Error::NonZeroPadding {
4292                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4293                });
4294            }
4295            fidl::decode!(
4296                fidl::encoding::UnboundedVector<u8>,
4297                D,
4298                &mut self.data,
4299                decoder,
4300                offset + 0,
4301                _depth
4302            )?;
4303            fidl::decode!(bool, D, &mut self.is_datagram, decoder, offset + 16, _depth)?;
4304            Ok(())
4305        }
4306    }
4307
4308    impl fidl::encoding::ValueTypeMarker for SocketDispositionUnknown {
4309        type Borrowed<'a> = &'a Self;
4310        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4311            value
4312        }
4313    }
4314
4315    unsafe impl fidl::encoding::TypeMarker for SocketDispositionUnknown {
4316        type Owned = Self;
4317
4318        #[inline(always)]
4319        fn inline_align(_context: fidl::encoding::Context) -> usize {
4320            4
4321        }
4322
4323        #[inline(always)]
4324        fn inline_size(_context: fidl::encoding::Context) -> usize {
4325            4
4326        }
4327    }
4328
4329    unsafe impl<D: fidl::encoding::ResourceDialect>
4330        fidl::encoding::Encode<SocketDispositionUnknown, D> for &SocketDispositionUnknown
4331    {
4332        #[inline]
4333        unsafe fn encode(
4334            self,
4335            encoder: &mut fidl::encoding::Encoder<'_, D>,
4336            offset: usize,
4337            _depth: fidl::encoding::Depth,
4338        ) -> fidl::Result<()> {
4339            encoder.debug_check_bounds::<SocketDispositionUnknown>(offset);
4340            // Delegate to tuple encoding.
4341            fidl::encoding::Encode::<SocketDispositionUnknown, D>::encode(
4342                (<SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(&self.disposition),),
4343                encoder,
4344                offset,
4345                _depth,
4346            )
4347        }
4348    }
4349    unsafe impl<
4350        D: fidl::encoding::ResourceDialect,
4351        T0: fidl::encoding::Encode<SocketDisposition, D>,
4352    > fidl::encoding::Encode<SocketDispositionUnknown, D> for (T0,)
4353    {
4354        #[inline]
4355        unsafe fn encode(
4356            self,
4357            encoder: &mut fidl::encoding::Encoder<'_, D>,
4358            offset: usize,
4359            depth: fidl::encoding::Depth,
4360        ) -> fidl::Result<()> {
4361            encoder.debug_check_bounds::<SocketDispositionUnknown>(offset);
4362            // Zero out padding regions. There's no need to apply masks
4363            // because the unmasked parts will be overwritten by fields.
4364            // Write the fields.
4365            self.0.encode(encoder, offset + 0, depth)?;
4366            Ok(())
4367        }
4368    }
4369
4370    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4371        for SocketDispositionUnknown
4372    {
4373        #[inline(always)]
4374        fn new_empty() -> Self {
4375            Self { disposition: fidl::new_empty!(SocketDisposition, D) }
4376        }
4377
4378        #[inline]
4379        unsafe fn decode(
4380            &mut self,
4381            decoder: &mut fidl::encoding::Decoder<'_, D>,
4382            offset: usize,
4383            _depth: fidl::encoding::Depth,
4384        ) -> fidl::Result<()> {
4385            decoder.debug_check_bounds::<Self>(offset);
4386            // Verify that padding bytes are zero.
4387            fidl::decode!(
4388                SocketDisposition,
4389                D,
4390                &mut self.disposition,
4391                decoder,
4392                offset + 0,
4393                _depth
4394            )?;
4395            Ok(())
4396        }
4397    }
4398
4399    impl fidl::encoding::ValueTypeMarker for SocketOnSocketStreamingDataRequest {
4400        type Borrowed<'a> = &'a Self;
4401        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4402            value
4403        }
4404    }
4405
4406    unsafe impl fidl::encoding::TypeMarker for SocketOnSocketStreamingDataRequest {
4407        type Owned = Self;
4408
4409        #[inline(always)]
4410        fn inline_align(_context: fidl::encoding::Context) -> usize {
4411            8
4412        }
4413
4414        #[inline(always)]
4415        fn inline_size(_context: fidl::encoding::Context) -> usize {
4416            24
4417        }
4418    }
4419
4420    unsafe impl<D: fidl::encoding::ResourceDialect>
4421        fidl::encoding::Encode<SocketOnSocketStreamingDataRequest, D>
4422        for &SocketOnSocketStreamingDataRequest
4423    {
4424        #[inline]
4425        unsafe fn encode(
4426            self,
4427            encoder: &mut fidl::encoding::Encoder<'_, D>,
4428            offset: usize,
4429            _depth: fidl::encoding::Depth,
4430        ) -> fidl::Result<()> {
4431            encoder.debug_check_bounds::<SocketOnSocketStreamingDataRequest>(offset);
4432            // Delegate to tuple encoding.
4433            fidl::encoding::Encode::<SocketOnSocketStreamingDataRequest, D>::encode(
4434                (
4435                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4436                    <SocketMessage as fidl::encoding::ValueTypeMarker>::borrow(
4437                        &self.socket_message,
4438                    ),
4439                ),
4440                encoder,
4441                offset,
4442                _depth,
4443            )
4444        }
4445    }
4446    unsafe impl<
4447        D: fidl::encoding::ResourceDialect,
4448        T0: fidl::encoding::Encode<HandleId, D>,
4449        T1: fidl::encoding::Encode<SocketMessage, D>,
4450    > fidl::encoding::Encode<SocketOnSocketStreamingDataRequest, D> for (T0, T1)
4451    {
4452        #[inline]
4453        unsafe fn encode(
4454            self,
4455            encoder: &mut fidl::encoding::Encoder<'_, D>,
4456            offset: usize,
4457            depth: fidl::encoding::Depth,
4458        ) -> fidl::Result<()> {
4459            encoder.debug_check_bounds::<SocketOnSocketStreamingDataRequest>(offset);
4460            // Zero out padding regions. There's no need to apply masks
4461            // because the unmasked parts will be overwritten by fields.
4462            unsafe {
4463                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4464                (ptr as *mut u64).write_unaligned(0);
4465            }
4466            // Write the fields.
4467            self.0.encode(encoder, offset + 0, depth)?;
4468            self.1.encode(encoder, offset + 8, depth)?;
4469            Ok(())
4470        }
4471    }
4472
4473    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4474        for SocketOnSocketStreamingDataRequest
4475    {
4476        #[inline(always)]
4477        fn new_empty() -> Self {
4478            Self {
4479                handle: fidl::new_empty!(HandleId, D),
4480                socket_message: fidl::new_empty!(SocketMessage, D),
4481            }
4482        }
4483
4484        #[inline]
4485        unsafe fn decode(
4486            &mut self,
4487            decoder: &mut fidl::encoding::Decoder<'_, D>,
4488            offset: usize,
4489            _depth: fidl::encoding::Depth,
4490        ) -> fidl::Result<()> {
4491            decoder.debug_check_bounds::<Self>(offset);
4492            // Verify that padding bytes are zero.
4493            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4494            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4495            let mask = 0xffffffff00000000u64;
4496            let maskedval = padval & mask;
4497            if maskedval != 0 {
4498                return Err(fidl::Error::NonZeroPadding {
4499                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4500                });
4501            }
4502            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4503            fidl::decode!(SocketMessage, D, &mut self.socket_message, decoder, offset + 8, _depth)?;
4504            Ok(())
4505        }
4506    }
4507
4508    impl fidl::encoding::ValueTypeMarker for SocketReadSocketRequest {
4509        type Borrowed<'a> = &'a Self;
4510        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4511            value
4512        }
4513    }
4514
4515    unsafe impl fidl::encoding::TypeMarker for SocketReadSocketRequest {
4516        type Owned = Self;
4517
4518        #[inline(always)]
4519        fn inline_align(_context: fidl::encoding::Context) -> usize {
4520            8
4521        }
4522
4523        #[inline(always)]
4524        fn inline_size(_context: fidl::encoding::Context) -> usize {
4525            16
4526        }
4527    }
4528
4529    unsafe impl<D: fidl::encoding::ResourceDialect>
4530        fidl::encoding::Encode<SocketReadSocketRequest, D> for &SocketReadSocketRequest
4531    {
4532        #[inline]
4533        unsafe fn encode(
4534            self,
4535            encoder: &mut fidl::encoding::Encoder<'_, D>,
4536            offset: usize,
4537            _depth: fidl::encoding::Depth,
4538        ) -> fidl::Result<()> {
4539            encoder.debug_check_bounds::<SocketReadSocketRequest>(offset);
4540            unsafe {
4541                // Copy the object into the buffer.
4542                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4543                (buf_ptr as *mut SocketReadSocketRequest)
4544                    .write_unaligned((self as *const SocketReadSocketRequest).read());
4545                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4546                // done second because the memcpy will write garbage to these bytes.
4547                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4548                let padding_mask = 0xffffffff00000000u64;
4549                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4550            }
4551            Ok(())
4552        }
4553    }
4554    unsafe impl<
4555        D: fidl::encoding::ResourceDialect,
4556        T0: fidl::encoding::Encode<HandleId, D>,
4557        T1: fidl::encoding::Encode<u64, D>,
4558    > fidl::encoding::Encode<SocketReadSocketRequest, D> for (T0, T1)
4559    {
4560        #[inline]
4561        unsafe fn encode(
4562            self,
4563            encoder: &mut fidl::encoding::Encoder<'_, D>,
4564            offset: usize,
4565            depth: fidl::encoding::Depth,
4566        ) -> fidl::Result<()> {
4567            encoder.debug_check_bounds::<SocketReadSocketRequest>(offset);
4568            // Zero out padding regions. There's no need to apply masks
4569            // because the unmasked parts will be overwritten by fields.
4570            unsafe {
4571                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4572                (ptr as *mut u64).write_unaligned(0);
4573            }
4574            // Write the fields.
4575            self.0.encode(encoder, offset + 0, depth)?;
4576            self.1.encode(encoder, offset + 8, depth)?;
4577            Ok(())
4578        }
4579    }
4580
4581    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4582        for SocketReadSocketRequest
4583    {
4584        #[inline(always)]
4585        fn new_empty() -> Self {
4586            Self { handle: fidl::new_empty!(HandleId, D), max_bytes: fidl::new_empty!(u64, D) }
4587        }
4588
4589        #[inline]
4590        unsafe fn decode(
4591            &mut self,
4592            decoder: &mut fidl::encoding::Decoder<'_, D>,
4593            offset: usize,
4594            _depth: fidl::encoding::Depth,
4595        ) -> fidl::Result<()> {
4596            decoder.debug_check_bounds::<Self>(offset);
4597            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4598            // Verify that padding bytes are zero.
4599            let ptr = unsafe { buf_ptr.offset(0) };
4600            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4601            let mask = 0xffffffff00000000u64;
4602            let maskedval = padval & mask;
4603            if maskedval != 0 {
4604                return Err(fidl::Error::NonZeroPadding {
4605                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4606                });
4607            }
4608            // Copy from the buffer into the object.
4609            unsafe {
4610                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4611            }
4612            Ok(())
4613        }
4614    }
4615
4616    impl fidl::encoding::ValueTypeMarker for SocketReadSocketStreamingStartRequest {
4617        type Borrowed<'a> = &'a Self;
4618        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4619            value
4620        }
4621    }
4622
4623    unsafe impl fidl::encoding::TypeMarker for SocketReadSocketStreamingStartRequest {
4624        type Owned = Self;
4625
4626        #[inline(always)]
4627        fn inline_align(_context: fidl::encoding::Context) -> usize {
4628            4
4629        }
4630
4631        #[inline(always)]
4632        fn inline_size(_context: fidl::encoding::Context) -> usize {
4633            4
4634        }
4635        #[inline(always)]
4636        fn encode_is_copy() -> bool {
4637            true
4638        }
4639
4640        #[inline(always)]
4641        fn decode_is_copy() -> bool {
4642            true
4643        }
4644    }
4645
4646    unsafe impl<D: fidl::encoding::ResourceDialect>
4647        fidl::encoding::Encode<SocketReadSocketStreamingStartRequest, D>
4648        for &SocketReadSocketStreamingStartRequest
4649    {
4650        #[inline]
4651        unsafe fn encode(
4652            self,
4653            encoder: &mut fidl::encoding::Encoder<'_, D>,
4654            offset: usize,
4655            _depth: fidl::encoding::Depth,
4656        ) -> fidl::Result<()> {
4657            encoder.debug_check_bounds::<SocketReadSocketStreamingStartRequest>(offset);
4658            unsafe {
4659                // Copy the object into the buffer.
4660                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4661                (buf_ptr as *mut SocketReadSocketStreamingStartRequest)
4662                    .write_unaligned((self as *const SocketReadSocketStreamingStartRequest).read());
4663                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4664                // done second because the memcpy will write garbage to these bytes.
4665            }
4666            Ok(())
4667        }
4668    }
4669    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
4670        fidl::encoding::Encode<SocketReadSocketStreamingStartRequest, D> for (T0,)
4671    {
4672        #[inline]
4673        unsafe fn encode(
4674            self,
4675            encoder: &mut fidl::encoding::Encoder<'_, D>,
4676            offset: usize,
4677            depth: fidl::encoding::Depth,
4678        ) -> fidl::Result<()> {
4679            encoder.debug_check_bounds::<SocketReadSocketStreamingStartRequest>(offset);
4680            // Zero out padding regions. There's no need to apply masks
4681            // because the unmasked parts will be overwritten by fields.
4682            // Write the fields.
4683            self.0.encode(encoder, offset + 0, depth)?;
4684            Ok(())
4685        }
4686    }
4687
4688    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4689        for SocketReadSocketStreamingStartRequest
4690    {
4691        #[inline(always)]
4692        fn new_empty() -> Self {
4693            Self { handle: fidl::new_empty!(HandleId, D) }
4694        }
4695
4696        #[inline]
4697        unsafe fn decode(
4698            &mut self,
4699            decoder: &mut fidl::encoding::Decoder<'_, D>,
4700            offset: usize,
4701            _depth: fidl::encoding::Depth,
4702        ) -> fidl::Result<()> {
4703            decoder.debug_check_bounds::<Self>(offset);
4704            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4705            // Verify that padding bytes are zero.
4706            // Copy from the buffer into the object.
4707            unsafe {
4708                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4709            }
4710            Ok(())
4711        }
4712    }
4713
4714    impl fidl::encoding::ValueTypeMarker for SocketReadSocketStreamingStopRequest {
4715        type Borrowed<'a> = &'a Self;
4716        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4717            value
4718        }
4719    }
4720
4721    unsafe impl fidl::encoding::TypeMarker for SocketReadSocketStreamingStopRequest {
4722        type Owned = Self;
4723
4724        #[inline(always)]
4725        fn inline_align(_context: fidl::encoding::Context) -> usize {
4726            4
4727        }
4728
4729        #[inline(always)]
4730        fn inline_size(_context: fidl::encoding::Context) -> usize {
4731            4
4732        }
4733        #[inline(always)]
4734        fn encode_is_copy() -> bool {
4735            true
4736        }
4737
4738        #[inline(always)]
4739        fn decode_is_copy() -> bool {
4740            true
4741        }
4742    }
4743
4744    unsafe impl<D: fidl::encoding::ResourceDialect>
4745        fidl::encoding::Encode<SocketReadSocketStreamingStopRequest, D>
4746        for &SocketReadSocketStreamingStopRequest
4747    {
4748        #[inline]
4749        unsafe fn encode(
4750            self,
4751            encoder: &mut fidl::encoding::Encoder<'_, D>,
4752            offset: usize,
4753            _depth: fidl::encoding::Depth,
4754        ) -> fidl::Result<()> {
4755            encoder.debug_check_bounds::<SocketReadSocketStreamingStopRequest>(offset);
4756            unsafe {
4757                // Copy the object into the buffer.
4758                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4759                (buf_ptr as *mut SocketReadSocketStreamingStopRequest)
4760                    .write_unaligned((self as *const SocketReadSocketStreamingStopRequest).read());
4761                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4762                // done second because the memcpy will write garbage to these bytes.
4763            }
4764            Ok(())
4765        }
4766    }
4767    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
4768        fidl::encoding::Encode<SocketReadSocketStreamingStopRequest, D> for (T0,)
4769    {
4770        #[inline]
4771        unsafe fn encode(
4772            self,
4773            encoder: &mut fidl::encoding::Encoder<'_, D>,
4774            offset: usize,
4775            depth: fidl::encoding::Depth,
4776        ) -> fidl::Result<()> {
4777            encoder.debug_check_bounds::<SocketReadSocketStreamingStopRequest>(offset);
4778            // Zero out padding regions. There's no need to apply masks
4779            // because the unmasked parts will be overwritten by fields.
4780            // Write the fields.
4781            self.0.encode(encoder, offset + 0, depth)?;
4782            Ok(())
4783        }
4784    }
4785
4786    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4787        for SocketReadSocketStreamingStopRequest
4788    {
4789        #[inline(always)]
4790        fn new_empty() -> Self {
4791            Self { handle: fidl::new_empty!(HandleId, D) }
4792        }
4793
4794        #[inline]
4795        unsafe fn decode(
4796            &mut self,
4797            decoder: &mut fidl::encoding::Decoder<'_, D>,
4798            offset: usize,
4799            _depth: fidl::encoding::Depth,
4800        ) -> fidl::Result<()> {
4801            decoder.debug_check_bounds::<Self>(offset);
4802            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4803            // Verify that padding bytes are zero.
4804            // Copy from the buffer into the object.
4805            unsafe {
4806                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4807            }
4808            Ok(())
4809        }
4810    }
4811
4812    impl fidl::encoding::ValueTypeMarker for SocketSetSocketDispositionRequest {
4813        type Borrowed<'a> = &'a Self;
4814        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4815            value
4816        }
4817    }
4818
4819    unsafe impl fidl::encoding::TypeMarker for SocketSetSocketDispositionRequest {
4820        type Owned = Self;
4821
4822        #[inline(always)]
4823        fn inline_align(_context: fidl::encoding::Context) -> usize {
4824            4
4825        }
4826
4827        #[inline(always)]
4828        fn inline_size(_context: fidl::encoding::Context) -> usize {
4829            12
4830        }
4831    }
4832
4833    unsafe impl<D: fidl::encoding::ResourceDialect>
4834        fidl::encoding::Encode<SocketSetSocketDispositionRequest, D>
4835        for &SocketSetSocketDispositionRequest
4836    {
4837        #[inline]
4838        unsafe fn encode(
4839            self,
4840            encoder: &mut fidl::encoding::Encoder<'_, D>,
4841            offset: usize,
4842            _depth: fidl::encoding::Depth,
4843        ) -> fidl::Result<()> {
4844            encoder.debug_check_bounds::<SocketSetSocketDispositionRequest>(offset);
4845            // Delegate to tuple encoding.
4846            fidl::encoding::Encode::<SocketSetSocketDispositionRequest, D>::encode(
4847                (
4848                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4849                    <SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(
4850                        &self.disposition,
4851                    ),
4852                    <SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(
4853                        &self.disposition_peer,
4854                    ),
4855                ),
4856                encoder,
4857                offset,
4858                _depth,
4859            )
4860        }
4861    }
4862    unsafe impl<
4863        D: fidl::encoding::ResourceDialect,
4864        T0: fidl::encoding::Encode<HandleId, D>,
4865        T1: fidl::encoding::Encode<SocketDisposition, D>,
4866        T2: fidl::encoding::Encode<SocketDisposition, D>,
4867    > fidl::encoding::Encode<SocketSetSocketDispositionRequest, D> for (T0, T1, T2)
4868    {
4869        #[inline]
4870        unsafe fn encode(
4871            self,
4872            encoder: &mut fidl::encoding::Encoder<'_, D>,
4873            offset: usize,
4874            depth: fidl::encoding::Depth,
4875        ) -> fidl::Result<()> {
4876            encoder.debug_check_bounds::<SocketSetSocketDispositionRequest>(offset);
4877            // Zero out padding regions. There's no need to apply masks
4878            // because the unmasked parts will be overwritten by fields.
4879            // Write the fields.
4880            self.0.encode(encoder, offset + 0, depth)?;
4881            self.1.encode(encoder, offset + 4, depth)?;
4882            self.2.encode(encoder, offset + 8, depth)?;
4883            Ok(())
4884        }
4885    }
4886
4887    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4888        for SocketSetSocketDispositionRequest
4889    {
4890        #[inline(always)]
4891        fn new_empty() -> Self {
4892            Self {
4893                handle: fidl::new_empty!(HandleId, D),
4894                disposition: fidl::new_empty!(SocketDisposition, D),
4895                disposition_peer: fidl::new_empty!(SocketDisposition, D),
4896            }
4897        }
4898
4899        #[inline]
4900        unsafe fn decode(
4901            &mut self,
4902            decoder: &mut fidl::encoding::Decoder<'_, D>,
4903            offset: usize,
4904            _depth: fidl::encoding::Depth,
4905        ) -> fidl::Result<()> {
4906            decoder.debug_check_bounds::<Self>(offset);
4907            // Verify that padding bytes are zero.
4908            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4909            fidl::decode!(
4910                SocketDisposition,
4911                D,
4912                &mut self.disposition,
4913                decoder,
4914                offset + 4,
4915                _depth
4916            )?;
4917            fidl::decode!(
4918                SocketDisposition,
4919                D,
4920                &mut self.disposition_peer,
4921                decoder,
4922                offset + 8,
4923                _depth
4924            )?;
4925            Ok(())
4926        }
4927    }
4928
4929    impl fidl::encoding::ValueTypeMarker for SocketTypeUnknown {
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 SocketTypeUnknown {
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            4
4947        }
4948    }
4949
4950    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketTypeUnknown, D>
4951        for &SocketTypeUnknown
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::<SocketTypeUnknown>(offset);
4961            // Delegate to tuple encoding.
4962            fidl::encoding::Encode::<SocketTypeUnknown, D>::encode(
4963                (<SocketType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
4964                encoder,
4965                offset,
4966                _depth,
4967            )
4968        }
4969    }
4970    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SocketType, D>>
4971        fidl::encoding::Encode<SocketTypeUnknown, D> for (T0,)
4972    {
4973        #[inline]
4974        unsafe fn encode(
4975            self,
4976            encoder: &mut fidl::encoding::Encoder<'_, D>,
4977            offset: usize,
4978            depth: fidl::encoding::Depth,
4979        ) -> fidl::Result<()> {
4980            encoder.debug_check_bounds::<SocketTypeUnknown>(offset);
4981            // Zero out padding regions. There's no need to apply masks
4982            // because the unmasked parts will be overwritten by fields.
4983            // Write the fields.
4984            self.0.encode(encoder, offset + 0, depth)?;
4985            Ok(())
4986        }
4987    }
4988
4989    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketTypeUnknown {
4990        #[inline(always)]
4991        fn new_empty() -> Self {
4992            Self { type_: fidl::new_empty!(SocketType, D) }
4993        }
4994
4995        #[inline]
4996        unsafe fn decode(
4997            &mut self,
4998            decoder: &mut fidl::encoding::Decoder<'_, D>,
4999            offset: usize,
5000            _depth: fidl::encoding::Depth,
5001        ) -> fidl::Result<()> {
5002            decoder.debug_check_bounds::<Self>(offset);
5003            // Verify that padding bytes are zero.
5004            fidl::decode!(SocketType, D, &mut self.type_, decoder, offset + 0, _depth)?;
5005            Ok(())
5006        }
5007    }
5008
5009    impl fidl::encoding::ValueTypeMarker for SocketWriteSocketRequest {
5010        type Borrowed<'a> = &'a Self;
5011        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5012            value
5013        }
5014    }
5015
5016    unsafe impl fidl::encoding::TypeMarker for SocketWriteSocketRequest {
5017        type Owned = Self;
5018
5019        #[inline(always)]
5020        fn inline_align(_context: fidl::encoding::Context) -> usize {
5021            8
5022        }
5023
5024        #[inline(always)]
5025        fn inline_size(_context: fidl::encoding::Context) -> usize {
5026            24
5027        }
5028    }
5029
5030    unsafe impl<D: fidl::encoding::ResourceDialect>
5031        fidl::encoding::Encode<SocketWriteSocketRequest, D> for &SocketWriteSocketRequest
5032    {
5033        #[inline]
5034        unsafe fn encode(
5035            self,
5036            encoder: &mut fidl::encoding::Encoder<'_, D>,
5037            offset: usize,
5038            _depth: fidl::encoding::Depth,
5039        ) -> fidl::Result<()> {
5040            encoder.debug_check_bounds::<SocketWriteSocketRequest>(offset);
5041            // Delegate to tuple encoding.
5042            fidl::encoding::Encode::<SocketWriteSocketRequest, D>::encode(
5043                (
5044                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
5045                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
5046                ),
5047                encoder, offset, _depth
5048            )
5049        }
5050    }
5051    unsafe impl<
5052        D: fidl::encoding::ResourceDialect,
5053        T0: fidl::encoding::Encode<HandleId, D>,
5054        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
5055    > fidl::encoding::Encode<SocketWriteSocketRequest, D> for (T0, T1)
5056    {
5057        #[inline]
5058        unsafe fn encode(
5059            self,
5060            encoder: &mut fidl::encoding::Encoder<'_, D>,
5061            offset: usize,
5062            depth: fidl::encoding::Depth,
5063        ) -> fidl::Result<()> {
5064            encoder.debug_check_bounds::<SocketWriteSocketRequest>(offset);
5065            // Zero out padding regions. There's no need to apply masks
5066            // because the unmasked parts will be overwritten by fields.
5067            unsafe {
5068                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5069                (ptr as *mut u64).write_unaligned(0);
5070            }
5071            // Write the fields.
5072            self.0.encode(encoder, offset + 0, depth)?;
5073            self.1.encode(encoder, offset + 8, depth)?;
5074            Ok(())
5075        }
5076    }
5077
5078    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5079        for SocketWriteSocketRequest
5080    {
5081        #[inline(always)]
5082        fn new_empty() -> Self {
5083            Self {
5084                handle: fidl::new_empty!(HandleId, D),
5085                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
5086            }
5087        }
5088
5089        #[inline]
5090        unsafe fn decode(
5091            &mut self,
5092            decoder: &mut fidl::encoding::Decoder<'_, D>,
5093            offset: usize,
5094            _depth: fidl::encoding::Depth,
5095        ) -> fidl::Result<()> {
5096            decoder.debug_check_bounds::<Self>(offset);
5097            // Verify that padding bytes are zero.
5098            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5099            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5100            let mask = 0xffffffff00000000u64;
5101            let maskedval = padval & mask;
5102            if maskedval != 0 {
5103                return Err(fidl::Error::NonZeroPadding {
5104                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5105                });
5106            }
5107            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
5108            fidl::decode!(
5109                fidl::encoding::UnboundedVector<u8>,
5110                D,
5111                &mut self.data,
5112                decoder,
5113                offset + 8,
5114                _depth
5115            )?;
5116            Ok(())
5117        }
5118    }
5119
5120    impl fidl::encoding::ValueTypeMarker for SocketWriteSocketResponse {
5121        type Borrowed<'a> = &'a Self;
5122        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5123            value
5124        }
5125    }
5126
5127    unsafe impl fidl::encoding::TypeMarker for SocketWriteSocketResponse {
5128        type Owned = Self;
5129
5130        #[inline(always)]
5131        fn inline_align(_context: fidl::encoding::Context) -> usize {
5132            8
5133        }
5134
5135        #[inline(always)]
5136        fn inline_size(_context: fidl::encoding::Context) -> usize {
5137            8
5138        }
5139        #[inline(always)]
5140        fn encode_is_copy() -> bool {
5141            true
5142        }
5143
5144        #[inline(always)]
5145        fn decode_is_copy() -> bool {
5146            true
5147        }
5148    }
5149
5150    unsafe impl<D: fidl::encoding::ResourceDialect>
5151        fidl::encoding::Encode<SocketWriteSocketResponse, D> for &SocketWriteSocketResponse
5152    {
5153        #[inline]
5154        unsafe fn encode(
5155            self,
5156            encoder: &mut fidl::encoding::Encoder<'_, D>,
5157            offset: usize,
5158            _depth: fidl::encoding::Depth,
5159        ) -> fidl::Result<()> {
5160            encoder.debug_check_bounds::<SocketWriteSocketResponse>(offset);
5161            unsafe {
5162                // Copy the object into the buffer.
5163                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5164                (buf_ptr as *mut SocketWriteSocketResponse)
5165                    .write_unaligned((self as *const SocketWriteSocketResponse).read());
5166                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5167                // done second because the memcpy will write garbage to these bytes.
5168            }
5169            Ok(())
5170        }
5171    }
5172    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
5173        fidl::encoding::Encode<SocketWriteSocketResponse, D> for (T0,)
5174    {
5175        #[inline]
5176        unsafe fn encode(
5177            self,
5178            encoder: &mut fidl::encoding::Encoder<'_, D>,
5179            offset: usize,
5180            depth: fidl::encoding::Depth,
5181        ) -> fidl::Result<()> {
5182            encoder.debug_check_bounds::<SocketWriteSocketResponse>(offset);
5183            // Zero out padding regions. There's no need to apply masks
5184            // because the unmasked parts will be overwritten by fields.
5185            // Write the fields.
5186            self.0.encode(encoder, offset + 0, depth)?;
5187            Ok(())
5188        }
5189    }
5190
5191    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5192        for SocketWriteSocketResponse
5193    {
5194        #[inline(always)]
5195        fn new_empty() -> Self {
5196            Self { wrote: fidl::new_empty!(u64, D) }
5197        }
5198
5199        #[inline]
5200        unsafe fn decode(
5201            &mut self,
5202            decoder: &mut fidl::encoding::Decoder<'_, D>,
5203            offset: usize,
5204            _depth: fidl::encoding::Depth,
5205        ) -> fidl::Result<()> {
5206            decoder.debug_check_bounds::<Self>(offset);
5207            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5208            // Verify that padding bytes are zero.
5209            // Copy from the buffer into the object.
5210            unsafe {
5211                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
5212            }
5213            Ok(())
5214        }
5215    }
5216
5217    impl fidl::encoding::ValueTypeMarker for StreamingReadInProgress {
5218        type Borrowed<'a> = &'a Self;
5219        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5220            value
5221        }
5222    }
5223
5224    unsafe impl fidl::encoding::TypeMarker for StreamingReadInProgress {
5225        type Owned = Self;
5226
5227        #[inline(always)]
5228        fn inline_align(_context: fidl::encoding::Context) -> usize {
5229            1
5230        }
5231
5232        #[inline(always)]
5233        fn inline_size(_context: fidl::encoding::Context) -> usize {
5234            1
5235        }
5236    }
5237
5238    unsafe impl<D: fidl::encoding::ResourceDialect>
5239        fidl::encoding::Encode<StreamingReadInProgress, D> for &StreamingReadInProgress
5240    {
5241        #[inline]
5242        unsafe fn encode(
5243            self,
5244            encoder: &mut fidl::encoding::Encoder<'_, D>,
5245            offset: usize,
5246            _depth: fidl::encoding::Depth,
5247        ) -> fidl::Result<()> {
5248            encoder.debug_check_bounds::<StreamingReadInProgress>(offset);
5249            encoder.write_num(0u8, offset);
5250            Ok(())
5251        }
5252    }
5253
5254    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5255        for StreamingReadInProgress
5256    {
5257        #[inline(always)]
5258        fn new_empty() -> Self {
5259            Self
5260        }
5261
5262        #[inline]
5263        unsafe fn decode(
5264            &mut self,
5265            decoder: &mut fidl::encoding::Decoder<'_, D>,
5266            offset: usize,
5267            _depth: fidl::encoding::Depth,
5268        ) -> fidl::Result<()> {
5269            decoder.debug_check_bounds::<Self>(offset);
5270            match decoder.read_num::<u8>(offset) {
5271                0 => Ok(()),
5272                _ => Err(fidl::Error::Invalid),
5273            }
5274        }
5275    }
5276
5277    impl fidl::encoding::ValueTypeMarker for VmoCreateVmoRequest {
5278        type Borrowed<'a> = &'a Self;
5279        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5280            value
5281        }
5282    }
5283
5284    unsafe impl fidl::encoding::TypeMarker for VmoCreateVmoRequest {
5285        type Owned = Self;
5286
5287        #[inline(always)]
5288        fn inline_align(_context: fidl::encoding::Context) -> usize {
5289            8
5290        }
5291
5292        #[inline(always)]
5293        fn inline_size(_context: fidl::encoding::Context) -> usize {
5294            16
5295        }
5296    }
5297
5298    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoCreateVmoRequest, D>
5299        for &VmoCreateVmoRequest
5300    {
5301        #[inline]
5302        unsafe fn encode(
5303            self,
5304            encoder: &mut fidl::encoding::Encoder<'_, D>,
5305            offset: usize,
5306            _depth: fidl::encoding::Depth,
5307        ) -> fidl::Result<()> {
5308            encoder.debug_check_bounds::<VmoCreateVmoRequest>(offset);
5309            // Delegate to tuple encoding.
5310            fidl::encoding::Encode::<VmoCreateVmoRequest, D>::encode(
5311                (
5312                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.size),
5313                    <VmoOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
5314                    <NewHandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
5315                ),
5316                encoder,
5317                offset,
5318                _depth,
5319            )
5320        }
5321    }
5322    unsafe impl<
5323        D: fidl::encoding::ResourceDialect,
5324        T0: fidl::encoding::Encode<u64, D>,
5325        T1: fidl::encoding::Encode<VmoOptions, D>,
5326        T2: fidl::encoding::Encode<NewHandleId, D>,
5327    > fidl::encoding::Encode<VmoCreateVmoRequest, D> for (T0, T1, T2)
5328    {
5329        #[inline]
5330        unsafe fn encode(
5331            self,
5332            encoder: &mut fidl::encoding::Encoder<'_, D>,
5333            offset: usize,
5334            depth: fidl::encoding::Depth,
5335        ) -> fidl::Result<()> {
5336            encoder.debug_check_bounds::<VmoCreateVmoRequest>(offset);
5337            // Zero out padding regions. There's no need to apply masks
5338            // because the unmasked parts will be overwritten by fields.
5339            // Write the fields.
5340            self.0.encode(encoder, offset + 0, depth)?;
5341            self.1.encode(encoder, offset + 8, depth)?;
5342            self.2.encode(encoder, offset + 12, depth)?;
5343            Ok(())
5344        }
5345    }
5346
5347    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoCreateVmoRequest {
5348        #[inline(always)]
5349        fn new_empty() -> Self {
5350            Self {
5351                size: fidl::new_empty!(u64, D),
5352                options: fidl::new_empty!(VmoOptions, D),
5353                handle: fidl::new_empty!(NewHandleId, D),
5354            }
5355        }
5356
5357        #[inline]
5358        unsafe fn decode(
5359            &mut self,
5360            decoder: &mut fidl::encoding::Decoder<'_, D>,
5361            offset: usize,
5362            _depth: fidl::encoding::Depth,
5363        ) -> fidl::Result<()> {
5364            decoder.debug_check_bounds::<Self>(offset);
5365            // Verify that padding bytes are zero.
5366            fidl::decode!(u64, D, &mut self.size, decoder, offset + 0, _depth)?;
5367            fidl::decode!(VmoOptions, D, &mut self.options, decoder, offset + 8, _depth)?;
5368            fidl::decode!(NewHandleId, D, &mut self.handle, decoder, offset + 12, _depth)?;
5369            Ok(())
5370        }
5371    }
5372
5373    impl fidl::encoding::ValueTypeMarker for VmoGetVmoSizeRequest {
5374        type Borrowed<'a> = &'a Self;
5375        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5376            value
5377        }
5378    }
5379
5380    unsafe impl fidl::encoding::TypeMarker for VmoGetVmoSizeRequest {
5381        type Owned = Self;
5382
5383        #[inline(always)]
5384        fn inline_align(_context: fidl::encoding::Context) -> usize {
5385            4
5386        }
5387
5388        #[inline(always)]
5389        fn inline_size(_context: fidl::encoding::Context) -> usize {
5390            4
5391        }
5392        #[inline(always)]
5393        fn encode_is_copy() -> bool {
5394            true
5395        }
5396
5397        #[inline(always)]
5398        fn decode_is_copy() -> bool {
5399            true
5400        }
5401    }
5402
5403    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoGetVmoSizeRequest, D>
5404        for &VmoGetVmoSizeRequest
5405    {
5406        #[inline]
5407        unsafe fn encode(
5408            self,
5409            encoder: &mut fidl::encoding::Encoder<'_, D>,
5410            offset: usize,
5411            _depth: fidl::encoding::Depth,
5412        ) -> fidl::Result<()> {
5413            encoder.debug_check_bounds::<VmoGetVmoSizeRequest>(offset);
5414            unsafe {
5415                // Copy the object into the buffer.
5416                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5417                (buf_ptr as *mut VmoGetVmoSizeRequest)
5418                    .write_unaligned((self as *const VmoGetVmoSizeRequest).read());
5419                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5420                // done second because the memcpy will write garbage to these bytes.
5421            }
5422            Ok(())
5423        }
5424    }
5425    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
5426        fidl::encoding::Encode<VmoGetVmoSizeRequest, D> for (T0,)
5427    {
5428        #[inline]
5429        unsafe fn encode(
5430            self,
5431            encoder: &mut fidl::encoding::Encoder<'_, D>,
5432            offset: usize,
5433            depth: fidl::encoding::Depth,
5434        ) -> fidl::Result<()> {
5435            encoder.debug_check_bounds::<VmoGetVmoSizeRequest>(offset);
5436            // Zero out padding regions. There's no need to apply masks
5437            // because the unmasked parts will be overwritten by fields.
5438            // Write the fields.
5439            self.0.encode(encoder, offset + 0, depth)?;
5440            Ok(())
5441        }
5442    }
5443
5444    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoGetVmoSizeRequest {
5445        #[inline(always)]
5446        fn new_empty() -> Self {
5447            Self { handle: fidl::new_empty!(HandleId, D) }
5448        }
5449
5450        #[inline]
5451        unsafe fn decode(
5452            &mut self,
5453            decoder: &mut fidl::encoding::Decoder<'_, D>,
5454            offset: usize,
5455            _depth: fidl::encoding::Depth,
5456        ) -> fidl::Result<()> {
5457            decoder.debug_check_bounds::<Self>(offset);
5458            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5459            // Verify that padding bytes are zero.
5460            // Copy from the buffer into the object.
5461            unsafe {
5462                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5463            }
5464            Ok(())
5465        }
5466    }
5467
5468    impl fidl::encoding::ValueTypeMarker for VmoGetVmoStreamSizeRequest {
5469        type Borrowed<'a> = &'a Self;
5470        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5471            value
5472        }
5473    }
5474
5475    unsafe impl fidl::encoding::TypeMarker for VmoGetVmoStreamSizeRequest {
5476        type Owned = Self;
5477
5478        #[inline(always)]
5479        fn inline_align(_context: fidl::encoding::Context) -> usize {
5480            4
5481        }
5482
5483        #[inline(always)]
5484        fn inline_size(_context: fidl::encoding::Context) -> usize {
5485            4
5486        }
5487        #[inline(always)]
5488        fn encode_is_copy() -> bool {
5489            true
5490        }
5491
5492        #[inline(always)]
5493        fn decode_is_copy() -> bool {
5494            true
5495        }
5496    }
5497
5498    unsafe impl<D: fidl::encoding::ResourceDialect>
5499        fidl::encoding::Encode<VmoGetVmoStreamSizeRequest, D> for &VmoGetVmoStreamSizeRequest
5500    {
5501        #[inline]
5502        unsafe fn encode(
5503            self,
5504            encoder: &mut fidl::encoding::Encoder<'_, D>,
5505            offset: usize,
5506            _depth: fidl::encoding::Depth,
5507        ) -> fidl::Result<()> {
5508            encoder.debug_check_bounds::<VmoGetVmoStreamSizeRequest>(offset);
5509            unsafe {
5510                // Copy the object into the buffer.
5511                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5512                (buf_ptr as *mut VmoGetVmoStreamSizeRequest)
5513                    .write_unaligned((self as *const VmoGetVmoStreamSizeRequest).read());
5514                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5515                // done second because the memcpy will write garbage to these bytes.
5516            }
5517            Ok(())
5518        }
5519    }
5520    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
5521        fidl::encoding::Encode<VmoGetVmoStreamSizeRequest, D> for (T0,)
5522    {
5523        #[inline]
5524        unsafe fn encode(
5525            self,
5526            encoder: &mut fidl::encoding::Encoder<'_, D>,
5527            offset: usize,
5528            depth: fidl::encoding::Depth,
5529        ) -> fidl::Result<()> {
5530            encoder.debug_check_bounds::<VmoGetVmoStreamSizeRequest>(offset);
5531            // Zero out padding regions. There's no need to apply masks
5532            // because the unmasked parts will be overwritten by fields.
5533            // Write the fields.
5534            self.0.encode(encoder, offset + 0, depth)?;
5535            Ok(())
5536        }
5537    }
5538
5539    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5540        for VmoGetVmoStreamSizeRequest
5541    {
5542        #[inline(always)]
5543        fn new_empty() -> Self {
5544            Self { handle: fidl::new_empty!(HandleId, D) }
5545        }
5546
5547        #[inline]
5548        unsafe fn decode(
5549            &mut self,
5550            decoder: &mut fidl::encoding::Decoder<'_, D>,
5551            offset: usize,
5552            _depth: fidl::encoding::Depth,
5553        ) -> fidl::Result<()> {
5554            decoder.debug_check_bounds::<Self>(offset);
5555            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5556            // Verify that padding bytes are zero.
5557            // Copy from the buffer into the object.
5558            unsafe {
5559                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5560            }
5561            Ok(())
5562        }
5563    }
5564
5565    impl fidl::encoding::ValueTypeMarker for VmoReadVmoRequest {
5566        type Borrowed<'a> = &'a Self;
5567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5568            value
5569        }
5570    }
5571
5572    unsafe impl fidl::encoding::TypeMarker for VmoReadVmoRequest {
5573        type Owned = Self;
5574
5575        #[inline(always)]
5576        fn inline_align(_context: fidl::encoding::Context) -> usize {
5577            8
5578        }
5579
5580        #[inline(always)]
5581        fn inline_size(_context: fidl::encoding::Context) -> usize {
5582            24
5583        }
5584    }
5585
5586    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoReadVmoRequest, D>
5587        for &VmoReadVmoRequest
5588    {
5589        #[inline]
5590        unsafe fn encode(
5591            self,
5592            encoder: &mut fidl::encoding::Encoder<'_, D>,
5593            offset: usize,
5594            _depth: fidl::encoding::Depth,
5595        ) -> fidl::Result<()> {
5596            encoder.debug_check_bounds::<VmoReadVmoRequest>(offset);
5597            unsafe {
5598                // Copy the object into the buffer.
5599                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5600                (buf_ptr as *mut VmoReadVmoRequest)
5601                    .write_unaligned((self as *const VmoReadVmoRequest).read());
5602                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5603                // done second because the memcpy will write garbage to these bytes.
5604                let padding_ptr = buf_ptr.offset(0) as *mut u64;
5605                let padding_mask = 0xffffffff00000000u64;
5606                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5607            }
5608            Ok(())
5609        }
5610    }
5611    unsafe impl<
5612        D: fidl::encoding::ResourceDialect,
5613        T0: fidl::encoding::Encode<HandleId, D>,
5614        T1: fidl::encoding::Encode<u64, D>,
5615        T2: fidl::encoding::Encode<u64, D>,
5616    > fidl::encoding::Encode<VmoReadVmoRequest, D> for (T0, T1, T2)
5617    {
5618        #[inline]
5619        unsafe fn encode(
5620            self,
5621            encoder: &mut fidl::encoding::Encoder<'_, D>,
5622            offset: usize,
5623            depth: fidl::encoding::Depth,
5624        ) -> fidl::Result<()> {
5625            encoder.debug_check_bounds::<VmoReadVmoRequest>(offset);
5626            // Zero out padding regions. There's no need to apply masks
5627            // because the unmasked parts will be overwritten by fields.
5628            unsafe {
5629                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5630                (ptr as *mut u64).write_unaligned(0);
5631            }
5632            // Write the fields.
5633            self.0.encode(encoder, offset + 0, depth)?;
5634            self.1.encode(encoder, offset + 8, depth)?;
5635            self.2.encode(encoder, offset + 16, depth)?;
5636            Ok(())
5637        }
5638    }
5639
5640    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoReadVmoRequest {
5641        #[inline(always)]
5642        fn new_empty() -> Self {
5643            Self {
5644                handle: fidl::new_empty!(HandleId, D),
5645                offset: fidl::new_empty!(u64, D),
5646                size: fidl::new_empty!(u64, D),
5647            }
5648        }
5649
5650        #[inline]
5651        unsafe fn decode(
5652            &mut self,
5653            decoder: &mut fidl::encoding::Decoder<'_, D>,
5654            offset: usize,
5655            _depth: fidl::encoding::Depth,
5656        ) -> fidl::Result<()> {
5657            decoder.debug_check_bounds::<Self>(offset);
5658            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5659            // Verify that padding bytes are zero.
5660            let ptr = unsafe { buf_ptr.offset(0) };
5661            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5662            let mask = 0xffffffff00000000u64;
5663            let maskedval = padval & mask;
5664            if maskedval != 0 {
5665                return Err(fidl::Error::NonZeroPadding {
5666                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5667                });
5668            }
5669            // Copy from the buffer into the object.
5670            unsafe {
5671                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
5672            }
5673            Ok(())
5674        }
5675    }
5676
5677    impl fidl::encoding::ValueTypeMarker for VmoSetVmoSizeRequest {
5678        type Borrowed<'a> = &'a Self;
5679        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5680            value
5681        }
5682    }
5683
5684    unsafe impl fidl::encoding::TypeMarker for VmoSetVmoSizeRequest {
5685        type Owned = Self;
5686
5687        #[inline(always)]
5688        fn inline_align(_context: fidl::encoding::Context) -> usize {
5689            8
5690        }
5691
5692        #[inline(always)]
5693        fn inline_size(_context: fidl::encoding::Context) -> usize {
5694            16
5695        }
5696    }
5697
5698    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoSetVmoSizeRequest, D>
5699        for &VmoSetVmoSizeRequest
5700    {
5701        #[inline]
5702        unsafe fn encode(
5703            self,
5704            encoder: &mut fidl::encoding::Encoder<'_, D>,
5705            offset: usize,
5706            _depth: fidl::encoding::Depth,
5707        ) -> fidl::Result<()> {
5708            encoder.debug_check_bounds::<VmoSetVmoSizeRequest>(offset);
5709            unsafe {
5710                // Copy the object into the buffer.
5711                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5712                (buf_ptr as *mut VmoSetVmoSizeRequest)
5713                    .write_unaligned((self as *const VmoSetVmoSizeRequest).read());
5714                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5715                // done second because the memcpy will write garbage to these bytes.
5716                let padding_ptr = buf_ptr.offset(0) as *mut u64;
5717                let padding_mask = 0xffffffff00000000u64;
5718                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5719            }
5720            Ok(())
5721        }
5722    }
5723    unsafe impl<
5724        D: fidl::encoding::ResourceDialect,
5725        T0: fidl::encoding::Encode<HandleId, D>,
5726        T1: fidl::encoding::Encode<u64, D>,
5727    > fidl::encoding::Encode<VmoSetVmoSizeRequest, D> for (T0, T1)
5728    {
5729        #[inline]
5730        unsafe fn encode(
5731            self,
5732            encoder: &mut fidl::encoding::Encoder<'_, D>,
5733            offset: usize,
5734            depth: fidl::encoding::Depth,
5735        ) -> fidl::Result<()> {
5736            encoder.debug_check_bounds::<VmoSetVmoSizeRequest>(offset);
5737            // Zero out padding regions. There's no need to apply masks
5738            // because the unmasked parts will be overwritten by fields.
5739            unsafe {
5740                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5741                (ptr as *mut u64).write_unaligned(0);
5742            }
5743            // Write the fields.
5744            self.0.encode(encoder, offset + 0, depth)?;
5745            self.1.encode(encoder, offset + 8, depth)?;
5746            Ok(())
5747        }
5748    }
5749
5750    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoSetVmoSizeRequest {
5751        #[inline(always)]
5752        fn new_empty() -> Self {
5753            Self { handle: fidl::new_empty!(HandleId, D), size: fidl::new_empty!(u64, D) }
5754        }
5755
5756        #[inline]
5757        unsafe fn decode(
5758            &mut self,
5759            decoder: &mut fidl::encoding::Decoder<'_, D>,
5760            offset: usize,
5761            _depth: fidl::encoding::Depth,
5762        ) -> fidl::Result<()> {
5763            decoder.debug_check_bounds::<Self>(offset);
5764            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5765            // Verify that padding bytes are zero.
5766            let ptr = unsafe { buf_ptr.offset(0) };
5767            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5768            let mask = 0xffffffff00000000u64;
5769            let maskedval = padval & mask;
5770            if maskedval != 0 {
5771                return Err(fidl::Error::NonZeroPadding {
5772                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5773                });
5774            }
5775            // Copy from the buffer into the object.
5776            unsafe {
5777                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5778            }
5779            Ok(())
5780        }
5781    }
5782
5783    impl fidl::encoding::ValueTypeMarker for VmoSetVmoStreamSizeRequest {
5784        type Borrowed<'a> = &'a Self;
5785        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5786            value
5787        }
5788    }
5789
5790    unsafe impl fidl::encoding::TypeMarker for VmoSetVmoStreamSizeRequest {
5791        type Owned = Self;
5792
5793        #[inline(always)]
5794        fn inline_align(_context: fidl::encoding::Context) -> usize {
5795            8
5796        }
5797
5798        #[inline(always)]
5799        fn inline_size(_context: fidl::encoding::Context) -> usize {
5800            16
5801        }
5802    }
5803
5804    unsafe impl<D: fidl::encoding::ResourceDialect>
5805        fidl::encoding::Encode<VmoSetVmoStreamSizeRequest, D> for &VmoSetVmoStreamSizeRequest
5806    {
5807        #[inline]
5808        unsafe fn encode(
5809            self,
5810            encoder: &mut fidl::encoding::Encoder<'_, D>,
5811            offset: usize,
5812            _depth: fidl::encoding::Depth,
5813        ) -> fidl::Result<()> {
5814            encoder.debug_check_bounds::<VmoSetVmoStreamSizeRequest>(offset);
5815            unsafe {
5816                // Copy the object into the buffer.
5817                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5818                (buf_ptr as *mut VmoSetVmoStreamSizeRequest)
5819                    .write_unaligned((self as *const VmoSetVmoStreamSizeRequest).read());
5820                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5821                // done second because the memcpy will write garbage to these bytes.
5822                let padding_ptr = buf_ptr.offset(0) as *mut u64;
5823                let padding_mask = 0xffffffff00000000u64;
5824                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5825            }
5826            Ok(())
5827        }
5828    }
5829    unsafe impl<
5830        D: fidl::encoding::ResourceDialect,
5831        T0: fidl::encoding::Encode<HandleId, D>,
5832        T1: fidl::encoding::Encode<u64, D>,
5833    > fidl::encoding::Encode<VmoSetVmoStreamSizeRequest, D> for (T0, T1)
5834    {
5835        #[inline]
5836        unsafe fn encode(
5837            self,
5838            encoder: &mut fidl::encoding::Encoder<'_, D>,
5839            offset: usize,
5840            depth: fidl::encoding::Depth,
5841        ) -> fidl::Result<()> {
5842            encoder.debug_check_bounds::<VmoSetVmoStreamSizeRequest>(offset);
5843            // Zero out padding regions. There's no need to apply masks
5844            // because the unmasked parts will be overwritten by fields.
5845            unsafe {
5846                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5847                (ptr as *mut u64).write_unaligned(0);
5848            }
5849            // Write the fields.
5850            self.0.encode(encoder, offset + 0, depth)?;
5851            self.1.encode(encoder, offset + 8, depth)?;
5852            Ok(())
5853        }
5854    }
5855
5856    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5857        for VmoSetVmoStreamSizeRequest
5858    {
5859        #[inline(always)]
5860        fn new_empty() -> Self {
5861            Self { handle: fidl::new_empty!(HandleId, D), size: fidl::new_empty!(u64, D) }
5862        }
5863
5864        #[inline]
5865        unsafe fn decode(
5866            &mut self,
5867            decoder: &mut fidl::encoding::Decoder<'_, D>,
5868            offset: usize,
5869            _depth: fidl::encoding::Depth,
5870        ) -> fidl::Result<()> {
5871            decoder.debug_check_bounds::<Self>(offset);
5872            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5873            // Verify that padding bytes are zero.
5874            let ptr = unsafe { buf_ptr.offset(0) };
5875            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5876            let mask = 0xffffffff00000000u64;
5877            let maskedval = padval & mask;
5878            if maskedval != 0 {
5879                return Err(fidl::Error::NonZeroPadding {
5880                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5881                });
5882            }
5883            // Copy from the buffer into the object.
5884            unsafe {
5885                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5886            }
5887            Ok(())
5888        }
5889    }
5890
5891    impl fidl::encoding::ValueTypeMarker for VmoWriteVmoRequest {
5892        type Borrowed<'a> = &'a Self;
5893        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5894            value
5895        }
5896    }
5897
5898    unsafe impl fidl::encoding::TypeMarker for VmoWriteVmoRequest {
5899        type Owned = Self;
5900
5901        #[inline(always)]
5902        fn inline_align(_context: fidl::encoding::Context) -> usize {
5903            8
5904        }
5905
5906        #[inline(always)]
5907        fn inline_size(_context: fidl::encoding::Context) -> usize {
5908            32
5909        }
5910    }
5911
5912    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoWriteVmoRequest, D>
5913        for &VmoWriteVmoRequest
5914    {
5915        #[inline]
5916        unsafe fn encode(
5917            self,
5918            encoder: &mut fidl::encoding::Encoder<'_, D>,
5919            offset: usize,
5920            _depth: fidl::encoding::Depth,
5921        ) -> fidl::Result<()> {
5922            encoder.debug_check_bounds::<VmoWriteVmoRequest>(offset);
5923            // Delegate to tuple encoding.
5924            fidl::encoding::Encode::<VmoWriteVmoRequest, D>::encode(
5925                (
5926                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
5927                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
5928                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
5929                ),
5930                encoder, offset, _depth
5931            )
5932        }
5933    }
5934    unsafe impl<
5935        D: fidl::encoding::ResourceDialect,
5936        T0: fidl::encoding::Encode<HandleId, D>,
5937        T1: fidl::encoding::Encode<u64, D>,
5938        T2: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
5939    > fidl::encoding::Encode<VmoWriteVmoRequest, D> for (T0, T1, T2)
5940    {
5941        #[inline]
5942        unsafe fn encode(
5943            self,
5944            encoder: &mut fidl::encoding::Encoder<'_, D>,
5945            offset: usize,
5946            depth: fidl::encoding::Depth,
5947        ) -> fidl::Result<()> {
5948            encoder.debug_check_bounds::<VmoWriteVmoRequest>(offset);
5949            // Zero out padding regions. There's no need to apply masks
5950            // because the unmasked parts will be overwritten by fields.
5951            unsafe {
5952                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5953                (ptr as *mut u64).write_unaligned(0);
5954            }
5955            // Write the fields.
5956            self.0.encode(encoder, offset + 0, depth)?;
5957            self.1.encode(encoder, offset + 8, depth)?;
5958            self.2.encode(encoder, offset + 16, depth)?;
5959            Ok(())
5960        }
5961    }
5962
5963    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoWriteVmoRequest {
5964        #[inline(always)]
5965        fn new_empty() -> Self {
5966            Self {
5967                handle: fidl::new_empty!(HandleId, D),
5968                offset: fidl::new_empty!(u64, D),
5969                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
5970            }
5971        }
5972
5973        #[inline]
5974        unsafe fn decode(
5975            &mut self,
5976            decoder: &mut fidl::encoding::Decoder<'_, D>,
5977            offset: usize,
5978            _depth: fidl::encoding::Depth,
5979        ) -> fidl::Result<()> {
5980            decoder.debug_check_bounds::<Self>(offset);
5981            // Verify that padding bytes are zero.
5982            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5983            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5984            let mask = 0xffffffff00000000u64;
5985            let maskedval = padval & mask;
5986            if maskedval != 0 {
5987                return Err(fidl::Error::NonZeroPadding {
5988                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5989                });
5990            }
5991            fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
5992            fidl::decode!(u64, D, &mut self.offset, decoder, offset + 8, _depth)?;
5993            fidl::decode!(
5994                fidl::encoding::UnboundedVector<u8>,
5995                D,
5996                &mut self.data,
5997                decoder,
5998                offset + 16,
5999                _depth
6000            )?;
6001            Ok(())
6002        }
6003    }
6004
6005    impl fidl::encoding::ValueTypeMarker for VmoGetVmoSizeResponse {
6006        type Borrowed<'a> = &'a Self;
6007        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6008            value
6009        }
6010    }
6011
6012    unsafe impl fidl::encoding::TypeMarker for VmoGetVmoSizeResponse {
6013        type Owned = Self;
6014
6015        #[inline(always)]
6016        fn inline_align(_context: fidl::encoding::Context) -> usize {
6017            8
6018        }
6019
6020        #[inline(always)]
6021        fn inline_size(_context: fidl::encoding::Context) -> usize {
6022            8
6023        }
6024        #[inline(always)]
6025        fn encode_is_copy() -> bool {
6026            true
6027        }
6028
6029        #[inline(always)]
6030        fn decode_is_copy() -> bool {
6031            true
6032        }
6033    }
6034
6035    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoGetVmoSizeResponse, D>
6036        for &VmoGetVmoSizeResponse
6037    {
6038        #[inline]
6039        unsafe fn encode(
6040            self,
6041            encoder: &mut fidl::encoding::Encoder<'_, D>,
6042            offset: usize,
6043            _depth: fidl::encoding::Depth,
6044        ) -> fidl::Result<()> {
6045            encoder.debug_check_bounds::<VmoGetVmoSizeResponse>(offset);
6046            unsafe {
6047                // Copy the object into the buffer.
6048                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6049                (buf_ptr as *mut VmoGetVmoSizeResponse)
6050                    .write_unaligned((self as *const VmoGetVmoSizeResponse).read());
6051                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6052                // done second because the memcpy will write garbage to these bytes.
6053            }
6054            Ok(())
6055        }
6056    }
6057    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6058        fidl::encoding::Encode<VmoGetVmoSizeResponse, D> for (T0,)
6059    {
6060        #[inline]
6061        unsafe fn encode(
6062            self,
6063            encoder: &mut fidl::encoding::Encoder<'_, D>,
6064            offset: usize,
6065            depth: fidl::encoding::Depth,
6066        ) -> fidl::Result<()> {
6067            encoder.debug_check_bounds::<VmoGetVmoSizeResponse>(offset);
6068            // Zero out padding regions. There's no need to apply masks
6069            // because the unmasked parts will be overwritten by fields.
6070            // Write the fields.
6071            self.0.encode(encoder, offset + 0, depth)?;
6072            Ok(())
6073        }
6074    }
6075
6076    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoGetVmoSizeResponse {
6077        #[inline(always)]
6078        fn new_empty() -> Self {
6079            Self { size: fidl::new_empty!(u64, D) }
6080        }
6081
6082        #[inline]
6083        unsafe fn decode(
6084            &mut self,
6085            decoder: &mut fidl::encoding::Decoder<'_, D>,
6086            offset: usize,
6087            _depth: fidl::encoding::Depth,
6088        ) -> fidl::Result<()> {
6089            decoder.debug_check_bounds::<Self>(offset);
6090            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6091            // Verify that padding bytes are zero.
6092            // Copy from the buffer into the object.
6093            unsafe {
6094                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6095            }
6096            Ok(())
6097        }
6098    }
6099
6100    impl fidl::encoding::ValueTypeMarker for VmoGetVmoStreamSizeResponse {
6101        type Borrowed<'a> = &'a Self;
6102        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6103            value
6104        }
6105    }
6106
6107    unsafe impl fidl::encoding::TypeMarker for VmoGetVmoStreamSizeResponse {
6108        type Owned = Self;
6109
6110        #[inline(always)]
6111        fn inline_align(_context: fidl::encoding::Context) -> usize {
6112            8
6113        }
6114
6115        #[inline(always)]
6116        fn inline_size(_context: fidl::encoding::Context) -> usize {
6117            8
6118        }
6119        #[inline(always)]
6120        fn encode_is_copy() -> bool {
6121            true
6122        }
6123
6124        #[inline(always)]
6125        fn decode_is_copy() -> bool {
6126            true
6127        }
6128    }
6129
6130    unsafe impl<D: fidl::encoding::ResourceDialect>
6131        fidl::encoding::Encode<VmoGetVmoStreamSizeResponse, D> for &VmoGetVmoStreamSizeResponse
6132    {
6133        #[inline]
6134        unsafe fn encode(
6135            self,
6136            encoder: &mut fidl::encoding::Encoder<'_, D>,
6137            offset: usize,
6138            _depth: fidl::encoding::Depth,
6139        ) -> fidl::Result<()> {
6140            encoder.debug_check_bounds::<VmoGetVmoStreamSizeResponse>(offset);
6141            unsafe {
6142                // Copy the object into the buffer.
6143                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6144                (buf_ptr as *mut VmoGetVmoStreamSizeResponse)
6145                    .write_unaligned((self as *const VmoGetVmoStreamSizeResponse).read());
6146                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6147                // done second because the memcpy will write garbage to these bytes.
6148            }
6149            Ok(())
6150        }
6151    }
6152    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6153        fidl::encoding::Encode<VmoGetVmoStreamSizeResponse, D> for (T0,)
6154    {
6155        #[inline]
6156        unsafe fn encode(
6157            self,
6158            encoder: &mut fidl::encoding::Encoder<'_, D>,
6159            offset: usize,
6160            depth: fidl::encoding::Depth,
6161        ) -> fidl::Result<()> {
6162            encoder.debug_check_bounds::<VmoGetVmoStreamSizeResponse>(offset);
6163            // Zero out padding regions. There's no need to apply masks
6164            // because the unmasked parts will be overwritten by fields.
6165            // Write the fields.
6166            self.0.encode(encoder, offset + 0, depth)?;
6167            Ok(())
6168        }
6169    }
6170
6171    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6172        for VmoGetVmoStreamSizeResponse
6173    {
6174        #[inline(always)]
6175        fn new_empty() -> Self {
6176            Self { size: fidl::new_empty!(u64, D) }
6177        }
6178
6179        #[inline]
6180        unsafe fn decode(
6181            &mut self,
6182            decoder: &mut fidl::encoding::Decoder<'_, D>,
6183            offset: usize,
6184            _depth: fidl::encoding::Depth,
6185        ) -> fidl::Result<()> {
6186            decoder.debug_check_bounds::<Self>(offset);
6187            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6188            // Verify that padding bytes are zero.
6189            // Copy from the buffer into the object.
6190            unsafe {
6191                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6192            }
6193            Ok(())
6194        }
6195    }
6196
6197    impl fidl::encoding::ValueTypeMarker for VmoReadVmoResponse {
6198        type Borrowed<'a> = &'a Self;
6199        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6200            value
6201        }
6202    }
6203
6204    unsafe impl fidl::encoding::TypeMarker for VmoReadVmoResponse {
6205        type Owned = Self;
6206
6207        #[inline(always)]
6208        fn inline_align(_context: fidl::encoding::Context) -> usize {
6209            8
6210        }
6211
6212        #[inline(always)]
6213        fn inline_size(_context: fidl::encoding::Context) -> usize {
6214            16
6215        }
6216    }
6217
6218    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VmoReadVmoResponse, D>
6219        for &VmoReadVmoResponse
6220    {
6221        #[inline]
6222        unsafe fn encode(
6223            self,
6224            encoder: &mut fidl::encoding::Encoder<'_, D>,
6225            offset: usize,
6226            _depth: fidl::encoding::Depth,
6227        ) -> fidl::Result<()> {
6228            encoder.debug_check_bounds::<VmoReadVmoResponse>(offset);
6229            // Delegate to tuple encoding.
6230            fidl::encoding::Encode::<VmoReadVmoResponse, D>::encode(
6231                (<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
6232                    &self.data,
6233                ),),
6234                encoder,
6235                offset,
6236                _depth,
6237            )
6238        }
6239    }
6240    unsafe impl<
6241        D: fidl::encoding::ResourceDialect,
6242        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
6243    > fidl::encoding::Encode<VmoReadVmoResponse, D> for (T0,)
6244    {
6245        #[inline]
6246        unsafe fn encode(
6247            self,
6248            encoder: &mut fidl::encoding::Encoder<'_, D>,
6249            offset: usize,
6250            depth: fidl::encoding::Depth,
6251        ) -> fidl::Result<()> {
6252            encoder.debug_check_bounds::<VmoReadVmoResponse>(offset);
6253            // Zero out padding regions. There's no need to apply masks
6254            // because the unmasked parts will be overwritten by fields.
6255            // Write the fields.
6256            self.0.encode(encoder, offset + 0, depth)?;
6257            Ok(())
6258        }
6259    }
6260
6261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoReadVmoResponse {
6262        #[inline(always)]
6263        fn new_empty() -> Self {
6264            Self { data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D) }
6265        }
6266
6267        #[inline]
6268        unsafe fn decode(
6269            &mut self,
6270            decoder: &mut fidl::encoding::Decoder<'_, D>,
6271            offset: usize,
6272            _depth: fidl::encoding::Depth,
6273        ) -> fidl::Result<()> {
6274            decoder.debug_check_bounds::<Self>(offset);
6275            // Verify that padding bytes are zero.
6276            fidl::decode!(
6277                fidl::encoding::UnboundedVector<u8>,
6278                D,
6279                &mut self.data,
6280                decoder,
6281                offset + 0,
6282                _depth
6283            )?;
6284            Ok(())
6285        }
6286    }
6287
6288    impl fidl::encoding::ValueTypeMarker for WriteSocketError {
6289        type Borrowed<'a> = &'a Self;
6290        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6291            value
6292        }
6293    }
6294
6295    unsafe impl fidl::encoding::TypeMarker for WriteSocketError {
6296        type Owned = Self;
6297
6298        #[inline(always)]
6299        fn inline_align(_context: fidl::encoding::Context) -> usize {
6300            8
6301        }
6302
6303        #[inline(always)]
6304        fn inline_size(_context: fidl::encoding::Context) -> usize {
6305            24
6306        }
6307    }
6308
6309    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteSocketError, D>
6310        for &WriteSocketError
6311    {
6312        #[inline]
6313        unsafe fn encode(
6314            self,
6315            encoder: &mut fidl::encoding::Encoder<'_, D>,
6316            offset: usize,
6317            _depth: fidl::encoding::Depth,
6318        ) -> fidl::Result<()> {
6319            encoder.debug_check_bounds::<WriteSocketError>(offset);
6320            // Delegate to tuple encoding.
6321            fidl::encoding::Encode::<WriteSocketError, D>::encode(
6322                (
6323                    <Error as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
6324                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wrote),
6325                ),
6326                encoder,
6327                offset,
6328                _depth,
6329            )
6330        }
6331    }
6332    unsafe impl<
6333        D: fidl::encoding::ResourceDialect,
6334        T0: fidl::encoding::Encode<Error, D>,
6335        T1: fidl::encoding::Encode<u64, D>,
6336    > fidl::encoding::Encode<WriteSocketError, D> for (T0, T1)
6337    {
6338        #[inline]
6339        unsafe fn encode(
6340            self,
6341            encoder: &mut fidl::encoding::Encoder<'_, D>,
6342            offset: usize,
6343            depth: fidl::encoding::Depth,
6344        ) -> fidl::Result<()> {
6345            encoder.debug_check_bounds::<WriteSocketError>(offset);
6346            // Zero out padding regions. There's no need to apply masks
6347            // because the unmasked parts will be overwritten by fields.
6348            // Write the fields.
6349            self.0.encode(encoder, offset + 0, depth)?;
6350            self.1.encode(encoder, offset + 16, depth)?;
6351            Ok(())
6352        }
6353    }
6354
6355    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteSocketError {
6356        #[inline(always)]
6357        fn new_empty() -> Self {
6358            Self { error: fidl::new_empty!(Error, D), wrote: fidl::new_empty!(u64, D) }
6359        }
6360
6361        #[inline]
6362        unsafe fn decode(
6363            &mut self,
6364            decoder: &mut fidl::encoding::Decoder<'_, D>,
6365            offset: usize,
6366            _depth: fidl::encoding::Depth,
6367        ) -> fidl::Result<()> {
6368            decoder.debug_check_bounds::<Self>(offset);
6369            // Verify that padding bytes are zero.
6370            fidl::decode!(Error, D, &mut self.error, decoder, offset + 0, _depth)?;
6371            fidl::decode!(u64, D, &mut self.wrote, decoder, offset + 16, _depth)?;
6372            Ok(())
6373        }
6374    }
6375
6376    impl fidl::encoding::ValueTypeMarker for WrongHandleType {
6377        type Borrowed<'a> = &'a Self;
6378        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6379            value
6380        }
6381    }
6382
6383    unsafe impl fidl::encoding::TypeMarker for WrongHandleType {
6384        type Owned = Self;
6385
6386        #[inline(always)]
6387        fn inline_align(_context: fidl::encoding::Context) -> usize {
6388            4
6389        }
6390
6391        #[inline(always)]
6392        fn inline_size(_context: fidl::encoding::Context) -> usize {
6393            8
6394        }
6395    }
6396
6397    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WrongHandleType, D>
6398        for &WrongHandleType
6399    {
6400        #[inline]
6401        unsafe fn encode(
6402            self,
6403            encoder: &mut fidl::encoding::Encoder<'_, D>,
6404            offset: usize,
6405            _depth: fidl::encoding::Depth,
6406        ) -> fidl::Result<()> {
6407            encoder.debug_check_bounds::<WrongHandleType>(offset);
6408            // Delegate to tuple encoding.
6409            fidl::encoding::Encode::<WrongHandleType, D>::encode(
6410                (
6411                    <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.expected),
6412                    <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.got),
6413                ),
6414                encoder,
6415                offset,
6416                _depth,
6417            )
6418        }
6419    }
6420    unsafe impl<
6421        D: fidl::encoding::ResourceDialect,
6422        T0: fidl::encoding::Encode<fidl::ObjectType, D>,
6423        T1: fidl::encoding::Encode<fidl::ObjectType, D>,
6424    > fidl::encoding::Encode<WrongHandleType, D> for (T0, T1)
6425    {
6426        #[inline]
6427        unsafe fn encode(
6428            self,
6429            encoder: &mut fidl::encoding::Encoder<'_, D>,
6430            offset: usize,
6431            depth: fidl::encoding::Depth,
6432        ) -> fidl::Result<()> {
6433            encoder.debug_check_bounds::<WrongHandleType>(offset);
6434            // Zero out padding regions. There's no need to apply masks
6435            // because the unmasked parts will be overwritten by fields.
6436            // Write the fields.
6437            self.0.encode(encoder, offset + 0, depth)?;
6438            self.1.encode(encoder, offset + 4, depth)?;
6439            Ok(())
6440        }
6441    }
6442
6443    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WrongHandleType {
6444        #[inline(always)]
6445        fn new_empty() -> Self {
6446            Self {
6447                expected: fidl::new_empty!(fidl::ObjectType, D),
6448                got: fidl::new_empty!(fidl::ObjectType, D),
6449            }
6450        }
6451
6452        #[inline]
6453        unsafe fn decode(
6454            &mut self,
6455            decoder: &mut fidl::encoding::Decoder<'_, D>,
6456            offset: usize,
6457            _depth: fidl::encoding::Depth,
6458        ) -> fidl::Result<()> {
6459            decoder.debug_check_bounds::<Self>(offset);
6460            // Verify that padding bytes are zero.
6461            fidl::decode!(fidl::ObjectType, D, &mut self.expected, decoder, offset + 0, _depth)?;
6462            fidl::decode!(fidl::ObjectType, D, &mut self.got, decoder, offset + 4, _depth)?;
6463            Ok(())
6464        }
6465    }
6466
6467    impl fidl::encoding::ValueTypeMarker for WroteToSelf {
6468        type Borrowed<'a> = &'a Self;
6469        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6470            value
6471        }
6472    }
6473
6474    unsafe impl fidl::encoding::TypeMarker for WroteToSelf {
6475        type Owned = Self;
6476
6477        #[inline(always)]
6478        fn inline_align(_context: fidl::encoding::Context) -> usize {
6479            1
6480        }
6481
6482        #[inline(always)]
6483        fn inline_size(_context: fidl::encoding::Context) -> usize {
6484            1
6485        }
6486    }
6487
6488    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WroteToSelf, D>
6489        for &WroteToSelf
6490    {
6491        #[inline]
6492        unsafe fn encode(
6493            self,
6494            encoder: &mut fidl::encoding::Encoder<'_, D>,
6495            offset: usize,
6496            _depth: fidl::encoding::Depth,
6497        ) -> fidl::Result<()> {
6498            encoder.debug_check_bounds::<WroteToSelf>(offset);
6499            encoder.write_num(0u8, offset);
6500            Ok(())
6501        }
6502    }
6503
6504    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WroteToSelf {
6505        #[inline(always)]
6506        fn new_empty() -> Self {
6507            Self
6508        }
6509
6510        #[inline]
6511        unsafe fn decode(
6512            &mut self,
6513            decoder: &mut fidl::encoding::Decoder<'_, D>,
6514            offset: usize,
6515            _depth: fidl::encoding::Depth,
6516        ) -> fidl::Result<()> {
6517            decoder.debug_check_bounds::<Self>(offset);
6518            match decoder.read_num::<u8>(offset) {
6519                0 => Ok(()),
6520                _ => Err(fidl::Error::Invalid),
6521            }
6522        }
6523    }
6524
6525    impl fidl::encoding::ValueTypeMarker for ChannelSent {
6526        type Borrowed<'a> = &'a Self;
6527        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6528            value
6529        }
6530    }
6531
6532    unsafe impl fidl::encoding::TypeMarker for ChannelSent {
6533        type Owned = Self;
6534
6535        #[inline(always)]
6536        fn inline_align(_context: fidl::encoding::Context) -> usize {
6537            8
6538        }
6539
6540        #[inline(always)]
6541        fn inline_size(_context: fidl::encoding::Context) -> usize {
6542            16
6543        }
6544    }
6545
6546    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelSent, D>
6547        for &ChannelSent
6548    {
6549        #[inline]
6550        unsafe fn encode(
6551            self,
6552            encoder: &mut fidl::encoding::Encoder<'_, D>,
6553            offset: usize,
6554            _depth: fidl::encoding::Depth,
6555        ) -> fidl::Result<()> {
6556            encoder.debug_check_bounds::<ChannelSent>(offset);
6557            encoder.write_num::<u64>(self.ordinal(), offset);
6558            match self {
6559                ChannelSent::Message(ref val) => {
6560                    fidl::encoding::encode_in_envelope::<ChannelMessage, D>(
6561                        <ChannelMessage as fidl::encoding::ValueTypeMarker>::borrow(val),
6562                        encoder,
6563                        offset + 8,
6564                        _depth,
6565                    )
6566                }
6567                ChannelSent::Stopped(ref val) => {
6568                    fidl::encoding::encode_in_envelope::<AioStopped, D>(
6569                        <AioStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
6570                        encoder,
6571                        offset + 8,
6572                        _depth,
6573                    )
6574                }
6575                ChannelSent::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
6576            }
6577        }
6578    }
6579
6580    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelSent {
6581        #[inline(always)]
6582        fn new_empty() -> Self {
6583            Self::__SourceBreaking { unknown_ordinal: 0 }
6584        }
6585
6586        #[inline]
6587        unsafe fn decode(
6588            &mut self,
6589            decoder: &mut fidl::encoding::Decoder<'_, D>,
6590            offset: usize,
6591            mut depth: fidl::encoding::Depth,
6592        ) -> fidl::Result<()> {
6593            decoder.debug_check_bounds::<Self>(offset);
6594            #[allow(unused_variables)]
6595            let next_out_of_line = decoder.next_out_of_line();
6596            let handles_before = decoder.remaining_handles();
6597            let (ordinal, inlined, num_bytes, num_handles) =
6598                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6599
6600            let member_inline_size = match ordinal {
6601                1 => <ChannelMessage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6602                2 => <AioStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6603                0 => return Err(fidl::Error::UnknownUnionTag),
6604                _ => num_bytes as usize,
6605            };
6606
6607            if inlined != (member_inline_size <= 4) {
6608                return Err(fidl::Error::InvalidInlineBitInEnvelope);
6609            }
6610            let _inner_offset;
6611            if inlined {
6612                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6613                _inner_offset = offset + 8;
6614            } else {
6615                depth.increment()?;
6616                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6617            }
6618            match ordinal {
6619                1 => {
6620                    #[allow(irrefutable_let_patterns)]
6621                    if let ChannelSent::Message(_) = self {
6622                        // Do nothing, read the value into the object
6623                    } else {
6624                        // Initialize `self` to the right variant
6625                        *self = ChannelSent::Message(fidl::new_empty!(ChannelMessage, D));
6626                    }
6627                    #[allow(irrefutable_let_patterns)]
6628                    if let ChannelSent::Message(ref mut val) = self {
6629                        fidl::decode!(ChannelMessage, D, val, decoder, _inner_offset, depth)?;
6630                    } else {
6631                        unreachable!()
6632                    }
6633                }
6634                2 => {
6635                    #[allow(irrefutable_let_patterns)]
6636                    if let ChannelSent::Stopped(_) = self {
6637                        // Do nothing, read the value into the object
6638                    } else {
6639                        // Initialize `self` to the right variant
6640                        *self = ChannelSent::Stopped(fidl::new_empty!(AioStopped, D));
6641                    }
6642                    #[allow(irrefutable_let_patterns)]
6643                    if let ChannelSent::Stopped(ref mut val) = self {
6644                        fidl::decode!(AioStopped, D, val, decoder, _inner_offset, depth)?;
6645                    } else {
6646                        unreachable!()
6647                    }
6648                }
6649                #[allow(deprecated)]
6650                ordinal => {
6651                    for _ in 0..num_handles {
6652                        decoder.drop_next_handle()?;
6653                    }
6654                    *self = ChannelSent::__SourceBreaking { unknown_ordinal: ordinal };
6655                }
6656            }
6657            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6658                return Err(fidl::Error::InvalidNumBytesInEnvelope);
6659            }
6660            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6661                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6662            }
6663            Ok(())
6664        }
6665    }
6666
6667    impl fidl::encoding::ValueTypeMarker for Error {
6668        type Borrowed<'a> = &'a Self;
6669        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6670            value
6671        }
6672    }
6673
6674    unsafe impl fidl::encoding::TypeMarker for Error {
6675        type Owned = Self;
6676
6677        #[inline(always)]
6678        fn inline_align(_context: fidl::encoding::Context) -> usize {
6679            8
6680        }
6681
6682        #[inline(always)]
6683        fn inline_size(_context: fidl::encoding::Context) -> usize {
6684            16
6685        }
6686    }
6687
6688    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Error, D> for &Error {
6689        #[inline]
6690        unsafe fn encode(
6691            self,
6692            encoder: &mut fidl::encoding::Encoder<'_, D>,
6693            offset: usize,
6694            _depth: fidl::encoding::Depth,
6695        ) -> fidl::Result<()> {
6696            encoder.debug_check_bounds::<Error>(offset);
6697            encoder.write_num::<u64>(self.ordinal(), offset);
6698            match self {
6699                Error::TargetError(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
6700                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
6701                    encoder,
6702                    offset + 8,
6703                    _depth,
6704                ),
6705                Error::BadHandleId(ref val) => {
6706                    fidl::encoding::encode_in_envelope::<BadHandleId, D>(
6707                        <BadHandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
6708                        encoder,
6709                        offset + 8,
6710                        _depth,
6711                    )
6712                }
6713                Error::NewHandleIdOutOfRange(ref val) => {
6714                    fidl::encoding::encode_in_envelope::<NewHandleIdOutOfRange, D>(
6715                        <NewHandleIdOutOfRange as fidl::encoding::ValueTypeMarker>::borrow(val),
6716                        encoder,
6717                        offset + 8,
6718                        _depth,
6719                    )
6720                }
6721                Error::NewHandleIdReused(ref val) => {
6722                    fidl::encoding::encode_in_envelope::<NewHandleIdReused, D>(
6723                        <NewHandleIdReused as fidl::encoding::ValueTypeMarker>::borrow(val),
6724                        encoder,
6725                        offset + 8,
6726                        _depth,
6727                    )
6728                }
6729                Error::WrongHandleType(ref val) => {
6730                    fidl::encoding::encode_in_envelope::<WrongHandleType, D>(
6731                        <WrongHandleType as fidl::encoding::ValueTypeMarker>::borrow(val),
6732                        encoder,
6733                        offset + 8,
6734                        _depth,
6735                    )
6736                }
6737                Error::StreamingReadInProgress(ref val) => {
6738                    fidl::encoding::encode_in_envelope::<StreamingReadInProgress, D>(
6739                        <StreamingReadInProgress as fidl::encoding::ValueTypeMarker>::borrow(val),
6740                        encoder,
6741                        offset + 8,
6742                        _depth,
6743                    )
6744                }
6745                Error::NoReadInProgress(ref val) => {
6746                    fidl::encoding::encode_in_envelope::<NoReadInProgress, D>(
6747                        <NoReadInProgress as fidl::encoding::ValueTypeMarker>::borrow(val),
6748                        encoder,
6749                        offset + 8,
6750                        _depth,
6751                    )
6752                }
6753                Error::WroteToSelf(ref val) => {
6754                    fidl::encoding::encode_in_envelope::<WroteToSelf, D>(
6755                        <WroteToSelf as fidl::encoding::ValueTypeMarker>::borrow(val),
6756                        encoder,
6757                        offset + 8,
6758                        _depth,
6759                    )
6760                }
6761                Error::ClosedDuringRead(ref val) => {
6762                    fidl::encoding::encode_in_envelope::<ClosedDuringRead, D>(
6763                        <ClosedDuringRead as fidl::encoding::ValueTypeMarker>::borrow(val),
6764                        encoder,
6765                        offset + 8,
6766                        _depth,
6767                    )
6768                }
6769                Error::SignalsUnknown(ref val) => {
6770                    fidl::encoding::encode_in_envelope::<SignalsUnknown, D>(
6771                        <SignalsUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
6772                        encoder,
6773                        offset + 8,
6774                        _depth,
6775                    )
6776                }
6777                Error::RightsUnknown(ref val) => {
6778                    fidl::encoding::encode_in_envelope::<RightsUnknown, D>(
6779                        <RightsUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
6780                        encoder,
6781                        offset + 8,
6782                        _depth,
6783                    )
6784                }
6785                Error::SocketDispositionUnknown(ref val) => {
6786                    fidl::encoding::encode_in_envelope::<SocketDispositionUnknown, D>(
6787                        <SocketDispositionUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
6788                        encoder,
6789                        offset + 8,
6790                        _depth,
6791                    )
6792                }
6793                Error::SocketTypeUnknown(ref val) => {
6794                    fidl::encoding::encode_in_envelope::<SocketTypeUnknown, D>(
6795                        <SocketTypeUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
6796                        encoder,
6797                        offset + 8,
6798                        _depth,
6799                    )
6800                }
6801                Error::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
6802            }
6803        }
6804    }
6805
6806    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
6807        #[inline(always)]
6808        fn new_empty() -> Self {
6809            Self::__SourceBreaking { unknown_ordinal: 0 }
6810        }
6811
6812        #[inline]
6813        unsafe fn decode(
6814            &mut self,
6815            decoder: &mut fidl::encoding::Decoder<'_, D>,
6816            offset: usize,
6817            mut depth: fidl::encoding::Depth,
6818        ) -> fidl::Result<()> {
6819            decoder.debug_check_bounds::<Self>(offset);
6820            #[allow(unused_variables)]
6821            let next_out_of_line = decoder.next_out_of_line();
6822            let handles_before = decoder.remaining_handles();
6823            let (ordinal, inlined, num_bytes, num_handles) =
6824                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6825
6826            let member_inline_size = match ordinal {
6827                1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6828                2 => <BadHandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6829                3 => <NewHandleIdOutOfRange as fidl::encoding::TypeMarker>::inline_size(
6830                    decoder.context,
6831                ),
6832                4 => {
6833                    <NewHandleIdReused as fidl::encoding::TypeMarker>::inline_size(decoder.context)
6834                }
6835                5 => <WrongHandleType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6836                6 => <StreamingReadInProgress as fidl::encoding::TypeMarker>::inline_size(
6837                    decoder.context,
6838                ),
6839                7 => <NoReadInProgress as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6840                8 => <WroteToSelf as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6841                9 => <ClosedDuringRead as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6842                10 => <SignalsUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6843                11 => <RightsUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6844                12 => <SocketDispositionUnknown as fidl::encoding::TypeMarker>::inline_size(
6845                    decoder.context,
6846                ),
6847                13 => {
6848                    <SocketTypeUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context)
6849                }
6850                0 => return Err(fidl::Error::UnknownUnionTag),
6851                _ => num_bytes as usize,
6852            };
6853
6854            if inlined != (member_inline_size <= 4) {
6855                return Err(fidl::Error::InvalidInlineBitInEnvelope);
6856            }
6857            let _inner_offset;
6858            if inlined {
6859                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6860                _inner_offset = offset + 8;
6861            } else {
6862                depth.increment()?;
6863                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6864            }
6865            match ordinal {
6866                1 => {
6867                    #[allow(irrefutable_let_patterns)]
6868                    if let Error::TargetError(_) = self {
6869                        // Do nothing, read the value into the object
6870                    } else {
6871                        // Initialize `self` to the right variant
6872                        *self = Error::TargetError(fidl::new_empty!(i32, D));
6873                    }
6874                    #[allow(irrefutable_let_patterns)]
6875                    if let Error::TargetError(ref mut val) = self {
6876                        fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
6877                    } else {
6878                        unreachable!()
6879                    }
6880                }
6881                2 => {
6882                    #[allow(irrefutable_let_patterns)]
6883                    if let Error::BadHandleId(_) = self {
6884                        // Do nothing, read the value into the object
6885                    } else {
6886                        // Initialize `self` to the right variant
6887                        *self = Error::BadHandleId(fidl::new_empty!(BadHandleId, D));
6888                    }
6889                    #[allow(irrefutable_let_patterns)]
6890                    if let Error::BadHandleId(ref mut val) = self {
6891                        fidl::decode!(BadHandleId, D, val, decoder, _inner_offset, depth)?;
6892                    } else {
6893                        unreachable!()
6894                    }
6895                }
6896                3 => {
6897                    #[allow(irrefutable_let_patterns)]
6898                    if let Error::NewHandleIdOutOfRange(_) = self {
6899                        // Do nothing, read the value into the object
6900                    } else {
6901                        // Initialize `self` to the right variant
6902                        *self = Error::NewHandleIdOutOfRange(fidl::new_empty!(
6903                            NewHandleIdOutOfRange,
6904                            D
6905                        ));
6906                    }
6907                    #[allow(irrefutable_let_patterns)]
6908                    if let Error::NewHandleIdOutOfRange(ref mut val) = self {
6909                        fidl::decode!(
6910                            NewHandleIdOutOfRange,
6911                            D,
6912                            val,
6913                            decoder,
6914                            _inner_offset,
6915                            depth
6916                        )?;
6917                    } else {
6918                        unreachable!()
6919                    }
6920                }
6921                4 => {
6922                    #[allow(irrefutable_let_patterns)]
6923                    if let Error::NewHandleIdReused(_) = self {
6924                        // Do nothing, read the value into the object
6925                    } else {
6926                        // Initialize `self` to the right variant
6927                        *self = Error::NewHandleIdReused(fidl::new_empty!(NewHandleIdReused, D));
6928                    }
6929                    #[allow(irrefutable_let_patterns)]
6930                    if let Error::NewHandleIdReused(ref mut val) = self {
6931                        fidl::decode!(NewHandleIdReused, D, val, decoder, _inner_offset, depth)?;
6932                    } else {
6933                        unreachable!()
6934                    }
6935                }
6936                5 => {
6937                    #[allow(irrefutable_let_patterns)]
6938                    if let Error::WrongHandleType(_) = self {
6939                        // Do nothing, read the value into the object
6940                    } else {
6941                        // Initialize `self` to the right variant
6942                        *self = Error::WrongHandleType(fidl::new_empty!(WrongHandleType, D));
6943                    }
6944                    #[allow(irrefutable_let_patterns)]
6945                    if let Error::WrongHandleType(ref mut val) = self {
6946                        fidl::decode!(WrongHandleType, D, val, decoder, _inner_offset, depth)?;
6947                    } else {
6948                        unreachable!()
6949                    }
6950                }
6951                6 => {
6952                    #[allow(irrefutable_let_patterns)]
6953                    if let Error::StreamingReadInProgress(_) = self {
6954                        // Do nothing, read the value into the object
6955                    } else {
6956                        // Initialize `self` to the right variant
6957                        *self = Error::StreamingReadInProgress(fidl::new_empty!(
6958                            StreamingReadInProgress,
6959                            D
6960                        ));
6961                    }
6962                    #[allow(irrefutable_let_patterns)]
6963                    if let Error::StreamingReadInProgress(ref mut val) = self {
6964                        fidl::decode!(
6965                            StreamingReadInProgress,
6966                            D,
6967                            val,
6968                            decoder,
6969                            _inner_offset,
6970                            depth
6971                        )?;
6972                    } else {
6973                        unreachable!()
6974                    }
6975                }
6976                7 => {
6977                    #[allow(irrefutable_let_patterns)]
6978                    if let Error::NoReadInProgress(_) = self {
6979                        // Do nothing, read the value into the object
6980                    } else {
6981                        // Initialize `self` to the right variant
6982                        *self = Error::NoReadInProgress(fidl::new_empty!(NoReadInProgress, D));
6983                    }
6984                    #[allow(irrefutable_let_patterns)]
6985                    if let Error::NoReadInProgress(ref mut val) = self {
6986                        fidl::decode!(NoReadInProgress, D, val, decoder, _inner_offset, depth)?;
6987                    } else {
6988                        unreachable!()
6989                    }
6990                }
6991                8 => {
6992                    #[allow(irrefutable_let_patterns)]
6993                    if let Error::WroteToSelf(_) = self {
6994                        // Do nothing, read the value into the object
6995                    } else {
6996                        // Initialize `self` to the right variant
6997                        *self = Error::WroteToSelf(fidl::new_empty!(WroteToSelf, D));
6998                    }
6999                    #[allow(irrefutable_let_patterns)]
7000                    if let Error::WroteToSelf(ref mut val) = self {
7001                        fidl::decode!(WroteToSelf, D, val, decoder, _inner_offset, depth)?;
7002                    } else {
7003                        unreachable!()
7004                    }
7005                }
7006                9 => {
7007                    #[allow(irrefutable_let_patterns)]
7008                    if let Error::ClosedDuringRead(_) = self {
7009                        // Do nothing, read the value into the object
7010                    } else {
7011                        // Initialize `self` to the right variant
7012                        *self = Error::ClosedDuringRead(fidl::new_empty!(ClosedDuringRead, D));
7013                    }
7014                    #[allow(irrefutable_let_patterns)]
7015                    if let Error::ClosedDuringRead(ref mut val) = self {
7016                        fidl::decode!(ClosedDuringRead, D, val, decoder, _inner_offset, depth)?;
7017                    } else {
7018                        unreachable!()
7019                    }
7020                }
7021                10 => {
7022                    #[allow(irrefutable_let_patterns)]
7023                    if let Error::SignalsUnknown(_) = self {
7024                        // Do nothing, read the value into the object
7025                    } else {
7026                        // Initialize `self` to the right variant
7027                        *self = Error::SignalsUnknown(fidl::new_empty!(SignalsUnknown, D));
7028                    }
7029                    #[allow(irrefutable_let_patterns)]
7030                    if let Error::SignalsUnknown(ref mut val) = self {
7031                        fidl::decode!(SignalsUnknown, D, val, decoder, _inner_offset, depth)?;
7032                    } else {
7033                        unreachable!()
7034                    }
7035                }
7036                11 => {
7037                    #[allow(irrefutable_let_patterns)]
7038                    if let Error::RightsUnknown(_) = self {
7039                        // Do nothing, read the value into the object
7040                    } else {
7041                        // Initialize `self` to the right variant
7042                        *self = Error::RightsUnknown(fidl::new_empty!(RightsUnknown, D));
7043                    }
7044                    #[allow(irrefutable_let_patterns)]
7045                    if let Error::RightsUnknown(ref mut val) = self {
7046                        fidl::decode!(RightsUnknown, D, val, decoder, _inner_offset, depth)?;
7047                    } else {
7048                        unreachable!()
7049                    }
7050                }
7051                12 => {
7052                    #[allow(irrefutable_let_patterns)]
7053                    if let Error::SocketDispositionUnknown(_) = self {
7054                        // Do nothing, read the value into the object
7055                    } else {
7056                        // Initialize `self` to the right variant
7057                        *self = Error::SocketDispositionUnknown(fidl::new_empty!(
7058                            SocketDispositionUnknown,
7059                            D
7060                        ));
7061                    }
7062                    #[allow(irrefutable_let_patterns)]
7063                    if let Error::SocketDispositionUnknown(ref mut val) = self {
7064                        fidl::decode!(
7065                            SocketDispositionUnknown,
7066                            D,
7067                            val,
7068                            decoder,
7069                            _inner_offset,
7070                            depth
7071                        )?;
7072                    } else {
7073                        unreachable!()
7074                    }
7075                }
7076                13 => {
7077                    #[allow(irrefutable_let_patterns)]
7078                    if let Error::SocketTypeUnknown(_) = self {
7079                        // Do nothing, read the value into the object
7080                    } else {
7081                        // Initialize `self` to the right variant
7082                        *self = Error::SocketTypeUnknown(fidl::new_empty!(SocketTypeUnknown, D));
7083                    }
7084                    #[allow(irrefutable_let_patterns)]
7085                    if let Error::SocketTypeUnknown(ref mut val) = self {
7086                        fidl::decode!(SocketTypeUnknown, D, val, decoder, _inner_offset, depth)?;
7087                    } else {
7088                        unreachable!()
7089                    }
7090                }
7091                #[allow(deprecated)]
7092                ordinal => {
7093                    for _ in 0..num_handles {
7094                        decoder.drop_next_handle()?;
7095                    }
7096                    *self = Error::__SourceBreaking { unknown_ordinal: ordinal };
7097                }
7098            }
7099            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7100                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7101            }
7102            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7103                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7104            }
7105            Ok(())
7106        }
7107    }
7108
7109    impl fidl::encoding::ValueTypeMarker for HandleOp {
7110        type Borrowed<'a> = &'a Self;
7111        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7112            value
7113        }
7114    }
7115
7116    unsafe impl fidl::encoding::TypeMarker for HandleOp {
7117        type Owned = Self;
7118
7119        #[inline(always)]
7120        fn inline_align(_context: fidl::encoding::Context) -> usize {
7121            8
7122        }
7123
7124        #[inline(always)]
7125        fn inline_size(_context: fidl::encoding::Context) -> usize {
7126            16
7127        }
7128    }
7129
7130    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleOp, D> for &HandleOp {
7131        #[inline]
7132        unsafe fn encode(
7133            self,
7134            encoder: &mut fidl::encoding::Encoder<'_, D>,
7135            offset: usize,
7136            _depth: fidl::encoding::Depth,
7137        ) -> fidl::Result<()> {
7138            encoder.debug_check_bounds::<HandleOp>(offset);
7139            encoder.write_num::<u64>(self.ordinal(), offset);
7140            match self {
7141                HandleOp::Move_(ref val) => fidl::encoding::encode_in_envelope::<HandleId, D>(
7142                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
7143                    encoder,
7144                    offset + 8,
7145                    _depth,
7146                ),
7147                HandleOp::Duplicate(ref val) => fidl::encoding::encode_in_envelope::<HandleId, D>(
7148                    <HandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
7149                    encoder,
7150                    offset + 8,
7151                    _depth,
7152                ),
7153            }
7154        }
7155    }
7156
7157    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleOp {
7158        #[inline(always)]
7159        fn new_empty() -> Self {
7160            Self::Move_(fidl::new_empty!(HandleId, D))
7161        }
7162
7163        #[inline]
7164        unsafe fn decode(
7165            &mut self,
7166            decoder: &mut fidl::encoding::Decoder<'_, D>,
7167            offset: usize,
7168            mut depth: fidl::encoding::Depth,
7169        ) -> fidl::Result<()> {
7170            decoder.debug_check_bounds::<Self>(offset);
7171            #[allow(unused_variables)]
7172            let next_out_of_line = decoder.next_out_of_line();
7173            let handles_before = decoder.remaining_handles();
7174            let (ordinal, inlined, num_bytes, num_handles) =
7175                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7176
7177            let member_inline_size = match ordinal {
7178                1 => <HandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7179                2 => <HandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7180                _ => return Err(fidl::Error::UnknownUnionTag),
7181            };
7182
7183            if inlined != (member_inline_size <= 4) {
7184                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7185            }
7186            let _inner_offset;
7187            if inlined {
7188                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7189                _inner_offset = offset + 8;
7190            } else {
7191                depth.increment()?;
7192                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7193            }
7194            match ordinal {
7195                1 => {
7196                    #[allow(irrefutable_let_patterns)]
7197                    if let HandleOp::Move_(_) = self {
7198                        // Do nothing, read the value into the object
7199                    } else {
7200                        // Initialize `self` to the right variant
7201                        *self = HandleOp::Move_(fidl::new_empty!(HandleId, D));
7202                    }
7203                    #[allow(irrefutable_let_patterns)]
7204                    if let HandleOp::Move_(ref mut val) = self {
7205                        fidl::decode!(HandleId, D, val, decoder, _inner_offset, depth)?;
7206                    } else {
7207                        unreachable!()
7208                    }
7209                }
7210                2 => {
7211                    #[allow(irrefutable_let_patterns)]
7212                    if let HandleOp::Duplicate(_) = self {
7213                        // Do nothing, read the value into the object
7214                    } else {
7215                        // Initialize `self` to the right variant
7216                        *self = HandleOp::Duplicate(fidl::new_empty!(HandleId, D));
7217                    }
7218                    #[allow(irrefutable_let_patterns)]
7219                    if let HandleOp::Duplicate(ref mut val) = self {
7220                        fidl::decode!(HandleId, D, val, decoder, _inner_offset, depth)?;
7221                    } else {
7222                        unreachable!()
7223                    }
7224                }
7225                ordinal => panic!("unexpected ordinal {:?}", ordinal),
7226            }
7227            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7228                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7229            }
7230            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7231                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7232            }
7233            Ok(())
7234        }
7235    }
7236
7237    impl fidl::encoding::ValueTypeMarker for Handles {
7238        type Borrowed<'a> = &'a Self;
7239        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7240            value
7241        }
7242    }
7243
7244    unsafe impl fidl::encoding::TypeMarker for Handles {
7245        type Owned = Self;
7246
7247        #[inline(always)]
7248        fn inline_align(_context: fidl::encoding::Context) -> usize {
7249            8
7250        }
7251
7252        #[inline(always)]
7253        fn inline_size(_context: fidl::encoding::Context) -> usize {
7254            16
7255        }
7256    }
7257
7258    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Handles, D> for &Handles {
7259        #[inline]
7260        unsafe fn encode(
7261            self,
7262            encoder: &mut fidl::encoding::Encoder<'_, D>,
7263            offset: usize,
7264            _depth: fidl::encoding::Depth,
7265        ) -> fidl::Result<()> {
7266            encoder.debug_check_bounds::<Handles>(offset);
7267            encoder.write_num::<u64>(self.ordinal(), offset);
7268            match self {
7269            Handles::Handles(ref val) => {
7270                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<HandleId, 64>, D>(
7271                    <fidl::encoding::Vector<HandleId, 64> as fidl::encoding::ValueTypeMarker>::borrow(val),
7272                    encoder, offset + 8, _depth
7273                )
7274            }
7275            Handles::Dispositions(ref val) => {
7276                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<HandleDisposition, 64>, D>(
7277                    <fidl::encoding::Vector<HandleDisposition, 64> as fidl::encoding::ValueTypeMarker>::borrow(val),
7278                    encoder, offset + 8, _depth
7279                )
7280            }
7281        }
7282        }
7283    }
7284
7285    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Handles {
7286        #[inline(always)]
7287        fn new_empty() -> Self {
7288            Self::Handles(fidl::new_empty!(fidl::encoding::Vector<HandleId, 64>, D))
7289        }
7290
7291        #[inline]
7292        unsafe fn decode(
7293            &mut self,
7294            decoder: &mut fidl::encoding::Decoder<'_, D>,
7295            offset: usize,
7296            mut depth: fidl::encoding::Depth,
7297        ) -> fidl::Result<()> {
7298            decoder.debug_check_bounds::<Self>(offset);
7299            #[allow(unused_variables)]
7300            let next_out_of_line = decoder.next_out_of_line();
7301            let handles_before = decoder.remaining_handles();
7302            let (ordinal, inlined, num_bytes, num_handles) =
7303                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7304
7305            let member_inline_size = match ordinal {
7306            1 => <fidl::encoding::Vector<HandleId, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7307            2 => <fidl::encoding::Vector<HandleDisposition, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7308            _ => return Err(fidl::Error::UnknownUnionTag),
7309        };
7310
7311            if inlined != (member_inline_size <= 4) {
7312                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7313            }
7314            let _inner_offset;
7315            if inlined {
7316                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7317                _inner_offset = offset + 8;
7318            } else {
7319                depth.increment()?;
7320                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7321            }
7322            match ordinal {
7323                1 => {
7324                    #[allow(irrefutable_let_patterns)]
7325                    if let Handles::Handles(_) = self {
7326                        // Do nothing, read the value into the object
7327                    } else {
7328                        // Initialize `self` to the right variant
7329                        *self = Handles::Handles(
7330                            fidl::new_empty!(fidl::encoding::Vector<HandleId, 64>, D),
7331                        );
7332                    }
7333                    #[allow(irrefutable_let_patterns)]
7334                    if let Handles::Handles(ref mut val) = self {
7335                        fidl::decode!(fidl::encoding::Vector<HandleId, 64>, D, val, decoder, _inner_offset, depth)?;
7336                    } else {
7337                        unreachable!()
7338                    }
7339                }
7340                2 => {
7341                    #[allow(irrefutable_let_patterns)]
7342                    if let Handles::Dispositions(_) = self {
7343                        // Do nothing, read the value into the object
7344                    } else {
7345                        // Initialize `self` to the right variant
7346                        *self = Handles::Dispositions(
7347                            fidl::new_empty!(fidl::encoding::Vector<HandleDisposition, 64>, D),
7348                        );
7349                    }
7350                    #[allow(irrefutable_let_patterns)]
7351                    if let Handles::Dispositions(ref mut val) = self {
7352                        fidl::decode!(fidl::encoding::Vector<HandleDisposition, 64>, D, val, decoder, _inner_offset, depth)?;
7353                    } else {
7354                        unreachable!()
7355                    }
7356                }
7357                ordinal => panic!("unexpected ordinal {:?}", ordinal),
7358            }
7359            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7360                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7361            }
7362            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7363                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7364            }
7365            Ok(())
7366        }
7367    }
7368
7369    impl fidl::encoding::ValueTypeMarker for SocketMessage {
7370        type Borrowed<'a> = &'a Self;
7371        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7372            value
7373        }
7374    }
7375
7376    unsafe impl fidl::encoding::TypeMarker for SocketMessage {
7377        type Owned = Self;
7378
7379        #[inline(always)]
7380        fn inline_align(_context: fidl::encoding::Context) -> usize {
7381            8
7382        }
7383
7384        #[inline(always)]
7385        fn inline_size(_context: fidl::encoding::Context) -> usize {
7386            16
7387        }
7388    }
7389
7390    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketMessage, D>
7391        for &SocketMessage
7392    {
7393        #[inline]
7394        unsafe fn encode(
7395            self,
7396            encoder: &mut fidl::encoding::Encoder<'_, D>,
7397            offset: usize,
7398            _depth: fidl::encoding::Depth,
7399        ) -> fidl::Result<()> {
7400            encoder.debug_check_bounds::<SocketMessage>(offset);
7401            encoder.write_num::<u64>(self.ordinal(), offset);
7402            match self {
7403                SocketMessage::Data(ref val) => {
7404                    fidl::encoding::encode_in_envelope::<SocketData, D>(
7405                        <SocketData as fidl::encoding::ValueTypeMarker>::borrow(val),
7406                        encoder,
7407                        offset + 8,
7408                        _depth,
7409                    )
7410                }
7411                SocketMessage::Stopped(ref val) => {
7412                    fidl::encoding::encode_in_envelope::<AioStopped, D>(
7413                        <AioStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
7414                        encoder,
7415                        offset + 8,
7416                        _depth,
7417                    )
7418                }
7419                SocketMessage::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7420            }
7421        }
7422    }
7423
7424    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketMessage {
7425        #[inline(always)]
7426        fn new_empty() -> Self {
7427            Self::__SourceBreaking { unknown_ordinal: 0 }
7428        }
7429
7430        #[inline]
7431        unsafe fn decode(
7432            &mut self,
7433            decoder: &mut fidl::encoding::Decoder<'_, D>,
7434            offset: usize,
7435            mut depth: fidl::encoding::Depth,
7436        ) -> fidl::Result<()> {
7437            decoder.debug_check_bounds::<Self>(offset);
7438            #[allow(unused_variables)]
7439            let next_out_of_line = decoder.next_out_of_line();
7440            let handles_before = decoder.remaining_handles();
7441            let (ordinal, inlined, num_bytes, num_handles) =
7442                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7443
7444            let member_inline_size = match ordinal {
7445                1 => <SocketData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7446                2 => <AioStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7447                0 => return Err(fidl::Error::UnknownUnionTag),
7448                _ => num_bytes as usize,
7449            };
7450
7451            if inlined != (member_inline_size <= 4) {
7452                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7453            }
7454            let _inner_offset;
7455            if inlined {
7456                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7457                _inner_offset = offset + 8;
7458            } else {
7459                depth.increment()?;
7460                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7461            }
7462            match ordinal {
7463                1 => {
7464                    #[allow(irrefutable_let_patterns)]
7465                    if let SocketMessage::Data(_) = self {
7466                        // Do nothing, read the value into the object
7467                    } else {
7468                        // Initialize `self` to the right variant
7469                        *self = SocketMessage::Data(fidl::new_empty!(SocketData, D));
7470                    }
7471                    #[allow(irrefutable_let_patterns)]
7472                    if let SocketMessage::Data(ref mut val) = self {
7473                        fidl::decode!(SocketData, D, val, decoder, _inner_offset, depth)?;
7474                    } else {
7475                        unreachable!()
7476                    }
7477                }
7478                2 => {
7479                    #[allow(irrefutable_let_patterns)]
7480                    if let SocketMessage::Stopped(_) = self {
7481                        // Do nothing, read the value into the object
7482                    } else {
7483                        // Initialize `self` to the right variant
7484                        *self = SocketMessage::Stopped(fidl::new_empty!(AioStopped, D));
7485                    }
7486                    #[allow(irrefutable_let_patterns)]
7487                    if let SocketMessage::Stopped(ref mut val) = self {
7488                        fidl::decode!(AioStopped, D, val, decoder, _inner_offset, depth)?;
7489                    } else {
7490                        unreachable!()
7491                    }
7492                }
7493                #[allow(deprecated)]
7494                ordinal => {
7495                    for _ in 0..num_handles {
7496                        decoder.drop_next_handle()?;
7497                    }
7498                    *self = SocketMessage::__SourceBreaking { unknown_ordinal: ordinal };
7499                }
7500            }
7501            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7502                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7503            }
7504            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7505                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7506            }
7507            Ok(())
7508        }
7509    }
7510
7511    impl fidl::encoding::ValueTypeMarker for WriteChannelError {
7512        type Borrowed<'a> = &'a Self;
7513        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7514            value
7515        }
7516    }
7517
7518    unsafe impl fidl::encoding::TypeMarker for WriteChannelError {
7519        type Owned = Self;
7520
7521        #[inline(always)]
7522        fn inline_align(_context: fidl::encoding::Context) -> usize {
7523            8
7524        }
7525
7526        #[inline(always)]
7527        fn inline_size(_context: fidl::encoding::Context) -> usize {
7528            16
7529        }
7530    }
7531
7532    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteChannelError, D>
7533        for &WriteChannelError
7534    {
7535        #[inline]
7536        unsafe fn encode(
7537            self,
7538            encoder: &mut fidl::encoding::Encoder<'_, D>,
7539            offset: usize,
7540            _depth: fidl::encoding::Depth,
7541        ) -> fidl::Result<()> {
7542            encoder.debug_check_bounds::<WriteChannelError>(offset);
7543            encoder.write_num::<u64>(self.ordinal(), offset);
7544            match self {
7545            WriteChannelError::Error(ref val) => {
7546                fidl::encoding::encode_in_envelope::<Error, D>(
7547                    <Error as fidl::encoding::ValueTypeMarker>::borrow(val),
7548                    encoder, offset + 8, _depth
7549                )
7550            }
7551            WriteChannelError::OpErrors(ref val) => {
7552                fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>, D>(
7553                    <fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>> as fidl::encoding::ValueTypeMarker>::borrow(val),
7554                    encoder, offset + 8, _depth
7555                )
7556            }
7557        }
7558        }
7559    }
7560
7561    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteChannelError {
7562        #[inline(always)]
7563        fn new_empty() -> Self {
7564            Self::Error(fidl::new_empty!(Error, D))
7565        }
7566
7567        #[inline]
7568        unsafe fn decode(
7569            &mut self,
7570            decoder: &mut fidl::encoding::Decoder<'_, D>,
7571            offset: usize,
7572            mut depth: fidl::encoding::Depth,
7573        ) -> fidl::Result<()> {
7574            decoder.debug_check_bounds::<Self>(offset);
7575            #[allow(unused_variables)]
7576            let next_out_of_line = decoder.next_out_of_line();
7577            let handles_before = decoder.remaining_handles();
7578            let (ordinal, inlined, num_bytes, num_handles) =
7579                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7580
7581            let member_inline_size = match ordinal {
7582            1 => <Error as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7583            2 => <fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7584            _ => return Err(fidl::Error::UnknownUnionTag),
7585        };
7586
7587            if inlined != (member_inline_size <= 4) {
7588                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7589            }
7590            let _inner_offset;
7591            if inlined {
7592                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7593                _inner_offset = offset + 8;
7594            } else {
7595                depth.increment()?;
7596                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7597            }
7598            match ordinal {
7599                1 => {
7600                    #[allow(irrefutable_let_patterns)]
7601                    if let WriteChannelError::Error(_) = self {
7602                        // Do nothing, read the value into the object
7603                    } else {
7604                        // Initialize `self` to the right variant
7605                        *self = WriteChannelError::Error(fidl::new_empty!(Error, D));
7606                    }
7607                    #[allow(irrefutable_let_patterns)]
7608                    if let WriteChannelError::Error(ref mut val) = self {
7609                        fidl::decode!(Error, D, val, decoder, _inner_offset, depth)?;
7610                    } else {
7611                        unreachable!()
7612                    }
7613                }
7614                2 => {
7615                    #[allow(irrefutable_let_patterns)]
7616                    if let WriteChannelError::OpErrors(_) = self {
7617                        // Do nothing, read the value into the object
7618                    } else {
7619                        // Initialize `self` to the right variant
7620                        *self = WriteChannelError::OpErrors(fidl::new_empty!(
7621                            fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>,
7622                            D
7623                        ));
7624                    }
7625                    #[allow(irrefutable_let_patterns)]
7626                    if let WriteChannelError::OpErrors(ref mut val) = self {
7627                        fidl::decode!(
7628                            fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>,
7629                            D,
7630                            val,
7631                            decoder,
7632                            _inner_offset,
7633                            depth
7634                        )?;
7635                    } else {
7636                        unreachable!()
7637                    }
7638                }
7639                ordinal => panic!("unexpected ordinal {:?}", ordinal),
7640            }
7641            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7642                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7643            }
7644            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7645                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7646            }
7647            Ok(())
7648        }
7649    }
7650}