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