fidl_fuchsia_posix_socket__common/
fidl_fuchsia_posix_socket__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const DATAGRAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/DatagramSocket";
12
13/// Constant bounding the number of eventpairs returned by Netstack to clients
14/// of the fast protocol.
15///
16/// Set equal to `ZX_WAIT_MANY_MAXIMUM_ITEMS` - 1, where `ZX_WAIT_MANY_MAXIMUM_ITEMS`
17/// is defined in `//zircon/system/public/zircon/types.h` and bounds the number of eventpairs
18/// in a single call to `zx_object_wait_many`. The bias leaves room to allow clients to wait
19/// for errors on the zircon socket in the same call.
20pub const FAST_UDP_WAIT_MANY_MAXIMUM_ITEMS: u32 = 63;
21
22pub const SIGNAL_DATAGRAM_ERROR: u32 = USER_SIGNAL_2 as u32;
23
24pub const SIGNAL_DATAGRAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
25
26pub const SIGNAL_DATAGRAM_OUTGOING: u32 = USER_SIGNAL_1 as u32;
27
28pub const SIGNAL_DATAGRAM_SHUTDOWN_READ: u32 = USER_SIGNAL_4 as u32;
29
30pub const SIGNAL_DATAGRAM_SHUTDOWN_WRITE: u32 = USER_SIGNAL_5 as u32;
31
32pub const SIGNAL_STREAM_CONNECTED: u32 = USER_SIGNAL_3 as u32;
33
34pub const SIGNAL_STREAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
35
36pub const STREAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/StreamSocket";
37
38pub const SYNCHRONOUS_DATAGRAM_SOCKET_PROTOCOL_NAME: &str =
39    "fuchsia.posix.socket/SynchronousDatagramSocket";
40
41pub const USER_SIGNAL_0: u32 = 16777216;
42
43pub const USER_SIGNAL_1: u32 = 33554432;
44
45pub const USER_SIGNAL_2: u32 = 67108864;
46
47pub const USER_SIGNAL_3: u32 = 134217728;
48
49pub const USER_SIGNAL_4: u32 = 268435456;
50
51pub const USER_SIGNAL_5: u32 = 536870912;
52
53bitflags! {
54    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
55    pub struct CmsgRequests: u32 {
56        /// Identifies whether the `IP_RECVTOS` control message is requested.
57        const IP_TOS = 1;
58        /// Identifies whether the `IP_RECVTTL` control message is requested.
59        const IP_TTL = 2;
60        /// Identifies whether the `IPV6_RECVTCLASS` control message is requested.
61        const IPV6_TCLASS = 4;
62        /// Identifies whether the `IPV6_RECVHOPLIMIT` control message is requested.
63        const IPV6_HOPLIMIT = 8;
64        /// Identifies whether the `IPV6_RECVPKTINFO` control message is requested.
65        const IPV6_PKTINFO = 16;
66        /// Identifies whether the `IP_RECVORIGDSTADDR` control message is requested.
67        const IP_RECVORIGDSTADDR = 32;
68    }
69}
70
71impl CmsgRequests {
72    #[inline(always)]
73    pub fn from_bits_allow_unknown(bits: u32) -> Self {
74        Self::from_bits_retain(bits)
75    }
76
77    #[inline(always)]
78    pub fn has_unknown_bits(&self) -> bool {
79        self.get_unknown_bits() != 0
80    }
81
82    #[inline(always)]
83    pub fn get_unknown_bits(&self) -> u32 {
84        self.bits() & !Self::all().bits()
85    }
86}
87
88bitflags! {
89    /// Bits representing the interface flags as returned by the SIOCGIFFLAGS ioctl
90    /// operation. These bitmasks are intended to track the C API definition. For
91    /// example, `InterfaceFlags.UP` corresponds to `IFF_UP`, etc.
92    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
93    pub struct InterfaceFlags: u16 {
94        const UP = 1;
95        const BROADCAST = 2;
96        const DEBUG = 4;
97        const LOOPBACK = 8;
98        const POINTTOPOINT = 16;
99        const NOTRAILERS = 32;
100        const RUNNING = 64;
101        const NOARP = 128;
102        const PROMISC = 256;
103        const ALLMULTI = 512;
104        const LEADER = 1024;
105        const FOLLOWER = 2048;
106        const MULTICAST = 4096;
107        const PORTSEL = 8192;
108        const AUTOMEDIA = 16384;
109        const DYNAMIC = 32768;
110    }
111}
112
113impl InterfaceFlags {}
114
115bitflags! {
116    /// Flags controlling RecvMsg behavior.
117    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
118    pub struct RecvMsgFlags: u16 {
119        /// Returns data from the receive queue without removing from it.
120        ///
121        /// Equivalent to `MSG_PEEK`.
122        const PEEK = 2;
123    }
124}
125
126impl RecvMsgFlags {}
127
128bitflags! {
129    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
130    pub struct SendMsgFlags: u16 {
131        const RESERVED = 32768;
132    }
133}
134
135impl SendMsgFlags {}
136
137bitflags! {
138    /// Socket shutdown mode.
139    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
140    pub struct ShutdownMode: u16 {
141        /// Shutdown socket read endpoint.
142        const READ = 1;
143        /// Shutdown socket write endpoint.
144        const WRITE = 2;
145    }
146}
147
148impl ShutdownMode {}
149
150/// Protocols supported by [`fuchsia.posix.socket/DatagramSocket`].
151///
152/// `DatagramSocketProtocol` enumerates the protocols supported by the network
153/// stack over datagram sockets.
154#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
155#[repr(u32)]
156pub enum DatagramSocketProtocol {
157    /// UDP (User Datagram Protocol).
158    ///
159    /// A UDP socket is equivalent to the POSIX API of `SOCK_DGRAM` with a
160    /// protocol of 0 or `IPPROTO_UDP`.
161    Udp = 1,
162    /// ICMP (Internet Control Message Protocol) echo.
163    ///
164    /// An ICMP echo socket is equivalent to the POSIX API of `SOCK_DGRAM` with
165    /// a protocol of `IPPROTO_ICMP` `IPPROTO_ICMPV6` (depending on provided
166    /// domain).
167    ///
168    /// Datagrams sent over an ICMP echo socket *must* have a valid ICMP or
169    /// ICMPv6 echo header.
170    IcmpEcho = 2,
171}
172
173impl DatagramSocketProtocol {
174    #[inline]
175    pub fn from_primitive(prim: u32) -> Option<Self> {
176        match prim {
177            1 => Some(Self::Udp),
178            2 => Some(Self::IcmpEcho),
179            _ => None,
180        }
181    }
182
183    #[inline]
184    pub const fn into_primitive(self) -> u32 {
185        self as u32
186    }
187}
188
189/// A socket's domain.
190///
191/// Determines the addressing domain for a socket.
192#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
193#[repr(i16)]
194pub enum Domain {
195    /// An IPv4 socket. Equivalent to `AF_INET`.
196    Ipv4 = 0,
197    /// An IPv6 socket. Equivalent to `AF_INET6`.
198    Ipv6 = 1,
199}
200
201impl Domain {
202    #[inline]
203    pub fn from_primitive(prim: i16) -> Option<Self> {
204        match prim {
205            0 => Some(Self::Ipv4),
206            1 => Some(Self::Ipv6),
207            _ => None,
208        }
209    }
210
211    #[inline]
212    pub const fn into_primitive(self) -> i16 {
213        self as i16
214    }
215}
216
217/// Protocols supported by [`fuchsia.posix.socket/StreamSocket`].
218///
219/// `StreamSocketProtocol` enumerates the protocols supported by the network
220/// stack over stream sockets.
221#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
222#[repr(u32)]
223pub enum StreamSocketProtocol {
224    /// TCP (Transmission Control Protocol).
225    ///
226    /// A TCP socket is equivalent to the POSIX API of `SOCK_STREAM` with a
227    /// protocol of 0 or `IPPROTO_TCP`.
228    Tcp = 0,
229}
230
231impl StreamSocketProtocol {
232    #[inline]
233    pub fn from_primitive(prim: u32) -> Option<Self> {
234        match prim {
235            0 => Some(Self::Tcp),
236            _ => None,
237        }
238    }
239
240    #[inline]
241    pub const fn into_primitive(self) -> u32 {
242        self as u32
243    }
244}
245
246/// TCP congestion control modes.
247#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
248#[repr(u32)]
249pub enum TcpCongestionControl {
250    Reno = 1,
251    Cubic = 2,
252}
253
254impl TcpCongestionControl {
255    #[inline]
256    pub fn from_primitive(prim: u32) -> Option<Self> {
257        match prim {
258            1 => Some(Self::Reno),
259            2 => Some(Self::Cubic),
260            _ => None,
261        }
262    }
263
264    #[inline]
265    pub const fn into_primitive(self) -> u32 {
266        self as u32
267    }
268}
269
270/// TCP congestion control state machine state.
271#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
272#[repr(u32)]
273pub enum TcpCongestionControlState {
274    Open = 0,
275    Disorder = 1,
276    CongestionWindowReduced = 2,
277    Recovery = 3,
278    Loss = 4,
279}
280
281impl TcpCongestionControlState {
282    #[inline]
283    pub fn from_primitive(prim: u32) -> Option<Self> {
284        match prim {
285            0 => Some(Self::Open),
286            1 => Some(Self::Disorder),
287            2 => Some(Self::CongestionWindowReduced),
288            3 => Some(Self::Recovery),
289            4 => Some(Self::Loss),
290            _ => None,
291        }
292    }
293
294    #[inline]
295    pub const fn into_primitive(self) -> u32 {
296        self as u32
297    }
298}
299
300/// TCP state machine state.
301#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
302#[repr(u32)]
303pub enum TcpState {
304    Established = 1,
305    SynSent = 2,
306    SynRecv = 3,
307    FinWait1 = 4,
308    FinWait2 = 5,
309    TimeWait = 6,
310    Close = 7,
311    CloseWait = 8,
312    LastAck = 9,
313    Listen = 10,
314    Closing = 11,
315}
316
317impl TcpState {
318    #[inline]
319    pub fn from_primitive(prim: u32) -> Option<Self> {
320        match prim {
321            1 => Some(Self::Established),
322            2 => Some(Self::SynSent),
323            3 => Some(Self::SynRecv),
324            4 => Some(Self::FinWait1),
325            5 => Some(Self::FinWait2),
326            6 => Some(Self::TimeWait),
327            7 => Some(Self::Close),
328            8 => Some(Self::CloseWait),
329            9 => Some(Self::LastAck),
330            10 => Some(Self::Listen),
331            11 => Some(Self::Closing),
332            _ => None,
333        }
334    }
335
336    #[inline]
337    pub const fn into_primitive(self) -> u32 {
338        self as u32
339    }
340}
341
342/// Packet timestamp reporting precision options.
343#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
344#[repr(u32)]
345pub enum TimestampOption {
346    /// Do not report timestamp.
347    Disabled = 0,
348    /// Report timestamp with nanosecond precision.
349    Nanosecond = 1,
350    /// Report timestamp with microsecond precision.
351    Microsecond = 2,
352}
353
354impl TimestampOption {
355    #[inline]
356    pub fn from_primitive(prim: u32) -> Option<Self> {
357        match prim {
358            0 => Some(Self::Disabled),
359            1 => Some(Self::Nanosecond),
360            2 => Some(Self::Microsecond),
361            _ => None,
362        }
363    }
364
365    #[inline]
366    pub const fn into_primitive(self) -> u32 {
367        self as u32
368    }
369}
370
371#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
372pub enum UdpMetadataEncodingProtocolVersion {
373    Zero,
374    #[doc(hidden)]
375    __SourceBreaking {
376        unknown_ordinal: u16,
377    },
378}
379
380/// Pattern that matches an unknown `UdpMetadataEncodingProtocolVersion` member.
381#[macro_export]
382macro_rules! UdpMetadataEncodingProtocolVersionUnknown {
383    () => {
384        _
385    };
386}
387
388impl UdpMetadataEncodingProtocolVersion {
389    #[inline]
390    pub fn from_primitive(prim: u16) -> Option<Self> {
391        match prim {
392            0 => Some(Self::Zero),
393            _ => None,
394        }
395    }
396
397    #[inline]
398    pub fn from_primitive_allow_unknown(prim: u16) -> Self {
399        match prim {
400            0 => Self::Zero,
401            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
402        }
403    }
404
405    #[inline]
406    pub fn unknown() -> Self {
407        Self::__SourceBreaking { unknown_ordinal: 0xffff }
408    }
409
410    #[inline]
411    pub const fn into_primitive(self) -> u16 {
412        match self {
413            Self::Zero => 0,
414            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
415        }
416    }
417
418    #[inline]
419    pub fn is_unknown(&self) -> bool {
420        match self {
421            Self::__SourceBreaking { unknown_ordinal: _ } => true,
422            _ => false,
423        }
424    }
425}
426
427#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
428pub struct BaseDatagramSocketGetInfoResponse {
429    pub domain: Domain,
430    pub proto: DatagramSocketProtocol,
431}
432
433impl fidl::Persistable for BaseDatagramSocketGetInfoResponse {}
434
435#[derive(Clone, Debug, PartialEq)]
436pub struct BaseNetworkSocketAddIpMembershipRequest {
437    pub membership: IpMulticastMembership,
438}
439
440impl fidl::Persistable for BaseNetworkSocketAddIpMembershipRequest {}
441
442#[derive(Clone, Debug, PartialEq)]
443pub struct BaseNetworkSocketAddIpv6MembershipRequest {
444    pub membership: Ipv6MulticastMembership,
445}
446
447impl fidl::Persistable for BaseNetworkSocketAddIpv6MembershipRequest {}
448
449#[derive(Clone, Debug, PartialEq)]
450pub struct BaseNetworkSocketBindRequest {
451    pub addr: fidl_fuchsia_net__common::SocketAddress,
452}
453
454impl fidl::Persistable for BaseNetworkSocketBindRequest {}
455
456#[derive(Clone, Debug, PartialEq)]
457pub struct BaseNetworkSocketConnectRequest {
458    pub addr: fidl_fuchsia_net__common::SocketAddress,
459}
460
461impl fidl::Persistable for BaseNetworkSocketConnectRequest {}
462
463#[derive(Clone, Debug, PartialEq)]
464pub struct BaseNetworkSocketDropIpMembershipRequest {
465    pub membership: IpMulticastMembership,
466}
467
468impl fidl::Persistable for BaseNetworkSocketDropIpMembershipRequest {}
469
470#[derive(Clone, Debug, PartialEq)]
471pub struct BaseNetworkSocketDropIpv6MembershipRequest {
472    pub membership: Ipv6MulticastMembership,
473}
474
475impl fidl::Persistable for BaseNetworkSocketDropIpv6MembershipRequest {}
476
477#[derive(Clone, Debug, PartialEq)]
478pub struct BaseNetworkSocketSetIpMulticastInterfaceRequest {
479    pub iface: u64,
480    pub address: fidl_fuchsia_net__common::Ipv4Address,
481}
482
483impl fidl::Persistable for BaseNetworkSocketSetIpMulticastInterfaceRequest {}
484
485#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
486pub struct BaseNetworkSocketSetIpMulticastLoopbackRequest {
487    pub value: bool,
488}
489
490impl fidl::Persistable for BaseNetworkSocketSetIpMulticastLoopbackRequest {}
491
492#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
493pub struct BaseNetworkSocketSetIpMulticastTtlRequest {
494    pub value: OptionalUint8,
495}
496
497impl fidl::Persistable for BaseNetworkSocketSetIpMulticastTtlRequest {}
498
499#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
500pub struct BaseNetworkSocketSetIpPacketInfoRequest {
501    pub value: bool,
502}
503
504impl fidl::Persistable for BaseNetworkSocketSetIpPacketInfoRequest {}
505
506#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
507pub struct BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {
508    pub value: bool,
509}
510
511impl fidl::Persistable for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {}
512
513#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
514pub struct BaseNetworkSocketSetIpReceiveTtlRequest {
515    pub value: bool,
516}
517
518impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTtlRequest {}
519
520#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
521pub struct BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
522    pub value: bool,
523}
524
525impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {}
526
527#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
528pub struct BaseNetworkSocketSetIpTransparentRequest {
529    pub value: bool,
530}
531
532impl fidl::Persistable for BaseNetworkSocketSetIpTransparentRequest {}
533
534#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
535pub struct BaseNetworkSocketSetIpTtlRequest {
536    pub value: OptionalUint8,
537}
538
539impl fidl::Persistable for BaseNetworkSocketSetIpTtlRequest {}
540
541#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
542#[repr(C)]
543pub struct BaseNetworkSocketSetIpTypeOfServiceRequest {
544    pub value: u8,
545}
546
547impl fidl::Persistable for BaseNetworkSocketSetIpTypeOfServiceRequest {}
548
549#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
550pub struct BaseNetworkSocketSetIpv6MulticastHopsRequest {
551    pub value: OptionalUint8,
552}
553
554impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastHopsRequest {}
555
556#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
557#[repr(C)]
558pub struct BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
559    pub value: u64,
560}
561
562impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {}
563
564#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
565pub struct BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
566    pub value: bool,
567}
568
569impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {}
570
571#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
572pub struct BaseNetworkSocketSetIpv6OnlyRequest {
573    pub value: bool,
574}
575
576impl fidl::Persistable for BaseNetworkSocketSetIpv6OnlyRequest {}
577
578#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
579pub struct BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
580    pub value: bool,
581}
582
583impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {}
584
585#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
586pub struct BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
587    pub value: bool,
588}
589
590impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {}
591
592#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
593pub struct BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
594    pub value: bool,
595}
596
597impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {}
598
599#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
600pub struct BaseNetworkSocketSetIpv6TrafficClassRequest {
601    pub value: OptionalUint8,
602}
603
604impl fidl::Persistable for BaseNetworkSocketSetIpv6TrafficClassRequest {}
605
606#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
607pub struct BaseNetworkSocketSetIpv6UnicastHopsRequest {
608    pub value: OptionalUint8,
609}
610
611impl fidl::Persistable for BaseNetworkSocketSetIpv6UnicastHopsRequest {}
612
613#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
614pub struct BaseNetworkSocketShutdownRequest {
615    pub mode: ShutdownMode,
616}
617
618impl fidl::Persistable for BaseNetworkSocketShutdownRequest {}
619
620#[derive(Clone, Debug, PartialEq)]
621pub struct BaseNetworkSocketGetIpMulticastInterfaceResponse {
622    pub value: fidl_fuchsia_net__common::Ipv4Address,
623}
624
625impl fidl::Persistable for BaseNetworkSocketGetIpMulticastInterfaceResponse {}
626
627#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
628pub struct BaseNetworkSocketGetIpMulticastLoopbackResponse {
629    pub value: bool,
630}
631
632impl fidl::Persistable for BaseNetworkSocketGetIpMulticastLoopbackResponse {}
633
634#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
635#[repr(C)]
636pub struct BaseNetworkSocketGetIpMulticastTtlResponse {
637    pub value: u8,
638}
639
640impl fidl::Persistable for BaseNetworkSocketGetIpMulticastTtlResponse {}
641
642#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
643pub struct BaseNetworkSocketGetIpPacketInfoResponse {
644    pub value: bool,
645}
646
647impl fidl::Persistable for BaseNetworkSocketGetIpPacketInfoResponse {}
648
649#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
650pub struct BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {
651    pub value: bool,
652}
653
654impl fidl::Persistable for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {}
655
656#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
657pub struct BaseNetworkSocketGetIpReceiveTtlResponse {
658    pub value: bool,
659}
660
661impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTtlResponse {}
662
663#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
664pub struct BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
665    pub value: bool,
666}
667
668impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {}
669
670#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
671pub struct BaseNetworkSocketGetIpTransparentResponse {
672    pub value: bool,
673}
674
675impl fidl::Persistable for BaseNetworkSocketGetIpTransparentResponse {}
676
677#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
678#[repr(C)]
679pub struct BaseNetworkSocketGetIpTtlResponse {
680    pub value: u8,
681}
682
683impl fidl::Persistable for BaseNetworkSocketGetIpTtlResponse {}
684
685#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
686#[repr(C)]
687pub struct BaseNetworkSocketGetIpTypeOfServiceResponse {
688    pub value: u8,
689}
690
691impl fidl::Persistable for BaseNetworkSocketGetIpTypeOfServiceResponse {}
692
693#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
694#[repr(C)]
695pub struct BaseNetworkSocketGetIpv6MulticastHopsResponse {
696    pub value: u8,
697}
698
699impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastHopsResponse {}
700
701#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
702#[repr(C)]
703pub struct BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
704    pub value: u64,
705}
706
707impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {}
708
709#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
710pub struct BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
711    pub value: bool,
712}
713
714impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {}
715
716#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
717pub struct BaseNetworkSocketGetIpv6OnlyResponse {
718    pub value: bool,
719}
720
721impl fidl::Persistable for BaseNetworkSocketGetIpv6OnlyResponse {}
722
723#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
724pub struct BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
725    pub value: bool,
726}
727
728impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {}
729
730#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
731pub struct BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
732    pub value: bool,
733}
734
735impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {}
736
737#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
738pub struct BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
739    pub value: bool,
740}
741
742impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {}
743
744#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
745#[repr(C)]
746pub struct BaseNetworkSocketGetIpv6TrafficClassResponse {
747    pub value: u8,
748}
749
750impl fidl::Persistable for BaseNetworkSocketGetIpv6TrafficClassResponse {}
751
752#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
753#[repr(C)]
754pub struct BaseNetworkSocketGetIpv6UnicastHopsResponse {
755    pub value: u8,
756}
757
758impl fidl::Persistable for BaseNetworkSocketGetIpv6UnicastHopsResponse {}
759
760#[derive(Clone, Debug, PartialEq)]
761pub struct BaseNetworkSocketGetOriginalDestinationResponse {
762    pub value: fidl_fuchsia_net__common::SocketAddress,
763}
764
765impl fidl::Persistable for BaseNetworkSocketGetOriginalDestinationResponse {}
766
767#[derive(Clone, Debug, PartialEq)]
768pub struct BaseNetworkSocketGetPeerNameResponse {
769    pub addr: fidl_fuchsia_net__common::SocketAddress,
770}
771
772impl fidl::Persistable for BaseNetworkSocketGetPeerNameResponse {}
773
774#[derive(Clone, Debug, PartialEq)]
775pub struct BaseNetworkSocketGetSockNameResponse {
776    pub addr: fidl_fuchsia_net__common::SocketAddress,
777}
778
779impl fidl::Persistable for BaseNetworkSocketGetSockNameResponse {}
780
781#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
782pub struct BaseSocketGetMarkRequest {
783    pub domain: fidl_fuchsia_net__common::MarkDomain,
784}
785
786impl fidl::Persistable for BaseSocketGetMarkRequest {}
787
788#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
789pub struct BaseSocketSetBindToDeviceRequest {
790    pub value: String,
791}
792
793impl fidl::Persistable for BaseSocketSetBindToDeviceRequest {}
794
795#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
796#[repr(C)]
797pub struct BaseSocketSetBindToInterfaceIndexRequest {
798    pub value: u64,
799}
800
801impl fidl::Persistable for BaseSocketSetBindToInterfaceIndexRequest {}
802
803#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
804pub struct BaseSocketSetBroadcastRequest {
805    pub value: bool,
806}
807
808impl fidl::Persistable for BaseSocketSetBroadcastRequest {}
809
810#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
811pub struct BaseSocketSetKeepAliveRequest {
812    pub value: bool,
813}
814
815impl fidl::Persistable for BaseSocketSetKeepAliveRequest {}
816
817#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
818pub struct BaseSocketSetLingerRequest {
819    pub linger: bool,
820    pub length_secs: u32,
821}
822
823impl fidl::Persistable for BaseSocketSetLingerRequest {}
824
825#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
826pub struct BaseSocketSetMarkRequest {
827    pub domain: fidl_fuchsia_net__common::MarkDomain,
828    pub mark: OptionalUint32,
829}
830
831impl fidl::Persistable for BaseSocketSetMarkRequest {}
832
833#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
834pub struct BaseSocketSetNoCheckRequest {
835    pub value: bool,
836}
837
838impl fidl::Persistable for BaseSocketSetNoCheckRequest {}
839
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841pub struct BaseSocketSetOutOfBandInlineRequest {
842    pub value: bool,
843}
844
845impl fidl::Persistable for BaseSocketSetOutOfBandInlineRequest {}
846
847#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
848#[repr(C)]
849pub struct BaseSocketSetReceiveBufferRequest {
850    pub value_bytes: u64,
851}
852
853impl fidl::Persistable for BaseSocketSetReceiveBufferRequest {}
854
855#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
856pub struct BaseSocketSetReuseAddressRequest {
857    pub value: bool,
858}
859
860impl fidl::Persistable for BaseSocketSetReuseAddressRequest {}
861
862#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
863pub struct BaseSocketSetReusePortRequest {
864    pub value: bool,
865}
866
867impl fidl::Persistable for BaseSocketSetReusePortRequest {}
868
869#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
870#[repr(C)]
871pub struct BaseSocketSetSendBufferRequest {
872    pub value_bytes: u64,
873}
874
875impl fidl::Persistable for BaseSocketSetSendBufferRequest {}
876
877#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
878pub struct BaseSocketSetTimestampRequest {
879    pub value: TimestampOption,
880}
881
882impl fidl::Persistable for BaseSocketSetTimestampRequest {}
883
884#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
885pub struct BaseSocketGetAcceptConnResponse {
886    pub value: bool,
887}
888
889impl fidl::Persistable for BaseSocketGetAcceptConnResponse {}
890
891#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
892pub struct BaseSocketGetBindToDeviceResponse {
893    pub value: String,
894}
895
896impl fidl::Persistable for BaseSocketGetBindToDeviceResponse {}
897
898#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
899#[repr(C)]
900pub struct BaseSocketGetBindToInterfaceIndexResponse {
901    pub value: u64,
902}
903
904impl fidl::Persistable for BaseSocketGetBindToInterfaceIndexResponse {}
905
906#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
907pub struct BaseSocketGetBroadcastResponse {
908    pub value: bool,
909}
910
911impl fidl::Persistable for BaseSocketGetBroadcastResponse {}
912
913#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
914pub struct BaseSocketGetKeepAliveResponse {
915    pub value: bool,
916}
917
918impl fidl::Persistable for BaseSocketGetKeepAliveResponse {}
919
920#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
921pub struct BaseSocketGetLingerResponse {
922    pub linger: bool,
923    pub length_secs: u32,
924}
925
926impl fidl::Persistable for BaseSocketGetLingerResponse {}
927
928#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
929pub struct BaseSocketGetMarkResponse {
930    pub mark: OptionalUint32,
931}
932
933impl fidl::Persistable for BaseSocketGetMarkResponse {}
934
935#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
936pub struct BaseSocketGetNoCheckResponse {
937    pub value: bool,
938}
939
940impl fidl::Persistable for BaseSocketGetNoCheckResponse {}
941
942#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
943pub struct BaseSocketGetOutOfBandInlineResponse {
944    pub value: bool,
945}
946
947impl fidl::Persistable for BaseSocketGetOutOfBandInlineResponse {}
948
949#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
950#[repr(C)]
951pub struct BaseSocketGetReceiveBufferResponse {
952    pub value_bytes: u64,
953}
954
955impl fidl::Persistable for BaseSocketGetReceiveBufferResponse {}
956
957#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
958pub struct BaseSocketGetReuseAddressResponse {
959    pub value: bool,
960}
961
962impl fidl::Persistable for BaseSocketGetReuseAddressResponse {}
963
964#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
965pub struct BaseSocketGetReusePortResponse {
966    pub value: bool,
967}
968
969impl fidl::Persistable for BaseSocketGetReusePortResponse {}
970
971#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
972#[repr(C)]
973pub struct BaseSocketGetSendBufferResponse {
974    pub value_bytes: u64,
975}
976
977impl fidl::Persistable for BaseSocketGetSendBufferResponse {}
978
979#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
980pub struct BaseSocketGetTimestampResponse {
981    pub value: TimestampOption,
982}
983
984impl fidl::Persistable for BaseSocketGetTimestampResponse {}
985
986#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
987pub struct Empty;
988
989impl fidl::Persistable for Empty {}
990
991/// IPv4 multicast membership options.
992#[derive(Clone, Debug, PartialEq)]
993pub struct IpMulticastMembership {
994    /// Interface index for membership.
995    pub iface: u64,
996    /// Local interface address requesting or relinquishing ownership.
997    pub local_addr: fidl_fuchsia_net__common::Ipv4Address,
998    /// Address of the multicast group the membership refers to.
999    pub mcast_addr: fidl_fuchsia_net__common::Ipv4Address,
1000}
1001
1002impl fidl::Persistable for IpMulticastMembership {}
1003
1004/// IPv6 multicast membership options.
1005#[derive(Clone, Debug, PartialEq)]
1006pub struct Ipv6MulticastMembership {
1007    /// Interface index for membership.
1008    pub iface: u64,
1009    /// Address of the multicast group the membership refers to.
1010    pub mcast_addr: fidl_fuchsia_net__common::Ipv6Address,
1011}
1012
1013impl fidl::Persistable for Ipv6MulticastMembership {}
1014
1015#[derive(Clone, Debug, PartialEq)]
1016pub struct Ipv6PktInfoRecvControlData {
1017    /// The index of the interface on which the IP packet was received.
1018    pub iface: u64,
1019    /// The destination address specified in the received packet's IP
1020    /// header.
1021    pub header_destination_addr: fidl_fuchsia_net__common::Ipv6Address,
1022}
1023
1024impl fidl::Persistable for Ipv6PktInfoRecvControlData {}
1025
1026/// IPv6-specific disposition of sent data.
1027///
1028/// This is currently a struct instead of a table as it is meant to match
1029/// `in6_pktinfo` which is not expected to grow.
1030#[derive(Clone, Debug, PartialEq)]
1031pub struct Ipv6PktInfoSendControlData {
1032    /// The interface index from which the IPv6 packet should be sent.
1033    ///
1034    /// 0 indicates that the local interface is unspecified and the
1035    /// stack may choose an appropriate interface.
1036    pub iface: u64,
1037    /// The source address from which the IPv6 packet should be sent.
1038    ///
1039    /// All zeroes indicates that the local address is unspecified and
1040    /// the stack may choose an appropriate address (i.e. the local
1041    /// address to which the socket is bound).
1042    pub local_addr: fidl_fuchsia_net__common::Ipv6Address,
1043}
1044
1045impl fidl::Persistable for Ipv6PktInfoSendControlData {}
1046
1047#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1048pub struct ProviderDatagramSocketDeprecatedRequest {
1049    pub domain: Domain,
1050    pub proto: DatagramSocketProtocol,
1051}
1052
1053impl fidl::Persistable for ProviderDatagramSocketDeprecatedRequest {}
1054
1055#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1056pub struct ProviderDatagramSocketRequest {
1057    pub domain: Domain,
1058    pub proto: DatagramSocketProtocol,
1059}
1060
1061impl fidl::Persistable for ProviderDatagramSocketRequest {}
1062
1063#[derive(Clone, Debug, PartialEq)]
1064pub struct ProviderDatagramSocketWithOptionsRequest {
1065    pub domain: Domain,
1066    pub proto: DatagramSocketProtocol,
1067    pub opts: SocketCreationOptions,
1068}
1069
1070impl fidl::Persistable for ProviderDatagramSocketWithOptionsRequest {}
1071
1072#[derive(Clone, Debug, PartialEq)]
1073pub struct ProviderGetInterfaceAddressesResponse {
1074    pub interfaces: Vec<InterfaceAddresses>,
1075}
1076
1077impl fidl::Persistable for ProviderGetInterfaceAddressesResponse {}
1078
1079#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1080#[repr(C)]
1081pub struct ProviderInterfaceIndexToNameRequest {
1082    pub index: u64,
1083}
1084
1085impl fidl::Persistable for ProviderInterfaceIndexToNameRequest {}
1086
1087#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1088pub struct ProviderInterfaceNameToFlagsRequest {
1089    pub name: String,
1090}
1091
1092impl fidl::Persistable for ProviderInterfaceNameToFlagsRequest {}
1093
1094#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1095pub struct ProviderInterfaceNameToIndexRequest {
1096    pub name: String,
1097}
1098
1099impl fidl::Persistable for ProviderInterfaceNameToIndexRequest {}
1100
1101#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1102pub struct ProviderStreamSocketRequest {
1103    pub domain: Domain,
1104    pub proto: StreamSocketProtocol,
1105}
1106
1107impl fidl::Persistable for ProviderStreamSocketRequest {}
1108
1109#[derive(Clone, Debug, PartialEq)]
1110pub struct ProviderStreamSocketWithOptionsRequest {
1111    pub domain: Domain,
1112    pub proto: StreamSocketProtocol,
1113    pub opts: SocketCreationOptions,
1114}
1115
1116impl fidl::Persistable for ProviderStreamSocketWithOptionsRequest {}
1117
1118#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1119pub struct ProviderInterfaceIndexToNameResponse {
1120    pub name: String,
1121}
1122
1123impl fidl::Persistable for ProviderInterfaceIndexToNameResponse {}
1124
1125#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1126pub struct ProviderInterfaceNameToFlagsResponse {
1127    pub flags: InterfaceFlags,
1128}
1129
1130impl fidl::Persistable for ProviderInterfaceNameToFlagsResponse {}
1131
1132#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1133#[repr(C)]
1134pub struct ProviderInterfaceNameToIndexResponse {
1135    pub index: u64,
1136}
1137
1138impl fidl::Persistable for ProviderInterfaceNameToIndexResponse {}
1139
1140#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1141pub struct StreamSocketAcceptRequest {
1142    pub want_addr: bool,
1143}
1144
1145impl fidl::Persistable for StreamSocketAcceptRequest {}
1146
1147#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1148#[repr(C)]
1149pub struct StreamSocketListenRequest {
1150    pub backlog: i16,
1151}
1152
1153impl fidl::Persistable for StreamSocketListenRequest {}
1154
1155#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1156pub struct StreamSocketSetTcpCongestionRequest {
1157    pub value: TcpCongestionControl,
1158}
1159
1160impl fidl::Persistable for StreamSocketSetTcpCongestionRequest {}
1161
1162#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1163pub struct StreamSocketSetTcpCorkRequest {
1164    pub value: bool,
1165}
1166
1167impl fidl::Persistable for StreamSocketSetTcpCorkRequest {}
1168
1169#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1170#[repr(C)]
1171pub struct StreamSocketSetTcpDeferAcceptRequest {
1172    pub value_secs: u32,
1173}
1174
1175impl fidl::Persistable for StreamSocketSetTcpDeferAcceptRequest {}
1176
1177#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1178#[repr(C)]
1179pub struct StreamSocketSetTcpKeepAliveCountRequest {
1180    pub value: u32,
1181}
1182
1183impl fidl::Persistable for StreamSocketSetTcpKeepAliveCountRequest {}
1184
1185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1186#[repr(C)]
1187pub struct StreamSocketSetTcpKeepAliveIdleRequest {
1188    pub value_secs: u32,
1189}
1190
1191impl fidl::Persistable for StreamSocketSetTcpKeepAliveIdleRequest {}
1192
1193#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1194#[repr(C)]
1195pub struct StreamSocketSetTcpKeepAliveIntervalRequest {
1196    pub value_secs: u32,
1197}
1198
1199impl fidl::Persistable for StreamSocketSetTcpKeepAliveIntervalRequest {}
1200
1201#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1202pub struct StreamSocketSetTcpLingerRequest {
1203    pub value_secs: OptionalUint32,
1204}
1205
1206impl fidl::Persistable for StreamSocketSetTcpLingerRequest {}
1207
1208#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1209#[repr(C)]
1210pub struct StreamSocketSetTcpMaxSegmentRequest {
1211    pub value_bytes: u32,
1212}
1213
1214impl fidl::Persistable for StreamSocketSetTcpMaxSegmentRequest {}
1215
1216#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1217pub struct StreamSocketSetTcpNoDelayRequest {
1218    pub value: bool,
1219}
1220
1221impl fidl::Persistable for StreamSocketSetTcpNoDelayRequest {}
1222
1223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1224pub struct StreamSocketSetTcpQuickAckRequest {
1225    pub value: bool,
1226}
1227
1228impl fidl::Persistable for StreamSocketSetTcpQuickAckRequest {}
1229
1230#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1231#[repr(C)]
1232pub struct StreamSocketSetTcpSynCountRequest {
1233    pub value: u32,
1234}
1235
1236impl fidl::Persistable for StreamSocketSetTcpSynCountRequest {}
1237
1238#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1239#[repr(C)]
1240pub struct StreamSocketSetTcpUserTimeoutRequest {
1241    pub value_millis: u32,
1242}
1243
1244impl fidl::Persistable for StreamSocketSetTcpUserTimeoutRequest {}
1245
1246#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1247#[repr(C)]
1248pub struct StreamSocketSetTcpWindowClampRequest {
1249    pub value: u32,
1250}
1251
1252impl fidl::Persistable for StreamSocketSetTcpWindowClampRequest {}
1253
1254#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1255pub struct StreamSocketGetInfoResponse {
1256    pub domain: Domain,
1257    pub proto: StreamSocketProtocol,
1258}
1259
1260impl fidl::Persistable for StreamSocketGetInfoResponse {}
1261
1262#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1263pub struct StreamSocketGetTcpCongestionResponse {
1264    pub value: TcpCongestionControl,
1265}
1266
1267impl fidl::Persistable for StreamSocketGetTcpCongestionResponse {}
1268
1269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1270pub struct StreamSocketGetTcpCorkResponse {
1271    pub value: bool,
1272}
1273
1274impl fidl::Persistable for StreamSocketGetTcpCorkResponse {}
1275
1276#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1277#[repr(C)]
1278pub struct StreamSocketGetTcpDeferAcceptResponse {
1279    pub value_secs: u32,
1280}
1281
1282impl fidl::Persistable for StreamSocketGetTcpDeferAcceptResponse {}
1283
1284#[derive(Clone, Debug, PartialEq)]
1285pub struct StreamSocketGetTcpInfoResponse {
1286    pub info: TcpInfo,
1287}
1288
1289impl fidl::Persistable for StreamSocketGetTcpInfoResponse {}
1290
1291#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1292#[repr(C)]
1293pub struct StreamSocketGetTcpKeepAliveCountResponse {
1294    pub value: u32,
1295}
1296
1297impl fidl::Persistable for StreamSocketGetTcpKeepAliveCountResponse {}
1298
1299#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1300#[repr(C)]
1301pub struct StreamSocketGetTcpKeepAliveIdleResponse {
1302    pub value_secs: u32,
1303}
1304
1305impl fidl::Persistable for StreamSocketGetTcpKeepAliveIdleResponse {}
1306
1307#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1308#[repr(C)]
1309pub struct StreamSocketGetTcpKeepAliveIntervalResponse {
1310    pub value_secs: u32,
1311}
1312
1313impl fidl::Persistable for StreamSocketGetTcpKeepAliveIntervalResponse {}
1314
1315#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1316pub struct StreamSocketGetTcpLingerResponse {
1317    pub value_secs: OptionalUint32,
1318}
1319
1320impl fidl::Persistable for StreamSocketGetTcpLingerResponse {}
1321
1322#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1323#[repr(C)]
1324pub struct StreamSocketGetTcpMaxSegmentResponse {
1325    pub value_bytes: u32,
1326}
1327
1328impl fidl::Persistable for StreamSocketGetTcpMaxSegmentResponse {}
1329
1330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1331pub struct StreamSocketGetTcpNoDelayResponse {
1332    pub value: bool,
1333}
1334
1335impl fidl::Persistable for StreamSocketGetTcpNoDelayResponse {}
1336
1337#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1338pub struct StreamSocketGetTcpQuickAckResponse {
1339    pub value: bool,
1340}
1341
1342impl fidl::Persistable for StreamSocketGetTcpQuickAckResponse {}
1343
1344#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1345#[repr(C)]
1346pub struct StreamSocketGetTcpSynCountResponse {
1347    pub value: u32,
1348}
1349
1350impl fidl::Persistable for StreamSocketGetTcpSynCountResponse {}
1351
1352#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1353#[repr(C)]
1354pub struct StreamSocketGetTcpUserTimeoutResponse {
1355    pub value_millis: u32,
1356}
1357
1358impl fidl::Persistable for StreamSocketGetTcpUserTimeoutResponse {}
1359
1360#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1361#[repr(C)]
1362pub struct StreamSocketGetTcpWindowClampResponse {
1363    pub value: u32,
1364}
1365
1366impl fidl::Persistable for StreamSocketGetTcpWindowClampResponse {}
1367
1368#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1369pub struct SynchronousDatagramSocketRecvMsgRequest {
1370    pub want_addr: bool,
1371    pub data_len: u32,
1372    pub want_control: bool,
1373    pub flags: RecvMsgFlags,
1374}
1375
1376impl fidl::Persistable for SynchronousDatagramSocketRecvMsgRequest {}
1377
1378#[derive(Clone, Debug, PartialEq)]
1379pub struct SynchronousDatagramSocketSendMsgRequest {
1380    pub addr: Option<Box<fidl_fuchsia_net__common::SocketAddress>>,
1381    pub data: Vec<u8>,
1382    pub control: DatagramSocketSendControlData,
1383    pub flags: SendMsgFlags,
1384}
1385
1386impl fidl::Persistable for SynchronousDatagramSocketSendMsgRequest {}
1387
1388#[derive(Clone, Debug, PartialEq)]
1389pub struct SynchronousDatagramSocketRecvMsgResponse {
1390    pub addr: Option<Box<fidl_fuchsia_net__common::SocketAddress>>,
1391    pub data: Vec<u8>,
1392    pub control: DatagramSocketRecvControlData,
1393    pub truncated: u32,
1394}
1395
1396impl fidl::Persistable for SynchronousDatagramSocketRecvMsgResponse {}
1397
1398#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1399#[repr(C)]
1400pub struct SynchronousDatagramSocketSendMsgResponse {
1401    pub len: i64,
1402}
1403
1404impl fidl::Persistable for SynchronousDatagramSocketSendMsgResponse {}
1405
1406#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1407pub struct Timestamp {
1408    /// Time in nanoseconds since epoch (January 1 1970 GMT).
1409    pub nanoseconds: i64,
1410    /// Identifies whether/how the timestamp should be returned to the user.
1411    /// Ignored in the DatagramSocket protocol.
1412    pub requested: TimestampOption,
1413}
1414
1415impl fidl::Persistable for Timestamp {}
1416
1417#[derive(Clone, Debug, Default, PartialEq)]
1418pub struct DatagramSocketRecvControlData {
1419    /// Network socket ancillary data.
1420    pub network: Option<NetworkSocketRecvControlData>,
1421    #[doc(hidden)]
1422    pub __source_breaking: fidl::marker::SourceBreaking,
1423}
1424
1425impl fidl::Persistable for DatagramSocketRecvControlData {}
1426
1427#[derive(Clone, Debug, Default, PartialEq)]
1428pub struct DatagramSocketSendControlData {
1429    /// Network socket ancillary data.
1430    pub network: Option<NetworkSocketSendControlData>,
1431    #[doc(hidden)]
1432    pub __source_breaking: fidl::marker::SourceBreaking,
1433}
1434
1435impl fidl::Persistable for DatagramSocketSendControlData {}
1436
1437#[derive(Clone, Debug, Default, PartialEq)]
1438pub struct DatagramSocketSendMsgPreflightRequest {
1439    /// The destination address.
1440    ///
1441    /// If absent, interpreted as the method receiver's connected address and
1442    /// causes the connected address to be returned.
1443    ///
1444    /// Required if the method receiver is not connected.
1445    pub to: Option<fidl_fuchsia_net__common::SocketAddress>,
1446    /// Information controlling the local interface and/or address used when
1447    /// sending an IPv6 packet.
1448    ///
1449    /// If absent, indicates that the stack is free to choose an appropriate
1450    /// outgoing route.
1451    pub ipv6_pktinfo: Option<Ipv6PktInfoSendControlData>,
1452    #[doc(hidden)]
1453    pub __source_breaking: fidl::marker::SourceBreaking,
1454}
1455
1456impl fidl::Persistable for DatagramSocketSendMsgPreflightRequest {}
1457
1458/// Holds information about an interface and its addresses.
1459#[derive(Clone, Debug, Default, PartialEq)]
1460pub struct InterfaceAddresses {
1461    /// ID of the interface.
1462    pub id: Option<u64>,
1463    /// Name of the interface.
1464    pub name: Option<String>,
1465    /// All addresses currently assigned to the interface.
1466    pub addresses: Option<Vec<fidl_fuchsia_net__common::Subnet>>,
1467    /// Contains the interface flags, as returned by the SIOCGIFFLAGS ioctl
1468    /// operation.
1469    pub interface_flags: Option<InterfaceFlags>,
1470    #[doc(hidden)]
1471    pub __source_breaking: fidl::marker::SourceBreaking,
1472}
1473
1474impl fidl::Persistable for InterfaceAddresses {}
1475
1476#[derive(Clone, Debug, Default, PartialEq)]
1477pub struct IpRecvControlData {
1478    /// The Type of Service value found in a received packet's IPv4 header.
1479    ///
1480    /// Present if the `SOL_IP` -> `IP_RECVTOS` option is enabled.
1481    pub tos: Option<u8>,
1482    /// The Time to Live value found in a received packet's IPv4 header.
1483    ///
1484    /// Present if the `SOL_IP` -> `IP_RECVTTL` option is enabled.
1485    pub ttl: Option<u8>,
1486    /// The original destination address.
1487    ///
1488    /// Present if the `SOL_IP` -> `IP_RECVORIGDSTADDR` option is enabled.
1489    pub original_destination_address: Option<fidl_fuchsia_net__common::SocketAddress>,
1490    #[doc(hidden)]
1491    pub __source_breaking: fidl::marker::SourceBreaking,
1492}
1493
1494impl fidl::Persistable for IpRecvControlData {}
1495
1496#[derive(Clone, Debug, Default, PartialEq)]
1497pub struct IpSendControlData {
1498    /// The Time to Live value to set in the IPv4 header of an outgoing
1499    /// packet.
1500    pub ttl: Option<u8>,
1501    #[doc(hidden)]
1502    pub __source_breaking: fidl::marker::SourceBreaking,
1503}
1504
1505impl fidl::Persistable for IpSendControlData {}
1506
1507#[derive(Clone, Debug, Default, PartialEq)]
1508pub struct Ipv6RecvControlData {
1509    /// The Traffic Class of a packet that was received.
1510    ///
1511    /// Present if the `SOL_IPV6` -> `IPV6_RECVTCLASS` option is enabled.
1512    pub tclass: Option<u8>,
1513    /// The Hop Limit of a packet that was received.
1514    ///
1515    /// Present if the `SOL_IPV6` -> `IPV6_RECVHOPLIMIT` option is enabled.
1516    pub hoplimit: Option<u8>,
1517    /// The packet information of a packet that was received.
1518    ///
1519    /// Present if the `SOL_IPV6` -> `IPV6_RECVPKTINFO` option is enabled.
1520    pub pktinfo: Option<Ipv6PktInfoRecvControlData>,
1521    #[doc(hidden)]
1522    pub __source_breaking: fidl::marker::SourceBreaking,
1523}
1524
1525impl fidl::Persistable for Ipv6RecvControlData {}
1526
1527#[derive(Clone, Debug, Default, PartialEq)]
1528pub struct Ipv6SendControlData {
1529    /// The Hop Limit value to set in the IPv6 header of an outgoing
1530    /// packet.
1531    pub hoplimit: Option<u8>,
1532    /// Information controlling the local interface and/or address used when
1533    /// sending an IPv6 packet.
1534    pub pktinfo: Option<Ipv6PktInfoSendControlData>,
1535    #[doc(hidden)]
1536    pub __source_breaking: fidl::marker::SourceBreaking,
1537}
1538
1539impl fidl::Persistable for Ipv6SendControlData {}
1540
1541/// Network socket (L3) ancillary data that can be received.
1542#[derive(Clone, Debug, Default, PartialEq)]
1543pub struct NetworkSocketRecvControlData {
1544    /// Socket level ancillary data.
1545    pub socket: Option<SocketRecvControlData>,
1546    /// IPv4 level ancillary data.
1547    ///
1548    /// These match POSIX `SOL_IP` control messages.
1549    pub ip: Option<IpRecvControlData>,
1550    /// IPv6 level ancillary data.
1551    ///
1552    /// These match POSIX `SOL_IPV6` control messages.
1553    pub ipv6: Option<Ipv6RecvControlData>,
1554    #[doc(hidden)]
1555    pub __source_breaking: fidl::marker::SourceBreaking,
1556}
1557
1558impl fidl::Persistable for NetworkSocketRecvControlData {}
1559
1560/// Network socket (L3) ancillary data that can be sent.
1561#[derive(Clone, Debug, Default, PartialEq)]
1562pub struct NetworkSocketSendControlData {
1563    /// Socket level ancillary data.
1564    pub socket: Option<SocketSendControlData>,
1565    /// IPv4 level ancillary data.
1566    ///
1567    /// These match POSIX `SOL_IP` control messages.
1568    pub ip: Option<IpSendControlData>,
1569    /// IPv6 level ancillary data.
1570    ///
1571    /// These match POSIX `SOL_IPV6` control messages.
1572    pub ipv6: Option<Ipv6SendControlData>,
1573    #[doc(hidden)]
1574    pub __source_breaking: fidl::marker::SourceBreaking,
1575}
1576
1577impl fidl::Persistable for NetworkSocketSendControlData {}
1578
1579/// Metadata of a received datagram.
1580#[derive(Clone, Debug, Default, PartialEq)]
1581pub struct RecvMsgMeta {
1582    /// The from address of the datagram.
1583    pub from: Option<fidl_fuchsia_net__common::SocketAddress>,
1584    /// Ancillary control message data describing the datagram.
1585    pub control: Option<DatagramSocketRecvControlData>,
1586    /// The length of the payload, in bytes.
1587    pub payload_len: Option<u16>,
1588    #[doc(hidden)]
1589    pub __source_breaking: fidl::marker::SourceBreaking,
1590}
1591
1592impl fidl::Persistable for RecvMsgMeta {}
1593
1594/// Metadata of a sent datagram.
1595#[derive(Clone, Debug, Default, PartialEq)]
1596pub struct SendMsgMeta {
1597    /// The destination address, if specified.
1598    pub to: Option<fidl_fuchsia_net__common::SocketAddress>,
1599    /// Ancillary control message data used for sending the payload.
1600    pub control: Option<DatagramSocketSendControlData>,
1601    #[doc(hidden)]
1602    pub __source_breaking: fidl::marker::SourceBreaking,
1603}
1604
1605impl fidl::Persistable for SendMsgMeta {}
1606
1607/// Options that can be provided at socket creation.
1608#[derive(Clone, Debug, Default, PartialEq)]
1609pub struct SocketCreationOptions {
1610    /// The marks for the created socket. If a mark is missing from the table,
1611    /// it will remain unset for the created socket.
1612    pub marks: Option<fidl_fuchsia_net__common::Marks>,
1613    #[doc(hidden)]
1614    pub __source_breaking: fidl::marker::SourceBreaking,
1615}
1616
1617impl fidl::Persistable for SocketCreationOptions {}
1618
1619/// Socket level ancillary data that can be received.
1620///
1621/// These match control messages with a `SOL_SOCKET` level.
1622#[derive(Clone, Debug, Default, PartialEq)]
1623pub struct SocketRecvControlData {
1624    /// Data about the time at which the packet was received.
1625    pub timestamp: Option<Timestamp>,
1626    #[doc(hidden)]
1627    pub __source_breaking: fidl::marker::SourceBreaking,
1628}
1629
1630impl fidl::Persistable for SocketRecvControlData {}
1631
1632/// Socket level ancillary data that can be sent.
1633///
1634/// These match the POSIX `SOL_SOCKET` control messages.
1635#[derive(Clone, Debug, Default, PartialEq)]
1636pub struct SocketSendControlData {
1637    #[doc(hidden)]
1638    pub __source_breaking: fidl::marker::SourceBreaking,
1639}
1640
1641impl fidl::Persistable for SocketSendControlData {}
1642
1643/// TCP protocol state.
1644#[derive(Clone, Debug, Default, PartialEq)]
1645pub struct TcpInfo {
1646    pub state: Option<TcpState>,
1647    pub ca_state: Option<TcpCongestionControlState>,
1648    pub rto_usec: Option<u32>,
1649    pub rtt_usec: Option<u32>,
1650    pub rtt_var_usec: Option<u32>,
1651    pub snd_ssthresh: Option<u32>,
1652    pub snd_cwnd: Option<u32>,
1653    pub reorder_seen: Option<bool>,
1654    #[doc(hidden)]
1655    pub __source_breaking: fidl::marker::SourceBreaking,
1656}
1657
1658impl fidl::Persistable for TcpInfo {}
1659
1660/// An optional uint32 value.
1661#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1662pub enum OptionalUint32 {
1663    Value(u32),
1664    Unset(Empty),
1665}
1666
1667impl OptionalUint32 {
1668    #[inline]
1669    pub fn ordinal(&self) -> u64 {
1670        match *self {
1671            Self::Value(_) => 1,
1672            Self::Unset(_) => 2,
1673        }
1674    }
1675}
1676
1677impl fidl::Persistable for OptionalUint32 {}
1678
1679/// An optional byte value.
1680#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1681pub enum OptionalUint8 {
1682    Value(u8),
1683    Unset(Empty),
1684}
1685
1686impl OptionalUint8 {
1687    #[inline]
1688    pub fn ordinal(&self) -> u64 {
1689        match *self {
1690            Self::Value(_) => 1,
1691            Self::Unset(_) => 2,
1692        }
1693    }
1694}
1695
1696impl fidl::Persistable for OptionalUint8 {}
1697
1698mod internal {
1699    use super::*;
1700    unsafe impl fidl::encoding::TypeMarker for CmsgRequests {
1701        type Owned = Self;
1702
1703        #[inline(always)]
1704        fn inline_align(_context: fidl::encoding::Context) -> usize {
1705            4
1706        }
1707
1708        #[inline(always)]
1709        fn inline_size(_context: fidl::encoding::Context) -> usize {
1710            4
1711        }
1712    }
1713
1714    impl fidl::encoding::ValueTypeMarker for CmsgRequests {
1715        type Borrowed<'a> = Self;
1716        #[inline(always)]
1717        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1718            *value
1719        }
1720    }
1721
1722    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CmsgRequests {
1723        #[inline]
1724        unsafe fn encode(
1725            self,
1726            encoder: &mut fidl::encoding::Encoder<'_, D>,
1727            offset: usize,
1728            _depth: fidl::encoding::Depth,
1729        ) -> fidl::Result<()> {
1730            encoder.debug_check_bounds::<Self>(offset);
1731            encoder.write_num(self.bits(), offset);
1732            Ok(())
1733        }
1734    }
1735
1736    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CmsgRequests {
1737        #[inline(always)]
1738        fn new_empty() -> Self {
1739            Self::empty()
1740        }
1741
1742        #[inline]
1743        unsafe fn decode(
1744            &mut self,
1745            decoder: &mut fidl::encoding::Decoder<'_, D>,
1746            offset: usize,
1747            _depth: fidl::encoding::Depth,
1748        ) -> fidl::Result<()> {
1749            decoder.debug_check_bounds::<Self>(offset);
1750            let prim = decoder.read_num::<u32>(offset);
1751            *self = Self::from_bits_allow_unknown(prim);
1752            Ok(())
1753        }
1754    }
1755    unsafe impl fidl::encoding::TypeMarker for InterfaceFlags {
1756        type Owned = Self;
1757
1758        #[inline(always)]
1759        fn inline_align(_context: fidl::encoding::Context) -> usize {
1760            2
1761        }
1762
1763        #[inline(always)]
1764        fn inline_size(_context: fidl::encoding::Context) -> usize {
1765            2
1766        }
1767    }
1768
1769    impl fidl::encoding::ValueTypeMarker for InterfaceFlags {
1770        type Borrowed<'a> = Self;
1771        #[inline(always)]
1772        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1773            *value
1774        }
1775    }
1776
1777    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for InterfaceFlags {
1778        #[inline]
1779        unsafe fn encode(
1780            self,
1781            encoder: &mut fidl::encoding::Encoder<'_, D>,
1782            offset: usize,
1783            _depth: fidl::encoding::Depth,
1784        ) -> fidl::Result<()> {
1785            encoder.debug_check_bounds::<Self>(offset);
1786            if self.bits() & Self::all().bits() != self.bits() {
1787                return Err(fidl::Error::InvalidBitsValue);
1788            }
1789            encoder.write_num(self.bits(), offset);
1790            Ok(())
1791        }
1792    }
1793
1794    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceFlags {
1795        #[inline(always)]
1796        fn new_empty() -> Self {
1797            Self::empty()
1798        }
1799
1800        #[inline]
1801        unsafe fn decode(
1802            &mut self,
1803            decoder: &mut fidl::encoding::Decoder<'_, D>,
1804            offset: usize,
1805            _depth: fidl::encoding::Depth,
1806        ) -> fidl::Result<()> {
1807            decoder.debug_check_bounds::<Self>(offset);
1808            let prim = decoder.read_num::<u16>(offset);
1809            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1810            Ok(())
1811        }
1812    }
1813    unsafe impl fidl::encoding::TypeMarker for RecvMsgFlags {
1814        type Owned = Self;
1815
1816        #[inline(always)]
1817        fn inline_align(_context: fidl::encoding::Context) -> usize {
1818            2
1819        }
1820
1821        #[inline(always)]
1822        fn inline_size(_context: fidl::encoding::Context) -> usize {
1823            2
1824        }
1825    }
1826
1827    impl fidl::encoding::ValueTypeMarker for RecvMsgFlags {
1828        type Borrowed<'a> = Self;
1829        #[inline(always)]
1830        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1831            *value
1832        }
1833    }
1834
1835    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RecvMsgFlags {
1836        #[inline]
1837        unsafe fn encode(
1838            self,
1839            encoder: &mut fidl::encoding::Encoder<'_, D>,
1840            offset: usize,
1841            _depth: fidl::encoding::Depth,
1842        ) -> fidl::Result<()> {
1843            encoder.debug_check_bounds::<Self>(offset);
1844            if self.bits() & Self::all().bits() != self.bits() {
1845                return Err(fidl::Error::InvalidBitsValue);
1846            }
1847            encoder.write_num(self.bits(), offset);
1848            Ok(())
1849        }
1850    }
1851
1852    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgFlags {
1853        #[inline(always)]
1854        fn new_empty() -> Self {
1855            Self::empty()
1856        }
1857
1858        #[inline]
1859        unsafe fn decode(
1860            &mut self,
1861            decoder: &mut fidl::encoding::Decoder<'_, D>,
1862            offset: usize,
1863            _depth: fidl::encoding::Depth,
1864        ) -> fidl::Result<()> {
1865            decoder.debug_check_bounds::<Self>(offset);
1866            let prim = decoder.read_num::<u16>(offset);
1867            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1868            Ok(())
1869        }
1870    }
1871    unsafe impl fidl::encoding::TypeMarker for SendMsgFlags {
1872        type Owned = Self;
1873
1874        #[inline(always)]
1875        fn inline_align(_context: fidl::encoding::Context) -> usize {
1876            2
1877        }
1878
1879        #[inline(always)]
1880        fn inline_size(_context: fidl::encoding::Context) -> usize {
1881            2
1882        }
1883    }
1884
1885    impl fidl::encoding::ValueTypeMarker for SendMsgFlags {
1886        type Borrowed<'a> = Self;
1887        #[inline(always)]
1888        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1889            *value
1890        }
1891    }
1892
1893    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SendMsgFlags {
1894        #[inline]
1895        unsafe fn encode(
1896            self,
1897            encoder: &mut fidl::encoding::Encoder<'_, D>,
1898            offset: usize,
1899            _depth: fidl::encoding::Depth,
1900        ) -> fidl::Result<()> {
1901            encoder.debug_check_bounds::<Self>(offset);
1902            if self.bits() & Self::all().bits() != self.bits() {
1903                return Err(fidl::Error::InvalidBitsValue);
1904            }
1905            encoder.write_num(self.bits(), offset);
1906            Ok(())
1907        }
1908    }
1909
1910    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgFlags {
1911        #[inline(always)]
1912        fn new_empty() -> Self {
1913            Self::empty()
1914        }
1915
1916        #[inline]
1917        unsafe fn decode(
1918            &mut self,
1919            decoder: &mut fidl::encoding::Decoder<'_, D>,
1920            offset: usize,
1921            _depth: fidl::encoding::Depth,
1922        ) -> fidl::Result<()> {
1923            decoder.debug_check_bounds::<Self>(offset);
1924            let prim = decoder.read_num::<u16>(offset);
1925            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1926            Ok(())
1927        }
1928    }
1929    unsafe impl fidl::encoding::TypeMarker for ShutdownMode {
1930        type Owned = Self;
1931
1932        #[inline(always)]
1933        fn inline_align(_context: fidl::encoding::Context) -> usize {
1934            2
1935        }
1936
1937        #[inline(always)]
1938        fn inline_size(_context: fidl::encoding::Context) -> usize {
1939            2
1940        }
1941    }
1942
1943    impl fidl::encoding::ValueTypeMarker for ShutdownMode {
1944        type Borrowed<'a> = Self;
1945        #[inline(always)]
1946        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1947            *value
1948        }
1949    }
1950
1951    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShutdownMode {
1952        #[inline]
1953        unsafe fn encode(
1954            self,
1955            encoder: &mut fidl::encoding::Encoder<'_, D>,
1956            offset: usize,
1957            _depth: fidl::encoding::Depth,
1958        ) -> fidl::Result<()> {
1959            encoder.debug_check_bounds::<Self>(offset);
1960            if self.bits() & Self::all().bits() != self.bits() {
1961                return Err(fidl::Error::InvalidBitsValue);
1962            }
1963            encoder.write_num(self.bits(), offset);
1964            Ok(())
1965        }
1966    }
1967
1968    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShutdownMode {
1969        #[inline(always)]
1970        fn new_empty() -> Self {
1971            Self::empty()
1972        }
1973
1974        #[inline]
1975        unsafe fn decode(
1976            &mut self,
1977            decoder: &mut fidl::encoding::Decoder<'_, D>,
1978            offset: usize,
1979            _depth: fidl::encoding::Depth,
1980        ) -> fidl::Result<()> {
1981            decoder.debug_check_bounds::<Self>(offset);
1982            let prim = decoder.read_num::<u16>(offset);
1983            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1984            Ok(())
1985        }
1986    }
1987    unsafe impl fidl::encoding::TypeMarker for DatagramSocketProtocol {
1988        type Owned = Self;
1989
1990        #[inline(always)]
1991        fn inline_align(_context: fidl::encoding::Context) -> usize {
1992            std::mem::align_of::<u32>()
1993        }
1994
1995        #[inline(always)]
1996        fn inline_size(_context: fidl::encoding::Context) -> usize {
1997            std::mem::size_of::<u32>()
1998        }
1999
2000        #[inline(always)]
2001        fn encode_is_copy() -> bool {
2002            true
2003        }
2004
2005        #[inline(always)]
2006        fn decode_is_copy() -> bool {
2007            false
2008        }
2009    }
2010
2011    impl fidl::encoding::ValueTypeMarker for DatagramSocketProtocol {
2012        type Borrowed<'a> = Self;
2013        #[inline(always)]
2014        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2015            *value
2016        }
2017    }
2018
2019    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2020        for DatagramSocketProtocol
2021    {
2022        #[inline]
2023        unsafe fn encode(
2024            self,
2025            encoder: &mut fidl::encoding::Encoder<'_, D>,
2026            offset: usize,
2027            _depth: fidl::encoding::Depth,
2028        ) -> fidl::Result<()> {
2029            encoder.debug_check_bounds::<Self>(offset);
2030            encoder.write_num(self.into_primitive(), offset);
2031            Ok(())
2032        }
2033    }
2034
2035    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2036        for DatagramSocketProtocol
2037    {
2038        #[inline(always)]
2039        fn new_empty() -> Self {
2040            Self::Udp
2041        }
2042
2043        #[inline]
2044        unsafe fn decode(
2045            &mut self,
2046            decoder: &mut fidl::encoding::Decoder<'_, D>,
2047            offset: usize,
2048            _depth: fidl::encoding::Depth,
2049        ) -> fidl::Result<()> {
2050            decoder.debug_check_bounds::<Self>(offset);
2051            let prim = decoder.read_num::<u32>(offset);
2052
2053            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2054            Ok(())
2055        }
2056    }
2057    unsafe impl fidl::encoding::TypeMarker for Domain {
2058        type Owned = Self;
2059
2060        #[inline(always)]
2061        fn inline_align(_context: fidl::encoding::Context) -> usize {
2062            std::mem::align_of::<i16>()
2063        }
2064
2065        #[inline(always)]
2066        fn inline_size(_context: fidl::encoding::Context) -> usize {
2067            std::mem::size_of::<i16>()
2068        }
2069
2070        #[inline(always)]
2071        fn encode_is_copy() -> bool {
2072            true
2073        }
2074
2075        #[inline(always)]
2076        fn decode_is_copy() -> bool {
2077            false
2078        }
2079    }
2080
2081    impl fidl::encoding::ValueTypeMarker for Domain {
2082        type Borrowed<'a> = Self;
2083        #[inline(always)]
2084        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2085            *value
2086        }
2087    }
2088
2089    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Domain {
2090        #[inline]
2091        unsafe fn encode(
2092            self,
2093            encoder: &mut fidl::encoding::Encoder<'_, D>,
2094            offset: usize,
2095            _depth: fidl::encoding::Depth,
2096        ) -> fidl::Result<()> {
2097            encoder.debug_check_bounds::<Self>(offset);
2098            encoder.write_num(self.into_primitive(), offset);
2099            Ok(())
2100        }
2101    }
2102
2103    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Domain {
2104        #[inline(always)]
2105        fn new_empty() -> Self {
2106            Self::Ipv4
2107        }
2108
2109        #[inline]
2110        unsafe fn decode(
2111            &mut self,
2112            decoder: &mut fidl::encoding::Decoder<'_, D>,
2113            offset: usize,
2114            _depth: fidl::encoding::Depth,
2115        ) -> fidl::Result<()> {
2116            decoder.debug_check_bounds::<Self>(offset);
2117            let prim = decoder.read_num::<i16>(offset);
2118
2119            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2120            Ok(())
2121        }
2122    }
2123    unsafe impl fidl::encoding::TypeMarker for StreamSocketProtocol {
2124        type Owned = Self;
2125
2126        #[inline(always)]
2127        fn inline_align(_context: fidl::encoding::Context) -> usize {
2128            std::mem::align_of::<u32>()
2129        }
2130
2131        #[inline(always)]
2132        fn inline_size(_context: fidl::encoding::Context) -> usize {
2133            std::mem::size_of::<u32>()
2134        }
2135
2136        #[inline(always)]
2137        fn encode_is_copy() -> bool {
2138            true
2139        }
2140
2141        #[inline(always)]
2142        fn decode_is_copy() -> bool {
2143            false
2144        }
2145    }
2146
2147    impl fidl::encoding::ValueTypeMarker for StreamSocketProtocol {
2148        type Borrowed<'a> = Self;
2149        #[inline(always)]
2150        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2151            *value
2152        }
2153    }
2154
2155    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2156        for StreamSocketProtocol
2157    {
2158        #[inline]
2159        unsafe fn encode(
2160            self,
2161            encoder: &mut fidl::encoding::Encoder<'_, D>,
2162            offset: usize,
2163            _depth: fidl::encoding::Depth,
2164        ) -> fidl::Result<()> {
2165            encoder.debug_check_bounds::<Self>(offset);
2166            encoder.write_num(self.into_primitive(), offset);
2167            Ok(())
2168        }
2169    }
2170
2171    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamSocketProtocol {
2172        #[inline(always)]
2173        fn new_empty() -> Self {
2174            Self::Tcp
2175        }
2176
2177        #[inline]
2178        unsafe fn decode(
2179            &mut self,
2180            decoder: &mut fidl::encoding::Decoder<'_, D>,
2181            offset: usize,
2182            _depth: fidl::encoding::Depth,
2183        ) -> fidl::Result<()> {
2184            decoder.debug_check_bounds::<Self>(offset);
2185            let prim = decoder.read_num::<u32>(offset);
2186
2187            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2188            Ok(())
2189        }
2190    }
2191    unsafe impl fidl::encoding::TypeMarker for TcpCongestionControl {
2192        type Owned = Self;
2193
2194        #[inline(always)]
2195        fn inline_align(_context: fidl::encoding::Context) -> usize {
2196            std::mem::align_of::<u32>()
2197        }
2198
2199        #[inline(always)]
2200        fn inline_size(_context: fidl::encoding::Context) -> usize {
2201            std::mem::size_of::<u32>()
2202        }
2203
2204        #[inline(always)]
2205        fn encode_is_copy() -> bool {
2206            true
2207        }
2208
2209        #[inline(always)]
2210        fn decode_is_copy() -> bool {
2211            false
2212        }
2213    }
2214
2215    impl fidl::encoding::ValueTypeMarker for TcpCongestionControl {
2216        type Borrowed<'a> = Self;
2217        #[inline(always)]
2218        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2219            *value
2220        }
2221    }
2222
2223    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2224        for TcpCongestionControl
2225    {
2226        #[inline]
2227        unsafe fn encode(
2228            self,
2229            encoder: &mut fidl::encoding::Encoder<'_, D>,
2230            offset: usize,
2231            _depth: fidl::encoding::Depth,
2232        ) -> fidl::Result<()> {
2233            encoder.debug_check_bounds::<Self>(offset);
2234            encoder.write_num(self.into_primitive(), offset);
2235            Ok(())
2236        }
2237    }
2238
2239    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpCongestionControl {
2240        #[inline(always)]
2241        fn new_empty() -> Self {
2242            Self::Reno
2243        }
2244
2245        #[inline]
2246        unsafe fn decode(
2247            &mut self,
2248            decoder: &mut fidl::encoding::Decoder<'_, D>,
2249            offset: usize,
2250            _depth: fidl::encoding::Depth,
2251        ) -> fidl::Result<()> {
2252            decoder.debug_check_bounds::<Self>(offset);
2253            let prim = decoder.read_num::<u32>(offset);
2254
2255            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2256            Ok(())
2257        }
2258    }
2259    unsafe impl fidl::encoding::TypeMarker for TcpCongestionControlState {
2260        type Owned = Self;
2261
2262        #[inline(always)]
2263        fn inline_align(_context: fidl::encoding::Context) -> usize {
2264            std::mem::align_of::<u32>()
2265        }
2266
2267        #[inline(always)]
2268        fn inline_size(_context: fidl::encoding::Context) -> usize {
2269            std::mem::size_of::<u32>()
2270        }
2271
2272        #[inline(always)]
2273        fn encode_is_copy() -> bool {
2274            true
2275        }
2276
2277        #[inline(always)]
2278        fn decode_is_copy() -> bool {
2279            false
2280        }
2281    }
2282
2283    impl fidl::encoding::ValueTypeMarker for TcpCongestionControlState {
2284        type Borrowed<'a> = Self;
2285        #[inline(always)]
2286        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2287            *value
2288        }
2289    }
2290
2291    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2292        for TcpCongestionControlState
2293    {
2294        #[inline]
2295        unsafe fn encode(
2296            self,
2297            encoder: &mut fidl::encoding::Encoder<'_, D>,
2298            offset: usize,
2299            _depth: fidl::encoding::Depth,
2300        ) -> fidl::Result<()> {
2301            encoder.debug_check_bounds::<Self>(offset);
2302            encoder.write_num(self.into_primitive(), offset);
2303            Ok(())
2304        }
2305    }
2306
2307    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2308        for TcpCongestionControlState
2309    {
2310        #[inline(always)]
2311        fn new_empty() -> Self {
2312            Self::Open
2313        }
2314
2315        #[inline]
2316        unsafe fn decode(
2317            &mut self,
2318            decoder: &mut fidl::encoding::Decoder<'_, D>,
2319            offset: usize,
2320            _depth: fidl::encoding::Depth,
2321        ) -> fidl::Result<()> {
2322            decoder.debug_check_bounds::<Self>(offset);
2323            let prim = decoder.read_num::<u32>(offset);
2324
2325            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2326            Ok(())
2327        }
2328    }
2329    unsafe impl fidl::encoding::TypeMarker for TcpState {
2330        type Owned = Self;
2331
2332        #[inline(always)]
2333        fn inline_align(_context: fidl::encoding::Context) -> usize {
2334            std::mem::align_of::<u32>()
2335        }
2336
2337        #[inline(always)]
2338        fn inline_size(_context: fidl::encoding::Context) -> usize {
2339            std::mem::size_of::<u32>()
2340        }
2341
2342        #[inline(always)]
2343        fn encode_is_copy() -> bool {
2344            true
2345        }
2346
2347        #[inline(always)]
2348        fn decode_is_copy() -> bool {
2349            false
2350        }
2351    }
2352
2353    impl fidl::encoding::ValueTypeMarker for TcpState {
2354        type Borrowed<'a> = Self;
2355        #[inline(always)]
2356        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2357            *value
2358        }
2359    }
2360
2361    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TcpState {
2362        #[inline]
2363        unsafe fn encode(
2364            self,
2365            encoder: &mut fidl::encoding::Encoder<'_, D>,
2366            offset: usize,
2367            _depth: fidl::encoding::Depth,
2368        ) -> fidl::Result<()> {
2369            encoder.debug_check_bounds::<Self>(offset);
2370            encoder.write_num(self.into_primitive(), offset);
2371            Ok(())
2372        }
2373    }
2374
2375    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpState {
2376        #[inline(always)]
2377        fn new_empty() -> Self {
2378            Self::Established
2379        }
2380
2381        #[inline]
2382        unsafe fn decode(
2383            &mut self,
2384            decoder: &mut fidl::encoding::Decoder<'_, D>,
2385            offset: usize,
2386            _depth: fidl::encoding::Depth,
2387        ) -> fidl::Result<()> {
2388            decoder.debug_check_bounds::<Self>(offset);
2389            let prim = decoder.read_num::<u32>(offset);
2390
2391            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2392            Ok(())
2393        }
2394    }
2395    unsafe impl fidl::encoding::TypeMarker for TimestampOption {
2396        type Owned = Self;
2397
2398        #[inline(always)]
2399        fn inline_align(_context: fidl::encoding::Context) -> usize {
2400            std::mem::align_of::<u32>()
2401        }
2402
2403        #[inline(always)]
2404        fn inline_size(_context: fidl::encoding::Context) -> usize {
2405            std::mem::size_of::<u32>()
2406        }
2407
2408        #[inline(always)]
2409        fn encode_is_copy() -> bool {
2410            true
2411        }
2412
2413        #[inline(always)]
2414        fn decode_is_copy() -> bool {
2415            false
2416        }
2417    }
2418
2419    impl fidl::encoding::ValueTypeMarker for TimestampOption {
2420        type Borrowed<'a> = Self;
2421        #[inline(always)]
2422        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2423            *value
2424        }
2425    }
2426
2427    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2428        for TimestampOption
2429    {
2430        #[inline]
2431        unsafe fn encode(
2432            self,
2433            encoder: &mut fidl::encoding::Encoder<'_, D>,
2434            offset: usize,
2435            _depth: fidl::encoding::Depth,
2436        ) -> fidl::Result<()> {
2437            encoder.debug_check_bounds::<Self>(offset);
2438            encoder.write_num(self.into_primitive(), offset);
2439            Ok(())
2440        }
2441    }
2442
2443    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimestampOption {
2444        #[inline(always)]
2445        fn new_empty() -> Self {
2446            Self::Disabled
2447        }
2448
2449        #[inline]
2450        unsafe fn decode(
2451            &mut self,
2452            decoder: &mut fidl::encoding::Decoder<'_, D>,
2453            offset: usize,
2454            _depth: fidl::encoding::Depth,
2455        ) -> fidl::Result<()> {
2456            decoder.debug_check_bounds::<Self>(offset);
2457            let prim = decoder.read_num::<u32>(offset);
2458
2459            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2460            Ok(())
2461        }
2462    }
2463    unsafe impl fidl::encoding::TypeMarker for UdpMetadataEncodingProtocolVersion {
2464        type Owned = Self;
2465
2466        #[inline(always)]
2467        fn inline_align(_context: fidl::encoding::Context) -> usize {
2468            std::mem::align_of::<u16>()
2469        }
2470
2471        #[inline(always)]
2472        fn inline_size(_context: fidl::encoding::Context) -> usize {
2473            std::mem::size_of::<u16>()
2474        }
2475
2476        #[inline(always)]
2477        fn encode_is_copy() -> bool {
2478            false
2479        }
2480
2481        #[inline(always)]
2482        fn decode_is_copy() -> bool {
2483            false
2484        }
2485    }
2486
2487    impl fidl::encoding::ValueTypeMarker for UdpMetadataEncodingProtocolVersion {
2488        type Borrowed<'a> = Self;
2489        #[inline(always)]
2490        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2491            *value
2492        }
2493    }
2494
2495    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2496        for UdpMetadataEncodingProtocolVersion
2497    {
2498        #[inline]
2499        unsafe fn encode(
2500            self,
2501            encoder: &mut fidl::encoding::Encoder<'_, D>,
2502            offset: usize,
2503            _depth: fidl::encoding::Depth,
2504        ) -> fidl::Result<()> {
2505            encoder.debug_check_bounds::<Self>(offset);
2506            encoder.write_num(self.into_primitive(), offset);
2507            Ok(())
2508        }
2509    }
2510
2511    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2512        for UdpMetadataEncodingProtocolVersion
2513    {
2514        #[inline(always)]
2515        fn new_empty() -> Self {
2516            Self::unknown()
2517        }
2518
2519        #[inline]
2520        unsafe fn decode(
2521            &mut self,
2522            decoder: &mut fidl::encoding::Decoder<'_, D>,
2523            offset: usize,
2524            _depth: fidl::encoding::Depth,
2525        ) -> fidl::Result<()> {
2526            decoder.debug_check_bounds::<Self>(offset);
2527            let prim = decoder.read_num::<u16>(offset);
2528
2529            *self = Self::from_primitive_allow_unknown(prim);
2530            Ok(())
2531        }
2532    }
2533
2534    impl fidl::encoding::ValueTypeMarker for BaseDatagramSocketGetInfoResponse {
2535        type Borrowed<'a> = &'a Self;
2536        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2537            value
2538        }
2539    }
2540
2541    unsafe impl fidl::encoding::TypeMarker for BaseDatagramSocketGetInfoResponse {
2542        type Owned = Self;
2543
2544        #[inline(always)]
2545        fn inline_align(_context: fidl::encoding::Context) -> usize {
2546            4
2547        }
2548
2549        #[inline(always)]
2550        fn inline_size(_context: fidl::encoding::Context) -> usize {
2551            8
2552        }
2553    }
2554
2555    unsafe impl<D: fidl::encoding::ResourceDialect>
2556        fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D>
2557        for &BaseDatagramSocketGetInfoResponse
2558    {
2559        #[inline]
2560        unsafe fn encode(
2561            self,
2562            encoder: &mut fidl::encoding::Encoder<'_, D>,
2563            offset: usize,
2564            _depth: fidl::encoding::Depth,
2565        ) -> fidl::Result<()> {
2566            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2567            // Delegate to tuple encoding.
2568            fidl::encoding::Encode::<BaseDatagramSocketGetInfoResponse, D>::encode(
2569                (
2570                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
2571                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
2572                        &self.proto,
2573                    ),
2574                ),
2575                encoder,
2576                offset,
2577                _depth,
2578            )
2579        }
2580    }
2581    unsafe impl<
2582            D: fidl::encoding::ResourceDialect,
2583            T0: fidl::encoding::Encode<Domain, D>,
2584            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
2585        > fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D> for (T0, T1)
2586    {
2587        #[inline]
2588        unsafe fn encode(
2589            self,
2590            encoder: &mut fidl::encoding::Encoder<'_, D>,
2591            offset: usize,
2592            depth: fidl::encoding::Depth,
2593        ) -> fidl::Result<()> {
2594            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2595            // Zero out padding regions. There's no need to apply masks
2596            // because the unmasked parts will be overwritten by fields.
2597            unsafe {
2598                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2599                (ptr as *mut u32).write_unaligned(0);
2600            }
2601            // Write the fields.
2602            self.0.encode(encoder, offset + 0, depth)?;
2603            self.1.encode(encoder, offset + 4, depth)?;
2604            Ok(())
2605        }
2606    }
2607
2608    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2609        for BaseDatagramSocketGetInfoResponse
2610    {
2611        #[inline(always)]
2612        fn new_empty() -> Self {
2613            Self {
2614                domain: fidl::new_empty!(Domain, D),
2615                proto: fidl::new_empty!(DatagramSocketProtocol, D),
2616            }
2617        }
2618
2619        #[inline]
2620        unsafe fn decode(
2621            &mut self,
2622            decoder: &mut fidl::encoding::Decoder<'_, D>,
2623            offset: usize,
2624            _depth: fidl::encoding::Depth,
2625        ) -> fidl::Result<()> {
2626            decoder.debug_check_bounds::<Self>(offset);
2627            // Verify that padding bytes are zero.
2628            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2629            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2630            let mask = 0xffff0000u32;
2631            let maskedval = padval & mask;
2632            if maskedval != 0 {
2633                return Err(fidl::Error::NonZeroPadding {
2634                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2635                });
2636            }
2637            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
2638            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
2639            Ok(())
2640        }
2641    }
2642
2643    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2644        type Borrowed<'a> = &'a Self;
2645        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2646            value
2647        }
2648    }
2649
2650    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2651        type Owned = Self;
2652
2653        #[inline(always)]
2654        fn inline_align(_context: fidl::encoding::Context) -> usize {
2655            8
2656        }
2657
2658        #[inline(always)]
2659        fn inline_size(_context: fidl::encoding::Context) -> usize {
2660            16
2661        }
2662    }
2663
2664    unsafe impl<D: fidl::encoding::ResourceDialect>
2665        fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D>
2666        for &BaseNetworkSocketAddIpMembershipRequest
2667    {
2668        #[inline]
2669        unsafe fn encode(
2670            self,
2671            encoder: &mut fidl::encoding::Encoder<'_, D>,
2672            offset: usize,
2673            _depth: fidl::encoding::Depth,
2674        ) -> fidl::Result<()> {
2675            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2676            // Delegate to tuple encoding.
2677            fidl::encoding::Encode::<BaseNetworkSocketAddIpMembershipRequest, D>::encode(
2678                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
2679                    &self.membership,
2680                ),),
2681                encoder,
2682                offset,
2683                _depth,
2684            )
2685        }
2686    }
2687    unsafe impl<
2688            D: fidl::encoding::ResourceDialect,
2689            T0: fidl::encoding::Encode<IpMulticastMembership, D>,
2690        > fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D> for (T0,)
2691    {
2692        #[inline]
2693        unsafe fn encode(
2694            self,
2695            encoder: &mut fidl::encoding::Encoder<'_, D>,
2696            offset: usize,
2697            depth: fidl::encoding::Depth,
2698        ) -> fidl::Result<()> {
2699            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2700            // Zero out padding regions. There's no need to apply masks
2701            // because the unmasked parts will be overwritten by fields.
2702            // Write the fields.
2703            self.0.encode(encoder, offset + 0, depth)?;
2704            Ok(())
2705        }
2706    }
2707
2708    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2709        for BaseNetworkSocketAddIpMembershipRequest
2710    {
2711        #[inline(always)]
2712        fn new_empty() -> Self {
2713            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
2714        }
2715
2716        #[inline]
2717        unsafe fn decode(
2718            &mut self,
2719            decoder: &mut fidl::encoding::Decoder<'_, D>,
2720            offset: usize,
2721            _depth: fidl::encoding::Depth,
2722        ) -> fidl::Result<()> {
2723            decoder.debug_check_bounds::<Self>(offset);
2724            // Verify that padding bytes are zero.
2725            fidl::decode!(
2726                IpMulticastMembership,
2727                D,
2728                &mut self.membership,
2729                decoder,
2730                offset + 0,
2731                _depth
2732            )?;
2733            Ok(())
2734        }
2735    }
2736
2737    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
2738        type Borrowed<'a> = &'a Self;
2739        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2740            value
2741        }
2742    }
2743
2744    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
2745        type Owned = Self;
2746
2747        #[inline(always)]
2748        fn inline_align(_context: fidl::encoding::Context) -> usize {
2749            8
2750        }
2751
2752        #[inline(always)]
2753        fn inline_size(_context: fidl::encoding::Context) -> usize {
2754            24
2755        }
2756    }
2757
2758    unsafe impl<D: fidl::encoding::ResourceDialect>
2759        fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D>
2760        for &BaseNetworkSocketAddIpv6MembershipRequest
2761    {
2762        #[inline]
2763        unsafe fn encode(
2764            self,
2765            encoder: &mut fidl::encoding::Encoder<'_, D>,
2766            offset: usize,
2767            _depth: fidl::encoding::Depth,
2768        ) -> fidl::Result<()> {
2769            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
2770            // Delegate to tuple encoding.
2771            fidl::encoding::Encode::<BaseNetworkSocketAddIpv6MembershipRequest, D>::encode(
2772                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
2773                    &self.membership,
2774                ),),
2775                encoder,
2776                offset,
2777                _depth,
2778            )
2779        }
2780    }
2781    unsafe impl<
2782            D: fidl::encoding::ResourceDialect,
2783            T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
2784        > fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D> for (T0,)
2785    {
2786        #[inline]
2787        unsafe fn encode(
2788            self,
2789            encoder: &mut fidl::encoding::Encoder<'_, D>,
2790            offset: usize,
2791            depth: fidl::encoding::Depth,
2792        ) -> fidl::Result<()> {
2793            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
2794            // Zero out padding regions. There's no need to apply masks
2795            // because the unmasked parts will be overwritten by fields.
2796            // Write the fields.
2797            self.0.encode(encoder, offset + 0, depth)?;
2798            Ok(())
2799        }
2800    }
2801
2802    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2803        for BaseNetworkSocketAddIpv6MembershipRequest
2804    {
2805        #[inline(always)]
2806        fn new_empty() -> Self {
2807            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
2808        }
2809
2810        #[inline]
2811        unsafe fn decode(
2812            &mut self,
2813            decoder: &mut fidl::encoding::Decoder<'_, D>,
2814            offset: usize,
2815            _depth: fidl::encoding::Depth,
2816        ) -> fidl::Result<()> {
2817            decoder.debug_check_bounds::<Self>(offset);
2818            // Verify that padding bytes are zero.
2819            fidl::decode!(
2820                Ipv6MulticastMembership,
2821                D,
2822                &mut self.membership,
2823                decoder,
2824                offset + 0,
2825                _depth
2826            )?;
2827            Ok(())
2828        }
2829    }
2830
2831    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketBindRequest {
2832        type Borrowed<'a> = &'a Self;
2833        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2834            value
2835        }
2836    }
2837
2838    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketBindRequest {
2839        type Owned = Self;
2840
2841        #[inline(always)]
2842        fn inline_align(_context: fidl::encoding::Context) -> usize {
2843            8
2844        }
2845
2846        #[inline(always)]
2847        fn inline_size(_context: fidl::encoding::Context) -> usize {
2848            16
2849        }
2850    }
2851
2852    unsafe impl<D: fidl::encoding::ResourceDialect>
2853        fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for &BaseNetworkSocketBindRequest
2854    {
2855        #[inline]
2856        unsafe fn encode(
2857            self,
2858            encoder: &mut fidl::encoding::Encoder<'_, D>,
2859            offset: usize,
2860            _depth: fidl::encoding::Depth,
2861        ) -> fidl::Result<()> {
2862            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
2863            // Delegate to tuple encoding.
2864            fidl::encoding::Encode::<BaseNetworkSocketBindRequest, D>::encode(
2865                (
2866                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
2867                ),
2868                encoder, offset, _depth
2869            )
2870        }
2871    }
2872    unsafe impl<
2873            D: fidl::encoding::ResourceDialect,
2874            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
2875        > fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for (T0,)
2876    {
2877        #[inline]
2878        unsafe fn encode(
2879            self,
2880            encoder: &mut fidl::encoding::Encoder<'_, D>,
2881            offset: usize,
2882            depth: fidl::encoding::Depth,
2883        ) -> fidl::Result<()> {
2884            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
2885            // Zero out padding regions. There's no need to apply masks
2886            // because the unmasked parts will be overwritten by fields.
2887            // Write the fields.
2888            self.0.encode(encoder, offset + 0, depth)?;
2889            Ok(())
2890        }
2891    }
2892
2893    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2894        for BaseNetworkSocketBindRequest
2895    {
2896        #[inline(always)]
2897        fn new_empty() -> Self {
2898            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
2899        }
2900
2901        #[inline]
2902        unsafe fn decode(
2903            &mut self,
2904            decoder: &mut fidl::encoding::Decoder<'_, D>,
2905            offset: usize,
2906            _depth: fidl::encoding::Depth,
2907        ) -> fidl::Result<()> {
2908            decoder.debug_check_bounds::<Self>(offset);
2909            // Verify that padding bytes are zero.
2910            fidl::decode!(
2911                fidl_fuchsia_net__common::SocketAddress,
2912                D,
2913                &mut self.addr,
2914                decoder,
2915                offset + 0,
2916                _depth
2917            )?;
2918            Ok(())
2919        }
2920    }
2921
2922    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketConnectRequest {
2923        type Borrowed<'a> = &'a Self;
2924        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2925            value
2926        }
2927    }
2928
2929    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketConnectRequest {
2930        type Owned = Self;
2931
2932        #[inline(always)]
2933        fn inline_align(_context: fidl::encoding::Context) -> usize {
2934            8
2935        }
2936
2937        #[inline(always)]
2938        fn inline_size(_context: fidl::encoding::Context) -> usize {
2939            16
2940        }
2941    }
2942
2943    unsafe impl<D: fidl::encoding::ResourceDialect>
2944        fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D>
2945        for &BaseNetworkSocketConnectRequest
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::<BaseNetworkSocketConnectRequest>(offset);
2955            // Delegate to tuple encoding.
2956            fidl::encoding::Encode::<BaseNetworkSocketConnectRequest, D>::encode(
2957                (
2958                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
2959                ),
2960                encoder, offset, _depth
2961            )
2962        }
2963    }
2964    unsafe impl<
2965            D: fidl::encoding::ResourceDialect,
2966            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
2967        > fidl::encoding::Encode<BaseNetworkSocketConnectRequest, 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::<BaseNetworkSocketConnectRequest>(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 BaseNetworkSocketConnectRequest
2987    {
2988        #[inline(always)]
2989        fn new_empty() -> Self {
2990            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, 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            // Verify that padding bytes are zero.
3002            fidl::decode!(
3003                fidl_fuchsia_net__common::SocketAddress,
3004                D,
3005                &mut self.addr,
3006                decoder,
3007                offset + 0,
3008                _depth
3009            )?;
3010            Ok(())
3011        }
3012    }
3013
3014    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3015        type Borrowed<'a> = &'a Self;
3016        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3017            value
3018        }
3019    }
3020
3021    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3022        type Owned = Self;
3023
3024        #[inline(always)]
3025        fn inline_align(_context: fidl::encoding::Context) -> usize {
3026            8
3027        }
3028
3029        #[inline(always)]
3030        fn inline_size(_context: fidl::encoding::Context) -> usize {
3031            16
3032        }
3033    }
3034
3035    unsafe impl<D: fidl::encoding::ResourceDialect>
3036        fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D>
3037        for &BaseNetworkSocketDropIpMembershipRequest
3038    {
3039        #[inline]
3040        unsafe fn encode(
3041            self,
3042            encoder: &mut fidl::encoding::Encoder<'_, D>,
3043            offset: usize,
3044            _depth: fidl::encoding::Depth,
3045        ) -> fidl::Result<()> {
3046            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3047            // Delegate to tuple encoding.
3048            fidl::encoding::Encode::<BaseNetworkSocketDropIpMembershipRequest, D>::encode(
3049                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3050                    &self.membership,
3051                ),),
3052                encoder,
3053                offset,
3054                _depth,
3055            )
3056        }
3057    }
3058    unsafe impl<
3059            D: fidl::encoding::ResourceDialect,
3060            T0: fidl::encoding::Encode<IpMulticastMembership, D>,
3061        > fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D> for (T0,)
3062    {
3063        #[inline]
3064        unsafe fn encode(
3065            self,
3066            encoder: &mut fidl::encoding::Encoder<'_, D>,
3067            offset: usize,
3068            depth: fidl::encoding::Depth,
3069        ) -> fidl::Result<()> {
3070            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3071            // Zero out padding regions. There's no need to apply masks
3072            // because the unmasked parts will be overwritten by fields.
3073            // Write the fields.
3074            self.0.encode(encoder, offset + 0, depth)?;
3075            Ok(())
3076        }
3077    }
3078
3079    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3080        for BaseNetworkSocketDropIpMembershipRequest
3081    {
3082        #[inline(always)]
3083        fn new_empty() -> Self {
3084            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3085        }
3086
3087        #[inline]
3088        unsafe fn decode(
3089            &mut self,
3090            decoder: &mut fidl::encoding::Decoder<'_, D>,
3091            offset: usize,
3092            _depth: fidl::encoding::Depth,
3093        ) -> fidl::Result<()> {
3094            decoder.debug_check_bounds::<Self>(offset);
3095            // Verify that padding bytes are zero.
3096            fidl::decode!(
3097                IpMulticastMembership,
3098                D,
3099                &mut self.membership,
3100                decoder,
3101                offset + 0,
3102                _depth
3103            )?;
3104            Ok(())
3105        }
3106    }
3107
3108    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3109        type Borrowed<'a> = &'a Self;
3110        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3111            value
3112        }
3113    }
3114
3115    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3116        type Owned = Self;
3117
3118        #[inline(always)]
3119        fn inline_align(_context: fidl::encoding::Context) -> usize {
3120            8
3121        }
3122
3123        #[inline(always)]
3124        fn inline_size(_context: fidl::encoding::Context) -> usize {
3125            24
3126        }
3127    }
3128
3129    unsafe impl<D: fidl::encoding::ResourceDialect>
3130        fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D>
3131        for &BaseNetworkSocketDropIpv6MembershipRequest
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::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3141            // Delegate to tuple encoding.
3142            fidl::encoding::Encode::<BaseNetworkSocketDropIpv6MembershipRequest, D>::encode(
3143                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3144                    &self.membership,
3145                ),),
3146                encoder,
3147                offset,
3148                _depth,
3149            )
3150        }
3151    }
3152    unsafe impl<
3153            D: fidl::encoding::ResourceDialect,
3154            T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3155        > fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D> for (T0,)
3156    {
3157        #[inline]
3158        unsafe fn encode(
3159            self,
3160            encoder: &mut fidl::encoding::Encoder<'_, D>,
3161            offset: usize,
3162            depth: fidl::encoding::Depth,
3163        ) -> fidl::Result<()> {
3164            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3165            // Zero out padding regions. There's no need to apply masks
3166            // because the unmasked parts will be overwritten by fields.
3167            // Write the fields.
3168            self.0.encode(encoder, offset + 0, depth)?;
3169            Ok(())
3170        }
3171    }
3172
3173    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3174        for BaseNetworkSocketDropIpv6MembershipRequest
3175    {
3176        #[inline(always)]
3177        fn new_empty() -> Self {
3178            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3179        }
3180
3181        #[inline]
3182        unsafe fn decode(
3183            &mut self,
3184            decoder: &mut fidl::encoding::Decoder<'_, D>,
3185            offset: usize,
3186            _depth: fidl::encoding::Depth,
3187        ) -> fidl::Result<()> {
3188            decoder.debug_check_bounds::<Self>(offset);
3189            // Verify that padding bytes are zero.
3190            fidl::decode!(
3191                Ipv6MulticastMembership,
3192                D,
3193                &mut self.membership,
3194                decoder,
3195                offset + 0,
3196                _depth
3197            )?;
3198            Ok(())
3199        }
3200    }
3201
3202    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3203        type Borrowed<'a> = &'a Self;
3204        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3205            value
3206        }
3207    }
3208
3209    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3210        type Owned = Self;
3211
3212        #[inline(always)]
3213        fn inline_align(_context: fidl::encoding::Context) -> usize {
3214            8
3215        }
3216
3217        #[inline(always)]
3218        fn inline_size(_context: fidl::encoding::Context) -> usize {
3219            16
3220        }
3221    }
3222
3223    unsafe impl<D: fidl::encoding::ResourceDialect>
3224        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>
3225        for &BaseNetworkSocketSetIpMulticastInterfaceRequest
3226    {
3227        #[inline]
3228        unsafe fn encode(
3229            self,
3230            encoder: &mut fidl::encoding::Encoder<'_, D>,
3231            offset: usize,
3232            _depth: fidl::encoding::Depth,
3233        ) -> fidl::Result<()> {
3234            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3235            // Delegate to tuple encoding.
3236            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>::encode(
3237                (
3238                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
3239                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
3240                ),
3241                encoder, offset, _depth
3242            )
3243        }
3244    }
3245    unsafe impl<
3246            D: fidl::encoding::ResourceDialect,
3247            T0: fidl::encoding::Encode<u64, D>,
3248            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
3249        > fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D> for (T0, T1)
3250    {
3251        #[inline]
3252        unsafe fn encode(
3253            self,
3254            encoder: &mut fidl::encoding::Encoder<'_, D>,
3255            offset: usize,
3256            depth: fidl::encoding::Depth,
3257        ) -> fidl::Result<()> {
3258            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3259            // Zero out padding regions. There's no need to apply masks
3260            // because the unmasked parts will be overwritten by fields.
3261            unsafe {
3262                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3263                (ptr as *mut u64).write_unaligned(0);
3264            }
3265            // Write the fields.
3266            self.0.encode(encoder, offset + 0, depth)?;
3267            self.1.encode(encoder, offset + 8, depth)?;
3268            Ok(())
3269        }
3270    }
3271
3272    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3273        for BaseNetworkSocketSetIpMulticastInterfaceRequest
3274    {
3275        #[inline(always)]
3276        fn new_empty() -> Self {
3277            Self {
3278                iface: fidl::new_empty!(u64, D),
3279                address: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D),
3280            }
3281        }
3282
3283        #[inline]
3284        unsafe fn decode(
3285            &mut self,
3286            decoder: &mut fidl::encoding::Decoder<'_, D>,
3287            offset: usize,
3288            _depth: fidl::encoding::Depth,
3289        ) -> fidl::Result<()> {
3290            decoder.debug_check_bounds::<Self>(offset);
3291            // Verify that padding bytes are zero.
3292            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3293            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3294            let mask = 0xffffffff00000000u64;
3295            let maskedval = padval & mask;
3296            if maskedval != 0 {
3297                return Err(fidl::Error::NonZeroPadding {
3298                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3299                });
3300            }
3301            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
3302            fidl::decode!(
3303                fidl_fuchsia_net__common::Ipv4Address,
3304                D,
3305                &mut self.address,
3306                decoder,
3307                offset + 8,
3308                _depth
3309            )?;
3310            Ok(())
3311        }
3312    }
3313
3314    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3315        type Borrowed<'a> = &'a Self;
3316        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3317            value
3318        }
3319    }
3320
3321    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3322        type Owned = Self;
3323
3324        #[inline(always)]
3325        fn inline_align(_context: fidl::encoding::Context) -> usize {
3326            1
3327        }
3328
3329        #[inline(always)]
3330        fn inline_size(_context: fidl::encoding::Context) -> usize {
3331            1
3332        }
3333    }
3334
3335    unsafe impl<D: fidl::encoding::ResourceDialect>
3336        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>
3337        for &BaseNetworkSocketSetIpMulticastLoopbackRequest
3338    {
3339        #[inline]
3340        unsafe fn encode(
3341            self,
3342            encoder: &mut fidl::encoding::Encoder<'_, D>,
3343            offset: usize,
3344            _depth: fidl::encoding::Depth,
3345        ) -> fidl::Result<()> {
3346            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3347            // Delegate to tuple encoding.
3348            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>::encode(
3349                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3350                encoder,
3351                offset,
3352                _depth,
3353            )
3354        }
3355    }
3356    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3357        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D> for (T0,)
3358    {
3359        #[inline]
3360        unsafe fn encode(
3361            self,
3362            encoder: &mut fidl::encoding::Encoder<'_, D>,
3363            offset: usize,
3364            depth: fidl::encoding::Depth,
3365        ) -> fidl::Result<()> {
3366            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3367            // Zero out padding regions. There's no need to apply masks
3368            // because the unmasked parts will be overwritten by fields.
3369            // Write the fields.
3370            self.0.encode(encoder, offset + 0, depth)?;
3371            Ok(())
3372        }
3373    }
3374
3375    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3376        for BaseNetworkSocketSetIpMulticastLoopbackRequest
3377    {
3378        #[inline(always)]
3379        fn new_empty() -> Self {
3380            Self { value: fidl::new_empty!(bool, D) }
3381        }
3382
3383        #[inline]
3384        unsafe fn decode(
3385            &mut self,
3386            decoder: &mut fidl::encoding::Decoder<'_, D>,
3387            offset: usize,
3388            _depth: fidl::encoding::Depth,
3389        ) -> fidl::Result<()> {
3390            decoder.debug_check_bounds::<Self>(offset);
3391            // Verify that padding bytes are zero.
3392            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3393            Ok(())
3394        }
3395    }
3396
3397    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3398        type Borrowed<'a> = &'a Self;
3399        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3400            value
3401        }
3402    }
3403
3404    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3405        type Owned = Self;
3406
3407        #[inline(always)]
3408        fn inline_align(_context: fidl::encoding::Context) -> usize {
3409            8
3410        }
3411
3412        #[inline(always)]
3413        fn inline_size(_context: fidl::encoding::Context) -> usize {
3414            16
3415        }
3416    }
3417
3418    unsafe impl<D: fidl::encoding::ResourceDialect>
3419        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D>
3420        for &BaseNetworkSocketSetIpMulticastTtlRequest
3421    {
3422        #[inline]
3423        unsafe fn encode(
3424            self,
3425            encoder: &mut fidl::encoding::Encoder<'_, D>,
3426            offset: usize,
3427            _depth: fidl::encoding::Depth,
3428        ) -> fidl::Result<()> {
3429            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3430            // Delegate to tuple encoding.
3431            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastTtlRequest, D>::encode(
3432                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3433                encoder,
3434                offset,
3435                _depth,
3436            )
3437        }
3438    }
3439    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
3440        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D> for (T0,)
3441    {
3442        #[inline]
3443        unsafe fn encode(
3444            self,
3445            encoder: &mut fidl::encoding::Encoder<'_, D>,
3446            offset: usize,
3447            depth: fidl::encoding::Depth,
3448        ) -> fidl::Result<()> {
3449            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3450            // Zero out padding regions. There's no need to apply masks
3451            // because the unmasked parts will be overwritten by fields.
3452            // Write the fields.
3453            self.0.encode(encoder, offset + 0, depth)?;
3454            Ok(())
3455        }
3456    }
3457
3458    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3459        for BaseNetworkSocketSetIpMulticastTtlRequest
3460    {
3461        #[inline(always)]
3462        fn new_empty() -> Self {
3463            Self { value: fidl::new_empty!(OptionalUint8, D) }
3464        }
3465
3466        #[inline]
3467        unsafe fn decode(
3468            &mut self,
3469            decoder: &mut fidl::encoding::Decoder<'_, D>,
3470            offset: usize,
3471            _depth: fidl::encoding::Depth,
3472        ) -> fidl::Result<()> {
3473            decoder.debug_check_bounds::<Self>(offset);
3474            // Verify that padding bytes are zero.
3475            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
3476            Ok(())
3477        }
3478    }
3479
3480    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3481        type Borrowed<'a> = &'a Self;
3482        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3483            value
3484        }
3485    }
3486
3487    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3488        type Owned = Self;
3489
3490        #[inline(always)]
3491        fn inline_align(_context: fidl::encoding::Context) -> usize {
3492            1
3493        }
3494
3495        #[inline(always)]
3496        fn inline_size(_context: fidl::encoding::Context) -> usize {
3497            1
3498        }
3499    }
3500
3501    unsafe impl<D: fidl::encoding::ResourceDialect>
3502        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D>
3503        for &BaseNetworkSocketSetIpPacketInfoRequest
3504    {
3505        #[inline]
3506        unsafe fn encode(
3507            self,
3508            encoder: &mut fidl::encoding::Encoder<'_, D>,
3509            offset: usize,
3510            _depth: fidl::encoding::Depth,
3511        ) -> fidl::Result<()> {
3512            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3513            // Delegate to tuple encoding.
3514            fidl::encoding::Encode::<BaseNetworkSocketSetIpPacketInfoRequest, D>::encode(
3515                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3516                encoder,
3517                offset,
3518                _depth,
3519            )
3520        }
3521    }
3522    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3523        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D> for (T0,)
3524    {
3525        #[inline]
3526        unsafe fn encode(
3527            self,
3528            encoder: &mut fidl::encoding::Encoder<'_, D>,
3529            offset: usize,
3530            depth: fidl::encoding::Depth,
3531        ) -> fidl::Result<()> {
3532            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3533            // Zero out padding regions. There's no need to apply masks
3534            // because the unmasked parts will be overwritten by fields.
3535            // Write the fields.
3536            self.0.encode(encoder, offset + 0, depth)?;
3537            Ok(())
3538        }
3539    }
3540
3541    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3542        for BaseNetworkSocketSetIpPacketInfoRequest
3543    {
3544        #[inline(always)]
3545        fn new_empty() -> Self {
3546            Self { value: fidl::new_empty!(bool, D) }
3547        }
3548
3549        #[inline]
3550        unsafe fn decode(
3551            &mut self,
3552            decoder: &mut fidl::encoding::Decoder<'_, D>,
3553            offset: usize,
3554            _depth: fidl::encoding::Depth,
3555        ) -> fidl::Result<()> {
3556            decoder.debug_check_bounds::<Self>(offset);
3557            // Verify that padding bytes are zero.
3558            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3559            Ok(())
3560        }
3561    }
3562
3563    impl fidl::encoding::ValueTypeMarker
3564        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3565    {
3566        type Borrowed<'a> = &'a Self;
3567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3568            value
3569        }
3570    }
3571
3572    unsafe impl fidl::encoding::TypeMarker
3573        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3574    {
3575        type Owned = Self;
3576
3577        #[inline(always)]
3578        fn inline_align(_context: fidl::encoding::Context) -> usize {
3579            1
3580        }
3581
3582        #[inline(always)]
3583        fn inline_size(_context: fidl::encoding::Context) -> usize {
3584            1
3585        }
3586    }
3587
3588    unsafe impl<D: fidl::encoding::ResourceDialect>
3589        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3590        for &BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3591    {
3592        #[inline]
3593        unsafe fn encode(
3594            self,
3595            encoder: &mut fidl::encoding::Encoder<'_, D>,
3596            offset: usize,
3597            _depth: fidl::encoding::Depth,
3598        ) -> fidl::Result<()> {
3599            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3600            // Delegate to tuple encoding.
3601            fidl::encoding::Encode::<
3602                BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest,
3603                D,
3604            >::encode(
3605                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3606                encoder,
3607                offset,
3608                _depth,
3609            )
3610        }
3611    }
3612    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3613        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3614        for (T0,)
3615    {
3616        #[inline]
3617        unsafe fn encode(
3618            self,
3619            encoder: &mut fidl::encoding::Encoder<'_, D>,
3620            offset: usize,
3621            depth: fidl::encoding::Depth,
3622        ) -> fidl::Result<()> {
3623            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3624            // Zero out padding regions. There's no need to apply masks
3625            // because the unmasked parts will be overwritten by fields.
3626            // Write the fields.
3627            self.0.encode(encoder, offset + 0, depth)?;
3628            Ok(())
3629        }
3630    }
3631
3632    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3633        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3634    {
3635        #[inline(always)]
3636        fn new_empty() -> Self {
3637            Self { value: fidl::new_empty!(bool, D) }
3638        }
3639
3640        #[inline]
3641        unsafe fn decode(
3642            &mut self,
3643            decoder: &mut fidl::encoding::Decoder<'_, D>,
3644            offset: usize,
3645            _depth: fidl::encoding::Depth,
3646        ) -> fidl::Result<()> {
3647            decoder.debug_check_bounds::<Self>(offset);
3648            // Verify that padding bytes are zero.
3649            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3650            Ok(())
3651        }
3652    }
3653
3654    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3655        type Borrowed<'a> = &'a Self;
3656        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3657            value
3658        }
3659    }
3660
3661    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3662        type Owned = Self;
3663
3664        #[inline(always)]
3665        fn inline_align(_context: fidl::encoding::Context) -> usize {
3666            1
3667        }
3668
3669        #[inline(always)]
3670        fn inline_size(_context: fidl::encoding::Context) -> usize {
3671            1
3672        }
3673    }
3674
3675    unsafe impl<D: fidl::encoding::ResourceDialect>
3676        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D>
3677        for &BaseNetworkSocketSetIpReceiveTtlRequest
3678    {
3679        #[inline]
3680        unsafe fn encode(
3681            self,
3682            encoder: &mut fidl::encoding::Encoder<'_, D>,
3683            offset: usize,
3684            _depth: fidl::encoding::Depth,
3685        ) -> fidl::Result<()> {
3686            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3687            // Delegate to tuple encoding.
3688            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTtlRequest, D>::encode(
3689                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3690                encoder,
3691                offset,
3692                _depth,
3693            )
3694        }
3695    }
3696    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3697        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D> for (T0,)
3698    {
3699        #[inline]
3700        unsafe fn encode(
3701            self,
3702            encoder: &mut fidl::encoding::Encoder<'_, D>,
3703            offset: usize,
3704            depth: fidl::encoding::Depth,
3705        ) -> fidl::Result<()> {
3706            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3707            // Zero out padding regions. There's no need to apply masks
3708            // because the unmasked parts will be overwritten by fields.
3709            // Write the fields.
3710            self.0.encode(encoder, offset + 0, depth)?;
3711            Ok(())
3712        }
3713    }
3714
3715    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3716        for BaseNetworkSocketSetIpReceiveTtlRequest
3717    {
3718        #[inline(always)]
3719        fn new_empty() -> Self {
3720            Self { value: fidl::new_empty!(bool, D) }
3721        }
3722
3723        #[inline]
3724        unsafe fn decode(
3725            &mut self,
3726            decoder: &mut fidl::encoding::Decoder<'_, D>,
3727            offset: usize,
3728            _depth: fidl::encoding::Depth,
3729        ) -> fidl::Result<()> {
3730            decoder.debug_check_bounds::<Self>(offset);
3731            // Verify that padding bytes are zero.
3732            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3733            Ok(())
3734        }
3735    }
3736
3737    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
3738        type Borrowed<'a> = &'a Self;
3739        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3740            value
3741        }
3742    }
3743
3744    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
3745        type Owned = Self;
3746
3747        #[inline(always)]
3748        fn inline_align(_context: fidl::encoding::Context) -> usize {
3749            1
3750        }
3751
3752        #[inline(always)]
3753        fn inline_size(_context: fidl::encoding::Context) -> usize {
3754            1
3755        }
3756    }
3757
3758    unsafe impl<D: fidl::encoding::ResourceDialect>
3759        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>
3760        for &BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
3761    {
3762        #[inline]
3763        unsafe fn encode(
3764            self,
3765            encoder: &mut fidl::encoding::Encoder<'_, D>,
3766            offset: usize,
3767            _depth: fidl::encoding::Depth,
3768        ) -> fidl::Result<()> {
3769            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
3770            // Delegate to tuple encoding.
3771            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>::encode(
3772                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3773                encoder,
3774                offset,
3775                _depth,
3776            )
3777        }
3778    }
3779    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3780        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D> for (T0,)
3781    {
3782        #[inline]
3783        unsafe fn encode(
3784            self,
3785            encoder: &mut fidl::encoding::Encoder<'_, D>,
3786            offset: usize,
3787            depth: fidl::encoding::Depth,
3788        ) -> fidl::Result<()> {
3789            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
3790            // Zero out padding regions. There's no need to apply masks
3791            // because the unmasked parts will be overwritten by fields.
3792            // Write the fields.
3793            self.0.encode(encoder, offset + 0, depth)?;
3794            Ok(())
3795        }
3796    }
3797
3798    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3799        for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
3800    {
3801        #[inline(always)]
3802        fn new_empty() -> Self {
3803            Self { value: fidl::new_empty!(bool, D) }
3804        }
3805
3806        #[inline]
3807        unsafe fn decode(
3808            &mut self,
3809            decoder: &mut fidl::encoding::Decoder<'_, D>,
3810            offset: usize,
3811            _depth: fidl::encoding::Depth,
3812        ) -> fidl::Result<()> {
3813            decoder.debug_check_bounds::<Self>(offset);
3814            // Verify that padding bytes are zero.
3815            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3816            Ok(())
3817        }
3818    }
3819
3820    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTransparentRequest {
3821        type Borrowed<'a> = &'a Self;
3822        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3823            value
3824        }
3825    }
3826
3827    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTransparentRequest {
3828        type Owned = Self;
3829
3830        #[inline(always)]
3831        fn inline_align(_context: fidl::encoding::Context) -> usize {
3832            1
3833        }
3834
3835        #[inline(always)]
3836        fn inline_size(_context: fidl::encoding::Context) -> usize {
3837            1
3838        }
3839    }
3840
3841    unsafe impl<D: fidl::encoding::ResourceDialect>
3842        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D>
3843        for &BaseNetworkSocketSetIpTransparentRequest
3844    {
3845        #[inline]
3846        unsafe fn encode(
3847            self,
3848            encoder: &mut fidl::encoding::Encoder<'_, D>,
3849            offset: usize,
3850            _depth: fidl::encoding::Depth,
3851        ) -> fidl::Result<()> {
3852            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
3853            // Delegate to tuple encoding.
3854            fidl::encoding::Encode::<BaseNetworkSocketSetIpTransparentRequest, D>::encode(
3855                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3856                encoder,
3857                offset,
3858                _depth,
3859            )
3860        }
3861    }
3862    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3863        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D> for (T0,)
3864    {
3865        #[inline]
3866        unsafe fn encode(
3867            self,
3868            encoder: &mut fidl::encoding::Encoder<'_, D>,
3869            offset: usize,
3870            depth: fidl::encoding::Depth,
3871        ) -> fidl::Result<()> {
3872            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
3873            // Zero out padding regions. There's no need to apply masks
3874            // because the unmasked parts will be overwritten by fields.
3875            // Write the fields.
3876            self.0.encode(encoder, offset + 0, depth)?;
3877            Ok(())
3878        }
3879    }
3880
3881    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3882        for BaseNetworkSocketSetIpTransparentRequest
3883    {
3884        #[inline(always)]
3885        fn new_empty() -> Self {
3886            Self { value: fidl::new_empty!(bool, D) }
3887        }
3888
3889        #[inline]
3890        unsafe fn decode(
3891            &mut self,
3892            decoder: &mut fidl::encoding::Decoder<'_, D>,
3893            offset: usize,
3894            _depth: fidl::encoding::Depth,
3895        ) -> fidl::Result<()> {
3896            decoder.debug_check_bounds::<Self>(offset);
3897            // Verify that padding bytes are zero.
3898            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3899            Ok(())
3900        }
3901    }
3902
3903    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTtlRequest {
3904        type Borrowed<'a> = &'a Self;
3905        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3906            value
3907        }
3908    }
3909
3910    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTtlRequest {
3911        type Owned = Self;
3912
3913        #[inline(always)]
3914        fn inline_align(_context: fidl::encoding::Context) -> usize {
3915            8
3916        }
3917
3918        #[inline(always)]
3919        fn inline_size(_context: fidl::encoding::Context) -> usize {
3920            16
3921        }
3922    }
3923
3924    unsafe impl<D: fidl::encoding::ResourceDialect>
3925        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D>
3926        for &BaseNetworkSocketSetIpTtlRequest
3927    {
3928        #[inline]
3929        unsafe fn encode(
3930            self,
3931            encoder: &mut fidl::encoding::Encoder<'_, D>,
3932            offset: usize,
3933            _depth: fidl::encoding::Depth,
3934        ) -> fidl::Result<()> {
3935            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
3936            // Delegate to tuple encoding.
3937            fidl::encoding::Encode::<BaseNetworkSocketSetIpTtlRequest, D>::encode(
3938                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3939                encoder,
3940                offset,
3941                _depth,
3942            )
3943        }
3944    }
3945    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
3946        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D> for (T0,)
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::<BaseNetworkSocketSetIpTtlRequest>(offset);
3956            // Zero out padding regions. There's no need to apply masks
3957            // because the unmasked parts will be overwritten by fields.
3958            // Write the fields.
3959            self.0.encode(encoder, offset + 0, depth)?;
3960            Ok(())
3961        }
3962    }
3963
3964    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3965        for BaseNetworkSocketSetIpTtlRequest
3966    {
3967        #[inline(always)]
3968        fn new_empty() -> Self {
3969            Self { value: fidl::new_empty!(OptionalUint8, D) }
3970        }
3971
3972        #[inline]
3973        unsafe fn decode(
3974            &mut self,
3975            decoder: &mut fidl::encoding::Decoder<'_, D>,
3976            offset: usize,
3977            _depth: fidl::encoding::Depth,
3978        ) -> fidl::Result<()> {
3979            decoder.debug_check_bounds::<Self>(offset);
3980            // Verify that padding bytes are zero.
3981            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
3982            Ok(())
3983        }
3984    }
3985
3986    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
3987        type Borrowed<'a> = &'a Self;
3988        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3989            value
3990        }
3991    }
3992
3993    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
3994        type Owned = Self;
3995
3996        #[inline(always)]
3997        fn inline_align(_context: fidl::encoding::Context) -> usize {
3998            1
3999        }
4000
4001        #[inline(always)]
4002        fn inline_size(_context: fidl::encoding::Context) -> usize {
4003            1
4004        }
4005        #[inline(always)]
4006        fn encode_is_copy() -> bool {
4007            true
4008        }
4009
4010        #[inline(always)]
4011        fn decode_is_copy() -> bool {
4012            true
4013        }
4014    }
4015
4016    unsafe impl<D: fidl::encoding::ResourceDialect>
4017        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D>
4018        for &BaseNetworkSocketSetIpTypeOfServiceRequest
4019    {
4020        #[inline]
4021        unsafe fn encode(
4022            self,
4023            encoder: &mut fidl::encoding::Encoder<'_, D>,
4024            offset: usize,
4025            _depth: fidl::encoding::Depth,
4026        ) -> fidl::Result<()> {
4027            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4028            unsafe {
4029                // Copy the object into the buffer.
4030                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4031                (buf_ptr as *mut BaseNetworkSocketSetIpTypeOfServiceRequest).write_unaligned(
4032                    (self as *const BaseNetworkSocketSetIpTypeOfServiceRequest).read(),
4033                );
4034                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4035                // done second because the memcpy will write garbage to these bytes.
4036            }
4037            Ok(())
4038        }
4039    }
4040    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
4041        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D> for (T0,)
4042    {
4043        #[inline]
4044        unsafe fn encode(
4045            self,
4046            encoder: &mut fidl::encoding::Encoder<'_, D>,
4047            offset: usize,
4048            depth: fidl::encoding::Depth,
4049        ) -> fidl::Result<()> {
4050            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4051            // Zero out padding regions. There's no need to apply masks
4052            // because the unmasked parts will be overwritten by fields.
4053            // Write the fields.
4054            self.0.encode(encoder, offset + 0, depth)?;
4055            Ok(())
4056        }
4057    }
4058
4059    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4060        for BaseNetworkSocketSetIpTypeOfServiceRequest
4061    {
4062        #[inline(always)]
4063        fn new_empty() -> Self {
4064            Self { value: fidl::new_empty!(u8, D) }
4065        }
4066
4067        #[inline]
4068        unsafe fn decode(
4069            &mut self,
4070            decoder: &mut fidl::encoding::Decoder<'_, D>,
4071            offset: usize,
4072            _depth: fidl::encoding::Depth,
4073        ) -> fidl::Result<()> {
4074            decoder.debug_check_bounds::<Self>(offset);
4075            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4076            // Verify that padding bytes are zero.
4077            // Copy from the buffer into the object.
4078            unsafe {
4079                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
4080            }
4081            Ok(())
4082        }
4083    }
4084
4085    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4086        type Borrowed<'a> = &'a Self;
4087        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4088            value
4089        }
4090    }
4091
4092    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4093        type Owned = Self;
4094
4095        #[inline(always)]
4096        fn inline_align(_context: fidl::encoding::Context) -> usize {
4097            8
4098        }
4099
4100        #[inline(always)]
4101        fn inline_size(_context: fidl::encoding::Context) -> usize {
4102            16
4103        }
4104    }
4105
4106    unsafe impl<D: fidl::encoding::ResourceDialect>
4107        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>
4108        for &BaseNetworkSocketSetIpv6MulticastHopsRequest
4109    {
4110        #[inline]
4111        unsafe fn encode(
4112            self,
4113            encoder: &mut fidl::encoding::Encoder<'_, D>,
4114            offset: usize,
4115            _depth: fidl::encoding::Depth,
4116        ) -> fidl::Result<()> {
4117            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4118            // Delegate to tuple encoding.
4119            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>::encode(
4120                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4121                encoder,
4122                offset,
4123                _depth,
4124            )
4125        }
4126    }
4127    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4128        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D> for (T0,)
4129    {
4130        #[inline]
4131        unsafe fn encode(
4132            self,
4133            encoder: &mut fidl::encoding::Encoder<'_, D>,
4134            offset: usize,
4135            depth: fidl::encoding::Depth,
4136        ) -> fidl::Result<()> {
4137            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4138            // Zero out padding regions. There's no need to apply masks
4139            // because the unmasked parts will be overwritten by fields.
4140            // Write the fields.
4141            self.0.encode(encoder, offset + 0, depth)?;
4142            Ok(())
4143        }
4144    }
4145
4146    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4147        for BaseNetworkSocketSetIpv6MulticastHopsRequest
4148    {
4149        #[inline(always)]
4150        fn new_empty() -> Self {
4151            Self { value: fidl::new_empty!(OptionalUint8, D) }
4152        }
4153
4154        #[inline]
4155        unsafe fn decode(
4156            &mut self,
4157            decoder: &mut fidl::encoding::Decoder<'_, D>,
4158            offset: usize,
4159            _depth: fidl::encoding::Depth,
4160        ) -> fidl::Result<()> {
4161            decoder.debug_check_bounds::<Self>(offset);
4162            // Verify that padding bytes are zero.
4163            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4164            Ok(())
4165        }
4166    }
4167
4168    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4169        type Borrowed<'a> = &'a Self;
4170        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4171            value
4172        }
4173    }
4174
4175    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4176        type Owned = Self;
4177
4178        #[inline(always)]
4179        fn inline_align(_context: fidl::encoding::Context) -> usize {
4180            8
4181        }
4182
4183        #[inline(always)]
4184        fn inline_size(_context: fidl::encoding::Context) -> usize {
4185            8
4186        }
4187        #[inline(always)]
4188        fn encode_is_copy() -> bool {
4189            true
4190        }
4191
4192        #[inline(always)]
4193        fn decode_is_copy() -> bool {
4194            true
4195        }
4196    }
4197
4198    unsafe impl<D: fidl::encoding::ResourceDialect>
4199        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D>
4200        for &BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4201    {
4202        #[inline]
4203        unsafe fn encode(
4204            self,
4205            encoder: &mut fidl::encoding::Encoder<'_, D>,
4206            offset: usize,
4207            _depth: fidl::encoding::Depth,
4208        ) -> fidl::Result<()> {
4209            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4210            unsafe {
4211                // Copy the object into the buffer.
4212                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4213                (buf_ptr as *mut BaseNetworkSocketSetIpv6MulticastInterfaceRequest)
4214                    .write_unaligned(
4215                        (self as *const BaseNetworkSocketSetIpv6MulticastInterfaceRequest).read(),
4216                    );
4217                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4218                // done second because the memcpy will write garbage to these bytes.
4219            }
4220            Ok(())
4221        }
4222    }
4223    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4224        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D> for (T0,)
4225    {
4226        #[inline]
4227        unsafe fn encode(
4228            self,
4229            encoder: &mut fidl::encoding::Encoder<'_, D>,
4230            offset: usize,
4231            depth: fidl::encoding::Depth,
4232        ) -> fidl::Result<()> {
4233            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4234            // Zero out padding regions. There's no need to apply masks
4235            // because the unmasked parts will be overwritten by fields.
4236            // Write the fields.
4237            self.0.encode(encoder, offset + 0, depth)?;
4238            Ok(())
4239        }
4240    }
4241
4242    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4243        for BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4244    {
4245        #[inline(always)]
4246        fn new_empty() -> Self {
4247            Self { value: fidl::new_empty!(u64, D) }
4248        }
4249
4250        #[inline]
4251        unsafe fn decode(
4252            &mut self,
4253            decoder: &mut fidl::encoding::Decoder<'_, D>,
4254            offset: usize,
4255            _depth: fidl::encoding::Depth,
4256        ) -> fidl::Result<()> {
4257            decoder.debug_check_bounds::<Self>(offset);
4258            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4259            // Verify that padding bytes are zero.
4260            // Copy from the buffer into the object.
4261            unsafe {
4262                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4263            }
4264            Ok(())
4265        }
4266    }
4267
4268    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4269        type Borrowed<'a> = &'a Self;
4270        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4271            value
4272        }
4273    }
4274
4275    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4276        type Owned = Self;
4277
4278        #[inline(always)]
4279        fn inline_align(_context: fidl::encoding::Context) -> usize {
4280            1
4281        }
4282
4283        #[inline(always)]
4284        fn inline_size(_context: fidl::encoding::Context) -> usize {
4285            1
4286        }
4287    }
4288
4289    unsafe impl<D: fidl::encoding::ResourceDialect>
4290        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>
4291        for &BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4292    {
4293        #[inline]
4294        unsafe fn encode(
4295            self,
4296            encoder: &mut fidl::encoding::Encoder<'_, D>,
4297            offset: usize,
4298            _depth: fidl::encoding::Depth,
4299        ) -> fidl::Result<()> {
4300            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4301            // Delegate to tuple encoding.
4302            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>::encode(
4303                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4304                encoder,
4305                offset,
4306                _depth,
4307            )
4308        }
4309    }
4310    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4311        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D> for (T0,)
4312    {
4313        #[inline]
4314        unsafe fn encode(
4315            self,
4316            encoder: &mut fidl::encoding::Encoder<'_, D>,
4317            offset: usize,
4318            depth: fidl::encoding::Depth,
4319        ) -> fidl::Result<()> {
4320            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4321            // Zero out padding regions. There's no need to apply masks
4322            // because the unmasked parts will be overwritten by fields.
4323            // Write the fields.
4324            self.0.encode(encoder, offset + 0, depth)?;
4325            Ok(())
4326        }
4327    }
4328
4329    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4330        for BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4331    {
4332        #[inline(always)]
4333        fn new_empty() -> Self {
4334            Self { value: fidl::new_empty!(bool, D) }
4335        }
4336
4337        #[inline]
4338        unsafe fn decode(
4339            &mut self,
4340            decoder: &mut fidl::encoding::Decoder<'_, D>,
4341            offset: usize,
4342            _depth: fidl::encoding::Depth,
4343        ) -> fidl::Result<()> {
4344            decoder.debug_check_bounds::<Self>(offset);
4345            // Verify that padding bytes are zero.
4346            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4347            Ok(())
4348        }
4349    }
4350
4351    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4352        type Borrowed<'a> = &'a Self;
4353        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4354            value
4355        }
4356    }
4357
4358    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4359        type Owned = Self;
4360
4361        #[inline(always)]
4362        fn inline_align(_context: fidl::encoding::Context) -> usize {
4363            1
4364        }
4365
4366        #[inline(always)]
4367        fn inline_size(_context: fidl::encoding::Context) -> usize {
4368            1
4369        }
4370    }
4371
4372    unsafe impl<D: fidl::encoding::ResourceDialect>
4373        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D>
4374        for &BaseNetworkSocketSetIpv6OnlyRequest
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::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4384            // Delegate to tuple encoding.
4385            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6OnlyRequest, D>::encode(
4386                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4387                encoder,
4388                offset,
4389                _depth,
4390            )
4391        }
4392    }
4393    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4394        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D> for (T0,)
4395    {
4396        #[inline]
4397        unsafe fn encode(
4398            self,
4399            encoder: &mut fidl::encoding::Encoder<'_, D>,
4400            offset: usize,
4401            depth: fidl::encoding::Depth,
4402        ) -> fidl::Result<()> {
4403            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4404            // Zero out padding regions. There's no need to apply masks
4405            // because the unmasked parts will be overwritten by fields.
4406            // Write the fields.
4407            self.0.encode(encoder, offset + 0, depth)?;
4408            Ok(())
4409        }
4410    }
4411
4412    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4413        for BaseNetworkSocketSetIpv6OnlyRequest
4414    {
4415        #[inline(always)]
4416        fn new_empty() -> Self {
4417            Self { value: fidl::new_empty!(bool, D) }
4418        }
4419
4420        #[inline]
4421        unsafe fn decode(
4422            &mut self,
4423            decoder: &mut fidl::encoding::Decoder<'_, D>,
4424            offset: usize,
4425            _depth: fidl::encoding::Depth,
4426        ) -> fidl::Result<()> {
4427            decoder.debug_check_bounds::<Self>(offset);
4428            // Verify that padding bytes are zero.
4429            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4430            Ok(())
4431        }
4432    }
4433
4434    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4435        type Borrowed<'a> = &'a Self;
4436        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4437            value
4438        }
4439    }
4440
4441    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4442        type Owned = Self;
4443
4444        #[inline(always)]
4445        fn inline_align(_context: fidl::encoding::Context) -> usize {
4446            1
4447        }
4448
4449        #[inline(always)]
4450        fn inline_size(_context: fidl::encoding::Context) -> usize {
4451            1
4452        }
4453    }
4454
4455    unsafe impl<D: fidl::encoding::ResourceDialect>
4456        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>
4457        for &BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4458    {
4459        #[inline]
4460        unsafe fn encode(
4461            self,
4462            encoder: &mut fidl::encoding::Encoder<'_, D>,
4463            offset: usize,
4464            _depth: fidl::encoding::Depth,
4465        ) -> fidl::Result<()> {
4466            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4467            // Delegate to tuple encoding.
4468            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>::encode(
4469                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4470                encoder,
4471                offset,
4472                _depth,
4473            )
4474        }
4475    }
4476    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4477        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D> for (T0,)
4478    {
4479        #[inline]
4480        unsafe fn encode(
4481            self,
4482            encoder: &mut fidl::encoding::Encoder<'_, D>,
4483            offset: usize,
4484            depth: fidl::encoding::Depth,
4485        ) -> fidl::Result<()> {
4486            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4487            // Zero out padding regions. There's no need to apply masks
4488            // because the unmasked parts will be overwritten by fields.
4489            // Write the fields.
4490            self.0.encode(encoder, offset + 0, depth)?;
4491            Ok(())
4492        }
4493    }
4494
4495    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4496        for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4497    {
4498        #[inline(always)]
4499        fn new_empty() -> Self {
4500            Self { value: fidl::new_empty!(bool, D) }
4501        }
4502
4503        #[inline]
4504        unsafe fn decode(
4505            &mut self,
4506            decoder: &mut fidl::encoding::Decoder<'_, D>,
4507            offset: usize,
4508            _depth: fidl::encoding::Depth,
4509        ) -> fidl::Result<()> {
4510            decoder.debug_check_bounds::<Self>(offset);
4511            // Verify that padding bytes are zero.
4512            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4513            Ok(())
4514        }
4515    }
4516
4517    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4518        type Borrowed<'a> = &'a Self;
4519        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4520            value
4521        }
4522    }
4523
4524    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4525        type Owned = Self;
4526
4527        #[inline(always)]
4528        fn inline_align(_context: fidl::encoding::Context) -> usize {
4529            1
4530        }
4531
4532        #[inline(always)]
4533        fn inline_size(_context: fidl::encoding::Context) -> usize {
4534            1
4535        }
4536    }
4537
4538    unsafe impl<D: fidl::encoding::ResourceDialect>
4539        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>
4540        for &BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4541    {
4542        #[inline]
4543        unsafe fn encode(
4544            self,
4545            encoder: &mut fidl::encoding::Encoder<'_, D>,
4546            offset: usize,
4547            _depth: fidl::encoding::Depth,
4548        ) -> fidl::Result<()> {
4549            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4550            // Delegate to tuple encoding.
4551            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>::encode(
4552                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4553                encoder,
4554                offset,
4555                _depth,
4556            )
4557        }
4558    }
4559    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4560        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D> for (T0,)
4561    {
4562        #[inline]
4563        unsafe fn encode(
4564            self,
4565            encoder: &mut fidl::encoding::Encoder<'_, D>,
4566            offset: usize,
4567            depth: fidl::encoding::Depth,
4568        ) -> fidl::Result<()> {
4569            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4570            // Zero out padding regions. There's no need to apply masks
4571            // because the unmasked parts will be overwritten by fields.
4572            // Write the fields.
4573            self.0.encode(encoder, offset + 0, depth)?;
4574            Ok(())
4575        }
4576    }
4577
4578    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4579        for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4580    {
4581        #[inline(always)]
4582        fn new_empty() -> Self {
4583            Self { value: fidl::new_empty!(bool, D) }
4584        }
4585
4586        #[inline]
4587        unsafe fn decode(
4588            &mut self,
4589            decoder: &mut fidl::encoding::Decoder<'_, D>,
4590            offset: usize,
4591            _depth: fidl::encoding::Depth,
4592        ) -> fidl::Result<()> {
4593            decoder.debug_check_bounds::<Self>(offset);
4594            // Verify that padding bytes are zero.
4595            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4596            Ok(())
4597        }
4598    }
4599
4600    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4601        type Borrowed<'a> = &'a Self;
4602        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4603            value
4604        }
4605    }
4606
4607    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4608        type Owned = Self;
4609
4610        #[inline(always)]
4611        fn inline_align(_context: fidl::encoding::Context) -> usize {
4612            1
4613        }
4614
4615        #[inline(always)]
4616        fn inline_size(_context: fidl::encoding::Context) -> usize {
4617            1
4618        }
4619    }
4620
4621    unsafe impl<D: fidl::encoding::ResourceDialect>
4622        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>
4623        for &BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4624    {
4625        #[inline]
4626        unsafe fn encode(
4627            self,
4628            encoder: &mut fidl::encoding::Encoder<'_, D>,
4629            offset: usize,
4630            _depth: fidl::encoding::Depth,
4631        ) -> fidl::Result<()> {
4632            encoder
4633                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4634            // Delegate to tuple encoding.
4635            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>::encode(
4636                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4637                encoder,
4638                offset,
4639                _depth,
4640            )
4641        }
4642    }
4643    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4644        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D> for (T0,)
4645    {
4646        #[inline]
4647        unsafe fn encode(
4648            self,
4649            encoder: &mut fidl::encoding::Encoder<'_, D>,
4650            offset: usize,
4651            depth: fidl::encoding::Depth,
4652        ) -> fidl::Result<()> {
4653            encoder
4654                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4655            // Zero out padding regions. There's no need to apply masks
4656            // because the unmasked parts will be overwritten by fields.
4657            // Write the fields.
4658            self.0.encode(encoder, offset + 0, depth)?;
4659            Ok(())
4660        }
4661    }
4662
4663    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4664        for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4665    {
4666        #[inline(always)]
4667        fn new_empty() -> Self {
4668            Self { value: fidl::new_empty!(bool, D) }
4669        }
4670
4671        #[inline]
4672        unsafe fn decode(
4673            &mut self,
4674            decoder: &mut fidl::encoding::Decoder<'_, D>,
4675            offset: usize,
4676            _depth: fidl::encoding::Depth,
4677        ) -> fidl::Result<()> {
4678            decoder.debug_check_bounds::<Self>(offset);
4679            // Verify that padding bytes are zero.
4680            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4681            Ok(())
4682        }
4683    }
4684
4685    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4686        type Borrowed<'a> = &'a Self;
4687        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4688            value
4689        }
4690    }
4691
4692    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4693        type Owned = Self;
4694
4695        #[inline(always)]
4696        fn inline_align(_context: fidl::encoding::Context) -> usize {
4697            8
4698        }
4699
4700        #[inline(always)]
4701        fn inline_size(_context: fidl::encoding::Context) -> usize {
4702            16
4703        }
4704    }
4705
4706    unsafe impl<D: fidl::encoding::ResourceDialect>
4707        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D>
4708        for &BaseNetworkSocketSetIpv6TrafficClassRequest
4709    {
4710        #[inline]
4711        unsafe fn encode(
4712            self,
4713            encoder: &mut fidl::encoding::Encoder<'_, D>,
4714            offset: usize,
4715            _depth: fidl::encoding::Depth,
4716        ) -> fidl::Result<()> {
4717            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
4718            // Delegate to tuple encoding.
4719            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6TrafficClassRequest, D>::encode(
4720                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4721                encoder,
4722                offset,
4723                _depth,
4724            )
4725        }
4726    }
4727    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4728        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D> for (T0,)
4729    {
4730        #[inline]
4731        unsafe fn encode(
4732            self,
4733            encoder: &mut fidl::encoding::Encoder<'_, D>,
4734            offset: usize,
4735            depth: fidl::encoding::Depth,
4736        ) -> fidl::Result<()> {
4737            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
4738            // Zero out padding regions. There's no need to apply masks
4739            // because the unmasked parts will be overwritten by fields.
4740            // Write the fields.
4741            self.0.encode(encoder, offset + 0, depth)?;
4742            Ok(())
4743        }
4744    }
4745
4746    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4747        for BaseNetworkSocketSetIpv6TrafficClassRequest
4748    {
4749        #[inline(always)]
4750        fn new_empty() -> Self {
4751            Self { value: fidl::new_empty!(OptionalUint8, D) }
4752        }
4753
4754        #[inline]
4755        unsafe fn decode(
4756            &mut self,
4757            decoder: &mut fidl::encoding::Decoder<'_, D>,
4758            offset: usize,
4759            _depth: fidl::encoding::Depth,
4760        ) -> fidl::Result<()> {
4761            decoder.debug_check_bounds::<Self>(offset);
4762            // Verify that padding bytes are zero.
4763            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4764            Ok(())
4765        }
4766    }
4767
4768    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
4769        type Borrowed<'a> = &'a Self;
4770        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4771            value
4772        }
4773    }
4774
4775    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
4776        type Owned = Self;
4777
4778        #[inline(always)]
4779        fn inline_align(_context: fidl::encoding::Context) -> usize {
4780            8
4781        }
4782
4783        #[inline(always)]
4784        fn inline_size(_context: fidl::encoding::Context) -> usize {
4785            16
4786        }
4787    }
4788
4789    unsafe impl<D: fidl::encoding::ResourceDialect>
4790        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>
4791        for &BaseNetworkSocketSetIpv6UnicastHopsRequest
4792    {
4793        #[inline]
4794        unsafe fn encode(
4795            self,
4796            encoder: &mut fidl::encoding::Encoder<'_, D>,
4797            offset: usize,
4798            _depth: fidl::encoding::Depth,
4799        ) -> fidl::Result<()> {
4800            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
4801            // Delegate to tuple encoding.
4802            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>::encode(
4803                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4804                encoder,
4805                offset,
4806                _depth,
4807            )
4808        }
4809    }
4810    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4811        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D> for (T0,)
4812    {
4813        #[inline]
4814        unsafe fn encode(
4815            self,
4816            encoder: &mut fidl::encoding::Encoder<'_, D>,
4817            offset: usize,
4818            depth: fidl::encoding::Depth,
4819        ) -> fidl::Result<()> {
4820            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
4821            // Zero out padding regions. There's no need to apply masks
4822            // because the unmasked parts will be overwritten by fields.
4823            // Write the fields.
4824            self.0.encode(encoder, offset + 0, depth)?;
4825            Ok(())
4826        }
4827    }
4828
4829    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4830        for BaseNetworkSocketSetIpv6UnicastHopsRequest
4831    {
4832        #[inline(always)]
4833        fn new_empty() -> Self {
4834            Self { value: fidl::new_empty!(OptionalUint8, D) }
4835        }
4836
4837        #[inline]
4838        unsafe fn decode(
4839            &mut self,
4840            decoder: &mut fidl::encoding::Decoder<'_, D>,
4841            offset: usize,
4842            _depth: fidl::encoding::Depth,
4843        ) -> fidl::Result<()> {
4844            decoder.debug_check_bounds::<Self>(offset);
4845            // Verify that padding bytes are zero.
4846            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4847            Ok(())
4848        }
4849    }
4850
4851    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketShutdownRequest {
4852        type Borrowed<'a> = &'a Self;
4853        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4854            value
4855        }
4856    }
4857
4858    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketShutdownRequest {
4859        type Owned = Self;
4860
4861        #[inline(always)]
4862        fn inline_align(_context: fidl::encoding::Context) -> usize {
4863            2
4864        }
4865
4866        #[inline(always)]
4867        fn inline_size(_context: fidl::encoding::Context) -> usize {
4868            2
4869        }
4870    }
4871
4872    unsafe impl<D: fidl::encoding::ResourceDialect>
4873        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D>
4874        for &BaseNetworkSocketShutdownRequest
4875    {
4876        #[inline]
4877        unsafe fn encode(
4878            self,
4879            encoder: &mut fidl::encoding::Encoder<'_, D>,
4880            offset: usize,
4881            _depth: fidl::encoding::Depth,
4882        ) -> fidl::Result<()> {
4883            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
4884            // Delegate to tuple encoding.
4885            fidl::encoding::Encode::<BaseNetworkSocketShutdownRequest, D>::encode(
4886                (<ShutdownMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
4887                encoder,
4888                offset,
4889                _depth,
4890            )
4891        }
4892    }
4893    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ShutdownMode, D>>
4894        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D> for (T0,)
4895    {
4896        #[inline]
4897        unsafe fn encode(
4898            self,
4899            encoder: &mut fidl::encoding::Encoder<'_, D>,
4900            offset: usize,
4901            depth: fidl::encoding::Depth,
4902        ) -> fidl::Result<()> {
4903            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
4904            // Zero out padding regions. There's no need to apply masks
4905            // because the unmasked parts will be overwritten by fields.
4906            // Write the fields.
4907            self.0.encode(encoder, offset + 0, depth)?;
4908            Ok(())
4909        }
4910    }
4911
4912    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4913        for BaseNetworkSocketShutdownRequest
4914    {
4915        #[inline(always)]
4916        fn new_empty() -> Self {
4917            Self { mode: fidl::new_empty!(ShutdownMode, D) }
4918        }
4919
4920        #[inline]
4921        unsafe fn decode(
4922            &mut self,
4923            decoder: &mut fidl::encoding::Decoder<'_, D>,
4924            offset: usize,
4925            _depth: fidl::encoding::Depth,
4926        ) -> fidl::Result<()> {
4927            decoder.debug_check_bounds::<Self>(offset);
4928            // Verify that padding bytes are zero.
4929            fidl::decode!(ShutdownMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
4930            Ok(())
4931        }
4932    }
4933
4934    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
4935        type Borrowed<'a> = &'a Self;
4936        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4937            value
4938        }
4939    }
4940
4941    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
4942        type Owned = Self;
4943
4944        #[inline(always)]
4945        fn inline_align(_context: fidl::encoding::Context) -> usize {
4946            1
4947        }
4948
4949        #[inline(always)]
4950        fn inline_size(_context: fidl::encoding::Context) -> usize {
4951            4
4952        }
4953    }
4954
4955    unsafe impl<D: fidl::encoding::ResourceDialect>
4956        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>
4957        for &BaseNetworkSocketGetIpMulticastInterfaceResponse
4958    {
4959        #[inline]
4960        unsafe fn encode(
4961            self,
4962            encoder: &mut fidl::encoding::Encoder<'_, D>,
4963            offset: usize,
4964            _depth: fidl::encoding::Depth,
4965        ) -> fidl::Result<()> {
4966            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
4967            // Delegate to tuple encoding.
4968            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>::encode(
4969                (
4970                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4971                ),
4972                encoder, offset, _depth
4973            )
4974        }
4975    }
4976    unsafe impl<
4977            D: fidl::encoding::ResourceDialect,
4978            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
4979        > fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D> for (T0,)
4980    {
4981        #[inline]
4982        unsafe fn encode(
4983            self,
4984            encoder: &mut fidl::encoding::Encoder<'_, D>,
4985            offset: usize,
4986            depth: fidl::encoding::Depth,
4987        ) -> fidl::Result<()> {
4988            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
4989            // Zero out padding regions. There's no need to apply masks
4990            // because the unmasked parts will be overwritten by fields.
4991            // Write the fields.
4992            self.0.encode(encoder, offset + 0, depth)?;
4993            Ok(())
4994        }
4995    }
4996
4997    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4998        for BaseNetworkSocketGetIpMulticastInterfaceResponse
4999    {
5000        #[inline(always)]
5001        fn new_empty() -> Self {
5002            Self { value: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D) }
5003        }
5004
5005        #[inline]
5006        unsafe fn decode(
5007            &mut self,
5008            decoder: &mut fidl::encoding::Decoder<'_, D>,
5009            offset: usize,
5010            _depth: fidl::encoding::Depth,
5011        ) -> fidl::Result<()> {
5012            decoder.debug_check_bounds::<Self>(offset);
5013            // Verify that padding bytes are zero.
5014            fidl::decode!(
5015                fidl_fuchsia_net__common::Ipv4Address,
5016                D,
5017                &mut self.value,
5018                decoder,
5019                offset + 0,
5020                _depth
5021            )?;
5022            Ok(())
5023        }
5024    }
5025
5026    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5027        type Borrowed<'a> = &'a Self;
5028        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5029            value
5030        }
5031    }
5032
5033    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5034        type Owned = Self;
5035
5036        #[inline(always)]
5037        fn inline_align(_context: fidl::encoding::Context) -> usize {
5038            1
5039        }
5040
5041        #[inline(always)]
5042        fn inline_size(_context: fidl::encoding::Context) -> usize {
5043            1
5044        }
5045    }
5046
5047    unsafe impl<D: fidl::encoding::ResourceDialect>
5048        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>
5049        for &BaseNetworkSocketGetIpMulticastLoopbackResponse
5050    {
5051        #[inline]
5052        unsafe fn encode(
5053            self,
5054            encoder: &mut fidl::encoding::Encoder<'_, D>,
5055            offset: usize,
5056            _depth: fidl::encoding::Depth,
5057        ) -> fidl::Result<()> {
5058            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5059            // Delegate to tuple encoding.
5060            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>::encode(
5061                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5062                encoder,
5063                offset,
5064                _depth,
5065            )
5066        }
5067    }
5068    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5069        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D> for (T0,)
5070    {
5071        #[inline]
5072        unsafe fn encode(
5073            self,
5074            encoder: &mut fidl::encoding::Encoder<'_, D>,
5075            offset: usize,
5076            depth: fidl::encoding::Depth,
5077        ) -> fidl::Result<()> {
5078            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5079            // Zero out padding regions. There's no need to apply masks
5080            // because the unmasked parts will be overwritten by fields.
5081            // Write the fields.
5082            self.0.encode(encoder, offset + 0, depth)?;
5083            Ok(())
5084        }
5085    }
5086
5087    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5088        for BaseNetworkSocketGetIpMulticastLoopbackResponse
5089    {
5090        #[inline(always)]
5091        fn new_empty() -> Self {
5092            Self { value: fidl::new_empty!(bool, D) }
5093        }
5094
5095        #[inline]
5096        unsafe fn decode(
5097            &mut self,
5098            decoder: &mut fidl::encoding::Decoder<'_, D>,
5099            offset: usize,
5100            _depth: fidl::encoding::Depth,
5101        ) -> fidl::Result<()> {
5102            decoder.debug_check_bounds::<Self>(offset);
5103            // Verify that padding bytes are zero.
5104            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5105            Ok(())
5106        }
5107    }
5108
5109    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5110        type Borrowed<'a> = &'a Self;
5111        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5112            value
5113        }
5114    }
5115
5116    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5117        type Owned = Self;
5118
5119        #[inline(always)]
5120        fn inline_align(_context: fidl::encoding::Context) -> usize {
5121            1
5122        }
5123
5124        #[inline(always)]
5125        fn inline_size(_context: fidl::encoding::Context) -> usize {
5126            1
5127        }
5128        #[inline(always)]
5129        fn encode_is_copy() -> bool {
5130            true
5131        }
5132
5133        #[inline(always)]
5134        fn decode_is_copy() -> bool {
5135            true
5136        }
5137    }
5138
5139    unsafe impl<D: fidl::encoding::ResourceDialect>
5140        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D>
5141        for &BaseNetworkSocketGetIpMulticastTtlResponse
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::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5151            unsafe {
5152                // Copy the object into the buffer.
5153                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5154                (buf_ptr as *mut BaseNetworkSocketGetIpMulticastTtlResponse).write_unaligned(
5155                    (self as *const BaseNetworkSocketGetIpMulticastTtlResponse).read(),
5156                );
5157                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5158                // done second because the memcpy will write garbage to these bytes.
5159            }
5160            Ok(())
5161        }
5162    }
5163    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5164        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D> for (T0,)
5165    {
5166        #[inline]
5167        unsafe fn encode(
5168            self,
5169            encoder: &mut fidl::encoding::Encoder<'_, D>,
5170            offset: usize,
5171            depth: fidl::encoding::Depth,
5172        ) -> fidl::Result<()> {
5173            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5174            // Zero out padding regions. There's no need to apply masks
5175            // because the unmasked parts will be overwritten by fields.
5176            // Write the fields.
5177            self.0.encode(encoder, offset + 0, depth)?;
5178            Ok(())
5179        }
5180    }
5181
5182    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5183        for BaseNetworkSocketGetIpMulticastTtlResponse
5184    {
5185        #[inline(always)]
5186        fn new_empty() -> Self {
5187            Self { value: fidl::new_empty!(u8, D) }
5188        }
5189
5190        #[inline]
5191        unsafe fn decode(
5192            &mut self,
5193            decoder: &mut fidl::encoding::Decoder<'_, D>,
5194            offset: usize,
5195            _depth: fidl::encoding::Depth,
5196        ) -> fidl::Result<()> {
5197            decoder.debug_check_bounds::<Self>(offset);
5198            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5199            // Verify that padding bytes are zero.
5200            // Copy from the buffer into the object.
5201            unsafe {
5202                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5203            }
5204            Ok(())
5205        }
5206    }
5207
5208    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5209        type Borrowed<'a> = &'a Self;
5210        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5211            value
5212        }
5213    }
5214
5215    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5216        type Owned = Self;
5217
5218        #[inline(always)]
5219        fn inline_align(_context: fidl::encoding::Context) -> usize {
5220            1
5221        }
5222
5223        #[inline(always)]
5224        fn inline_size(_context: fidl::encoding::Context) -> usize {
5225            1
5226        }
5227    }
5228
5229    unsafe impl<D: fidl::encoding::ResourceDialect>
5230        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D>
5231        for &BaseNetworkSocketGetIpPacketInfoResponse
5232    {
5233        #[inline]
5234        unsafe fn encode(
5235            self,
5236            encoder: &mut fidl::encoding::Encoder<'_, D>,
5237            offset: usize,
5238            _depth: fidl::encoding::Depth,
5239        ) -> fidl::Result<()> {
5240            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5241            // Delegate to tuple encoding.
5242            fidl::encoding::Encode::<BaseNetworkSocketGetIpPacketInfoResponse, D>::encode(
5243                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5244                encoder,
5245                offset,
5246                _depth,
5247            )
5248        }
5249    }
5250    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5251        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D> for (T0,)
5252    {
5253        #[inline]
5254        unsafe fn encode(
5255            self,
5256            encoder: &mut fidl::encoding::Encoder<'_, D>,
5257            offset: usize,
5258            depth: fidl::encoding::Depth,
5259        ) -> fidl::Result<()> {
5260            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5261            // Zero out padding regions. There's no need to apply masks
5262            // because the unmasked parts will be overwritten by fields.
5263            // Write the fields.
5264            self.0.encode(encoder, offset + 0, depth)?;
5265            Ok(())
5266        }
5267    }
5268
5269    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5270        for BaseNetworkSocketGetIpPacketInfoResponse
5271    {
5272        #[inline(always)]
5273        fn new_empty() -> Self {
5274            Self { value: fidl::new_empty!(bool, D) }
5275        }
5276
5277        #[inline]
5278        unsafe fn decode(
5279            &mut self,
5280            decoder: &mut fidl::encoding::Decoder<'_, D>,
5281            offset: usize,
5282            _depth: fidl::encoding::Depth,
5283        ) -> fidl::Result<()> {
5284            decoder.debug_check_bounds::<Self>(offset);
5285            // Verify that padding bytes are zero.
5286            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5287            Ok(())
5288        }
5289    }
5290
5291    impl fidl::encoding::ValueTypeMarker
5292        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5293    {
5294        type Borrowed<'a> = &'a Self;
5295        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5296            value
5297        }
5298    }
5299
5300    unsafe impl fidl::encoding::TypeMarker
5301        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5302    {
5303        type Owned = Self;
5304
5305        #[inline(always)]
5306        fn inline_align(_context: fidl::encoding::Context) -> usize {
5307            1
5308        }
5309
5310        #[inline(always)]
5311        fn inline_size(_context: fidl::encoding::Context) -> usize {
5312            1
5313        }
5314    }
5315
5316    unsafe impl<D: fidl::encoding::ResourceDialect>
5317        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5318        for &BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5319    {
5320        #[inline]
5321        unsafe fn encode(
5322            self,
5323            encoder: &mut fidl::encoding::Encoder<'_, D>,
5324            offset: usize,
5325            _depth: fidl::encoding::Depth,
5326        ) -> fidl::Result<()> {
5327            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5328            // Delegate to tuple encoding.
5329            fidl::encoding::Encode::<
5330                BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse,
5331                D,
5332            >::encode(
5333                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5334                encoder,
5335                offset,
5336                _depth,
5337            )
5338        }
5339    }
5340    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5341        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5342        for (T0,)
5343    {
5344        #[inline]
5345        unsafe fn encode(
5346            self,
5347            encoder: &mut fidl::encoding::Encoder<'_, D>,
5348            offset: usize,
5349            depth: fidl::encoding::Depth,
5350        ) -> fidl::Result<()> {
5351            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5352            // Zero out padding regions. There's no need to apply masks
5353            // because the unmasked parts will be overwritten by fields.
5354            // Write the fields.
5355            self.0.encode(encoder, offset + 0, depth)?;
5356            Ok(())
5357        }
5358    }
5359
5360    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5361        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5362    {
5363        #[inline(always)]
5364        fn new_empty() -> Self {
5365            Self { value: fidl::new_empty!(bool, D) }
5366        }
5367
5368        #[inline]
5369        unsafe fn decode(
5370            &mut self,
5371            decoder: &mut fidl::encoding::Decoder<'_, D>,
5372            offset: usize,
5373            _depth: fidl::encoding::Depth,
5374        ) -> fidl::Result<()> {
5375            decoder.debug_check_bounds::<Self>(offset);
5376            // Verify that padding bytes are zero.
5377            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5378            Ok(())
5379        }
5380    }
5381
5382    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5383        type Borrowed<'a> = &'a Self;
5384        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5385            value
5386        }
5387    }
5388
5389    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5390        type Owned = Self;
5391
5392        #[inline(always)]
5393        fn inline_align(_context: fidl::encoding::Context) -> usize {
5394            1
5395        }
5396
5397        #[inline(always)]
5398        fn inline_size(_context: fidl::encoding::Context) -> usize {
5399            1
5400        }
5401    }
5402
5403    unsafe impl<D: fidl::encoding::ResourceDialect>
5404        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D>
5405        for &BaseNetworkSocketGetIpReceiveTtlResponse
5406    {
5407        #[inline]
5408        unsafe fn encode(
5409            self,
5410            encoder: &mut fidl::encoding::Encoder<'_, D>,
5411            offset: usize,
5412            _depth: fidl::encoding::Depth,
5413        ) -> fidl::Result<()> {
5414            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5415            // Delegate to tuple encoding.
5416            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTtlResponse, D>::encode(
5417                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5418                encoder,
5419                offset,
5420                _depth,
5421            )
5422        }
5423    }
5424    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5425        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D> for (T0,)
5426    {
5427        #[inline]
5428        unsafe fn encode(
5429            self,
5430            encoder: &mut fidl::encoding::Encoder<'_, D>,
5431            offset: usize,
5432            depth: fidl::encoding::Depth,
5433        ) -> fidl::Result<()> {
5434            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5435            // Zero out padding regions. There's no need to apply masks
5436            // because the unmasked parts will be overwritten by fields.
5437            // Write the fields.
5438            self.0.encode(encoder, offset + 0, depth)?;
5439            Ok(())
5440        }
5441    }
5442
5443    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5444        for BaseNetworkSocketGetIpReceiveTtlResponse
5445    {
5446        #[inline(always)]
5447        fn new_empty() -> Self {
5448            Self { value: fidl::new_empty!(bool, D) }
5449        }
5450
5451        #[inline]
5452        unsafe fn decode(
5453            &mut self,
5454            decoder: &mut fidl::encoding::Decoder<'_, D>,
5455            offset: usize,
5456            _depth: fidl::encoding::Depth,
5457        ) -> fidl::Result<()> {
5458            decoder.debug_check_bounds::<Self>(offset);
5459            // Verify that padding bytes are zero.
5460            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5461            Ok(())
5462        }
5463    }
5464
5465    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5466        type Borrowed<'a> = &'a Self;
5467        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5468            value
5469        }
5470    }
5471
5472    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5473        type Owned = Self;
5474
5475        #[inline(always)]
5476        fn inline_align(_context: fidl::encoding::Context) -> usize {
5477            1
5478        }
5479
5480        #[inline(always)]
5481        fn inline_size(_context: fidl::encoding::Context) -> usize {
5482            1
5483        }
5484    }
5485
5486    unsafe impl<D: fidl::encoding::ResourceDialect>
5487        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>
5488        for &BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5489    {
5490        #[inline]
5491        unsafe fn encode(
5492            self,
5493            encoder: &mut fidl::encoding::Encoder<'_, D>,
5494            offset: usize,
5495            _depth: fidl::encoding::Depth,
5496        ) -> fidl::Result<()> {
5497            encoder
5498                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5499            // Delegate to tuple encoding.
5500            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>::encode(
5501                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5502                encoder,
5503                offset,
5504                _depth,
5505            )
5506        }
5507    }
5508    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5509        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D> for (T0,)
5510    {
5511        #[inline]
5512        unsafe fn encode(
5513            self,
5514            encoder: &mut fidl::encoding::Encoder<'_, D>,
5515            offset: usize,
5516            depth: fidl::encoding::Depth,
5517        ) -> fidl::Result<()> {
5518            encoder
5519                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5520            // Zero out padding regions. There's no need to apply masks
5521            // because the unmasked parts will be overwritten by fields.
5522            // Write the fields.
5523            self.0.encode(encoder, offset + 0, depth)?;
5524            Ok(())
5525        }
5526    }
5527
5528    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5529        for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5530    {
5531        #[inline(always)]
5532        fn new_empty() -> Self {
5533            Self { value: fidl::new_empty!(bool, D) }
5534        }
5535
5536        #[inline]
5537        unsafe fn decode(
5538            &mut self,
5539            decoder: &mut fidl::encoding::Decoder<'_, D>,
5540            offset: usize,
5541            _depth: fidl::encoding::Depth,
5542        ) -> fidl::Result<()> {
5543            decoder.debug_check_bounds::<Self>(offset);
5544            // Verify that padding bytes are zero.
5545            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5546            Ok(())
5547        }
5548    }
5549
5550    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5551        type Borrowed<'a> = &'a Self;
5552        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5553            value
5554        }
5555    }
5556
5557    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5558        type Owned = Self;
5559
5560        #[inline(always)]
5561        fn inline_align(_context: fidl::encoding::Context) -> usize {
5562            1
5563        }
5564
5565        #[inline(always)]
5566        fn inline_size(_context: fidl::encoding::Context) -> usize {
5567            1
5568        }
5569    }
5570
5571    unsafe impl<D: fidl::encoding::ResourceDialect>
5572        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D>
5573        for &BaseNetworkSocketGetIpTransparentResponse
5574    {
5575        #[inline]
5576        unsafe fn encode(
5577            self,
5578            encoder: &mut fidl::encoding::Encoder<'_, D>,
5579            offset: usize,
5580            _depth: fidl::encoding::Depth,
5581        ) -> fidl::Result<()> {
5582            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5583            // Delegate to tuple encoding.
5584            fidl::encoding::Encode::<BaseNetworkSocketGetIpTransparentResponse, D>::encode(
5585                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5586                encoder,
5587                offset,
5588                _depth,
5589            )
5590        }
5591    }
5592    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5593        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D> for (T0,)
5594    {
5595        #[inline]
5596        unsafe fn encode(
5597            self,
5598            encoder: &mut fidl::encoding::Encoder<'_, D>,
5599            offset: usize,
5600            depth: fidl::encoding::Depth,
5601        ) -> fidl::Result<()> {
5602            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5603            // Zero out padding regions. There's no need to apply masks
5604            // because the unmasked parts will be overwritten by fields.
5605            // Write the fields.
5606            self.0.encode(encoder, offset + 0, depth)?;
5607            Ok(())
5608        }
5609    }
5610
5611    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5612        for BaseNetworkSocketGetIpTransparentResponse
5613    {
5614        #[inline(always)]
5615        fn new_empty() -> Self {
5616            Self { value: fidl::new_empty!(bool, D) }
5617        }
5618
5619        #[inline]
5620        unsafe fn decode(
5621            &mut self,
5622            decoder: &mut fidl::encoding::Decoder<'_, D>,
5623            offset: usize,
5624            _depth: fidl::encoding::Depth,
5625        ) -> fidl::Result<()> {
5626            decoder.debug_check_bounds::<Self>(offset);
5627            // Verify that padding bytes are zero.
5628            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5629            Ok(())
5630        }
5631    }
5632
5633    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTtlResponse {
5634        type Borrowed<'a> = &'a Self;
5635        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5636            value
5637        }
5638    }
5639
5640    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTtlResponse {
5641        type Owned = Self;
5642
5643        #[inline(always)]
5644        fn inline_align(_context: fidl::encoding::Context) -> usize {
5645            1
5646        }
5647
5648        #[inline(always)]
5649        fn inline_size(_context: fidl::encoding::Context) -> usize {
5650            1
5651        }
5652        #[inline(always)]
5653        fn encode_is_copy() -> bool {
5654            true
5655        }
5656
5657        #[inline(always)]
5658        fn decode_is_copy() -> bool {
5659            true
5660        }
5661    }
5662
5663    unsafe impl<D: fidl::encoding::ResourceDialect>
5664        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D>
5665        for &BaseNetworkSocketGetIpTtlResponse
5666    {
5667        #[inline]
5668        unsafe fn encode(
5669            self,
5670            encoder: &mut fidl::encoding::Encoder<'_, D>,
5671            offset: usize,
5672            _depth: fidl::encoding::Depth,
5673        ) -> fidl::Result<()> {
5674            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5675            unsafe {
5676                // Copy the object into the buffer.
5677                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5678                (buf_ptr as *mut BaseNetworkSocketGetIpTtlResponse)
5679                    .write_unaligned((self as *const BaseNetworkSocketGetIpTtlResponse).read());
5680                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5681                // done second because the memcpy will write garbage to these bytes.
5682            }
5683            Ok(())
5684        }
5685    }
5686    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5687        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D> for (T0,)
5688    {
5689        #[inline]
5690        unsafe fn encode(
5691            self,
5692            encoder: &mut fidl::encoding::Encoder<'_, D>,
5693            offset: usize,
5694            depth: fidl::encoding::Depth,
5695        ) -> fidl::Result<()> {
5696            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5697            // Zero out padding regions. There's no need to apply masks
5698            // because the unmasked parts will be overwritten by fields.
5699            // Write the fields.
5700            self.0.encode(encoder, offset + 0, depth)?;
5701            Ok(())
5702        }
5703    }
5704
5705    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5706        for BaseNetworkSocketGetIpTtlResponse
5707    {
5708        #[inline(always)]
5709        fn new_empty() -> Self {
5710            Self { value: fidl::new_empty!(u8, D) }
5711        }
5712
5713        #[inline]
5714        unsafe fn decode(
5715            &mut self,
5716            decoder: &mut fidl::encoding::Decoder<'_, D>,
5717            offset: usize,
5718            _depth: fidl::encoding::Depth,
5719        ) -> fidl::Result<()> {
5720            decoder.debug_check_bounds::<Self>(offset);
5721            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5722            // Verify that padding bytes are zero.
5723            // Copy from the buffer into the object.
5724            unsafe {
5725                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5726            }
5727            Ok(())
5728        }
5729    }
5730
5731    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
5732        type Borrowed<'a> = &'a Self;
5733        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5734            value
5735        }
5736    }
5737
5738    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
5739        type Owned = Self;
5740
5741        #[inline(always)]
5742        fn inline_align(_context: fidl::encoding::Context) -> usize {
5743            1
5744        }
5745
5746        #[inline(always)]
5747        fn inline_size(_context: fidl::encoding::Context) -> usize {
5748            1
5749        }
5750        #[inline(always)]
5751        fn encode_is_copy() -> bool {
5752            true
5753        }
5754
5755        #[inline(always)]
5756        fn decode_is_copy() -> bool {
5757            true
5758        }
5759    }
5760
5761    unsafe impl<D: fidl::encoding::ResourceDialect>
5762        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D>
5763        for &BaseNetworkSocketGetIpTypeOfServiceResponse
5764    {
5765        #[inline]
5766        unsafe fn encode(
5767            self,
5768            encoder: &mut fidl::encoding::Encoder<'_, D>,
5769            offset: usize,
5770            _depth: fidl::encoding::Depth,
5771        ) -> fidl::Result<()> {
5772            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
5773            unsafe {
5774                // Copy the object into the buffer.
5775                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5776                (buf_ptr as *mut BaseNetworkSocketGetIpTypeOfServiceResponse).write_unaligned(
5777                    (self as *const BaseNetworkSocketGetIpTypeOfServiceResponse).read(),
5778                );
5779                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5780                // done second because the memcpy will write garbage to these bytes.
5781            }
5782            Ok(())
5783        }
5784    }
5785    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5786        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D> for (T0,)
5787    {
5788        #[inline]
5789        unsafe fn encode(
5790            self,
5791            encoder: &mut fidl::encoding::Encoder<'_, D>,
5792            offset: usize,
5793            depth: fidl::encoding::Depth,
5794        ) -> fidl::Result<()> {
5795            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
5796            // Zero out padding regions. There's no need to apply masks
5797            // because the unmasked parts will be overwritten by fields.
5798            // Write the fields.
5799            self.0.encode(encoder, offset + 0, depth)?;
5800            Ok(())
5801        }
5802    }
5803
5804    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5805        for BaseNetworkSocketGetIpTypeOfServiceResponse
5806    {
5807        #[inline(always)]
5808        fn new_empty() -> Self {
5809            Self { value: fidl::new_empty!(u8, D) }
5810        }
5811
5812        #[inline]
5813        unsafe fn decode(
5814            &mut self,
5815            decoder: &mut fidl::encoding::Decoder<'_, D>,
5816            offset: usize,
5817            _depth: fidl::encoding::Depth,
5818        ) -> fidl::Result<()> {
5819            decoder.debug_check_bounds::<Self>(offset);
5820            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5821            // Verify that padding bytes are zero.
5822            // Copy from the buffer into the object.
5823            unsafe {
5824                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5825            }
5826            Ok(())
5827        }
5828    }
5829
5830    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
5831        type Borrowed<'a> = &'a Self;
5832        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5833            value
5834        }
5835    }
5836
5837    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
5838        type Owned = Self;
5839
5840        #[inline(always)]
5841        fn inline_align(_context: fidl::encoding::Context) -> usize {
5842            1
5843        }
5844
5845        #[inline(always)]
5846        fn inline_size(_context: fidl::encoding::Context) -> usize {
5847            1
5848        }
5849        #[inline(always)]
5850        fn encode_is_copy() -> bool {
5851            true
5852        }
5853
5854        #[inline(always)]
5855        fn decode_is_copy() -> bool {
5856            true
5857        }
5858    }
5859
5860    unsafe impl<D: fidl::encoding::ResourceDialect>
5861        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D>
5862        for &BaseNetworkSocketGetIpv6MulticastHopsResponse
5863    {
5864        #[inline]
5865        unsafe fn encode(
5866            self,
5867            encoder: &mut fidl::encoding::Encoder<'_, D>,
5868            offset: usize,
5869            _depth: fidl::encoding::Depth,
5870        ) -> fidl::Result<()> {
5871            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
5872            unsafe {
5873                // Copy the object into the buffer.
5874                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5875                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastHopsResponse).write_unaligned(
5876                    (self as *const BaseNetworkSocketGetIpv6MulticastHopsResponse).read(),
5877                );
5878                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5879                // done second because the memcpy will write garbage to these bytes.
5880            }
5881            Ok(())
5882        }
5883    }
5884    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5885        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D> for (T0,)
5886    {
5887        #[inline]
5888        unsafe fn encode(
5889            self,
5890            encoder: &mut fidl::encoding::Encoder<'_, D>,
5891            offset: usize,
5892            depth: fidl::encoding::Depth,
5893        ) -> fidl::Result<()> {
5894            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
5895            // Zero out padding regions. There's no need to apply masks
5896            // because the unmasked parts will be overwritten by fields.
5897            // Write the fields.
5898            self.0.encode(encoder, offset + 0, depth)?;
5899            Ok(())
5900        }
5901    }
5902
5903    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5904        for BaseNetworkSocketGetIpv6MulticastHopsResponse
5905    {
5906        #[inline(always)]
5907        fn new_empty() -> Self {
5908            Self { value: fidl::new_empty!(u8, D) }
5909        }
5910
5911        #[inline]
5912        unsafe fn decode(
5913            &mut self,
5914            decoder: &mut fidl::encoding::Decoder<'_, D>,
5915            offset: usize,
5916            _depth: fidl::encoding::Depth,
5917        ) -> fidl::Result<()> {
5918            decoder.debug_check_bounds::<Self>(offset);
5919            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5920            // Verify that padding bytes are zero.
5921            // Copy from the buffer into the object.
5922            unsafe {
5923                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5924            }
5925            Ok(())
5926        }
5927    }
5928
5929    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
5930        type Borrowed<'a> = &'a Self;
5931        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5932            value
5933        }
5934    }
5935
5936    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
5937        type Owned = Self;
5938
5939        #[inline(always)]
5940        fn inline_align(_context: fidl::encoding::Context) -> usize {
5941            8
5942        }
5943
5944        #[inline(always)]
5945        fn inline_size(_context: fidl::encoding::Context) -> usize {
5946            8
5947        }
5948        #[inline(always)]
5949        fn encode_is_copy() -> bool {
5950            true
5951        }
5952
5953        #[inline(always)]
5954        fn decode_is_copy() -> bool {
5955            true
5956        }
5957    }
5958
5959    unsafe impl<D: fidl::encoding::ResourceDialect>
5960        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D>
5961        for &BaseNetworkSocketGetIpv6MulticastInterfaceResponse
5962    {
5963        #[inline]
5964        unsafe fn encode(
5965            self,
5966            encoder: &mut fidl::encoding::Encoder<'_, D>,
5967            offset: usize,
5968            _depth: fidl::encoding::Depth,
5969        ) -> fidl::Result<()> {
5970            encoder
5971                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
5972            unsafe {
5973                // Copy the object into the buffer.
5974                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5975                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastInterfaceResponse)
5976                    .write_unaligned(
5977                        (self as *const BaseNetworkSocketGetIpv6MulticastInterfaceResponse).read(),
5978                    );
5979                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5980                // done second because the memcpy will write garbage to these bytes.
5981            }
5982            Ok(())
5983        }
5984    }
5985    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
5986        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D> for (T0,)
5987    {
5988        #[inline]
5989        unsafe fn encode(
5990            self,
5991            encoder: &mut fidl::encoding::Encoder<'_, D>,
5992            offset: usize,
5993            depth: fidl::encoding::Depth,
5994        ) -> fidl::Result<()> {
5995            encoder
5996                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
5997            // Zero out padding regions. There's no need to apply masks
5998            // because the unmasked parts will be overwritten by fields.
5999            // Write the fields.
6000            self.0.encode(encoder, offset + 0, depth)?;
6001            Ok(())
6002        }
6003    }
6004
6005    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6006        for BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6007    {
6008        #[inline(always)]
6009        fn new_empty() -> Self {
6010            Self { value: fidl::new_empty!(u64, D) }
6011        }
6012
6013        #[inline]
6014        unsafe fn decode(
6015            &mut self,
6016            decoder: &mut fidl::encoding::Decoder<'_, D>,
6017            offset: usize,
6018            _depth: fidl::encoding::Depth,
6019        ) -> fidl::Result<()> {
6020            decoder.debug_check_bounds::<Self>(offset);
6021            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6022            // Verify that padding bytes are zero.
6023            // Copy from the buffer into the object.
6024            unsafe {
6025                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6026            }
6027            Ok(())
6028        }
6029    }
6030
6031    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6032        type Borrowed<'a> = &'a Self;
6033        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6034            value
6035        }
6036    }
6037
6038    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6039        type Owned = Self;
6040
6041        #[inline(always)]
6042        fn inline_align(_context: fidl::encoding::Context) -> usize {
6043            1
6044        }
6045
6046        #[inline(always)]
6047        fn inline_size(_context: fidl::encoding::Context) -> usize {
6048            1
6049        }
6050    }
6051
6052    unsafe impl<D: fidl::encoding::ResourceDialect>
6053        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>
6054        for &BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6055    {
6056        #[inline]
6057        unsafe fn encode(
6058            self,
6059            encoder: &mut fidl::encoding::Encoder<'_, D>,
6060            offset: usize,
6061            _depth: fidl::encoding::Depth,
6062        ) -> fidl::Result<()> {
6063            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6064            // Delegate to tuple encoding.
6065            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>::encode(
6066                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6067                encoder,
6068                offset,
6069                _depth,
6070            )
6071        }
6072    }
6073    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6074        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D> for (T0,)
6075    {
6076        #[inline]
6077        unsafe fn encode(
6078            self,
6079            encoder: &mut fidl::encoding::Encoder<'_, D>,
6080            offset: usize,
6081            depth: fidl::encoding::Depth,
6082        ) -> fidl::Result<()> {
6083            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6084            // Zero out padding regions. There's no need to apply masks
6085            // because the unmasked parts will be overwritten by fields.
6086            // Write the fields.
6087            self.0.encode(encoder, offset + 0, depth)?;
6088            Ok(())
6089        }
6090    }
6091
6092    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6093        for BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6094    {
6095        #[inline(always)]
6096        fn new_empty() -> Self {
6097            Self { value: fidl::new_empty!(bool, D) }
6098        }
6099
6100        #[inline]
6101        unsafe fn decode(
6102            &mut self,
6103            decoder: &mut fidl::encoding::Decoder<'_, D>,
6104            offset: usize,
6105            _depth: fidl::encoding::Depth,
6106        ) -> fidl::Result<()> {
6107            decoder.debug_check_bounds::<Self>(offset);
6108            // Verify that padding bytes are zero.
6109            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6110            Ok(())
6111        }
6112    }
6113
6114    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6115        type Borrowed<'a> = &'a Self;
6116        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6117            value
6118        }
6119    }
6120
6121    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6122        type Owned = Self;
6123
6124        #[inline(always)]
6125        fn inline_align(_context: fidl::encoding::Context) -> usize {
6126            1
6127        }
6128
6129        #[inline(always)]
6130        fn inline_size(_context: fidl::encoding::Context) -> usize {
6131            1
6132        }
6133    }
6134
6135    unsafe impl<D: fidl::encoding::ResourceDialect>
6136        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D>
6137        for &BaseNetworkSocketGetIpv6OnlyResponse
6138    {
6139        #[inline]
6140        unsafe fn encode(
6141            self,
6142            encoder: &mut fidl::encoding::Encoder<'_, D>,
6143            offset: usize,
6144            _depth: fidl::encoding::Depth,
6145        ) -> fidl::Result<()> {
6146            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6147            // Delegate to tuple encoding.
6148            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6OnlyResponse, D>::encode(
6149                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6150                encoder,
6151                offset,
6152                _depth,
6153            )
6154        }
6155    }
6156    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6157        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D> for (T0,)
6158    {
6159        #[inline]
6160        unsafe fn encode(
6161            self,
6162            encoder: &mut fidl::encoding::Encoder<'_, D>,
6163            offset: usize,
6164            depth: fidl::encoding::Depth,
6165        ) -> fidl::Result<()> {
6166            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6167            // Zero out padding regions. There's no need to apply masks
6168            // because the unmasked parts will be overwritten by fields.
6169            // Write the fields.
6170            self.0.encode(encoder, offset + 0, depth)?;
6171            Ok(())
6172        }
6173    }
6174
6175    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6176        for BaseNetworkSocketGetIpv6OnlyResponse
6177    {
6178        #[inline(always)]
6179        fn new_empty() -> Self {
6180            Self { value: fidl::new_empty!(bool, D) }
6181        }
6182
6183        #[inline]
6184        unsafe fn decode(
6185            &mut self,
6186            decoder: &mut fidl::encoding::Decoder<'_, D>,
6187            offset: usize,
6188            _depth: fidl::encoding::Depth,
6189        ) -> fidl::Result<()> {
6190            decoder.debug_check_bounds::<Self>(offset);
6191            // Verify that padding bytes are zero.
6192            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6193            Ok(())
6194        }
6195    }
6196
6197    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6198        type Borrowed<'a> = &'a Self;
6199        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6200            value
6201        }
6202    }
6203
6204    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6205        type Owned = Self;
6206
6207        #[inline(always)]
6208        fn inline_align(_context: fidl::encoding::Context) -> usize {
6209            1
6210        }
6211
6212        #[inline(always)]
6213        fn inline_size(_context: fidl::encoding::Context) -> usize {
6214            1
6215        }
6216    }
6217
6218    unsafe impl<D: fidl::encoding::ResourceDialect>
6219        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>
6220        for &BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6221    {
6222        #[inline]
6223        unsafe fn encode(
6224            self,
6225            encoder: &mut fidl::encoding::Encoder<'_, D>,
6226            offset: usize,
6227            _depth: fidl::encoding::Depth,
6228        ) -> fidl::Result<()> {
6229            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6230            // Delegate to tuple encoding.
6231            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>::encode(
6232                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6233                encoder,
6234                offset,
6235                _depth,
6236            )
6237        }
6238    }
6239    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6240        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D> for (T0,)
6241    {
6242        #[inline]
6243        unsafe fn encode(
6244            self,
6245            encoder: &mut fidl::encoding::Encoder<'_, D>,
6246            offset: usize,
6247            depth: fidl::encoding::Depth,
6248        ) -> fidl::Result<()> {
6249            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6250            // Zero out padding regions. There's no need to apply masks
6251            // because the unmasked parts will be overwritten by fields.
6252            // Write the fields.
6253            self.0.encode(encoder, offset + 0, depth)?;
6254            Ok(())
6255        }
6256    }
6257
6258    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6259        for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6260    {
6261        #[inline(always)]
6262        fn new_empty() -> Self {
6263            Self { value: fidl::new_empty!(bool, D) }
6264        }
6265
6266        #[inline]
6267        unsafe fn decode(
6268            &mut self,
6269            decoder: &mut fidl::encoding::Decoder<'_, D>,
6270            offset: usize,
6271            _depth: fidl::encoding::Depth,
6272        ) -> fidl::Result<()> {
6273            decoder.debug_check_bounds::<Self>(offset);
6274            // Verify that padding bytes are zero.
6275            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6276            Ok(())
6277        }
6278    }
6279
6280    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6281        type Borrowed<'a> = &'a Self;
6282        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6283            value
6284        }
6285    }
6286
6287    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6288        type Owned = Self;
6289
6290        #[inline(always)]
6291        fn inline_align(_context: fidl::encoding::Context) -> usize {
6292            1
6293        }
6294
6295        #[inline(always)]
6296        fn inline_size(_context: fidl::encoding::Context) -> usize {
6297            1
6298        }
6299    }
6300
6301    unsafe impl<D: fidl::encoding::ResourceDialect>
6302        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>
6303        for &BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6304    {
6305        #[inline]
6306        unsafe fn encode(
6307            self,
6308            encoder: &mut fidl::encoding::Encoder<'_, D>,
6309            offset: usize,
6310            _depth: fidl::encoding::Depth,
6311        ) -> fidl::Result<()> {
6312            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6313            // Delegate to tuple encoding.
6314            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>::encode(
6315                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6316                encoder,
6317                offset,
6318                _depth,
6319            )
6320        }
6321    }
6322    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6323        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D> for (T0,)
6324    {
6325        #[inline]
6326        unsafe fn encode(
6327            self,
6328            encoder: &mut fidl::encoding::Encoder<'_, D>,
6329            offset: usize,
6330            depth: fidl::encoding::Depth,
6331        ) -> fidl::Result<()> {
6332            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6333            // Zero out padding regions. There's no need to apply masks
6334            // because the unmasked parts will be overwritten by fields.
6335            // Write the fields.
6336            self.0.encode(encoder, offset + 0, depth)?;
6337            Ok(())
6338        }
6339    }
6340
6341    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6342        for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6343    {
6344        #[inline(always)]
6345        fn new_empty() -> Self {
6346            Self { value: fidl::new_empty!(bool, D) }
6347        }
6348
6349        #[inline]
6350        unsafe fn decode(
6351            &mut self,
6352            decoder: &mut fidl::encoding::Decoder<'_, D>,
6353            offset: usize,
6354            _depth: fidl::encoding::Depth,
6355        ) -> fidl::Result<()> {
6356            decoder.debug_check_bounds::<Self>(offset);
6357            // Verify that padding bytes are zero.
6358            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6359            Ok(())
6360        }
6361    }
6362
6363    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6364        type Borrowed<'a> = &'a Self;
6365        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6366            value
6367        }
6368    }
6369
6370    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6371        type Owned = Self;
6372
6373        #[inline(always)]
6374        fn inline_align(_context: fidl::encoding::Context) -> usize {
6375            1
6376        }
6377
6378        #[inline(always)]
6379        fn inline_size(_context: fidl::encoding::Context) -> usize {
6380            1
6381        }
6382    }
6383
6384    unsafe impl<D: fidl::encoding::ResourceDialect>
6385        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>
6386        for &BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6387    {
6388        #[inline]
6389        unsafe fn encode(
6390            self,
6391            encoder: &mut fidl::encoding::Encoder<'_, D>,
6392            offset: usize,
6393            _depth: fidl::encoding::Depth,
6394        ) -> fidl::Result<()> {
6395            encoder
6396                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6397            // Delegate to tuple encoding.
6398            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>::encode(
6399                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6400                encoder,
6401                offset,
6402                _depth,
6403            )
6404        }
6405    }
6406    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6407        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D> for (T0,)
6408    {
6409        #[inline]
6410        unsafe fn encode(
6411            self,
6412            encoder: &mut fidl::encoding::Encoder<'_, D>,
6413            offset: usize,
6414            depth: fidl::encoding::Depth,
6415        ) -> fidl::Result<()> {
6416            encoder
6417                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6418            // Zero out padding regions. There's no need to apply masks
6419            // because the unmasked parts will be overwritten by fields.
6420            // Write the fields.
6421            self.0.encode(encoder, offset + 0, depth)?;
6422            Ok(())
6423        }
6424    }
6425
6426    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6427        for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6428    {
6429        #[inline(always)]
6430        fn new_empty() -> Self {
6431            Self { value: fidl::new_empty!(bool, D) }
6432        }
6433
6434        #[inline]
6435        unsafe fn decode(
6436            &mut self,
6437            decoder: &mut fidl::encoding::Decoder<'_, D>,
6438            offset: usize,
6439            _depth: fidl::encoding::Depth,
6440        ) -> fidl::Result<()> {
6441            decoder.debug_check_bounds::<Self>(offset);
6442            // Verify that padding bytes are zero.
6443            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6444            Ok(())
6445        }
6446    }
6447
6448    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6449        type Borrowed<'a> = &'a Self;
6450        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6451            value
6452        }
6453    }
6454
6455    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6456        type Owned = Self;
6457
6458        #[inline(always)]
6459        fn inline_align(_context: fidl::encoding::Context) -> usize {
6460            1
6461        }
6462
6463        #[inline(always)]
6464        fn inline_size(_context: fidl::encoding::Context) -> usize {
6465            1
6466        }
6467        #[inline(always)]
6468        fn encode_is_copy() -> bool {
6469            true
6470        }
6471
6472        #[inline(always)]
6473        fn decode_is_copy() -> bool {
6474            true
6475        }
6476    }
6477
6478    unsafe impl<D: fidl::encoding::ResourceDialect>
6479        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D>
6480        for &BaseNetworkSocketGetIpv6TrafficClassResponse
6481    {
6482        #[inline]
6483        unsafe fn encode(
6484            self,
6485            encoder: &mut fidl::encoding::Encoder<'_, D>,
6486            offset: usize,
6487            _depth: fidl::encoding::Depth,
6488        ) -> fidl::Result<()> {
6489            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6490            unsafe {
6491                // Copy the object into the buffer.
6492                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6493                (buf_ptr as *mut BaseNetworkSocketGetIpv6TrafficClassResponse).write_unaligned(
6494                    (self as *const BaseNetworkSocketGetIpv6TrafficClassResponse).read(),
6495                );
6496                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6497                // done second because the memcpy will write garbage to these bytes.
6498            }
6499            Ok(())
6500        }
6501    }
6502    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6503        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D> for (T0,)
6504    {
6505        #[inline]
6506        unsafe fn encode(
6507            self,
6508            encoder: &mut fidl::encoding::Encoder<'_, D>,
6509            offset: usize,
6510            depth: fidl::encoding::Depth,
6511        ) -> fidl::Result<()> {
6512            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6513            // Zero out padding regions. There's no need to apply masks
6514            // because the unmasked parts will be overwritten by fields.
6515            // Write the fields.
6516            self.0.encode(encoder, offset + 0, depth)?;
6517            Ok(())
6518        }
6519    }
6520
6521    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6522        for BaseNetworkSocketGetIpv6TrafficClassResponse
6523    {
6524        #[inline(always)]
6525        fn new_empty() -> Self {
6526            Self { value: fidl::new_empty!(u8, D) }
6527        }
6528
6529        #[inline]
6530        unsafe fn decode(
6531            &mut self,
6532            decoder: &mut fidl::encoding::Decoder<'_, D>,
6533            offset: usize,
6534            _depth: fidl::encoding::Depth,
6535        ) -> fidl::Result<()> {
6536            decoder.debug_check_bounds::<Self>(offset);
6537            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6538            // Verify that padding bytes are zero.
6539            // Copy from the buffer into the object.
6540            unsafe {
6541                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6542            }
6543            Ok(())
6544        }
6545    }
6546
6547    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6548        type Borrowed<'a> = &'a Self;
6549        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6550            value
6551        }
6552    }
6553
6554    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6555        type Owned = Self;
6556
6557        #[inline(always)]
6558        fn inline_align(_context: fidl::encoding::Context) -> usize {
6559            1
6560        }
6561
6562        #[inline(always)]
6563        fn inline_size(_context: fidl::encoding::Context) -> usize {
6564            1
6565        }
6566        #[inline(always)]
6567        fn encode_is_copy() -> bool {
6568            true
6569        }
6570
6571        #[inline(always)]
6572        fn decode_is_copy() -> bool {
6573            true
6574        }
6575    }
6576
6577    unsafe impl<D: fidl::encoding::ResourceDialect>
6578        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D>
6579        for &BaseNetworkSocketGetIpv6UnicastHopsResponse
6580    {
6581        #[inline]
6582        unsafe fn encode(
6583            self,
6584            encoder: &mut fidl::encoding::Encoder<'_, D>,
6585            offset: usize,
6586            _depth: fidl::encoding::Depth,
6587        ) -> fidl::Result<()> {
6588            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6589            unsafe {
6590                // Copy the object into the buffer.
6591                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6592                (buf_ptr as *mut BaseNetworkSocketGetIpv6UnicastHopsResponse).write_unaligned(
6593                    (self as *const BaseNetworkSocketGetIpv6UnicastHopsResponse).read(),
6594                );
6595                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6596                // done second because the memcpy will write garbage to these bytes.
6597            }
6598            Ok(())
6599        }
6600    }
6601    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6602        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D> for (T0,)
6603    {
6604        #[inline]
6605        unsafe fn encode(
6606            self,
6607            encoder: &mut fidl::encoding::Encoder<'_, D>,
6608            offset: usize,
6609            depth: fidl::encoding::Depth,
6610        ) -> fidl::Result<()> {
6611            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6612            // Zero out padding regions. There's no need to apply masks
6613            // because the unmasked parts will be overwritten by fields.
6614            // Write the fields.
6615            self.0.encode(encoder, offset + 0, depth)?;
6616            Ok(())
6617        }
6618    }
6619
6620    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6621        for BaseNetworkSocketGetIpv6UnicastHopsResponse
6622    {
6623        #[inline(always)]
6624        fn new_empty() -> Self {
6625            Self { value: fidl::new_empty!(u8, D) }
6626        }
6627
6628        #[inline]
6629        unsafe fn decode(
6630            &mut self,
6631            decoder: &mut fidl::encoding::Decoder<'_, D>,
6632            offset: usize,
6633            _depth: fidl::encoding::Depth,
6634        ) -> fidl::Result<()> {
6635            decoder.debug_check_bounds::<Self>(offset);
6636            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6637            // Verify that padding bytes are zero.
6638            // Copy from the buffer into the object.
6639            unsafe {
6640                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6641            }
6642            Ok(())
6643        }
6644    }
6645
6646    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6647        type Borrowed<'a> = &'a Self;
6648        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6649            value
6650        }
6651    }
6652
6653    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6654        type Owned = Self;
6655
6656        #[inline(always)]
6657        fn inline_align(_context: fidl::encoding::Context) -> usize {
6658            8
6659        }
6660
6661        #[inline(always)]
6662        fn inline_size(_context: fidl::encoding::Context) -> usize {
6663            16
6664        }
6665    }
6666
6667    unsafe impl<D: fidl::encoding::ResourceDialect>
6668        fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D>
6669        for &BaseNetworkSocketGetOriginalDestinationResponse
6670    {
6671        #[inline]
6672        unsafe fn encode(
6673            self,
6674            encoder: &mut fidl::encoding::Encoder<'_, D>,
6675            offset: usize,
6676            _depth: fidl::encoding::Depth,
6677        ) -> fidl::Result<()> {
6678            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6679            // Delegate to tuple encoding.
6680            fidl::encoding::Encode::<BaseNetworkSocketGetOriginalDestinationResponse, D>::encode(
6681                (
6682                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6683                ),
6684                encoder, offset, _depth
6685            )
6686        }
6687    }
6688    unsafe impl<
6689            D: fidl::encoding::ResourceDialect,
6690            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
6691        > fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D> for (T0,)
6692    {
6693        #[inline]
6694        unsafe fn encode(
6695            self,
6696            encoder: &mut fidl::encoding::Encoder<'_, D>,
6697            offset: usize,
6698            depth: fidl::encoding::Depth,
6699        ) -> fidl::Result<()> {
6700            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6701            // Zero out padding regions. There's no need to apply masks
6702            // because the unmasked parts will be overwritten by fields.
6703            // Write the fields.
6704            self.0.encode(encoder, offset + 0, depth)?;
6705            Ok(())
6706        }
6707    }
6708
6709    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6710        for BaseNetworkSocketGetOriginalDestinationResponse
6711    {
6712        #[inline(always)]
6713        fn new_empty() -> Self {
6714            Self { value: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
6715        }
6716
6717        #[inline]
6718        unsafe fn decode(
6719            &mut self,
6720            decoder: &mut fidl::encoding::Decoder<'_, D>,
6721            offset: usize,
6722            _depth: fidl::encoding::Depth,
6723        ) -> fidl::Result<()> {
6724            decoder.debug_check_bounds::<Self>(offset);
6725            // Verify that padding bytes are zero.
6726            fidl::decode!(
6727                fidl_fuchsia_net__common::SocketAddress,
6728                D,
6729                &mut self.value,
6730                decoder,
6731                offset + 0,
6732                _depth
6733            )?;
6734            Ok(())
6735        }
6736    }
6737
6738    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetPeerNameResponse {
6739        type Borrowed<'a> = &'a Self;
6740        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6741            value
6742        }
6743    }
6744
6745    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetPeerNameResponse {
6746        type Owned = Self;
6747
6748        #[inline(always)]
6749        fn inline_align(_context: fidl::encoding::Context) -> usize {
6750            8
6751        }
6752
6753        #[inline(always)]
6754        fn inline_size(_context: fidl::encoding::Context) -> usize {
6755            16
6756        }
6757    }
6758
6759    unsafe impl<D: fidl::encoding::ResourceDialect>
6760        fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D>
6761        for &BaseNetworkSocketGetPeerNameResponse
6762    {
6763        #[inline]
6764        unsafe fn encode(
6765            self,
6766            encoder: &mut fidl::encoding::Encoder<'_, D>,
6767            offset: usize,
6768            _depth: fidl::encoding::Depth,
6769        ) -> fidl::Result<()> {
6770            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
6771            // Delegate to tuple encoding.
6772            fidl::encoding::Encode::<BaseNetworkSocketGetPeerNameResponse, D>::encode(
6773                (
6774                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
6775                ),
6776                encoder, offset, _depth
6777            )
6778        }
6779    }
6780    unsafe impl<
6781            D: fidl::encoding::ResourceDialect,
6782            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
6783        > fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D> for (T0,)
6784    {
6785        #[inline]
6786        unsafe fn encode(
6787            self,
6788            encoder: &mut fidl::encoding::Encoder<'_, D>,
6789            offset: usize,
6790            depth: fidl::encoding::Depth,
6791        ) -> fidl::Result<()> {
6792            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
6793            // Zero out padding regions. There's no need to apply masks
6794            // because the unmasked parts will be overwritten by fields.
6795            // Write the fields.
6796            self.0.encode(encoder, offset + 0, depth)?;
6797            Ok(())
6798        }
6799    }
6800
6801    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6802        for BaseNetworkSocketGetPeerNameResponse
6803    {
6804        #[inline(always)]
6805        fn new_empty() -> Self {
6806            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
6807        }
6808
6809        #[inline]
6810        unsafe fn decode(
6811            &mut self,
6812            decoder: &mut fidl::encoding::Decoder<'_, D>,
6813            offset: usize,
6814            _depth: fidl::encoding::Depth,
6815        ) -> fidl::Result<()> {
6816            decoder.debug_check_bounds::<Self>(offset);
6817            // Verify that padding bytes are zero.
6818            fidl::decode!(
6819                fidl_fuchsia_net__common::SocketAddress,
6820                D,
6821                &mut self.addr,
6822                decoder,
6823                offset + 0,
6824                _depth
6825            )?;
6826            Ok(())
6827        }
6828    }
6829
6830    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetSockNameResponse {
6831        type Borrowed<'a> = &'a Self;
6832        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6833            value
6834        }
6835    }
6836
6837    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetSockNameResponse {
6838        type Owned = Self;
6839
6840        #[inline(always)]
6841        fn inline_align(_context: fidl::encoding::Context) -> usize {
6842            8
6843        }
6844
6845        #[inline(always)]
6846        fn inline_size(_context: fidl::encoding::Context) -> usize {
6847            16
6848        }
6849    }
6850
6851    unsafe impl<D: fidl::encoding::ResourceDialect>
6852        fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D>
6853        for &BaseNetworkSocketGetSockNameResponse
6854    {
6855        #[inline]
6856        unsafe fn encode(
6857            self,
6858            encoder: &mut fidl::encoding::Encoder<'_, D>,
6859            offset: usize,
6860            _depth: fidl::encoding::Depth,
6861        ) -> fidl::Result<()> {
6862            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
6863            // Delegate to tuple encoding.
6864            fidl::encoding::Encode::<BaseNetworkSocketGetSockNameResponse, D>::encode(
6865                (
6866                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
6867                ),
6868                encoder, offset, _depth
6869            )
6870        }
6871    }
6872    unsafe impl<
6873            D: fidl::encoding::ResourceDialect,
6874            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
6875        > fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D> for (T0,)
6876    {
6877        #[inline]
6878        unsafe fn encode(
6879            self,
6880            encoder: &mut fidl::encoding::Encoder<'_, D>,
6881            offset: usize,
6882            depth: fidl::encoding::Depth,
6883        ) -> fidl::Result<()> {
6884            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
6885            // Zero out padding regions. There's no need to apply masks
6886            // because the unmasked parts will be overwritten by fields.
6887            // Write the fields.
6888            self.0.encode(encoder, offset + 0, depth)?;
6889            Ok(())
6890        }
6891    }
6892
6893    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6894        for BaseNetworkSocketGetSockNameResponse
6895    {
6896        #[inline(always)]
6897        fn new_empty() -> Self {
6898            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
6899        }
6900
6901        #[inline]
6902        unsafe fn decode(
6903            &mut self,
6904            decoder: &mut fidl::encoding::Decoder<'_, D>,
6905            offset: usize,
6906            _depth: fidl::encoding::Depth,
6907        ) -> fidl::Result<()> {
6908            decoder.debug_check_bounds::<Self>(offset);
6909            // Verify that padding bytes are zero.
6910            fidl::decode!(
6911                fidl_fuchsia_net__common::SocketAddress,
6912                D,
6913                &mut self.addr,
6914                decoder,
6915                offset + 0,
6916                _depth
6917            )?;
6918            Ok(())
6919        }
6920    }
6921
6922    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkRequest {
6923        type Borrowed<'a> = &'a Self;
6924        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6925            value
6926        }
6927    }
6928
6929    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkRequest {
6930        type Owned = Self;
6931
6932        #[inline(always)]
6933        fn inline_align(_context: fidl::encoding::Context) -> usize {
6934            1
6935        }
6936
6937        #[inline(always)]
6938        fn inline_size(_context: fidl::encoding::Context) -> usize {
6939            1
6940        }
6941    }
6942
6943    unsafe impl<D: fidl::encoding::ResourceDialect>
6944        fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for &BaseSocketGetMarkRequest
6945    {
6946        #[inline]
6947        unsafe fn encode(
6948            self,
6949            encoder: &mut fidl::encoding::Encoder<'_, D>,
6950            offset: usize,
6951            _depth: fidl::encoding::Depth,
6952        ) -> fidl::Result<()> {
6953            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
6954            // Delegate to tuple encoding.
6955            fidl::encoding::Encode::<BaseSocketGetMarkRequest, D>::encode(
6956                (
6957                    <fidl_fuchsia_net__common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
6958                ),
6959                encoder, offset, _depth
6960            )
6961        }
6962    }
6963    unsafe impl<
6964            D: fidl::encoding::ResourceDialect,
6965            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MarkDomain, D>,
6966        > fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for (T0,)
6967    {
6968        #[inline]
6969        unsafe fn encode(
6970            self,
6971            encoder: &mut fidl::encoding::Encoder<'_, D>,
6972            offset: usize,
6973            depth: fidl::encoding::Depth,
6974        ) -> fidl::Result<()> {
6975            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
6976            // Zero out padding regions. There's no need to apply masks
6977            // because the unmasked parts will be overwritten by fields.
6978            // Write the fields.
6979            self.0.encode(encoder, offset + 0, depth)?;
6980            Ok(())
6981        }
6982    }
6983
6984    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6985        for BaseSocketGetMarkRequest
6986    {
6987        #[inline(always)]
6988        fn new_empty() -> Self {
6989            Self { domain: fidl::new_empty!(fidl_fuchsia_net__common::MarkDomain, D) }
6990        }
6991
6992        #[inline]
6993        unsafe fn decode(
6994            &mut self,
6995            decoder: &mut fidl::encoding::Decoder<'_, D>,
6996            offset: usize,
6997            _depth: fidl::encoding::Depth,
6998        ) -> fidl::Result<()> {
6999            decoder.debug_check_bounds::<Self>(offset);
7000            // Verify that padding bytes are zero.
7001            fidl::decode!(
7002                fidl_fuchsia_net__common::MarkDomain,
7003                D,
7004                &mut self.domain,
7005                decoder,
7006                offset + 0,
7007                _depth
7008            )?;
7009            Ok(())
7010        }
7011    }
7012
7013    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToDeviceRequest {
7014        type Borrowed<'a> = &'a Self;
7015        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7016            value
7017        }
7018    }
7019
7020    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToDeviceRequest {
7021        type Owned = Self;
7022
7023        #[inline(always)]
7024        fn inline_align(_context: fidl::encoding::Context) -> usize {
7025            8
7026        }
7027
7028        #[inline(always)]
7029        fn inline_size(_context: fidl::encoding::Context) -> usize {
7030            16
7031        }
7032    }
7033
7034    unsafe impl<D: fidl::encoding::ResourceDialect>
7035        fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D>
7036        for &BaseSocketSetBindToDeviceRequest
7037    {
7038        #[inline]
7039        unsafe fn encode(
7040            self,
7041            encoder: &mut fidl::encoding::Encoder<'_, D>,
7042            offset: usize,
7043            _depth: fidl::encoding::Depth,
7044        ) -> fidl::Result<()> {
7045            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7046            // Delegate to tuple encoding.
7047            fidl::encoding::Encode::<BaseSocketSetBindToDeviceRequest, D>::encode(
7048                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
7049                    &self.value,
7050                ),),
7051                encoder,
7052                offset,
7053                _depth,
7054            )
7055        }
7056    }
7057    unsafe impl<
7058            D: fidl::encoding::ResourceDialect,
7059            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
7060        > fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D> for (T0,)
7061    {
7062        #[inline]
7063        unsafe fn encode(
7064            self,
7065            encoder: &mut fidl::encoding::Encoder<'_, D>,
7066            offset: usize,
7067            depth: fidl::encoding::Depth,
7068        ) -> fidl::Result<()> {
7069            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7070            // Zero out padding regions. There's no need to apply masks
7071            // because the unmasked parts will be overwritten by fields.
7072            // Write the fields.
7073            self.0.encode(encoder, offset + 0, depth)?;
7074            Ok(())
7075        }
7076    }
7077
7078    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7079        for BaseSocketSetBindToDeviceRequest
7080    {
7081        #[inline(always)]
7082        fn new_empty() -> Self {
7083            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
7084        }
7085
7086        #[inline]
7087        unsafe fn decode(
7088            &mut self,
7089            decoder: &mut fidl::encoding::Decoder<'_, D>,
7090            offset: usize,
7091            _depth: fidl::encoding::Depth,
7092        ) -> fidl::Result<()> {
7093            decoder.debug_check_bounds::<Self>(offset);
7094            // Verify that padding bytes are zero.
7095            fidl::decode!(
7096                fidl::encoding::BoundedString<15>,
7097                D,
7098                &mut self.value,
7099                decoder,
7100                offset + 0,
7101                _depth
7102            )?;
7103            Ok(())
7104        }
7105    }
7106
7107    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7108        type Borrowed<'a> = &'a Self;
7109        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7110            value
7111        }
7112    }
7113
7114    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7115        type Owned = Self;
7116
7117        #[inline(always)]
7118        fn inline_align(_context: fidl::encoding::Context) -> usize {
7119            8
7120        }
7121
7122        #[inline(always)]
7123        fn inline_size(_context: fidl::encoding::Context) -> usize {
7124            8
7125        }
7126        #[inline(always)]
7127        fn encode_is_copy() -> bool {
7128            true
7129        }
7130
7131        #[inline(always)]
7132        fn decode_is_copy() -> bool {
7133            true
7134        }
7135    }
7136
7137    unsafe impl<D: fidl::encoding::ResourceDialect>
7138        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D>
7139        for &BaseSocketSetBindToInterfaceIndexRequest
7140    {
7141        #[inline]
7142        unsafe fn encode(
7143            self,
7144            encoder: &mut fidl::encoding::Encoder<'_, D>,
7145            offset: usize,
7146            _depth: fidl::encoding::Depth,
7147        ) -> fidl::Result<()> {
7148            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7149            unsafe {
7150                // Copy the object into the buffer.
7151                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7152                (buf_ptr as *mut BaseSocketSetBindToInterfaceIndexRequest).write_unaligned(
7153                    (self as *const BaseSocketSetBindToInterfaceIndexRequest).read(),
7154                );
7155                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7156                // done second because the memcpy will write garbage to these bytes.
7157            }
7158            Ok(())
7159        }
7160    }
7161    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7162        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D> for (T0,)
7163    {
7164        #[inline]
7165        unsafe fn encode(
7166            self,
7167            encoder: &mut fidl::encoding::Encoder<'_, D>,
7168            offset: usize,
7169            depth: fidl::encoding::Depth,
7170        ) -> fidl::Result<()> {
7171            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7172            // Zero out padding regions. There's no need to apply masks
7173            // because the unmasked parts will be overwritten by fields.
7174            // Write the fields.
7175            self.0.encode(encoder, offset + 0, depth)?;
7176            Ok(())
7177        }
7178    }
7179
7180    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7181        for BaseSocketSetBindToInterfaceIndexRequest
7182    {
7183        #[inline(always)]
7184        fn new_empty() -> Self {
7185            Self { value: fidl::new_empty!(u64, D) }
7186        }
7187
7188        #[inline]
7189        unsafe fn decode(
7190            &mut self,
7191            decoder: &mut fidl::encoding::Decoder<'_, D>,
7192            offset: usize,
7193            _depth: fidl::encoding::Depth,
7194        ) -> fidl::Result<()> {
7195            decoder.debug_check_bounds::<Self>(offset);
7196            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7197            // Verify that padding bytes are zero.
7198            // Copy from the buffer into the object.
7199            unsafe {
7200                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7201            }
7202            Ok(())
7203        }
7204    }
7205
7206    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBroadcastRequest {
7207        type Borrowed<'a> = &'a Self;
7208        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7209            value
7210        }
7211    }
7212
7213    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBroadcastRequest {
7214        type Owned = Self;
7215
7216        #[inline(always)]
7217        fn inline_align(_context: fidl::encoding::Context) -> usize {
7218            1
7219        }
7220
7221        #[inline(always)]
7222        fn inline_size(_context: fidl::encoding::Context) -> usize {
7223            1
7224        }
7225    }
7226
7227    unsafe impl<D: fidl::encoding::ResourceDialect>
7228        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D>
7229        for &BaseSocketSetBroadcastRequest
7230    {
7231        #[inline]
7232        unsafe fn encode(
7233            self,
7234            encoder: &mut fidl::encoding::Encoder<'_, D>,
7235            offset: usize,
7236            _depth: fidl::encoding::Depth,
7237        ) -> fidl::Result<()> {
7238            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7239            // Delegate to tuple encoding.
7240            fidl::encoding::Encode::<BaseSocketSetBroadcastRequest, D>::encode(
7241                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7242                encoder,
7243                offset,
7244                _depth,
7245            )
7246        }
7247    }
7248    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7249        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D> for (T0,)
7250    {
7251        #[inline]
7252        unsafe fn encode(
7253            self,
7254            encoder: &mut fidl::encoding::Encoder<'_, D>,
7255            offset: usize,
7256            depth: fidl::encoding::Depth,
7257        ) -> fidl::Result<()> {
7258            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7259            // Zero out padding regions. There's no need to apply masks
7260            // because the unmasked parts will be overwritten by fields.
7261            // Write the fields.
7262            self.0.encode(encoder, offset + 0, depth)?;
7263            Ok(())
7264        }
7265    }
7266
7267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7268        for BaseSocketSetBroadcastRequest
7269    {
7270        #[inline(always)]
7271        fn new_empty() -> Self {
7272            Self { value: fidl::new_empty!(bool, D) }
7273        }
7274
7275        #[inline]
7276        unsafe fn decode(
7277            &mut self,
7278            decoder: &mut fidl::encoding::Decoder<'_, D>,
7279            offset: usize,
7280            _depth: fidl::encoding::Depth,
7281        ) -> fidl::Result<()> {
7282            decoder.debug_check_bounds::<Self>(offset);
7283            // Verify that padding bytes are zero.
7284            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7285            Ok(())
7286        }
7287    }
7288
7289    impl fidl::encoding::ValueTypeMarker for BaseSocketSetKeepAliveRequest {
7290        type Borrowed<'a> = &'a Self;
7291        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7292            value
7293        }
7294    }
7295
7296    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetKeepAliveRequest {
7297        type Owned = Self;
7298
7299        #[inline(always)]
7300        fn inline_align(_context: fidl::encoding::Context) -> usize {
7301            1
7302        }
7303
7304        #[inline(always)]
7305        fn inline_size(_context: fidl::encoding::Context) -> usize {
7306            1
7307        }
7308    }
7309
7310    unsafe impl<D: fidl::encoding::ResourceDialect>
7311        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D>
7312        for &BaseSocketSetKeepAliveRequest
7313    {
7314        #[inline]
7315        unsafe fn encode(
7316            self,
7317            encoder: &mut fidl::encoding::Encoder<'_, D>,
7318            offset: usize,
7319            _depth: fidl::encoding::Depth,
7320        ) -> fidl::Result<()> {
7321            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7322            // Delegate to tuple encoding.
7323            fidl::encoding::Encode::<BaseSocketSetKeepAliveRequest, D>::encode(
7324                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7325                encoder,
7326                offset,
7327                _depth,
7328            )
7329        }
7330    }
7331    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7332        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D> for (T0,)
7333    {
7334        #[inline]
7335        unsafe fn encode(
7336            self,
7337            encoder: &mut fidl::encoding::Encoder<'_, D>,
7338            offset: usize,
7339            depth: fidl::encoding::Depth,
7340        ) -> fidl::Result<()> {
7341            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7342            // Zero out padding regions. There's no need to apply masks
7343            // because the unmasked parts will be overwritten by fields.
7344            // Write the fields.
7345            self.0.encode(encoder, offset + 0, depth)?;
7346            Ok(())
7347        }
7348    }
7349
7350    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7351        for BaseSocketSetKeepAliveRequest
7352    {
7353        #[inline(always)]
7354        fn new_empty() -> Self {
7355            Self { value: fidl::new_empty!(bool, D) }
7356        }
7357
7358        #[inline]
7359        unsafe fn decode(
7360            &mut self,
7361            decoder: &mut fidl::encoding::Decoder<'_, D>,
7362            offset: usize,
7363            _depth: fidl::encoding::Depth,
7364        ) -> fidl::Result<()> {
7365            decoder.debug_check_bounds::<Self>(offset);
7366            // Verify that padding bytes are zero.
7367            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7368            Ok(())
7369        }
7370    }
7371
7372    impl fidl::encoding::ValueTypeMarker for BaseSocketSetLingerRequest {
7373        type Borrowed<'a> = &'a Self;
7374        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7375            value
7376        }
7377    }
7378
7379    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetLingerRequest {
7380        type Owned = Self;
7381
7382        #[inline(always)]
7383        fn inline_align(_context: fidl::encoding::Context) -> usize {
7384            4
7385        }
7386
7387        #[inline(always)]
7388        fn inline_size(_context: fidl::encoding::Context) -> usize {
7389            8
7390        }
7391    }
7392
7393    unsafe impl<D: fidl::encoding::ResourceDialect>
7394        fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for &BaseSocketSetLingerRequest
7395    {
7396        #[inline]
7397        unsafe fn encode(
7398            self,
7399            encoder: &mut fidl::encoding::Encoder<'_, D>,
7400            offset: usize,
7401            _depth: fidl::encoding::Depth,
7402        ) -> fidl::Result<()> {
7403            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7404            // Delegate to tuple encoding.
7405            fidl::encoding::Encode::<BaseSocketSetLingerRequest, D>::encode(
7406                (
7407                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
7408                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
7409                ),
7410                encoder,
7411                offset,
7412                _depth,
7413            )
7414        }
7415    }
7416    unsafe impl<
7417            D: fidl::encoding::ResourceDialect,
7418            T0: fidl::encoding::Encode<bool, D>,
7419            T1: fidl::encoding::Encode<u32, D>,
7420        > fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for (T0, T1)
7421    {
7422        #[inline]
7423        unsafe fn encode(
7424            self,
7425            encoder: &mut fidl::encoding::Encoder<'_, D>,
7426            offset: usize,
7427            depth: fidl::encoding::Depth,
7428        ) -> fidl::Result<()> {
7429            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7430            // Zero out padding regions. There's no need to apply masks
7431            // because the unmasked parts will be overwritten by fields.
7432            unsafe {
7433                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7434                (ptr as *mut u32).write_unaligned(0);
7435            }
7436            // Write the fields.
7437            self.0.encode(encoder, offset + 0, depth)?;
7438            self.1.encode(encoder, offset + 4, depth)?;
7439            Ok(())
7440        }
7441    }
7442
7443    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7444        for BaseSocketSetLingerRequest
7445    {
7446        #[inline(always)]
7447        fn new_empty() -> Self {
7448            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
7449        }
7450
7451        #[inline]
7452        unsafe fn decode(
7453            &mut self,
7454            decoder: &mut fidl::encoding::Decoder<'_, D>,
7455            offset: usize,
7456            _depth: fidl::encoding::Depth,
7457        ) -> fidl::Result<()> {
7458            decoder.debug_check_bounds::<Self>(offset);
7459            // Verify that padding bytes are zero.
7460            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7461            let padval = unsafe { (ptr as *const u32).read_unaligned() };
7462            let mask = 0xffffff00u32;
7463            let maskedval = padval & mask;
7464            if maskedval != 0 {
7465                return Err(fidl::Error::NonZeroPadding {
7466                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7467                });
7468            }
7469            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
7470            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
7471            Ok(())
7472        }
7473    }
7474
7475    impl fidl::encoding::ValueTypeMarker for BaseSocketSetMarkRequest {
7476        type Borrowed<'a> = &'a Self;
7477        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7478            value
7479        }
7480    }
7481
7482    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetMarkRequest {
7483        type Owned = Self;
7484
7485        #[inline(always)]
7486        fn inline_align(_context: fidl::encoding::Context) -> usize {
7487            8
7488        }
7489
7490        #[inline(always)]
7491        fn inline_size(_context: fidl::encoding::Context) -> usize {
7492            24
7493        }
7494    }
7495
7496    unsafe impl<D: fidl::encoding::ResourceDialect>
7497        fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for &BaseSocketSetMarkRequest
7498    {
7499        #[inline]
7500        unsafe fn encode(
7501            self,
7502            encoder: &mut fidl::encoding::Encoder<'_, D>,
7503            offset: usize,
7504            _depth: fidl::encoding::Depth,
7505        ) -> fidl::Result<()> {
7506            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7507            // Delegate to tuple encoding.
7508            fidl::encoding::Encode::<BaseSocketSetMarkRequest, D>::encode(
7509                (
7510                    <fidl_fuchsia_net__common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
7511                    <OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),
7512                ),
7513                encoder, offset, _depth
7514            )
7515        }
7516    }
7517    unsafe impl<
7518            D: fidl::encoding::ResourceDialect,
7519            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MarkDomain, D>,
7520            T1: fidl::encoding::Encode<OptionalUint32, D>,
7521        > fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for (T0, T1)
7522    {
7523        #[inline]
7524        unsafe fn encode(
7525            self,
7526            encoder: &mut fidl::encoding::Encoder<'_, D>,
7527            offset: usize,
7528            depth: fidl::encoding::Depth,
7529        ) -> fidl::Result<()> {
7530            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7531            // Zero out padding regions. There's no need to apply masks
7532            // because the unmasked parts will be overwritten by fields.
7533            unsafe {
7534                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7535                (ptr as *mut u64).write_unaligned(0);
7536            }
7537            // Write the fields.
7538            self.0.encode(encoder, offset + 0, depth)?;
7539            self.1.encode(encoder, offset + 8, depth)?;
7540            Ok(())
7541        }
7542    }
7543
7544    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7545        for BaseSocketSetMarkRequest
7546    {
7547        #[inline(always)]
7548        fn new_empty() -> Self {
7549            Self {
7550                domain: fidl::new_empty!(fidl_fuchsia_net__common::MarkDomain, D),
7551                mark: fidl::new_empty!(OptionalUint32, D),
7552            }
7553        }
7554
7555        #[inline]
7556        unsafe fn decode(
7557            &mut self,
7558            decoder: &mut fidl::encoding::Decoder<'_, D>,
7559            offset: usize,
7560            _depth: fidl::encoding::Depth,
7561        ) -> fidl::Result<()> {
7562            decoder.debug_check_bounds::<Self>(offset);
7563            // Verify that padding bytes are zero.
7564            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7565            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7566            let mask = 0xffffffffffffff00u64;
7567            let maskedval = padval & mask;
7568            if maskedval != 0 {
7569                return Err(fidl::Error::NonZeroPadding {
7570                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7571                });
7572            }
7573            fidl::decode!(
7574                fidl_fuchsia_net__common::MarkDomain,
7575                D,
7576                &mut self.domain,
7577                decoder,
7578                offset + 0,
7579                _depth
7580            )?;
7581            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 8, _depth)?;
7582            Ok(())
7583        }
7584    }
7585
7586    impl fidl::encoding::ValueTypeMarker for BaseSocketSetNoCheckRequest {
7587        type Borrowed<'a> = &'a Self;
7588        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7589            value
7590        }
7591    }
7592
7593    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetNoCheckRequest {
7594        type Owned = Self;
7595
7596        #[inline(always)]
7597        fn inline_align(_context: fidl::encoding::Context) -> usize {
7598            1
7599        }
7600
7601        #[inline(always)]
7602        fn inline_size(_context: fidl::encoding::Context) -> usize {
7603            1
7604        }
7605    }
7606
7607    unsafe impl<D: fidl::encoding::ResourceDialect>
7608        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for &BaseSocketSetNoCheckRequest
7609    {
7610        #[inline]
7611        unsafe fn encode(
7612            self,
7613            encoder: &mut fidl::encoding::Encoder<'_, D>,
7614            offset: usize,
7615            _depth: fidl::encoding::Depth,
7616        ) -> fidl::Result<()> {
7617            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7618            // Delegate to tuple encoding.
7619            fidl::encoding::Encode::<BaseSocketSetNoCheckRequest, D>::encode(
7620                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7621                encoder,
7622                offset,
7623                _depth,
7624            )
7625        }
7626    }
7627    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7628        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for (T0,)
7629    {
7630        #[inline]
7631        unsafe fn encode(
7632            self,
7633            encoder: &mut fidl::encoding::Encoder<'_, D>,
7634            offset: usize,
7635            depth: fidl::encoding::Depth,
7636        ) -> fidl::Result<()> {
7637            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7638            // Zero out padding regions. There's no need to apply masks
7639            // because the unmasked parts will be overwritten by fields.
7640            // Write the fields.
7641            self.0.encode(encoder, offset + 0, depth)?;
7642            Ok(())
7643        }
7644    }
7645
7646    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7647        for BaseSocketSetNoCheckRequest
7648    {
7649        #[inline(always)]
7650        fn new_empty() -> Self {
7651            Self { value: fidl::new_empty!(bool, D) }
7652        }
7653
7654        #[inline]
7655        unsafe fn decode(
7656            &mut self,
7657            decoder: &mut fidl::encoding::Decoder<'_, D>,
7658            offset: usize,
7659            _depth: fidl::encoding::Depth,
7660        ) -> fidl::Result<()> {
7661            decoder.debug_check_bounds::<Self>(offset);
7662            // Verify that padding bytes are zero.
7663            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7664            Ok(())
7665        }
7666    }
7667
7668    impl fidl::encoding::ValueTypeMarker for BaseSocketSetOutOfBandInlineRequest {
7669        type Borrowed<'a> = &'a Self;
7670        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7671            value
7672        }
7673    }
7674
7675    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetOutOfBandInlineRequest {
7676        type Owned = Self;
7677
7678        #[inline(always)]
7679        fn inline_align(_context: fidl::encoding::Context) -> usize {
7680            1
7681        }
7682
7683        #[inline(always)]
7684        fn inline_size(_context: fidl::encoding::Context) -> usize {
7685            1
7686        }
7687    }
7688
7689    unsafe impl<D: fidl::encoding::ResourceDialect>
7690        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D>
7691        for &BaseSocketSetOutOfBandInlineRequest
7692    {
7693        #[inline]
7694        unsafe fn encode(
7695            self,
7696            encoder: &mut fidl::encoding::Encoder<'_, D>,
7697            offset: usize,
7698            _depth: fidl::encoding::Depth,
7699        ) -> fidl::Result<()> {
7700            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
7701            // Delegate to tuple encoding.
7702            fidl::encoding::Encode::<BaseSocketSetOutOfBandInlineRequest, D>::encode(
7703                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7704                encoder,
7705                offset,
7706                _depth,
7707            )
7708        }
7709    }
7710    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7711        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D> for (T0,)
7712    {
7713        #[inline]
7714        unsafe fn encode(
7715            self,
7716            encoder: &mut fidl::encoding::Encoder<'_, D>,
7717            offset: usize,
7718            depth: fidl::encoding::Depth,
7719        ) -> fidl::Result<()> {
7720            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
7721            // Zero out padding regions. There's no need to apply masks
7722            // because the unmasked parts will be overwritten by fields.
7723            // Write the fields.
7724            self.0.encode(encoder, offset + 0, depth)?;
7725            Ok(())
7726        }
7727    }
7728
7729    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7730        for BaseSocketSetOutOfBandInlineRequest
7731    {
7732        #[inline(always)]
7733        fn new_empty() -> Self {
7734            Self { value: fidl::new_empty!(bool, D) }
7735        }
7736
7737        #[inline]
7738        unsafe fn decode(
7739            &mut self,
7740            decoder: &mut fidl::encoding::Decoder<'_, D>,
7741            offset: usize,
7742            _depth: fidl::encoding::Depth,
7743        ) -> fidl::Result<()> {
7744            decoder.debug_check_bounds::<Self>(offset);
7745            // Verify that padding bytes are zero.
7746            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7747            Ok(())
7748        }
7749    }
7750
7751    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReceiveBufferRequest {
7752        type Borrowed<'a> = &'a Self;
7753        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7754            value
7755        }
7756    }
7757
7758    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReceiveBufferRequest {
7759        type Owned = Self;
7760
7761        #[inline(always)]
7762        fn inline_align(_context: fidl::encoding::Context) -> usize {
7763            8
7764        }
7765
7766        #[inline(always)]
7767        fn inline_size(_context: fidl::encoding::Context) -> usize {
7768            8
7769        }
7770        #[inline(always)]
7771        fn encode_is_copy() -> bool {
7772            true
7773        }
7774
7775        #[inline(always)]
7776        fn decode_is_copy() -> bool {
7777            true
7778        }
7779    }
7780
7781    unsafe impl<D: fidl::encoding::ResourceDialect>
7782        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D>
7783        for &BaseSocketSetReceiveBufferRequest
7784    {
7785        #[inline]
7786        unsafe fn encode(
7787            self,
7788            encoder: &mut fidl::encoding::Encoder<'_, D>,
7789            offset: usize,
7790            _depth: fidl::encoding::Depth,
7791        ) -> fidl::Result<()> {
7792            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
7793            unsafe {
7794                // Copy the object into the buffer.
7795                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7796                (buf_ptr as *mut BaseSocketSetReceiveBufferRequest)
7797                    .write_unaligned((self as *const BaseSocketSetReceiveBufferRequest).read());
7798                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7799                // done second because the memcpy will write garbage to these bytes.
7800            }
7801            Ok(())
7802        }
7803    }
7804    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7805        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D> for (T0,)
7806    {
7807        #[inline]
7808        unsafe fn encode(
7809            self,
7810            encoder: &mut fidl::encoding::Encoder<'_, D>,
7811            offset: usize,
7812            depth: fidl::encoding::Depth,
7813        ) -> fidl::Result<()> {
7814            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
7815            // Zero out padding regions. There's no need to apply masks
7816            // because the unmasked parts will be overwritten by fields.
7817            // Write the fields.
7818            self.0.encode(encoder, offset + 0, depth)?;
7819            Ok(())
7820        }
7821    }
7822
7823    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7824        for BaseSocketSetReceiveBufferRequest
7825    {
7826        #[inline(always)]
7827        fn new_empty() -> Self {
7828            Self { value_bytes: fidl::new_empty!(u64, D) }
7829        }
7830
7831        #[inline]
7832        unsafe fn decode(
7833            &mut self,
7834            decoder: &mut fidl::encoding::Decoder<'_, D>,
7835            offset: usize,
7836            _depth: fidl::encoding::Depth,
7837        ) -> fidl::Result<()> {
7838            decoder.debug_check_bounds::<Self>(offset);
7839            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7840            // Verify that padding bytes are zero.
7841            // Copy from the buffer into the object.
7842            unsafe {
7843                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7844            }
7845            Ok(())
7846        }
7847    }
7848
7849    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReuseAddressRequest {
7850        type Borrowed<'a> = &'a Self;
7851        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7852            value
7853        }
7854    }
7855
7856    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReuseAddressRequest {
7857        type Owned = Self;
7858
7859        #[inline(always)]
7860        fn inline_align(_context: fidl::encoding::Context) -> usize {
7861            1
7862        }
7863
7864        #[inline(always)]
7865        fn inline_size(_context: fidl::encoding::Context) -> usize {
7866            1
7867        }
7868    }
7869
7870    unsafe impl<D: fidl::encoding::ResourceDialect>
7871        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D>
7872        for &BaseSocketSetReuseAddressRequest
7873    {
7874        #[inline]
7875        unsafe fn encode(
7876            self,
7877            encoder: &mut fidl::encoding::Encoder<'_, D>,
7878            offset: usize,
7879            _depth: fidl::encoding::Depth,
7880        ) -> fidl::Result<()> {
7881            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
7882            // Delegate to tuple encoding.
7883            fidl::encoding::Encode::<BaseSocketSetReuseAddressRequest, D>::encode(
7884                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7885                encoder,
7886                offset,
7887                _depth,
7888            )
7889        }
7890    }
7891    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7892        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D> for (T0,)
7893    {
7894        #[inline]
7895        unsafe fn encode(
7896            self,
7897            encoder: &mut fidl::encoding::Encoder<'_, D>,
7898            offset: usize,
7899            depth: fidl::encoding::Depth,
7900        ) -> fidl::Result<()> {
7901            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
7902            // Zero out padding regions. There's no need to apply masks
7903            // because the unmasked parts will be overwritten by fields.
7904            // Write the fields.
7905            self.0.encode(encoder, offset + 0, depth)?;
7906            Ok(())
7907        }
7908    }
7909
7910    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7911        for BaseSocketSetReuseAddressRequest
7912    {
7913        #[inline(always)]
7914        fn new_empty() -> Self {
7915            Self { value: fidl::new_empty!(bool, D) }
7916        }
7917
7918        #[inline]
7919        unsafe fn decode(
7920            &mut self,
7921            decoder: &mut fidl::encoding::Decoder<'_, D>,
7922            offset: usize,
7923            _depth: fidl::encoding::Depth,
7924        ) -> fidl::Result<()> {
7925            decoder.debug_check_bounds::<Self>(offset);
7926            // Verify that padding bytes are zero.
7927            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7928            Ok(())
7929        }
7930    }
7931
7932    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReusePortRequest {
7933        type Borrowed<'a> = &'a Self;
7934        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7935            value
7936        }
7937    }
7938
7939    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReusePortRequest {
7940        type Owned = Self;
7941
7942        #[inline(always)]
7943        fn inline_align(_context: fidl::encoding::Context) -> usize {
7944            1
7945        }
7946
7947        #[inline(always)]
7948        fn inline_size(_context: fidl::encoding::Context) -> usize {
7949            1
7950        }
7951    }
7952
7953    unsafe impl<D: fidl::encoding::ResourceDialect>
7954        fidl::encoding::Encode<BaseSocketSetReusePortRequest, D>
7955        for &BaseSocketSetReusePortRequest
7956    {
7957        #[inline]
7958        unsafe fn encode(
7959            self,
7960            encoder: &mut fidl::encoding::Encoder<'_, D>,
7961            offset: usize,
7962            _depth: fidl::encoding::Depth,
7963        ) -> fidl::Result<()> {
7964            encoder.debug_check_bounds::<BaseSocketSetReusePortRequest>(offset);
7965            // Delegate to tuple encoding.
7966            fidl::encoding::Encode::<BaseSocketSetReusePortRequest, D>::encode(
7967                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7968                encoder,
7969                offset,
7970                _depth,
7971            )
7972        }
7973    }
7974    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7975        fidl::encoding::Encode<BaseSocketSetReusePortRequest, D> for (T0,)
7976    {
7977        #[inline]
7978        unsafe fn encode(
7979            self,
7980            encoder: &mut fidl::encoding::Encoder<'_, D>,
7981            offset: usize,
7982            depth: fidl::encoding::Depth,
7983        ) -> fidl::Result<()> {
7984            encoder.debug_check_bounds::<BaseSocketSetReusePortRequest>(offset);
7985            // Zero out padding regions. There's no need to apply masks
7986            // because the unmasked parts will be overwritten by fields.
7987            // Write the fields.
7988            self.0.encode(encoder, offset + 0, depth)?;
7989            Ok(())
7990        }
7991    }
7992
7993    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7994        for BaseSocketSetReusePortRequest
7995    {
7996        #[inline(always)]
7997        fn new_empty() -> Self {
7998            Self { value: fidl::new_empty!(bool, D) }
7999        }
8000
8001        #[inline]
8002        unsafe fn decode(
8003            &mut self,
8004            decoder: &mut fidl::encoding::Decoder<'_, D>,
8005            offset: usize,
8006            _depth: fidl::encoding::Depth,
8007        ) -> fidl::Result<()> {
8008            decoder.debug_check_bounds::<Self>(offset);
8009            // Verify that padding bytes are zero.
8010            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8011            Ok(())
8012        }
8013    }
8014
8015    impl fidl::encoding::ValueTypeMarker for BaseSocketSetSendBufferRequest {
8016        type Borrowed<'a> = &'a Self;
8017        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8018            value
8019        }
8020    }
8021
8022    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetSendBufferRequest {
8023        type Owned = Self;
8024
8025        #[inline(always)]
8026        fn inline_align(_context: fidl::encoding::Context) -> usize {
8027            8
8028        }
8029
8030        #[inline(always)]
8031        fn inline_size(_context: fidl::encoding::Context) -> usize {
8032            8
8033        }
8034        #[inline(always)]
8035        fn encode_is_copy() -> bool {
8036            true
8037        }
8038
8039        #[inline(always)]
8040        fn decode_is_copy() -> bool {
8041            true
8042        }
8043    }
8044
8045    unsafe impl<D: fidl::encoding::ResourceDialect>
8046        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D>
8047        for &BaseSocketSetSendBufferRequest
8048    {
8049        #[inline]
8050        unsafe fn encode(
8051            self,
8052            encoder: &mut fidl::encoding::Encoder<'_, D>,
8053            offset: usize,
8054            _depth: fidl::encoding::Depth,
8055        ) -> fidl::Result<()> {
8056            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8057            unsafe {
8058                // Copy the object into the buffer.
8059                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8060                (buf_ptr as *mut BaseSocketSetSendBufferRequest)
8061                    .write_unaligned((self as *const BaseSocketSetSendBufferRequest).read());
8062                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8063                // done second because the memcpy will write garbage to these bytes.
8064            }
8065            Ok(())
8066        }
8067    }
8068    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8069        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D> for (T0,)
8070    {
8071        #[inline]
8072        unsafe fn encode(
8073            self,
8074            encoder: &mut fidl::encoding::Encoder<'_, D>,
8075            offset: usize,
8076            depth: fidl::encoding::Depth,
8077        ) -> fidl::Result<()> {
8078            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8079            // Zero out padding regions. There's no need to apply masks
8080            // because the unmasked parts will be overwritten by fields.
8081            // Write the fields.
8082            self.0.encode(encoder, offset + 0, depth)?;
8083            Ok(())
8084        }
8085    }
8086
8087    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8088        for BaseSocketSetSendBufferRequest
8089    {
8090        #[inline(always)]
8091        fn new_empty() -> Self {
8092            Self { value_bytes: fidl::new_empty!(u64, D) }
8093        }
8094
8095        #[inline]
8096        unsafe fn decode(
8097            &mut self,
8098            decoder: &mut fidl::encoding::Decoder<'_, D>,
8099            offset: usize,
8100            _depth: fidl::encoding::Depth,
8101        ) -> fidl::Result<()> {
8102            decoder.debug_check_bounds::<Self>(offset);
8103            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8104            // Verify that padding bytes are zero.
8105            // Copy from the buffer into the object.
8106            unsafe {
8107                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8108            }
8109            Ok(())
8110        }
8111    }
8112
8113    impl fidl::encoding::ValueTypeMarker for BaseSocketSetTimestampRequest {
8114        type Borrowed<'a> = &'a Self;
8115        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8116            value
8117        }
8118    }
8119
8120    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetTimestampRequest {
8121        type Owned = Self;
8122
8123        #[inline(always)]
8124        fn inline_align(_context: fidl::encoding::Context) -> usize {
8125            4
8126        }
8127
8128        #[inline(always)]
8129        fn inline_size(_context: fidl::encoding::Context) -> usize {
8130            4
8131        }
8132    }
8133
8134    unsafe impl<D: fidl::encoding::ResourceDialect>
8135        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D>
8136        for &BaseSocketSetTimestampRequest
8137    {
8138        #[inline]
8139        unsafe fn encode(
8140            self,
8141            encoder: &mut fidl::encoding::Encoder<'_, D>,
8142            offset: usize,
8143            _depth: fidl::encoding::Depth,
8144        ) -> fidl::Result<()> {
8145            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8146            // Delegate to tuple encoding.
8147            fidl::encoding::Encode::<BaseSocketSetTimestampRequest, D>::encode(
8148                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8149                encoder,
8150                offset,
8151                _depth,
8152            )
8153        }
8154    }
8155    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
8156        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D> for (T0,)
8157    {
8158        #[inline]
8159        unsafe fn encode(
8160            self,
8161            encoder: &mut fidl::encoding::Encoder<'_, D>,
8162            offset: usize,
8163            depth: fidl::encoding::Depth,
8164        ) -> fidl::Result<()> {
8165            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8166            // Zero out padding regions. There's no need to apply masks
8167            // because the unmasked parts will be overwritten by fields.
8168            // Write the fields.
8169            self.0.encode(encoder, offset + 0, depth)?;
8170            Ok(())
8171        }
8172    }
8173
8174    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8175        for BaseSocketSetTimestampRequest
8176    {
8177        #[inline(always)]
8178        fn new_empty() -> Self {
8179            Self { value: fidl::new_empty!(TimestampOption, D) }
8180        }
8181
8182        #[inline]
8183        unsafe fn decode(
8184            &mut self,
8185            decoder: &mut fidl::encoding::Decoder<'_, D>,
8186            offset: usize,
8187            _depth: fidl::encoding::Depth,
8188        ) -> fidl::Result<()> {
8189            decoder.debug_check_bounds::<Self>(offset);
8190            // Verify that padding bytes are zero.
8191            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
8192            Ok(())
8193        }
8194    }
8195
8196    impl fidl::encoding::ValueTypeMarker for BaseSocketGetAcceptConnResponse {
8197        type Borrowed<'a> = &'a Self;
8198        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8199            value
8200        }
8201    }
8202
8203    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetAcceptConnResponse {
8204        type Owned = Self;
8205
8206        #[inline(always)]
8207        fn inline_align(_context: fidl::encoding::Context) -> usize {
8208            1
8209        }
8210
8211        #[inline(always)]
8212        fn inline_size(_context: fidl::encoding::Context) -> usize {
8213            1
8214        }
8215    }
8216
8217    unsafe impl<D: fidl::encoding::ResourceDialect>
8218        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D>
8219        for &BaseSocketGetAcceptConnResponse
8220    {
8221        #[inline]
8222        unsafe fn encode(
8223            self,
8224            encoder: &mut fidl::encoding::Encoder<'_, D>,
8225            offset: usize,
8226            _depth: fidl::encoding::Depth,
8227        ) -> fidl::Result<()> {
8228            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8229            // Delegate to tuple encoding.
8230            fidl::encoding::Encode::<BaseSocketGetAcceptConnResponse, D>::encode(
8231                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8232                encoder,
8233                offset,
8234                _depth,
8235            )
8236        }
8237    }
8238    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8239        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D> for (T0,)
8240    {
8241        #[inline]
8242        unsafe fn encode(
8243            self,
8244            encoder: &mut fidl::encoding::Encoder<'_, D>,
8245            offset: usize,
8246            depth: fidl::encoding::Depth,
8247        ) -> fidl::Result<()> {
8248            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8249            // Zero out padding regions. There's no need to apply masks
8250            // because the unmasked parts will be overwritten by fields.
8251            // Write the fields.
8252            self.0.encode(encoder, offset + 0, depth)?;
8253            Ok(())
8254        }
8255    }
8256
8257    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8258        for BaseSocketGetAcceptConnResponse
8259    {
8260        #[inline(always)]
8261        fn new_empty() -> Self {
8262            Self { value: fidl::new_empty!(bool, D) }
8263        }
8264
8265        #[inline]
8266        unsafe fn decode(
8267            &mut self,
8268            decoder: &mut fidl::encoding::Decoder<'_, D>,
8269            offset: usize,
8270            _depth: fidl::encoding::Depth,
8271        ) -> fidl::Result<()> {
8272            decoder.debug_check_bounds::<Self>(offset);
8273            // Verify that padding bytes are zero.
8274            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8275            Ok(())
8276        }
8277    }
8278
8279    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToDeviceResponse {
8280        type Borrowed<'a> = &'a Self;
8281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8282            value
8283        }
8284    }
8285
8286    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToDeviceResponse {
8287        type Owned = Self;
8288
8289        #[inline(always)]
8290        fn inline_align(_context: fidl::encoding::Context) -> usize {
8291            8
8292        }
8293
8294        #[inline(always)]
8295        fn inline_size(_context: fidl::encoding::Context) -> usize {
8296            16
8297        }
8298    }
8299
8300    unsafe impl<D: fidl::encoding::ResourceDialect>
8301        fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D>
8302        for &BaseSocketGetBindToDeviceResponse
8303    {
8304        #[inline]
8305        unsafe fn encode(
8306            self,
8307            encoder: &mut fidl::encoding::Encoder<'_, D>,
8308            offset: usize,
8309            _depth: fidl::encoding::Depth,
8310        ) -> fidl::Result<()> {
8311            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8312            // Delegate to tuple encoding.
8313            fidl::encoding::Encode::<BaseSocketGetBindToDeviceResponse, D>::encode(
8314                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
8315                    &self.value,
8316                ),),
8317                encoder,
8318                offset,
8319                _depth,
8320            )
8321        }
8322    }
8323    unsafe impl<
8324            D: fidl::encoding::ResourceDialect,
8325            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
8326        > fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D> for (T0,)
8327    {
8328        #[inline]
8329        unsafe fn encode(
8330            self,
8331            encoder: &mut fidl::encoding::Encoder<'_, D>,
8332            offset: usize,
8333            depth: fidl::encoding::Depth,
8334        ) -> fidl::Result<()> {
8335            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8336            // Zero out padding regions. There's no need to apply masks
8337            // because the unmasked parts will be overwritten by fields.
8338            // Write the fields.
8339            self.0.encode(encoder, offset + 0, depth)?;
8340            Ok(())
8341        }
8342    }
8343
8344    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8345        for BaseSocketGetBindToDeviceResponse
8346    {
8347        #[inline(always)]
8348        fn new_empty() -> Self {
8349            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
8350        }
8351
8352        #[inline]
8353        unsafe fn decode(
8354            &mut self,
8355            decoder: &mut fidl::encoding::Decoder<'_, D>,
8356            offset: usize,
8357            _depth: fidl::encoding::Depth,
8358        ) -> fidl::Result<()> {
8359            decoder.debug_check_bounds::<Self>(offset);
8360            // Verify that padding bytes are zero.
8361            fidl::decode!(
8362                fidl::encoding::BoundedString<15>,
8363                D,
8364                &mut self.value,
8365                decoder,
8366                offset + 0,
8367                _depth
8368            )?;
8369            Ok(())
8370        }
8371    }
8372
8373    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8374        type Borrowed<'a> = &'a Self;
8375        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8376            value
8377        }
8378    }
8379
8380    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8381        type Owned = Self;
8382
8383        #[inline(always)]
8384        fn inline_align(_context: fidl::encoding::Context) -> usize {
8385            8
8386        }
8387
8388        #[inline(always)]
8389        fn inline_size(_context: fidl::encoding::Context) -> usize {
8390            8
8391        }
8392        #[inline(always)]
8393        fn encode_is_copy() -> bool {
8394            true
8395        }
8396
8397        #[inline(always)]
8398        fn decode_is_copy() -> bool {
8399            true
8400        }
8401    }
8402
8403    unsafe impl<D: fidl::encoding::ResourceDialect>
8404        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D>
8405        for &BaseSocketGetBindToInterfaceIndexResponse
8406    {
8407        #[inline]
8408        unsafe fn encode(
8409            self,
8410            encoder: &mut fidl::encoding::Encoder<'_, D>,
8411            offset: usize,
8412            _depth: fidl::encoding::Depth,
8413        ) -> fidl::Result<()> {
8414            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8415            unsafe {
8416                // Copy the object into the buffer.
8417                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8418                (buf_ptr as *mut BaseSocketGetBindToInterfaceIndexResponse).write_unaligned(
8419                    (self as *const BaseSocketGetBindToInterfaceIndexResponse).read(),
8420                );
8421                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8422                // done second because the memcpy will write garbage to these bytes.
8423            }
8424            Ok(())
8425        }
8426    }
8427    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8428        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D> for (T0,)
8429    {
8430        #[inline]
8431        unsafe fn encode(
8432            self,
8433            encoder: &mut fidl::encoding::Encoder<'_, D>,
8434            offset: usize,
8435            depth: fidl::encoding::Depth,
8436        ) -> fidl::Result<()> {
8437            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8438            // Zero out padding regions. There's no need to apply masks
8439            // because the unmasked parts will be overwritten by fields.
8440            // Write the fields.
8441            self.0.encode(encoder, offset + 0, depth)?;
8442            Ok(())
8443        }
8444    }
8445
8446    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8447        for BaseSocketGetBindToInterfaceIndexResponse
8448    {
8449        #[inline(always)]
8450        fn new_empty() -> Self {
8451            Self { value: fidl::new_empty!(u64, D) }
8452        }
8453
8454        #[inline]
8455        unsafe fn decode(
8456            &mut self,
8457            decoder: &mut fidl::encoding::Decoder<'_, D>,
8458            offset: usize,
8459            _depth: fidl::encoding::Depth,
8460        ) -> fidl::Result<()> {
8461            decoder.debug_check_bounds::<Self>(offset);
8462            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8463            // Verify that padding bytes are zero.
8464            // Copy from the buffer into the object.
8465            unsafe {
8466                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8467            }
8468            Ok(())
8469        }
8470    }
8471
8472    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBroadcastResponse {
8473        type Borrowed<'a> = &'a Self;
8474        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8475            value
8476        }
8477    }
8478
8479    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBroadcastResponse {
8480        type Owned = Self;
8481
8482        #[inline(always)]
8483        fn inline_align(_context: fidl::encoding::Context) -> usize {
8484            1
8485        }
8486
8487        #[inline(always)]
8488        fn inline_size(_context: fidl::encoding::Context) -> usize {
8489            1
8490        }
8491    }
8492
8493    unsafe impl<D: fidl::encoding::ResourceDialect>
8494        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D>
8495        for &BaseSocketGetBroadcastResponse
8496    {
8497        #[inline]
8498        unsafe fn encode(
8499            self,
8500            encoder: &mut fidl::encoding::Encoder<'_, D>,
8501            offset: usize,
8502            _depth: fidl::encoding::Depth,
8503        ) -> fidl::Result<()> {
8504            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8505            // Delegate to tuple encoding.
8506            fidl::encoding::Encode::<BaseSocketGetBroadcastResponse, D>::encode(
8507                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8508                encoder,
8509                offset,
8510                _depth,
8511            )
8512        }
8513    }
8514    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8515        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D> for (T0,)
8516    {
8517        #[inline]
8518        unsafe fn encode(
8519            self,
8520            encoder: &mut fidl::encoding::Encoder<'_, D>,
8521            offset: usize,
8522            depth: fidl::encoding::Depth,
8523        ) -> fidl::Result<()> {
8524            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8525            // Zero out padding regions. There's no need to apply masks
8526            // because the unmasked parts will be overwritten by fields.
8527            // Write the fields.
8528            self.0.encode(encoder, offset + 0, depth)?;
8529            Ok(())
8530        }
8531    }
8532
8533    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8534        for BaseSocketGetBroadcastResponse
8535    {
8536        #[inline(always)]
8537        fn new_empty() -> Self {
8538            Self { value: fidl::new_empty!(bool, D) }
8539        }
8540
8541        #[inline]
8542        unsafe fn decode(
8543            &mut self,
8544            decoder: &mut fidl::encoding::Decoder<'_, D>,
8545            offset: usize,
8546            _depth: fidl::encoding::Depth,
8547        ) -> fidl::Result<()> {
8548            decoder.debug_check_bounds::<Self>(offset);
8549            // Verify that padding bytes are zero.
8550            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8551            Ok(())
8552        }
8553    }
8554
8555    impl fidl::encoding::ValueTypeMarker for BaseSocketGetKeepAliveResponse {
8556        type Borrowed<'a> = &'a Self;
8557        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8558            value
8559        }
8560    }
8561
8562    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetKeepAliveResponse {
8563        type Owned = Self;
8564
8565        #[inline(always)]
8566        fn inline_align(_context: fidl::encoding::Context) -> usize {
8567            1
8568        }
8569
8570        #[inline(always)]
8571        fn inline_size(_context: fidl::encoding::Context) -> usize {
8572            1
8573        }
8574    }
8575
8576    unsafe impl<D: fidl::encoding::ResourceDialect>
8577        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D>
8578        for &BaseSocketGetKeepAliveResponse
8579    {
8580        #[inline]
8581        unsafe fn encode(
8582            self,
8583            encoder: &mut fidl::encoding::Encoder<'_, D>,
8584            offset: usize,
8585            _depth: fidl::encoding::Depth,
8586        ) -> fidl::Result<()> {
8587            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8588            // Delegate to tuple encoding.
8589            fidl::encoding::Encode::<BaseSocketGetKeepAliveResponse, D>::encode(
8590                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8591                encoder,
8592                offset,
8593                _depth,
8594            )
8595        }
8596    }
8597    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8598        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D> for (T0,)
8599    {
8600        #[inline]
8601        unsafe fn encode(
8602            self,
8603            encoder: &mut fidl::encoding::Encoder<'_, D>,
8604            offset: usize,
8605            depth: fidl::encoding::Depth,
8606        ) -> fidl::Result<()> {
8607            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8608            // Zero out padding regions. There's no need to apply masks
8609            // because the unmasked parts will be overwritten by fields.
8610            // Write the fields.
8611            self.0.encode(encoder, offset + 0, depth)?;
8612            Ok(())
8613        }
8614    }
8615
8616    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8617        for BaseSocketGetKeepAliveResponse
8618    {
8619        #[inline(always)]
8620        fn new_empty() -> Self {
8621            Self { value: fidl::new_empty!(bool, D) }
8622        }
8623
8624        #[inline]
8625        unsafe fn decode(
8626            &mut self,
8627            decoder: &mut fidl::encoding::Decoder<'_, D>,
8628            offset: usize,
8629            _depth: fidl::encoding::Depth,
8630        ) -> fidl::Result<()> {
8631            decoder.debug_check_bounds::<Self>(offset);
8632            // Verify that padding bytes are zero.
8633            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8634            Ok(())
8635        }
8636    }
8637
8638    impl fidl::encoding::ValueTypeMarker for BaseSocketGetLingerResponse {
8639        type Borrowed<'a> = &'a Self;
8640        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8641            value
8642        }
8643    }
8644
8645    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetLingerResponse {
8646        type Owned = Self;
8647
8648        #[inline(always)]
8649        fn inline_align(_context: fidl::encoding::Context) -> usize {
8650            4
8651        }
8652
8653        #[inline(always)]
8654        fn inline_size(_context: fidl::encoding::Context) -> usize {
8655            8
8656        }
8657    }
8658
8659    unsafe impl<D: fidl::encoding::ResourceDialect>
8660        fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for &BaseSocketGetLingerResponse
8661    {
8662        #[inline]
8663        unsafe fn encode(
8664            self,
8665            encoder: &mut fidl::encoding::Encoder<'_, D>,
8666            offset: usize,
8667            _depth: fidl::encoding::Depth,
8668        ) -> fidl::Result<()> {
8669            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
8670            // Delegate to tuple encoding.
8671            fidl::encoding::Encode::<BaseSocketGetLingerResponse, D>::encode(
8672                (
8673                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
8674                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
8675                ),
8676                encoder,
8677                offset,
8678                _depth,
8679            )
8680        }
8681    }
8682    unsafe impl<
8683            D: fidl::encoding::ResourceDialect,
8684            T0: fidl::encoding::Encode<bool, D>,
8685            T1: fidl::encoding::Encode<u32, D>,
8686        > fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for (T0, T1)
8687    {
8688        #[inline]
8689        unsafe fn encode(
8690            self,
8691            encoder: &mut fidl::encoding::Encoder<'_, D>,
8692            offset: usize,
8693            depth: fidl::encoding::Depth,
8694        ) -> fidl::Result<()> {
8695            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
8696            // Zero out padding regions. There's no need to apply masks
8697            // because the unmasked parts will be overwritten by fields.
8698            unsafe {
8699                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8700                (ptr as *mut u32).write_unaligned(0);
8701            }
8702            // Write the fields.
8703            self.0.encode(encoder, offset + 0, depth)?;
8704            self.1.encode(encoder, offset + 4, depth)?;
8705            Ok(())
8706        }
8707    }
8708
8709    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8710        for BaseSocketGetLingerResponse
8711    {
8712        #[inline(always)]
8713        fn new_empty() -> Self {
8714            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
8715        }
8716
8717        #[inline]
8718        unsafe fn decode(
8719            &mut self,
8720            decoder: &mut fidl::encoding::Decoder<'_, D>,
8721            offset: usize,
8722            _depth: fidl::encoding::Depth,
8723        ) -> fidl::Result<()> {
8724            decoder.debug_check_bounds::<Self>(offset);
8725            // Verify that padding bytes are zero.
8726            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8727            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8728            let mask = 0xffffff00u32;
8729            let maskedval = padval & mask;
8730            if maskedval != 0 {
8731                return Err(fidl::Error::NonZeroPadding {
8732                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8733                });
8734            }
8735            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
8736            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
8737            Ok(())
8738        }
8739    }
8740
8741    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkResponse {
8742        type Borrowed<'a> = &'a Self;
8743        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8744            value
8745        }
8746    }
8747
8748    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkResponse {
8749        type Owned = Self;
8750
8751        #[inline(always)]
8752        fn inline_align(_context: fidl::encoding::Context) -> usize {
8753            8
8754        }
8755
8756        #[inline(always)]
8757        fn inline_size(_context: fidl::encoding::Context) -> usize {
8758            16
8759        }
8760    }
8761
8762    unsafe impl<D: fidl::encoding::ResourceDialect>
8763        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for &BaseSocketGetMarkResponse
8764    {
8765        #[inline]
8766        unsafe fn encode(
8767            self,
8768            encoder: &mut fidl::encoding::Encoder<'_, D>,
8769            offset: usize,
8770            _depth: fidl::encoding::Depth,
8771        ) -> fidl::Result<()> {
8772            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
8773            // Delegate to tuple encoding.
8774            fidl::encoding::Encode::<BaseSocketGetMarkResponse, D>::encode(
8775                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),),
8776                encoder,
8777                offset,
8778                _depth,
8779            )
8780        }
8781    }
8782    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
8783        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for (T0,)
8784    {
8785        #[inline]
8786        unsafe fn encode(
8787            self,
8788            encoder: &mut fidl::encoding::Encoder<'_, D>,
8789            offset: usize,
8790            depth: fidl::encoding::Depth,
8791        ) -> fidl::Result<()> {
8792            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
8793            // Zero out padding regions. There's no need to apply masks
8794            // because the unmasked parts will be overwritten by fields.
8795            // Write the fields.
8796            self.0.encode(encoder, offset + 0, depth)?;
8797            Ok(())
8798        }
8799    }
8800
8801    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8802        for BaseSocketGetMarkResponse
8803    {
8804        #[inline(always)]
8805        fn new_empty() -> Self {
8806            Self { mark: fidl::new_empty!(OptionalUint32, D) }
8807        }
8808
8809        #[inline]
8810        unsafe fn decode(
8811            &mut self,
8812            decoder: &mut fidl::encoding::Decoder<'_, D>,
8813            offset: usize,
8814            _depth: fidl::encoding::Depth,
8815        ) -> fidl::Result<()> {
8816            decoder.debug_check_bounds::<Self>(offset);
8817            // Verify that padding bytes are zero.
8818            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 0, _depth)?;
8819            Ok(())
8820        }
8821    }
8822
8823    impl fidl::encoding::ValueTypeMarker for BaseSocketGetNoCheckResponse {
8824        type Borrowed<'a> = &'a Self;
8825        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8826            value
8827        }
8828    }
8829
8830    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetNoCheckResponse {
8831        type Owned = Self;
8832
8833        #[inline(always)]
8834        fn inline_align(_context: fidl::encoding::Context) -> usize {
8835            1
8836        }
8837
8838        #[inline(always)]
8839        fn inline_size(_context: fidl::encoding::Context) -> usize {
8840            1
8841        }
8842    }
8843
8844    unsafe impl<D: fidl::encoding::ResourceDialect>
8845        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for &BaseSocketGetNoCheckResponse
8846    {
8847        #[inline]
8848        unsafe fn encode(
8849            self,
8850            encoder: &mut fidl::encoding::Encoder<'_, D>,
8851            offset: usize,
8852            _depth: fidl::encoding::Depth,
8853        ) -> fidl::Result<()> {
8854            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
8855            // Delegate to tuple encoding.
8856            fidl::encoding::Encode::<BaseSocketGetNoCheckResponse, D>::encode(
8857                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8858                encoder,
8859                offset,
8860                _depth,
8861            )
8862        }
8863    }
8864    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8865        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for (T0,)
8866    {
8867        #[inline]
8868        unsafe fn encode(
8869            self,
8870            encoder: &mut fidl::encoding::Encoder<'_, D>,
8871            offset: usize,
8872            depth: fidl::encoding::Depth,
8873        ) -> fidl::Result<()> {
8874            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
8875            // Zero out padding regions. There's no need to apply masks
8876            // because the unmasked parts will be overwritten by fields.
8877            // Write the fields.
8878            self.0.encode(encoder, offset + 0, depth)?;
8879            Ok(())
8880        }
8881    }
8882
8883    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8884        for BaseSocketGetNoCheckResponse
8885    {
8886        #[inline(always)]
8887        fn new_empty() -> Self {
8888            Self { value: fidl::new_empty!(bool, D) }
8889        }
8890
8891        #[inline]
8892        unsafe fn decode(
8893            &mut self,
8894            decoder: &mut fidl::encoding::Decoder<'_, D>,
8895            offset: usize,
8896            _depth: fidl::encoding::Depth,
8897        ) -> fidl::Result<()> {
8898            decoder.debug_check_bounds::<Self>(offset);
8899            // Verify that padding bytes are zero.
8900            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8901            Ok(())
8902        }
8903    }
8904
8905    impl fidl::encoding::ValueTypeMarker for BaseSocketGetOutOfBandInlineResponse {
8906        type Borrowed<'a> = &'a Self;
8907        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8908            value
8909        }
8910    }
8911
8912    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetOutOfBandInlineResponse {
8913        type Owned = Self;
8914
8915        #[inline(always)]
8916        fn inline_align(_context: fidl::encoding::Context) -> usize {
8917            1
8918        }
8919
8920        #[inline(always)]
8921        fn inline_size(_context: fidl::encoding::Context) -> usize {
8922            1
8923        }
8924    }
8925
8926    unsafe impl<D: fidl::encoding::ResourceDialect>
8927        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D>
8928        for &BaseSocketGetOutOfBandInlineResponse
8929    {
8930        #[inline]
8931        unsafe fn encode(
8932            self,
8933            encoder: &mut fidl::encoding::Encoder<'_, D>,
8934            offset: usize,
8935            _depth: fidl::encoding::Depth,
8936        ) -> fidl::Result<()> {
8937            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
8938            // Delegate to tuple encoding.
8939            fidl::encoding::Encode::<BaseSocketGetOutOfBandInlineResponse, D>::encode(
8940                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8941                encoder,
8942                offset,
8943                _depth,
8944            )
8945        }
8946    }
8947    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8948        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D> for (T0,)
8949    {
8950        #[inline]
8951        unsafe fn encode(
8952            self,
8953            encoder: &mut fidl::encoding::Encoder<'_, D>,
8954            offset: usize,
8955            depth: fidl::encoding::Depth,
8956        ) -> fidl::Result<()> {
8957            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
8958            // Zero out padding regions. There's no need to apply masks
8959            // because the unmasked parts will be overwritten by fields.
8960            // Write the fields.
8961            self.0.encode(encoder, offset + 0, depth)?;
8962            Ok(())
8963        }
8964    }
8965
8966    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8967        for BaseSocketGetOutOfBandInlineResponse
8968    {
8969        #[inline(always)]
8970        fn new_empty() -> Self {
8971            Self { value: fidl::new_empty!(bool, D) }
8972        }
8973
8974        #[inline]
8975        unsafe fn decode(
8976            &mut self,
8977            decoder: &mut fidl::encoding::Decoder<'_, D>,
8978            offset: usize,
8979            _depth: fidl::encoding::Depth,
8980        ) -> fidl::Result<()> {
8981            decoder.debug_check_bounds::<Self>(offset);
8982            // Verify that padding bytes are zero.
8983            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8984            Ok(())
8985        }
8986    }
8987
8988    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReceiveBufferResponse {
8989        type Borrowed<'a> = &'a Self;
8990        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8991            value
8992        }
8993    }
8994
8995    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReceiveBufferResponse {
8996        type Owned = Self;
8997
8998        #[inline(always)]
8999        fn inline_align(_context: fidl::encoding::Context) -> usize {
9000            8
9001        }
9002
9003        #[inline(always)]
9004        fn inline_size(_context: fidl::encoding::Context) -> usize {
9005            8
9006        }
9007        #[inline(always)]
9008        fn encode_is_copy() -> bool {
9009            true
9010        }
9011
9012        #[inline(always)]
9013        fn decode_is_copy() -> bool {
9014            true
9015        }
9016    }
9017
9018    unsafe impl<D: fidl::encoding::ResourceDialect>
9019        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D>
9020        for &BaseSocketGetReceiveBufferResponse
9021    {
9022        #[inline]
9023        unsafe fn encode(
9024            self,
9025            encoder: &mut fidl::encoding::Encoder<'_, D>,
9026            offset: usize,
9027            _depth: fidl::encoding::Depth,
9028        ) -> fidl::Result<()> {
9029            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9030            unsafe {
9031                // Copy the object into the buffer.
9032                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9033                (buf_ptr as *mut BaseSocketGetReceiveBufferResponse)
9034                    .write_unaligned((self as *const BaseSocketGetReceiveBufferResponse).read());
9035                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9036                // done second because the memcpy will write garbage to these bytes.
9037            }
9038            Ok(())
9039        }
9040    }
9041    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9042        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D> for (T0,)
9043    {
9044        #[inline]
9045        unsafe fn encode(
9046            self,
9047            encoder: &mut fidl::encoding::Encoder<'_, D>,
9048            offset: usize,
9049            depth: fidl::encoding::Depth,
9050        ) -> fidl::Result<()> {
9051            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9052            // Zero out padding regions. There's no need to apply masks
9053            // because the unmasked parts will be overwritten by fields.
9054            // Write the fields.
9055            self.0.encode(encoder, offset + 0, depth)?;
9056            Ok(())
9057        }
9058    }
9059
9060    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9061        for BaseSocketGetReceiveBufferResponse
9062    {
9063        #[inline(always)]
9064        fn new_empty() -> Self {
9065            Self { value_bytes: fidl::new_empty!(u64, D) }
9066        }
9067
9068        #[inline]
9069        unsafe fn decode(
9070            &mut self,
9071            decoder: &mut fidl::encoding::Decoder<'_, D>,
9072            offset: usize,
9073            _depth: fidl::encoding::Depth,
9074        ) -> fidl::Result<()> {
9075            decoder.debug_check_bounds::<Self>(offset);
9076            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9077            // Verify that padding bytes are zero.
9078            // Copy from the buffer into the object.
9079            unsafe {
9080                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9081            }
9082            Ok(())
9083        }
9084    }
9085
9086    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReuseAddressResponse {
9087        type Borrowed<'a> = &'a Self;
9088        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9089            value
9090        }
9091    }
9092
9093    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReuseAddressResponse {
9094        type Owned = Self;
9095
9096        #[inline(always)]
9097        fn inline_align(_context: fidl::encoding::Context) -> usize {
9098            1
9099        }
9100
9101        #[inline(always)]
9102        fn inline_size(_context: fidl::encoding::Context) -> usize {
9103            1
9104        }
9105    }
9106
9107    unsafe impl<D: fidl::encoding::ResourceDialect>
9108        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D>
9109        for &BaseSocketGetReuseAddressResponse
9110    {
9111        #[inline]
9112        unsafe fn encode(
9113            self,
9114            encoder: &mut fidl::encoding::Encoder<'_, D>,
9115            offset: usize,
9116            _depth: fidl::encoding::Depth,
9117        ) -> fidl::Result<()> {
9118            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9119            // Delegate to tuple encoding.
9120            fidl::encoding::Encode::<BaseSocketGetReuseAddressResponse, D>::encode(
9121                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9122                encoder,
9123                offset,
9124                _depth,
9125            )
9126        }
9127    }
9128    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9129        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D> for (T0,)
9130    {
9131        #[inline]
9132        unsafe fn encode(
9133            self,
9134            encoder: &mut fidl::encoding::Encoder<'_, D>,
9135            offset: usize,
9136            depth: fidl::encoding::Depth,
9137        ) -> fidl::Result<()> {
9138            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9139            // Zero out padding regions. There's no need to apply masks
9140            // because the unmasked parts will be overwritten by fields.
9141            // Write the fields.
9142            self.0.encode(encoder, offset + 0, depth)?;
9143            Ok(())
9144        }
9145    }
9146
9147    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9148        for BaseSocketGetReuseAddressResponse
9149    {
9150        #[inline(always)]
9151        fn new_empty() -> Self {
9152            Self { value: fidl::new_empty!(bool, D) }
9153        }
9154
9155        #[inline]
9156        unsafe fn decode(
9157            &mut self,
9158            decoder: &mut fidl::encoding::Decoder<'_, D>,
9159            offset: usize,
9160            _depth: fidl::encoding::Depth,
9161        ) -> fidl::Result<()> {
9162            decoder.debug_check_bounds::<Self>(offset);
9163            // Verify that padding bytes are zero.
9164            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9165            Ok(())
9166        }
9167    }
9168
9169    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReusePortResponse {
9170        type Borrowed<'a> = &'a Self;
9171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9172            value
9173        }
9174    }
9175
9176    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReusePortResponse {
9177        type Owned = Self;
9178
9179        #[inline(always)]
9180        fn inline_align(_context: fidl::encoding::Context) -> usize {
9181            1
9182        }
9183
9184        #[inline(always)]
9185        fn inline_size(_context: fidl::encoding::Context) -> usize {
9186            1
9187        }
9188    }
9189
9190    unsafe impl<D: fidl::encoding::ResourceDialect>
9191        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D>
9192        for &BaseSocketGetReusePortResponse
9193    {
9194        #[inline]
9195        unsafe fn encode(
9196            self,
9197            encoder: &mut fidl::encoding::Encoder<'_, D>,
9198            offset: usize,
9199            _depth: fidl::encoding::Depth,
9200        ) -> fidl::Result<()> {
9201            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9202            // Delegate to tuple encoding.
9203            fidl::encoding::Encode::<BaseSocketGetReusePortResponse, D>::encode(
9204                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9205                encoder,
9206                offset,
9207                _depth,
9208            )
9209        }
9210    }
9211    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9212        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D> for (T0,)
9213    {
9214        #[inline]
9215        unsafe fn encode(
9216            self,
9217            encoder: &mut fidl::encoding::Encoder<'_, D>,
9218            offset: usize,
9219            depth: fidl::encoding::Depth,
9220        ) -> fidl::Result<()> {
9221            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9222            // Zero out padding regions. There's no need to apply masks
9223            // because the unmasked parts will be overwritten by fields.
9224            // Write the fields.
9225            self.0.encode(encoder, offset + 0, depth)?;
9226            Ok(())
9227        }
9228    }
9229
9230    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9231        for BaseSocketGetReusePortResponse
9232    {
9233        #[inline(always)]
9234        fn new_empty() -> Self {
9235            Self { value: fidl::new_empty!(bool, D) }
9236        }
9237
9238        #[inline]
9239        unsafe fn decode(
9240            &mut self,
9241            decoder: &mut fidl::encoding::Decoder<'_, D>,
9242            offset: usize,
9243            _depth: fidl::encoding::Depth,
9244        ) -> fidl::Result<()> {
9245            decoder.debug_check_bounds::<Self>(offset);
9246            // Verify that padding bytes are zero.
9247            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9248            Ok(())
9249        }
9250    }
9251
9252    impl fidl::encoding::ValueTypeMarker for BaseSocketGetSendBufferResponse {
9253        type Borrowed<'a> = &'a Self;
9254        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9255            value
9256        }
9257    }
9258
9259    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetSendBufferResponse {
9260        type Owned = Self;
9261
9262        #[inline(always)]
9263        fn inline_align(_context: fidl::encoding::Context) -> usize {
9264            8
9265        }
9266
9267        #[inline(always)]
9268        fn inline_size(_context: fidl::encoding::Context) -> usize {
9269            8
9270        }
9271        #[inline(always)]
9272        fn encode_is_copy() -> bool {
9273            true
9274        }
9275
9276        #[inline(always)]
9277        fn decode_is_copy() -> bool {
9278            true
9279        }
9280    }
9281
9282    unsafe impl<D: fidl::encoding::ResourceDialect>
9283        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D>
9284        for &BaseSocketGetSendBufferResponse
9285    {
9286        #[inline]
9287        unsafe fn encode(
9288            self,
9289            encoder: &mut fidl::encoding::Encoder<'_, D>,
9290            offset: usize,
9291            _depth: fidl::encoding::Depth,
9292        ) -> fidl::Result<()> {
9293            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9294            unsafe {
9295                // Copy the object into the buffer.
9296                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9297                (buf_ptr as *mut BaseSocketGetSendBufferResponse)
9298                    .write_unaligned((self as *const BaseSocketGetSendBufferResponse).read());
9299                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9300                // done second because the memcpy will write garbage to these bytes.
9301            }
9302            Ok(())
9303        }
9304    }
9305    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9306        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D> for (T0,)
9307    {
9308        #[inline]
9309        unsafe fn encode(
9310            self,
9311            encoder: &mut fidl::encoding::Encoder<'_, D>,
9312            offset: usize,
9313            depth: fidl::encoding::Depth,
9314        ) -> fidl::Result<()> {
9315            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9316            // Zero out padding regions. There's no need to apply masks
9317            // because the unmasked parts will be overwritten by fields.
9318            // Write the fields.
9319            self.0.encode(encoder, offset + 0, depth)?;
9320            Ok(())
9321        }
9322    }
9323
9324    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9325        for BaseSocketGetSendBufferResponse
9326    {
9327        #[inline(always)]
9328        fn new_empty() -> Self {
9329            Self { value_bytes: fidl::new_empty!(u64, D) }
9330        }
9331
9332        #[inline]
9333        unsafe fn decode(
9334            &mut self,
9335            decoder: &mut fidl::encoding::Decoder<'_, D>,
9336            offset: usize,
9337            _depth: fidl::encoding::Depth,
9338        ) -> fidl::Result<()> {
9339            decoder.debug_check_bounds::<Self>(offset);
9340            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9341            // Verify that padding bytes are zero.
9342            // Copy from the buffer into the object.
9343            unsafe {
9344                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9345            }
9346            Ok(())
9347        }
9348    }
9349
9350    impl fidl::encoding::ValueTypeMarker for BaseSocketGetTimestampResponse {
9351        type Borrowed<'a> = &'a Self;
9352        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9353            value
9354        }
9355    }
9356
9357    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetTimestampResponse {
9358        type Owned = Self;
9359
9360        #[inline(always)]
9361        fn inline_align(_context: fidl::encoding::Context) -> usize {
9362            4
9363        }
9364
9365        #[inline(always)]
9366        fn inline_size(_context: fidl::encoding::Context) -> usize {
9367            4
9368        }
9369    }
9370
9371    unsafe impl<D: fidl::encoding::ResourceDialect>
9372        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D>
9373        for &BaseSocketGetTimestampResponse
9374    {
9375        #[inline]
9376        unsafe fn encode(
9377            self,
9378            encoder: &mut fidl::encoding::Encoder<'_, D>,
9379            offset: usize,
9380            _depth: fidl::encoding::Depth,
9381        ) -> fidl::Result<()> {
9382            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9383            // Delegate to tuple encoding.
9384            fidl::encoding::Encode::<BaseSocketGetTimestampResponse, D>::encode(
9385                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9386                encoder,
9387                offset,
9388                _depth,
9389            )
9390        }
9391    }
9392    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
9393        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D> for (T0,)
9394    {
9395        #[inline]
9396        unsafe fn encode(
9397            self,
9398            encoder: &mut fidl::encoding::Encoder<'_, D>,
9399            offset: usize,
9400            depth: fidl::encoding::Depth,
9401        ) -> fidl::Result<()> {
9402            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9403            // Zero out padding regions. There's no need to apply masks
9404            // because the unmasked parts will be overwritten by fields.
9405            // Write the fields.
9406            self.0.encode(encoder, offset + 0, depth)?;
9407            Ok(())
9408        }
9409    }
9410
9411    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9412        for BaseSocketGetTimestampResponse
9413    {
9414        #[inline(always)]
9415        fn new_empty() -> Self {
9416            Self { value: fidl::new_empty!(TimestampOption, D) }
9417        }
9418
9419        #[inline]
9420        unsafe fn decode(
9421            &mut self,
9422            decoder: &mut fidl::encoding::Decoder<'_, D>,
9423            offset: usize,
9424            _depth: fidl::encoding::Depth,
9425        ) -> fidl::Result<()> {
9426            decoder.debug_check_bounds::<Self>(offset);
9427            // Verify that padding bytes are zero.
9428            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
9429            Ok(())
9430        }
9431    }
9432
9433    impl fidl::encoding::ValueTypeMarker for Empty {
9434        type Borrowed<'a> = &'a Self;
9435        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9436            value
9437        }
9438    }
9439
9440    unsafe impl fidl::encoding::TypeMarker for Empty {
9441        type Owned = Self;
9442
9443        #[inline(always)]
9444        fn inline_align(_context: fidl::encoding::Context) -> usize {
9445            1
9446        }
9447
9448        #[inline(always)]
9449        fn inline_size(_context: fidl::encoding::Context) -> usize {
9450            1
9451        }
9452    }
9453
9454    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
9455        #[inline]
9456        unsafe fn encode(
9457            self,
9458            encoder: &mut fidl::encoding::Encoder<'_, D>,
9459            offset: usize,
9460            _depth: fidl::encoding::Depth,
9461        ) -> fidl::Result<()> {
9462            encoder.debug_check_bounds::<Empty>(offset);
9463            encoder.write_num(0u8, offset);
9464            Ok(())
9465        }
9466    }
9467
9468    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
9469        #[inline(always)]
9470        fn new_empty() -> Self {
9471            Self
9472        }
9473
9474        #[inline]
9475        unsafe fn decode(
9476            &mut self,
9477            decoder: &mut fidl::encoding::Decoder<'_, D>,
9478            offset: usize,
9479            _depth: fidl::encoding::Depth,
9480        ) -> fidl::Result<()> {
9481            decoder.debug_check_bounds::<Self>(offset);
9482            match decoder.read_num::<u8>(offset) {
9483                0 => Ok(()),
9484                _ => Err(fidl::Error::Invalid),
9485            }
9486        }
9487    }
9488
9489    impl fidl::encoding::ValueTypeMarker for IpMulticastMembership {
9490        type Borrowed<'a> = &'a Self;
9491        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9492            value
9493        }
9494    }
9495
9496    unsafe impl fidl::encoding::TypeMarker for IpMulticastMembership {
9497        type Owned = Self;
9498
9499        #[inline(always)]
9500        fn inline_align(_context: fidl::encoding::Context) -> usize {
9501            8
9502        }
9503
9504        #[inline(always)]
9505        fn inline_size(_context: fidl::encoding::Context) -> usize {
9506            16
9507        }
9508    }
9509
9510    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpMulticastMembership, D>
9511        for &IpMulticastMembership
9512    {
9513        #[inline]
9514        unsafe fn encode(
9515            self,
9516            encoder: &mut fidl::encoding::Encoder<'_, D>,
9517            offset: usize,
9518            _depth: fidl::encoding::Depth,
9519        ) -> fidl::Result<()> {
9520            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9521            // Delegate to tuple encoding.
9522            fidl::encoding::Encode::<IpMulticastMembership, D>::encode(
9523                (
9524                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9525                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
9526                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
9527                ),
9528                encoder, offset, _depth
9529            )
9530        }
9531    }
9532    unsafe impl<
9533            D: fidl::encoding::ResourceDialect,
9534            T0: fidl::encoding::Encode<u64, D>,
9535            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
9536            T2: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
9537        > fidl::encoding::Encode<IpMulticastMembership, D> for (T0, T1, T2)
9538    {
9539        #[inline]
9540        unsafe fn encode(
9541            self,
9542            encoder: &mut fidl::encoding::Encoder<'_, D>,
9543            offset: usize,
9544            depth: fidl::encoding::Depth,
9545        ) -> fidl::Result<()> {
9546            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9547            // Zero out padding regions. There's no need to apply masks
9548            // because the unmasked parts will be overwritten by fields.
9549            // Write the fields.
9550            self.0.encode(encoder, offset + 0, depth)?;
9551            self.1.encode(encoder, offset + 8, depth)?;
9552            self.2.encode(encoder, offset + 12, depth)?;
9553            Ok(())
9554        }
9555    }
9556
9557    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpMulticastMembership {
9558        #[inline(always)]
9559        fn new_empty() -> Self {
9560            Self {
9561                iface: fidl::new_empty!(u64, D),
9562                local_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D),
9563                mcast_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D),
9564            }
9565        }
9566
9567        #[inline]
9568        unsafe fn decode(
9569            &mut self,
9570            decoder: &mut fidl::encoding::Decoder<'_, D>,
9571            offset: usize,
9572            _depth: fidl::encoding::Depth,
9573        ) -> fidl::Result<()> {
9574            decoder.debug_check_bounds::<Self>(offset);
9575            // Verify that padding bytes are zero.
9576            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9577            fidl::decode!(
9578                fidl_fuchsia_net__common::Ipv4Address,
9579                D,
9580                &mut self.local_addr,
9581                decoder,
9582                offset + 8,
9583                _depth
9584            )?;
9585            fidl::decode!(
9586                fidl_fuchsia_net__common::Ipv4Address,
9587                D,
9588                &mut self.mcast_addr,
9589                decoder,
9590                offset + 12,
9591                _depth
9592            )?;
9593            Ok(())
9594        }
9595    }
9596
9597    impl fidl::encoding::ValueTypeMarker for Ipv6MulticastMembership {
9598        type Borrowed<'a> = &'a Self;
9599        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9600            value
9601        }
9602    }
9603
9604    unsafe impl fidl::encoding::TypeMarker for Ipv6MulticastMembership {
9605        type Owned = Self;
9606
9607        #[inline(always)]
9608        fn inline_align(_context: fidl::encoding::Context) -> usize {
9609            8
9610        }
9611
9612        #[inline(always)]
9613        fn inline_size(_context: fidl::encoding::Context) -> usize {
9614            24
9615        }
9616    }
9617
9618    unsafe impl<D: fidl::encoding::ResourceDialect>
9619        fidl::encoding::Encode<Ipv6MulticastMembership, D> for &Ipv6MulticastMembership
9620    {
9621        #[inline]
9622        unsafe fn encode(
9623            self,
9624            encoder: &mut fidl::encoding::Encoder<'_, D>,
9625            offset: usize,
9626            _depth: fidl::encoding::Depth,
9627        ) -> fidl::Result<()> {
9628            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
9629            // Delegate to tuple encoding.
9630            fidl::encoding::Encode::<Ipv6MulticastMembership, D>::encode(
9631                (
9632                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9633                    <fidl_fuchsia_net__common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
9634                ),
9635                encoder, offset, _depth
9636            )
9637        }
9638    }
9639    unsafe impl<
9640            D: fidl::encoding::ResourceDialect,
9641            T0: fidl::encoding::Encode<u64, D>,
9642            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6Address, D>,
9643        > fidl::encoding::Encode<Ipv6MulticastMembership, D> for (T0, T1)
9644    {
9645        #[inline]
9646        unsafe fn encode(
9647            self,
9648            encoder: &mut fidl::encoding::Encoder<'_, D>,
9649            offset: usize,
9650            depth: fidl::encoding::Depth,
9651        ) -> fidl::Result<()> {
9652            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
9653            // Zero out padding regions. There's no need to apply masks
9654            // because the unmasked parts will be overwritten by fields.
9655            // Write the fields.
9656            self.0.encode(encoder, offset + 0, depth)?;
9657            self.1.encode(encoder, offset + 8, depth)?;
9658            Ok(())
9659        }
9660    }
9661
9662    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9663        for Ipv6MulticastMembership
9664    {
9665        #[inline(always)]
9666        fn new_empty() -> Self {
9667            Self {
9668                iface: fidl::new_empty!(u64, D),
9669                mcast_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6Address, D),
9670            }
9671        }
9672
9673        #[inline]
9674        unsafe fn decode(
9675            &mut self,
9676            decoder: &mut fidl::encoding::Decoder<'_, D>,
9677            offset: usize,
9678            _depth: fidl::encoding::Depth,
9679        ) -> fidl::Result<()> {
9680            decoder.debug_check_bounds::<Self>(offset);
9681            // Verify that padding bytes are zero.
9682            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9683            fidl::decode!(
9684                fidl_fuchsia_net__common::Ipv6Address,
9685                D,
9686                &mut self.mcast_addr,
9687                decoder,
9688                offset + 8,
9689                _depth
9690            )?;
9691            Ok(())
9692        }
9693    }
9694
9695    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoRecvControlData {
9696        type Borrowed<'a> = &'a Self;
9697        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9698            value
9699        }
9700    }
9701
9702    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoRecvControlData {
9703        type Owned = Self;
9704
9705        #[inline(always)]
9706        fn inline_align(_context: fidl::encoding::Context) -> usize {
9707            8
9708        }
9709
9710        #[inline(always)]
9711        fn inline_size(_context: fidl::encoding::Context) -> usize {
9712            24
9713        }
9714    }
9715
9716    unsafe impl<D: fidl::encoding::ResourceDialect>
9717        fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for &Ipv6PktInfoRecvControlData
9718    {
9719        #[inline]
9720        unsafe fn encode(
9721            self,
9722            encoder: &mut fidl::encoding::Encoder<'_, D>,
9723            offset: usize,
9724            _depth: fidl::encoding::Depth,
9725        ) -> fidl::Result<()> {
9726            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
9727            // Delegate to tuple encoding.
9728            fidl::encoding::Encode::<Ipv6PktInfoRecvControlData, D>::encode(
9729                (
9730                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9731                    <fidl_fuchsia_net__common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.header_destination_addr),
9732                ),
9733                encoder, offset, _depth
9734            )
9735        }
9736    }
9737    unsafe impl<
9738            D: fidl::encoding::ResourceDialect,
9739            T0: fidl::encoding::Encode<u64, D>,
9740            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6Address, D>,
9741        > fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for (T0, T1)
9742    {
9743        #[inline]
9744        unsafe fn encode(
9745            self,
9746            encoder: &mut fidl::encoding::Encoder<'_, D>,
9747            offset: usize,
9748            depth: fidl::encoding::Depth,
9749        ) -> fidl::Result<()> {
9750            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
9751            // Zero out padding regions. There's no need to apply masks
9752            // because the unmasked parts will be overwritten by fields.
9753            // Write the fields.
9754            self.0.encode(encoder, offset + 0, depth)?;
9755            self.1.encode(encoder, offset + 8, depth)?;
9756            Ok(())
9757        }
9758    }
9759
9760    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9761        for Ipv6PktInfoRecvControlData
9762    {
9763        #[inline(always)]
9764        fn new_empty() -> Self {
9765            Self {
9766                iface: fidl::new_empty!(u64, D),
9767                header_destination_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6Address, D),
9768            }
9769        }
9770
9771        #[inline]
9772        unsafe fn decode(
9773            &mut self,
9774            decoder: &mut fidl::encoding::Decoder<'_, D>,
9775            offset: usize,
9776            _depth: fidl::encoding::Depth,
9777        ) -> fidl::Result<()> {
9778            decoder.debug_check_bounds::<Self>(offset);
9779            // Verify that padding bytes are zero.
9780            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9781            fidl::decode!(
9782                fidl_fuchsia_net__common::Ipv6Address,
9783                D,
9784                &mut self.header_destination_addr,
9785                decoder,
9786                offset + 8,
9787                _depth
9788            )?;
9789            Ok(())
9790        }
9791    }
9792
9793    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoSendControlData {
9794        type Borrowed<'a> = &'a Self;
9795        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9796            value
9797        }
9798    }
9799
9800    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoSendControlData {
9801        type Owned = Self;
9802
9803        #[inline(always)]
9804        fn inline_align(_context: fidl::encoding::Context) -> usize {
9805            8
9806        }
9807
9808        #[inline(always)]
9809        fn inline_size(_context: fidl::encoding::Context) -> usize {
9810            24
9811        }
9812    }
9813
9814    unsafe impl<D: fidl::encoding::ResourceDialect>
9815        fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for &Ipv6PktInfoSendControlData
9816    {
9817        #[inline]
9818        unsafe fn encode(
9819            self,
9820            encoder: &mut fidl::encoding::Encoder<'_, D>,
9821            offset: usize,
9822            _depth: fidl::encoding::Depth,
9823        ) -> fidl::Result<()> {
9824            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
9825            // Delegate to tuple encoding.
9826            fidl::encoding::Encode::<Ipv6PktInfoSendControlData, D>::encode(
9827                (
9828                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9829                    <fidl_fuchsia_net__common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
9830                ),
9831                encoder, offset, _depth
9832            )
9833        }
9834    }
9835    unsafe impl<
9836            D: fidl::encoding::ResourceDialect,
9837            T0: fidl::encoding::Encode<u64, D>,
9838            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6Address, D>,
9839        > fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for (T0, T1)
9840    {
9841        #[inline]
9842        unsafe fn encode(
9843            self,
9844            encoder: &mut fidl::encoding::Encoder<'_, D>,
9845            offset: usize,
9846            depth: fidl::encoding::Depth,
9847        ) -> fidl::Result<()> {
9848            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
9849            // Zero out padding regions. There's no need to apply masks
9850            // because the unmasked parts will be overwritten by fields.
9851            // Write the fields.
9852            self.0.encode(encoder, offset + 0, depth)?;
9853            self.1.encode(encoder, offset + 8, depth)?;
9854            Ok(())
9855        }
9856    }
9857
9858    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9859        for Ipv6PktInfoSendControlData
9860    {
9861        #[inline(always)]
9862        fn new_empty() -> Self {
9863            Self {
9864                iface: fidl::new_empty!(u64, D),
9865                local_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6Address, D),
9866            }
9867        }
9868
9869        #[inline]
9870        unsafe fn decode(
9871            &mut self,
9872            decoder: &mut fidl::encoding::Decoder<'_, D>,
9873            offset: usize,
9874            _depth: fidl::encoding::Depth,
9875        ) -> fidl::Result<()> {
9876            decoder.debug_check_bounds::<Self>(offset);
9877            // Verify that padding bytes are zero.
9878            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9879            fidl::decode!(
9880                fidl_fuchsia_net__common::Ipv6Address,
9881                D,
9882                &mut self.local_addr,
9883                decoder,
9884                offset + 8,
9885                _depth
9886            )?;
9887            Ok(())
9888        }
9889    }
9890
9891    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketDeprecatedRequest {
9892        type Borrowed<'a> = &'a Self;
9893        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9894            value
9895        }
9896    }
9897
9898    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketDeprecatedRequest {
9899        type Owned = Self;
9900
9901        #[inline(always)]
9902        fn inline_align(_context: fidl::encoding::Context) -> usize {
9903            4
9904        }
9905
9906        #[inline(always)]
9907        fn inline_size(_context: fidl::encoding::Context) -> usize {
9908            8
9909        }
9910    }
9911
9912    unsafe impl<D: fidl::encoding::ResourceDialect>
9913        fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D>
9914        for &ProviderDatagramSocketDeprecatedRequest
9915    {
9916        #[inline]
9917        unsafe fn encode(
9918            self,
9919            encoder: &mut fidl::encoding::Encoder<'_, D>,
9920            offset: usize,
9921            _depth: fidl::encoding::Depth,
9922        ) -> fidl::Result<()> {
9923            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
9924            // Delegate to tuple encoding.
9925            fidl::encoding::Encode::<ProviderDatagramSocketDeprecatedRequest, D>::encode(
9926                (
9927                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
9928                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
9929                        &self.proto,
9930                    ),
9931                ),
9932                encoder,
9933                offset,
9934                _depth,
9935            )
9936        }
9937    }
9938    unsafe impl<
9939            D: fidl::encoding::ResourceDialect,
9940            T0: fidl::encoding::Encode<Domain, D>,
9941            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
9942        > fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D> for (T0, T1)
9943    {
9944        #[inline]
9945        unsafe fn encode(
9946            self,
9947            encoder: &mut fidl::encoding::Encoder<'_, D>,
9948            offset: usize,
9949            depth: fidl::encoding::Depth,
9950        ) -> fidl::Result<()> {
9951            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
9952            // Zero out padding regions. There's no need to apply masks
9953            // because the unmasked parts will be overwritten by fields.
9954            unsafe {
9955                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9956                (ptr as *mut u32).write_unaligned(0);
9957            }
9958            // Write the fields.
9959            self.0.encode(encoder, offset + 0, depth)?;
9960            self.1.encode(encoder, offset + 4, depth)?;
9961            Ok(())
9962        }
9963    }
9964
9965    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9966        for ProviderDatagramSocketDeprecatedRequest
9967    {
9968        #[inline(always)]
9969        fn new_empty() -> Self {
9970            Self {
9971                domain: fidl::new_empty!(Domain, D),
9972                proto: fidl::new_empty!(DatagramSocketProtocol, D),
9973            }
9974        }
9975
9976        #[inline]
9977        unsafe fn decode(
9978            &mut self,
9979            decoder: &mut fidl::encoding::Decoder<'_, D>,
9980            offset: usize,
9981            _depth: fidl::encoding::Depth,
9982        ) -> fidl::Result<()> {
9983            decoder.debug_check_bounds::<Self>(offset);
9984            // Verify that padding bytes are zero.
9985            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9986            let padval = unsafe { (ptr as *const u32).read_unaligned() };
9987            let mask = 0xffff0000u32;
9988            let maskedval = padval & mask;
9989            if maskedval != 0 {
9990                return Err(fidl::Error::NonZeroPadding {
9991                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9992                });
9993            }
9994            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
9995            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
9996            Ok(())
9997        }
9998    }
9999
10000    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketRequest {
10001        type Borrowed<'a> = &'a Self;
10002        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10003            value
10004        }
10005    }
10006
10007    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketRequest {
10008        type Owned = Self;
10009
10010        #[inline(always)]
10011        fn inline_align(_context: fidl::encoding::Context) -> usize {
10012            4
10013        }
10014
10015        #[inline(always)]
10016        fn inline_size(_context: fidl::encoding::Context) -> usize {
10017            8
10018        }
10019    }
10020
10021    unsafe impl<D: fidl::encoding::ResourceDialect>
10022        fidl::encoding::Encode<ProviderDatagramSocketRequest, D>
10023        for &ProviderDatagramSocketRequest
10024    {
10025        #[inline]
10026        unsafe fn encode(
10027            self,
10028            encoder: &mut fidl::encoding::Encoder<'_, D>,
10029            offset: usize,
10030            _depth: fidl::encoding::Depth,
10031        ) -> fidl::Result<()> {
10032            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10033            // Delegate to tuple encoding.
10034            fidl::encoding::Encode::<ProviderDatagramSocketRequest, D>::encode(
10035                (
10036                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10037                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10038                        &self.proto,
10039                    ),
10040                ),
10041                encoder,
10042                offset,
10043                _depth,
10044            )
10045        }
10046    }
10047    unsafe impl<
10048            D: fidl::encoding::ResourceDialect,
10049            T0: fidl::encoding::Encode<Domain, D>,
10050            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10051        > fidl::encoding::Encode<ProviderDatagramSocketRequest, D> for (T0, T1)
10052    {
10053        #[inline]
10054        unsafe fn encode(
10055            self,
10056            encoder: &mut fidl::encoding::Encoder<'_, D>,
10057            offset: usize,
10058            depth: fidl::encoding::Depth,
10059        ) -> fidl::Result<()> {
10060            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10061            // Zero out padding regions. There's no need to apply masks
10062            // because the unmasked parts will be overwritten by fields.
10063            unsafe {
10064                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10065                (ptr as *mut u32).write_unaligned(0);
10066            }
10067            // Write the fields.
10068            self.0.encode(encoder, offset + 0, depth)?;
10069            self.1.encode(encoder, offset + 4, depth)?;
10070            Ok(())
10071        }
10072    }
10073
10074    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10075        for ProviderDatagramSocketRequest
10076    {
10077        #[inline(always)]
10078        fn new_empty() -> Self {
10079            Self {
10080                domain: fidl::new_empty!(Domain, D),
10081                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10082            }
10083        }
10084
10085        #[inline]
10086        unsafe fn decode(
10087            &mut self,
10088            decoder: &mut fidl::encoding::Decoder<'_, D>,
10089            offset: usize,
10090            _depth: fidl::encoding::Depth,
10091        ) -> fidl::Result<()> {
10092            decoder.debug_check_bounds::<Self>(offset);
10093            // Verify that padding bytes are zero.
10094            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10095            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10096            let mask = 0xffff0000u32;
10097            let maskedval = padval & mask;
10098            if maskedval != 0 {
10099                return Err(fidl::Error::NonZeroPadding {
10100                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10101                });
10102            }
10103            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10104            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10105            Ok(())
10106        }
10107    }
10108
10109    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketWithOptionsRequest {
10110        type Borrowed<'a> = &'a Self;
10111        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10112            value
10113        }
10114    }
10115
10116    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketWithOptionsRequest {
10117        type Owned = Self;
10118
10119        #[inline(always)]
10120        fn inline_align(_context: fidl::encoding::Context) -> usize {
10121            8
10122        }
10123
10124        #[inline(always)]
10125        fn inline_size(_context: fidl::encoding::Context) -> usize {
10126            24
10127        }
10128    }
10129
10130    unsafe impl<D: fidl::encoding::ResourceDialect>
10131        fidl::encoding::Encode<ProviderDatagramSocketWithOptionsRequest, D>
10132        for &ProviderDatagramSocketWithOptionsRequest
10133    {
10134        #[inline]
10135        unsafe fn encode(
10136            self,
10137            encoder: &mut fidl::encoding::Encoder<'_, D>,
10138            offset: usize,
10139            _depth: fidl::encoding::Depth,
10140        ) -> fidl::Result<()> {
10141            encoder.debug_check_bounds::<ProviderDatagramSocketWithOptionsRequest>(offset);
10142            // Delegate to tuple encoding.
10143            fidl::encoding::Encode::<ProviderDatagramSocketWithOptionsRequest, D>::encode(
10144                (
10145                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10146                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10147                        &self.proto,
10148                    ),
10149                    <SocketCreationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.opts),
10150                ),
10151                encoder,
10152                offset,
10153                _depth,
10154            )
10155        }
10156    }
10157    unsafe impl<
10158            D: fidl::encoding::ResourceDialect,
10159            T0: fidl::encoding::Encode<Domain, D>,
10160            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10161            T2: fidl::encoding::Encode<SocketCreationOptions, D>,
10162        > fidl::encoding::Encode<ProviderDatagramSocketWithOptionsRequest, D> for (T0, T1, T2)
10163    {
10164        #[inline]
10165        unsafe fn encode(
10166            self,
10167            encoder: &mut fidl::encoding::Encoder<'_, D>,
10168            offset: usize,
10169            depth: fidl::encoding::Depth,
10170        ) -> fidl::Result<()> {
10171            encoder.debug_check_bounds::<ProviderDatagramSocketWithOptionsRequest>(offset);
10172            // Zero out padding regions. There's no need to apply masks
10173            // because the unmasked parts will be overwritten by fields.
10174            unsafe {
10175                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10176                (ptr as *mut u64).write_unaligned(0);
10177            }
10178            // Write the fields.
10179            self.0.encode(encoder, offset + 0, depth)?;
10180            self.1.encode(encoder, offset + 4, depth)?;
10181            self.2.encode(encoder, offset + 8, depth)?;
10182            Ok(())
10183        }
10184    }
10185
10186    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10187        for ProviderDatagramSocketWithOptionsRequest
10188    {
10189        #[inline(always)]
10190        fn new_empty() -> Self {
10191            Self {
10192                domain: fidl::new_empty!(Domain, D),
10193                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10194                opts: fidl::new_empty!(SocketCreationOptions, D),
10195            }
10196        }
10197
10198        #[inline]
10199        unsafe fn decode(
10200            &mut self,
10201            decoder: &mut fidl::encoding::Decoder<'_, D>,
10202            offset: usize,
10203            _depth: fidl::encoding::Depth,
10204        ) -> fidl::Result<()> {
10205            decoder.debug_check_bounds::<Self>(offset);
10206            // Verify that padding bytes are zero.
10207            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10208            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10209            let mask = 0xffff0000u64;
10210            let maskedval = padval & mask;
10211            if maskedval != 0 {
10212                return Err(fidl::Error::NonZeroPadding {
10213                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10214                });
10215            }
10216            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10217            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10218            fidl::decode!(SocketCreationOptions, D, &mut self.opts, decoder, offset + 8, _depth)?;
10219            Ok(())
10220        }
10221    }
10222
10223    impl fidl::encoding::ValueTypeMarker for ProviderGetInterfaceAddressesResponse {
10224        type Borrowed<'a> = &'a Self;
10225        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10226            value
10227        }
10228    }
10229
10230    unsafe impl fidl::encoding::TypeMarker for ProviderGetInterfaceAddressesResponse {
10231        type Owned = Self;
10232
10233        #[inline(always)]
10234        fn inline_align(_context: fidl::encoding::Context) -> usize {
10235            8
10236        }
10237
10238        #[inline(always)]
10239        fn inline_size(_context: fidl::encoding::Context) -> usize {
10240            16
10241        }
10242    }
10243
10244    unsafe impl<D: fidl::encoding::ResourceDialect>
10245        fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D>
10246        for &ProviderGetInterfaceAddressesResponse
10247    {
10248        #[inline]
10249        unsafe fn encode(
10250            self,
10251            encoder: &mut fidl::encoding::Encoder<'_, D>,
10252            offset: usize,
10253            _depth: fidl::encoding::Depth,
10254        ) -> fidl::Result<()> {
10255            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10256            // Delegate to tuple encoding.
10257            fidl::encoding::Encode::<ProviderGetInterfaceAddressesResponse, D>::encode(
10258                (
10259                    <fidl::encoding::UnboundedVector<InterfaceAddresses> as fidl::encoding::ValueTypeMarker>::borrow(&self.interfaces),
10260                ),
10261                encoder, offset, _depth
10262            )
10263        }
10264    }
10265    unsafe impl<
10266            D: fidl::encoding::ResourceDialect,
10267            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<InterfaceAddresses>, D>,
10268        > fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D> for (T0,)
10269    {
10270        #[inline]
10271        unsafe fn encode(
10272            self,
10273            encoder: &mut fidl::encoding::Encoder<'_, D>,
10274            offset: usize,
10275            depth: fidl::encoding::Depth,
10276        ) -> fidl::Result<()> {
10277            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10278            // Zero out padding regions. There's no need to apply masks
10279            // because the unmasked parts will be overwritten by fields.
10280            // Write the fields.
10281            self.0.encode(encoder, offset + 0, depth)?;
10282            Ok(())
10283        }
10284    }
10285
10286    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10287        for ProviderGetInterfaceAddressesResponse
10288    {
10289        #[inline(always)]
10290        fn new_empty() -> Self {
10291            Self {
10292                interfaces: fidl::new_empty!(
10293                    fidl::encoding::UnboundedVector<InterfaceAddresses>,
10294                    D
10295                ),
10296            }
10297        }
10298
10299        #[inline]
10300        unsafe fn decode(
10301            &mut self,
10302            decoder: &mut fidl::encoding::Decoder<'_, D>,
10303            offset: usize,
10304            _depth: fidl::encoding::Depth,
10305        ) -> fidl::Result<()> {
10306            decoder.debug_check_bounds::<Self>(offset);
10307            // Verify that padding bytes are zero.
10308            fidl::decode!(
10309                fidl::encoding::UnboundedVector<InterfaceAddresses>,
10310                D,
10311                &mut self.interfaces,
10312                decoder,
10313                offset + 0,
10314                _depth
10315            )?;
10316            Ok(())
10317        }
10318    }
10319
10320    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameRequest {
10321        type Borrowed<'a> = &'a Self;
10322        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10323            value
10324        }
10325    }
10326
10327    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameRequest {
10328        type Owned = Self;
10329
10330        #[inline(always)]
10331        fn inline_align(_context: fidl::encoding::Context) -> usize {
10332            8
10333        }
10334
10335        #[inline(always)]
10336        fn inline_size(_context: fidl::encoding::Context) -> usize {
10337            8
10338        }
10339        #[inline(always)]
10340        fn encode_is_copy() -> bool {
10341            true
10342        }
10343
10344        #[inline(always)]
10345        fn decode_is_copy() -> bool {
10346            true
10347        }
10348    }
10349
10350    unsafe impl<D: fidl::encoding::ResourceDialect>
10351        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D>
10352        for &ProviderInterfaceIndexToNameRequest
10353    {
10354        #[inline]
10355        unsafe fn encode(
10356            self,
10357            encoder: &mut fidl::encoding::Encoder<'_, D>,
10358            offset: usize,
10359            _depth: fidl::encoding::Depth,
10360        ) -> fidl::Result<()> {
10361            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10362            unsafe {
10363                // Copy the object into the buffer.
10364                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10365                (buf_ptr as *mut ProviderInterfaceIndexToNameRequest)
10366                    .write_unaligned((self as *const ProviderInterfaceIndexToNameRequest).read());
10367                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10368                // done second because the memcpy will write garbage to these bytes.
10369            }
10370            Ok(())
10371        }
10372    }
10373    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
10374        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D> for (T0,)
10375    {
10376        #[inline]
10377        unsafe fn encode(
10378            self,
10379            encoder: &mut fidl::encoding::Encoder<'_, D>,
10380            offset: usize,
10381            depth: fidl::encoding::Depth,
10382        ) -> fidl::Result<()> {
10383            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10384            // Zero out padding regions. There's no need to apply masks
10385            // because the unmasked parts will be overwritten by fields.
10386            // Write the fields.
10387            self.0.encode(encoder, offset + 0, depth)?;
10388            Ok(())
10389        }
10390    }
10391
10392    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10393        for ProviderInterfaceIndexToNameRequest
10394    {
10395        #[inline(always)]
10396        fn new_empty() -> Self {
10397            Self { index: fidl::new_empty!(u64, D) }
10398        }
10399
10400        #[inline]
10401        unsafe fn decode(
10402            &mut self,
10403            decoder: &mut fidl::encoding::Decoder<'_, D>,
10404            offset: usize,
10405            _depth: fidl::encoding::Depth,
10406        ) -> fidl::Result<()> {
10407            decoder.debug_check_bounds::<Self>(offset);
10408            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10409            // Verify that padding bytes are zero.
10410            // Copy from the buffer into the object.
10411            unsafe {
10412                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10413            }
10414            Ok(())
10415        }
10416    }
10417
10418    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsRequest {
10419        type Borrowed<'a> = &'a Self;
10420        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10421            value
10422        }
10423    }
10424
10425    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsRequest {
10426        type Owned = Self;
10427
10428        #[inline(always)]
10429        fn inline_align(_context: fidl::encoding::Context) -> usize {
10430            8
10431        }
10432
10433        #[inline(always)]
10434        fn inline_size(_context: fidl::encoding::Context) -> usize {
10435            16
10436        }
10437    }
10438
10439    unsafe impl<D: fidl::encoding::ResourceDialect>
10440        fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D>
10441        for &ProviderInterfaceNameToFlagsRequest
10442    {
10443        #[inline]
10444        unsafe fn encode(
10445            self,
10446            encoder: &mut fidl::encoding::Encoder<'_, D>,
10447            offset: usize,
10448            _depth: fidl::encoding::Depth,
10449        ) -> fidl::Result<()> {
10450            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10451            // Delegate to tuple encoding.
10452            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsRequest, D>::encode(
10453                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10454                    &self.name,
10455                ),),
10456                encoder,
10457                offset,
10458                _depth,
10459            )
10460        }
10461    }
10462    unsafe impl<
10463            D: fidl::encoding::ResourceDialect,
10464            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10465        > fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D> for (T0,)
10466    {
10467        #[inline]
10468        unsafe fn encode(
10469            self,
10470            encoder: &mut fidl::encoding::Encoder<'_, D>,
10471            offset: usize,
10472            depth: fidl::encoding::Depth,
10473        ) -> fidl::Result<()> {
10474            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10475            // Zero out padding regions. There's no need to apply masks
10476            // because the unmasked parts will be overwritten by fields.
10477            // Write the fields.
10478            self.0.encode(encoder, offset + 0, depth)?;
10479            Ok(())
10480        }
10481    }
10482
10483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10484        for ProviderInterfaceNameToFlagsRequest
10485    {
10486        #[inline(always)]
10487        fn new_empty() -> Self {
10488            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10489        }
10490
10491        #[inline]
10492        unsafe fn decode(
10493            &mut self,
10494            decoder: &mut fidl::encoding::Decoder<'_, D>,
10495            offset: usize,
10496            _depth: fidl::encoding::Depth,
10497        ) -> fidl::Result<()> {
10498            decoder.debug_check_bounds::<Self>(offset);
10499            // Verify that padding bytes are zero.
10500            fidl::decode!(
10501                fidl::encoding::BoundedString<15>,
10502                D,
10503                &mut self.name,
10504                decoder,
10505                offset + 0,
10506                _depth
10507            )?;
10508            Ok(())
10509        }
10510    }
10511
10512    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexRequest {
10513        type Borrowed<'a> = &'a Self;
10514        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10515            value
10516        }
10517    }
10518
10519    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexRequest {
10520        type Owned = Self;
10521
10522        #[inline(always)]
10523        fn inline_align(_context: fidl::encoding::Context) -> usize {
10524            8
10525        }
10526
10527        #[inline(always)]
10528        fn inline_size(_context: fidl::encoding::Context) -> usize {
10529            16
10530        }
10531    }
10532
10533    unsafe impl<D: fidl::encoding::ResourceDialect>
10534        fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D>
10535        for &ProviderInterfaceNameToIndexRequest
10536    {
10537        #[inline]
10538        unsafe fn encode(
10539            self,
10540            encoder: &mut fidl::encoding::Encoder<'_, D>,
10541            offset: usize,
10542            _depth: fidl::encoding::Depth,
10543        ) -> fidl::Result<()> {
10544            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10545            // Delegate to tuple encoding.
10546            fidl::encoding::Encode::<ProviderInterfaceNameToIndexRequest, D>::encode(
10547                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10548                    &self.name,
10549                ),),
10550                encoder,
10551                offset,
10552                _depth,
10553            )
10554        }
10555    }
10556    unsafe impl<
10557            D: fidl::encoding::ResourceDialect,
10558            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10559        > fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D> for (T0,)
10560    {
10561        #[inline]
10562        unsafe fn encode(
10563            self,
10564            encoder: &mut fidl::encoding::Encoder<'_, D>,
10565            offset: usize,
10566            depth: fidl::encoding::Depth,
10567        ) -> fidl::Result<()> {
10568            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10569            // Zero out padding regions. There's no need to apply masks
10570            // because the unmasked parts will be overwritten by fields.
10571            // Write the fields.
10572            self.0.encode(encoder, offset + 0, depth)?;
10573            Ok(())
10574        }
10575    }
10576
10577    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10578        for ProviderInterfaceNameToIndexRequest
10579    {
10580        #[inline(always)]
10581        fn new_empty() -> Self {
10582            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10583        }
10584
10585        #[inline]
10586        unsafe fn decode(
10587            &mut self,
10588            decoder: &mut fidl::encoding::Decoder<'_, D>,
10589            offset: usize,
10590            _depth: fidl::encoding::Depth,
10591        ) -> fidl::Result<()> {
10592            decoder.debug_check_bounds::<Self>(offset);
10593            // Verify that padding bytes are zero.
10594            fidl::decode!(
10595                fidl::encoding::BoundedString<15>,
10596                D,
10597                &mut self.name,
10598                decoder,
10599                offset + 0,
10600                _depth
10601            )?;
10602            Ok(())
10603        }
10604    }
10605
10606    impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketRequest {
10607        type Borrowed<'a> = &'a Self;
10608        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10609            value
10610        }
10611    }
10612
10613    unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketRequest {
10614        type Owned = Self;
10615
10616        #[inline(always)]
10617        fn inline_align(_context: fidl::encoding::Context) -> usize {
10618            4
10619        }
10620
10621        #[inline(always)]
10622        fn inline_size(_context: fidl::encoding::Context) -> usize {
10623            8
10624        }
10625    }
10626
10627    unsafe impl<D: fidl::encoding::ResourceDialect>
10628        fidl::encoding::Encode<ProviderStreamSocketRequest, D> for &ProviderStreamSocketRequest
10629    {
10630        #[inline]
10631        unsafe fn encode(
10632            self,
10633            encoder: &mut fidl::encoding::Encoder<'_, D>,
10634            offset: usize,
10635            _depth: fidl::encoding::Depth,
10636        ) -> fidl::Result<()> {
10637            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
10638            // Delegate to tuple encoding.
10639            fidl::encoding::Encode::<ProviderStreamSocketRequest, D>::encode(
10640                (
10641                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10642                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
10643                ),
10644                encoder,
10645                offset,
10646                _depth,
10647            )
10648        }
10649    }
10650    unsafe impl<
10651            D: fidl::encoding::ResourceDialect,
10652            T0: fidl::encoding::Encode<Domain, D>,
10653            T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
10654        > fidl::encoding::Encode<ProviderStreamSocketRequest, D> for (T0, T1)
10655    {
10656        #[inline]
10657        unsafe fn encode(
10658            self,
10659            encoder: &mut fidl::encoding::Encoder<'_, D>,
10660            offset: usize,
10661            depth: fidl::encoding::Depth,
10662        ) -> fidl::Result<()> {
10663            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
10664            // Zero out padding regions. There's no need to apply masks
10665            // because the unmasked parts will be overwritten by fields.
10666            unsafe {
10667                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10668                (ptr as *mut u32).write_unaligned(0);
10669            }
10670            // Write the fields.
10671            self.0.encode(encoder, offset + 0, depth)?;
10672            self.1.encode(encoder, offset + 4, depth)?;
10673            Ok(())
10674        }
10675    }
10676
10677    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10678        for ProviderStreamSocketRequest
10679    {
10680        #[inline(always)]
10681        fn new_empty() -> Self {
10682            Self {
10683                domain: fidl::new_empty!(Domain, D),
10684                proto: fidl::new_empty!(StreamSocketProtocol, D),
10685            }
10686        }
10687
10688        #[inline]
10689        unsafe fn decode(
10690            &mut self,
10691            decoder: &mut fidl::encoding::Decoder<'_, D>,
10692            offset: usize,
10693            _depth: fidl::encoding::Depth,
10694        ) -> fidl::Result<()> {
10695            decoder.debug_check_bounds::<Self>(offset);
10696            // Verify that padding bytes are zero.
10697            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10698            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10699            let mask = 0xffff0000u32;
10700            let maskedval = padval & mask;
10701            if maskedval != 0 {
10702                return Err(fidl::Error::NonZeroPadding {
10703                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10704                });
10705            }
10706            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10707            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10708            Ok(())
10709        }
10710    }
10711
10712    impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketWithOptionsRequest {
10713        type Borrowed<'a> = &'a Self;
10714        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10715            value
10716        }
10717    }
10718
10719    unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketWithOptionsRequest {
10720        type Owned = Self;
10721
10722        #[inline(always)]
10723        fn inline_align(_context: fidl::encoding::Context) -> usize {
10724            8
10725        }
10726
10727        #[inline(always)]
10728        fn inline_size(_context: fidl::encoding::Context) -> usize {
10729            24
10730        }
10731    }
10732
10733    unsafe impl<D: fidl::encoding::ResourceDialect>
10734        fidl::encoding::Encode<ProviderStreamSocketWithOptionsRequest, D>
10735        for &ProviderStreamSocketWithOptionsRequest
10736    {
10737        #[inline]
10738        unsafe fn encode(
10739            self,
10740            encoder: &mut fidl::encoding::Encoder<'_, D>,
10741            offset: usize,
10742            _depth: fidl::encoding::Depth,
10743        ) -> fidl::Result<()> {
10744            encoder.debug_check_bounds::<ProviderStreamSocketWithOptionsRequest>(offset);
10745            // Delegate to tuple encoding.
10746            fidl::encoding::Encode::<ProviderStreamSocketWithOptionsRequest, D>::encode(
10747                (
10748                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10749                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
10750                    <SocketCreationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.opts),
10751                ),
10752                encoder,
10753                offset,
10754                _depth,
10755            )
10756        }
10757    }
10758    unsafe impl<
10759            D: fidl::encoding::ResourceDialect,
10760            T0: fidl::encoding::Encode<Domain, D>,
10761            T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
10762            T2: fidl::encoding::Encode<SocketCreationOptions, D>,
10763        > fidl::encoding::Encode<ProviderStreamSocketWithOptionsRequest, D> for (T0, T1, T2)
10764    {
10765        #[inline]
10766        unsafe fn encode(
10767            self,
10768            encoder: &mut fidl::encoding::Encoder<'_, D>,
10769            offset: usize,
10770            depth: fidl::encoding::Depth,
10771        ) -> fidl::Result<()> {
10772            encoder.debug_check_bounds::<ProviderStreamSocketWithOptionsRequest>(offset);
10773            // Zero out padding regions. There's no need to apply masks
10774            // because the unmasked parts will be overwritten by fields.
10775            unsafe {
10776                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10777                (ptr as *mut u64).write_unaligned(0);
10778            }
10779            // Write the fields.
10780            self.0.encode(encoder, offset + 0, depth)?;
10781            self.1.encode(encoder, offset + 4, depth)?;
10782            self.2.encode(encoder, offset + 8, depth)?;
10783            Ok(())
10784        }
10785    }
10786
10787    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10788        for ProviderStreamSocketWithOptionsRequest
10789    {
10790        #[inline(always)]
10791        fn new_empty() -> Self {
10792            Self {
10793                domain: fidl::new_empty!(Domain, D),
10794                proto: fidl::new_empty!(StreamSocketProtocol, D),
10795                opts: fidl::new_empty!(SocketCreationOptions, D),
10796            }
10797        }
10798
10799        #[inline]
10800        unsafe fn decode(
10801            &mut self,
10802            decoder: &mut fidl::encoding::Decoder<'_, D>,
10803            offset: usize,
10804            _depth: fidl::encoding::Depth,
10805        ) -> fidl::Result<()> {
10806            decoder.debug_check_bounds::<Self>(offset);
10807            // Verify that padding bytes are zero.
10808            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10809            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10810            let mask = 0xffff0000u64;
10811            let maskedval = padval & mask;
10812            if maskedval != 0 {
10813                return Err(fidl::Error::NonZeroPadding {
10814                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10815                });
10816            }
10817            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10818            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10819            fidl::decode!(SocketCreationOptions, D, &mut self.opts, decoder, offset + 8, _depth)?;
10820            Ok(())
10821        }
10822    }
10823
10824    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameResponse {
10825        type Borrowed<'a> = &'a Self;
10826        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10827            value
10828        }
10829    }
10830
10831    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameResponse {
10832        type Owned = Self;
10833
10834        #[inline(always)]
10835        fn inline_align(_context: fidl::encoding::Context) -> usize {
10836            8
10837        }
10838
10839        #[inline(always)]
10840        fn inline_size(_context: fidl::encoding::Context) -> usize {
10841            16
10842        }
10843    }
10844
10845    unsafe impl<D: fidl::encoding::ResourceDialect>
10846        fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D>
10847        for &ProviderInterfaceIndexToNameResponse
10848    {
10849        #[inline]
10850        unsafe fn encode(
10851            self,
10852            encoder: &mut fidl::encoding::Encoder<'_, D>,
10853            offset: usize,
10854            _depth: fidl::encoding::Depth,
10855        ) -> fidl::Result<()> {
10856            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
10857            // Delegate to tuple encoding.
10858            fidl::encoding::Encode::<ProviderInterfaceIndexToNameResponse, D>::encode(
10859                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10860                    &self.name,
10861                ),),
10862                encoder,
10863                offset,
10864                _depth,
10865            )
10866        }
10867    }
10868    unsafe impl<
10869            D: fidl::encoding::ResourceDialect,
10870            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10871        > fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D> for (T0,)
10872    {
10873        #[inline]
10874        unsafe fn encode(
10875            self,
10876            encoder: &mut fidl::encoding::Encoder<'_, D>,
10877            offset: usize,
10878            depth: fidl::encoding::Depth,
10879        ) -> fidl::Result<()> {
10880            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
10881            // Zero out padding regions. There's no need to apply masks
10882            // because the unmasked parts will be overwritten by fields.
10883            // Write the fields.
10884            self.0.encode(encoder, offset + 0, depth)?;
10885            Ok(())
10886        }
10887    }
10888
10889    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10890        for ProviderInterfaceIndexToNameResponse
10891    {
10892        #[inline(always)]
10893        fn new_empty() -> Self {
10894            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10895        }
10896
10897        #[inline]
10898        unsafe fn decode(
10899            &mut self,
10900            decoder: &mut fidl::encoding::Decoder<'_, D>,
10901            offset: usize,
10902            _depth: fidl::encoding::Depth,
10903        ) -> fidl::Result<()> {
10904            decoder.debug_check_bounds::<Self>(offset);
10905            // Verify that padding bytes are zero.
10906            fidl::decode!(
10907                fidl::encoding::BoundedString<15>,
10908                D,
10909                &mut self.name,
10910                decoder,
10911                offset + 0,
10912                _depth
10913            )?;
10914            Ok(())
10915        }
10916    }
10917
10918    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsResponse {
10919        type Borrowed<'a> = &'a Self;
10920        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10921            value
10922        }
10923    }
10924
10925    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsResponse {
10926        type Owned = Self;
10927
10928        #[inline(always)]
10929        fn inline_align(_context: fidl::encoding::Context) -> usize {
10930            2
10931        }
10932
10933        #[inline(always)]
10934        fn inline_size(_context: fidl::encoding::Context) -> usize {
10935            2
10936        }
10937    }
10938
10939    unsafe impl<D: fidl::encoding::ResourceDialect>
10940        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D>
10941        for &ProviderInterfaceNameToFlagsResponse
10942    {
10943        #[inline]
10944        unsafe fn encode(
10945            self,
10946            encoder: &mut fidl::encoding::Encoder<'_, D>,
10947            offset: usize,
10948            _depth: fidl::encoding::Depth,
10949        ) -> fidl::Result<()> {
10950            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
10951            // Delegate to tuple encoding.
10952            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsResponse, D>::encode(
10953                (<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
10954                encoder,
10955                offset,
10956                _depth,
10957            )
10958        }
10959    }
10960    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<InterfaceFlags, D>>
10961        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D> for (T0,)
10962    {
10963        #[inline]
10964        unsafe fn encode(
10965            self,
10966            encoder: &mut fidl::encoding::Encoder<'_, D>,
10967            offset: usize,
10968            depth: fidl::encoding::Depth,
10969        ) -> fidl::Result<()> {
10970            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
10971            // Zero out padding regions. There's no need to apply masks
10972            // because the unmasked parts will be overwritten by fields.
10973            // Write the fields.
10974            self.0.encode(encoder, offset + 0, depth)?;
10975            Ok(())
10976        }
10977    }
10978
10979    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10980        for ProviderInterfaceNameToFlagsResponse
10981    {
10982        #[inline(always)]
10983        fn new_empty() -> Self {
10984            Self { flags: fidl::new_empty!(InterfaceFlags, D) }
10985        }
10986
10987        #[inline]
10988        unsafe fn decode(
10989            &mut self,
10990            decoder: &mut fidl::encoding::Decoder<'_, D>,
10991            offset: usize,
10992            _depth: fidl::encoding::Depth,
10993        ) -> fidl::Result<()> {
10994            decoder.debug_check_bounds::<Self>(offset);
10995            // Verify that padding bytes are zero.
10996            fidl::decode!(InterfaceFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
10997            Ok(())
10998        }
10999    }
11000
11001    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexResponse {
11002        type Borrowed<'a> = &'a Self;
11003        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11004            value
11005        }
11006    }
11007
11008    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexResponse {
11009        type Owned = Self;
11010
11011        #[inline(always)]
11012        fn inline_align(_context: fidl::encoding::Context) -> usize {
11013            8
11014        }
11015
11016        #[inline(always)]
11017        fn inline_size(_context: fidl::encoding::Context) -> usize {
11018            8
11019        }
11020        #[inline(always)]
11021        fn encode_is_copy() -> bool {
11022            true
11023        }
11024
11025        #[inline(always)]
11026        fn decode_is_copy() -> bool {
11027            true
11028        }
11029    }
11030
11031    unsafe impl<D: fidl::encoding::ResourceDialect>
11032        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D>
11033        for &ProviderInterfaceNameToIndexResponse
11034    {
11035        #[inline]
11036        unsafe fn encode(
11037            self,
11038            encoder: &mut fidl::encoding::Encoder<'_, D>,
11039            offset: usize,
11040            _depth: fidl::encoding::Depth,
11041        ) -> fidl::Result<()> {
11042            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11043            unsafe {
11044                // Copy the object into the buffer.
11045                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11046                (buf_ptr as *mut ProviderInterfaceNameToIndexResponse)
11047                    .write_unaligned((self as *const ProviderInterfaceNameToIndexResponse).read());
11048                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11049                // done second because the memcpy will write garbage to these bytes.
11050            }
11051            Ok(())
11052        }
11053    }
11054    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11055        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D> for (T0,)
11056    {
11057        #[inline]
11058        unsafe fn encode(
11059            self,
11060            encoder: &mut fidl::encoding::Encoder<'_, D>,
11061            offset: usize,
11062            depth: fidl::encoding::Depth,
11063        ) -> fidl::Result<()> {
11064            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11065            // Zero out padding regions. There's no need to apply masks
11066            // because the unmasked parts will be overwritten by fields.
11067            // Write the fields.
11068            self.0.encode(encoder, offset + 0, depth)?;
11069            Ok(())
11070        }
11071    }
11072
11073    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11074        for ProviderInterfaceNameToIndexResponse
11075    {
11076        #[inline(always)]
11077        fn new_empty() -> Self {
11078            Self { index: fidl::new_empty!(u64, D) }
11079        }
11080
11081        #[inline]
11082        unsafe fn decode(
11083            &mut self,
11084            decoder: &mut fidl::encoding::Decoder<'_, D>,
11085            offset: usize,
11086            _depth: fidl::encoding::Depth,
11087        ) -> fidl::Result<()> {
11088            decoder.debug_check_bounds::<Self>(offset);
11089            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11090            // Verify that padding bytes are zero.
11091            // Copy from the buffer into the object.
11092            unsafe {
11093                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11094            }
11095            Ok(())
11096        }
11097    }
11098
11099    impl fidl::encoding::ValueTypeMarker for StreamSocketAcceptRequest {
11100        type Borrowed<'a> = &'a Self;
11101        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11102            value
11103        }
11104    }
11105
11106    unsafe impl fidl::encoding::TypeMarker for StreamSocketAcceptRequest {
11107        type Owned = Self;
11108
11109        #[inline(always)]
11110        fn inline_align(_context: fidl::encoding::Context) -> usize {
11111            1
11112        }
11113
11114        #[inline(always)]
11115        fn inline_size(_context: fidl::encoding::Context) -> usize {
11116            1
11117        }
11118    }
11119
11120    unsafe impl<D: fidl::encoding::ResourceDialect>
11121        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for &StreamSocketAcceptRequest
11122    {
11123        #[inline]
11124        unsafe fn encode(
11125            self,
11126            encoder: &mut fidl::encoding::Encoder<'_, D>,
11127            offset: usize,
11128            _depth: fidl::encoding::Depth,
11129        ) -> fidl::Result<()> {
11130            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11131            // Delegate to tuple encoding.
11132            fidl::encoding::Encode::<StreamSocketAcceptRequest, D>::encode(
11133                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),),
11134                encoder,
11135                offset,
11136                _depth,
11137            )
11138        }
11139    }
11140    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11141        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for (T0,)
11142    {
11143        #[inline]
11144        unsafe fn encode(
11145            self,
11146            encoder: &mut fidl::encoding::Encoder<'_, D>,
11147            offset: usize,
11148            depth: fidl::encoding::Depth,
11149        ) -> fidl::Result<()> {
11150            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11151            // Zero out padding regions. There's no need to apply masks
11152            // because the unmasked parts will be overwritten by fields.
11153            // Write the fields.
11154            self.0.encode(encoder, offset + 0, depth)?;
11155            Ok(())
11156        }
11157    }
11158
11159    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11160        for StreamSocketAcceptRequest
11161    {
11162        #[inline(always)]
11163        fn new_empty() -> Self {
11164            Self { want_addr: fidl::new_empty!(bool, D) }
11165        }
11166
11167        #[inline]
11168        unsafe fn decode(
11169            &mut self,
11170            decoder: &mut fidl::encoding::Decoder<'_, D>,
11171            offset: usize,
11172            _depth: fidl::encoding::Depth,
11173        ) -> fidl::Result<()> {
11174            decoder.debug_check_bounds::<Self>(offset);
11175            // Verify that padding bytes are zero.
11176            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
11177            Ok(())
11178        }
11179    }
11180
11181    impl fidl::encoding::ValueTypeMarker for StreamSocketListenRequest {
11182        type Borrowed<'a> = &'a Self;
11183        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11184            value
11185        }
11186    }
11187
11188    unsafe impl fidl::encoding::TypeMarker for StreamSocketListenRequest {
11189        type Owned = Self;
11190
11191        #[inline(always)]
11192        fn inline_align(_context: fidl::encoding::Context) -> usize {
11193            2
11194        }
11195
11196        #[inline(always)]
11197        fn inline_size(_context: fidl::encoding::Context) -> usize {
11198            2
11199        }
11200        #[inline(always)]
11201        fn encode_is_copy() -> bool {
11202            true
11203        }
11204
11205        #[inline(always)]
11206        fn decode_is_copy() -> bool {
11207            true
11208        }
11209    }
11210
11211    unsafe impl<D: fidl::encoding::ResourceDialect>
11212        fidl::encoding::Encode<StreamSocketListenRequest, D> for &StreamSocketListenRequest
11213    {
11214        #[inline]
11215        unsafe fn encode(
11216            self,
11217            encoder: &mut fidl::encoding::Encoder<'_, D>,
11218            offset: usize,
11219            _depth: fidl::encoding::Depth,
11220        ) -> fidl::Result<()> {
11221            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11222            unsafe {
11223                // Copy the object into the buffer.
11224                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11225                (buf_ptr as *mut StreamSocketListenRequest)
11226                    .write_unaligned((self as *const StreamSocketListenRequest).read());
11227                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11228                // done second because the memcpy will write garbage to these bytes.
11229            }
11230            Ok(())
11231        }
11232    }
11233    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i16, D>>
11234        fidl::encoding::Encode<StreamSocketListenRequest, D> for (T0,)
11235    {
11236        #[inline]
11237        unsafe fn encode(
11238            self,
11239            encoder: &mut fidl::encoding::Encoder<'_, D>,
11240            offset: usize,
11241            depth: fidl::encoding::Depth,
11242        ) -> fidl::Result<()> {
11243            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11244            // Zero out padding regions. There's no need to apply masks
11245            // because the unmasked parts will be overwritten by fields.
11246            // Write the fields.
11247            self.0.encode(encoder, offset + 0, depth)?;
11248            Ok(())
11249        }
11250    }
11251
11252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11253        for StreamSocketListenRequest
11254    {
11255        #[inline(always)]
11256        fn new_empty() -> Self {
11257            Self { backlog: fidl::new_empty!(i16, D) }
11258        }
11259
11260        #[inline]
11261        unsafe fn decode(
11262            &mut self,
11263            decoder: &mut fidl::encoding::Decoder<'_, D>,
11264            offset: usize,
11265            _depth: fidl::encoding::Depth,
11266        ) -> fidl::Result<()> {
11267            decoder.debug_check_bounds::<Self>(offset);
11268            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11269            // Verify that padding bytes are zero.
11270            // Copy from the buffer into the object.
11271            unsafe {
11272                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
11273            }
11274            Ok(())
11275        }
11276    }
11277
11278    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCongestionRequest {
11279        type Borrowed<'a> = &'a Self;
11280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11281            value
11282        }
11283    }
11284
11285    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCongestionRequest {
11286        type Owned = Self;
11287
11288        #[inline(always)]
11289        fn inline_align(_context: fidl::encoding::Context) -> usize {
11290            4
11291        }
11292
11293        #[inline(always)]
11294        fn inline_size(_context: fidl::encoding::Context) -> usize {
11295            4
11296        }
11297    }
11298
11299    unsafe impl<D: fidl::encoding::ResourceDialect>
11300        fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D>
11301        for &StreamSocketSetTcpCongestionRequest
11302    {
11303        #[inline]
11304        unsafe fn encode(
11305            self,
11306            encoder: &mut fidl::encoding::Encoder<'_, D>,
11307            offset: usize,
11308            _depth: fidl::encoding::Depth,
11309        ) -> fidl::Result<()> {
11310            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11311            // Delegate to tuple encoding.
11312            fidl::encoding::Encode::<StreamSocketSetTcpCongestionRequest, D>::encode(
11313                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11314                encoder,
11315                offset,
11316                _depth,
11317            )
11318        }
11319    }
11320    unsafe impl<
11321            D: fidl::encoding::ResourceDialect,
11322            T0: fidl::encoding::Encode<TcpCongestionControl, D>,
11323        > fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D> for (T0,)
11324    {
11325        #[inline]
11326        unsafe fn encode(
11327            self,
11328            encoder: &mut fidl::encoding::Encoder<'_, D>,
11329            offset: usize,
11330            depth: fidl::encoding::Depth,
11331        ) -> fidl::Result<()> {
11332            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11333            // Zero out padding regions. There's no need to apply masks
11334            // because the unmasked parts will be overwritten by fields.
11335            // Write the fields.
11336            self.0.encode(encoder, offset + 0, depth)?;
11337            Ok(())
11338        }
11339    }
11340
11341    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11342        for StreamSocketSetTcpCongestionRequest
11343    {
11344        #[inline(always)]
11345        fn new_empty() -> Self {
11346            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
11347        }
11348
11349        #[inline]
11350        unsafe fn decode(
11351            &mut self,
11352            decoder: &mut fidl::encoding::Decoder<'_, D>,
11353            offset: usize,
11354            _depth: fidl::encoding::Depth,
11355        ) -> fidl::Result<()> {
11356            decoder.debug_check_bounds::<Self>(offset);
11357            // Verify that padding bytes are zero.
11358            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
11359            Ok(())
11360        }
11361    }
11362
11363    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCorkRequest {
11364        type Borrowed<'a> = &'a Self;
11365        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11366            value
11367        }
11368    }
11369
11370    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCorkRequest {
11371        type Owned = Self;
11372
11373        #[inline(always)]
11374        fn inline_align(_context: fidl::encoding::Context) -> usize {
11375            1
11376        }
11377
11378        #[inline(always)]
11379        fn inline_size(_context: fidl::encoding::Context) -> usize {
11380            1
11381        }
11382    }
11383
11384    unsafe impl<D: fidl::encoding::ResourceDialect>
11385        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D>
11386        for &StreamSocketSetTcpCorkRequest
11387    {
11388        #[inline]
11389        unsafe fn encode(
11390            self,
11391            encoder: &mut fidl::encoding::Encoder<'_, D>,
11392            offset: usize,
11393            _depth: fidl::encoding::Depth,
11394        ) -> fidl::Result<()> {
11395            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11396            // Delegate to tuple encoding.
11397            fidl::encoding::Encode::<StreamSocketSetTcpCorkRequest, D>::encode(
11398                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11399                encoder,
11400                offset,
11401                _depth,
11402            )
11403        }
11404    }
11405    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11406        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D> for (T0,)
11407    {
11408        #[inline]
11409        unsafe fn encode(
11410            self,
11411            encoder: &mut fidl::encoding::Encoder<'_, D>,
11412            offset: usize,
11413            depth: fidl::encoding::Depth,
11414        ) -> fidl::Result<()> {
11415            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11416            // Zero out padding regions. There's no need to apply masks
11417            // because the unmasked parts will be overwritten by fields.
11418            // Write the fields.
11419            self.0.encode(encoder, offset + 0, depth)?;
11420            Ok(())
11421        }
11422    }
11423
11424    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11425        for StreamSocketSetTcpCorkRequest
11426    {
11427        #[inline(always)]
11428        fn new_empty() -> Self {
11429            Self { value: fidl::new_empty!(bool, D) }
11430        }
11431
11432        #[inline]
11433        unsafe fn decode(
11434            &mut self,
11435            decoder: &mut fidl::encoding::Decoder<'_, D>,
11436            offset: usize,
11437            _depth: fidl::encoding::Depth,
11438        ) -> fidl::Result<()> {
11439            decoder.debug_check_bounds::<Self>(offset);
11440            // Verify that padding bytes are zero.
11441            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
11442            Ok(())
11443        }
11444    }
11445
11446    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11447        type Borrowed<'a> = &'a Self;
11448        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11449            value
11450        }
11451    }
11452
11453    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11454        type Owned = Self;
11455
11456        #[inline(always)]
11457        fn inline_align(_context: fidl::encoding::Context) -> usize {
11458            4
11459        }
11460
11461        #[inline(always)]
11462        fn inline_size(_context: fidl::encoding::Context) -> usize {
11463            4
11464        }
11465        #[inline(always)]
11466        fn encode_is_copy() -> bool {
11467            true
11468        }
11469
11470        #[inline(always)]
11471        fn decode_is_copy() -> bool {
11472            true
11473        }
11474    }
11475
11476    unsafe impl<D: fidl::encoding::ResourceDialect>
11477        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D>
11478        for &StreamSocketSetTcpDeferAcceptRequest
11479    {
11480        #[inline]
11481        unsafe fn encode(
11482            self,
11483            encoder: &mut fidl::encoding::Encoder<'_, D>,
11484            offset: usize,
11485            _depth: fidl::encoding::Depth,
11486        ) -> fidl::Result<()> {
11487            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11488            unsafe {
11489                // Copy the object into the buffer.
11490                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11491                (buf_ptr as *mut StreamSocketSetTcpDeferAcceptRequest)
11492                    .write_unaligned((self as *const StreamSocketSetTcpDeferAcceptRequest).read());
11493                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11494                // done second because the memcpy will write garbage to these bytes.
11495            }
11496            Ok(())
11497        }
11498    }
11499    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11500        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D> for (T0,)
11501    {
11502        #[inline]
11503        unsafe fn encode(
11504            self,
11505            encoder: &mut fidl::encoding::Encoder<'_, D>,
11506            offset: usize,
11507            depth: fidl::encoding::Depth,
11508        ) -> fidl::Result<()> {
11509            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11510            // Zero out padding regions. There's no need to apply masks
11511            // because the unmasked parts will be overwritten by fields.
11512            // Write the fields.
11513            self.0.encode(encoder, offset + 0, depth)?;
11514            Ok(())
11515        }
11516    }
11517
11518    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11519        for StreamSocketSetTcpDeferAcceptRequest
11520    {
11521        #[inline(always)]
11522        fn new_empty() -> Self {
11523            Self { value_secs: fidl::new_empty!(u32, D) }
11524        }
11525
11526        #[inline]
11527        unsafe fn decode(
11528            &mut self,
11529            decoder: &mut fidl::encoding::Decoder<'_, D>,
11530            offset: usize,
11531            _depth: fidl::encoding::Depth,
11532        ) -> fidl::Result<()> {
11533            decoder.debug_check_bounds::<Self>(offset);
11534            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11535            // Verify that padding bytes are zero.
11536            // Copy from the buffer into the object.
11537            unsafe {
11538                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11539            }
11540            Ok(())
11541        }
11542    }
11543
11544    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11545        type Borrowed<'a> = &'a Self;
11546        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11547            value
11548        }
11549    }
11550
11551    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11552        type Owned = Self;
11553
11554        #[inline(always)]
11555        fn inline_align(_context: fidl::encoding::Context) -> usize {
11556            4
11557        }
11558
11559        #[inline(always)]
11560        fn inline_size(_context: fidl::encoding::Context) -> usize {
11561            4
11562        }
11563        #[inline(always)]
11564        fn encode_is_copy() -> bool {
11565            true
11566        }
11567
11568        #[inline(always)]
11569        fn decode_is_copy() -> bool {
11570            true
11571        }
11572    }
11573
11574    unsafe impl<D: fidl::encoding::ResourceDialect>
11575        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D>
11576        for &StreamSocketSetTcpKeepAliveCountRequest
11577    {
11578        #[inline]
11579        unsafe fn encode(
11580            self,
11581            encoder: &mut fidl::encoding::Encoder<'_, D>,
11582            offset: usize,
11583            _depth: fidl::encoding::Depth,
11584        ) -> fidl::Result<()> {
11585            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11586            unsafe {
11587                // Copy the object into the buffer.
11588                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11589                (buf_ptr as *mut StreamSocketSetTcpKeepAliveCountRequest).write_unaligned(
11590                    (self as *const StreamSocketSetTcpKeepAliveCountRequest).read(),
11591                );
11592                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11593                // done second because the memcpy will write garbage to these bytes.
11594            }
11595            Ok(())
11596        }
11597    }
11598    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11599        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D> for (T0,)
11600    {
11601        #[inline]
11602        unsafe fn encode(
11603            self,
11604            encoder: &mut fidl::encoding::Encoder<'_, D>,
11605            offset: usize,
11606            depth: fidl::encoding::Depth,
11607        ) -> fidl::Result<()> {
11608            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11609            // Zero out padding regions. There's no need to apply masks
11610            // because the unmasked parts will be overwritten by fields.
11611            // Write the fields.
11612            self.0.encode(encoder, offset + 0, depth)?;
11613            Ok(())
11614        }
11615    }
11616
11617    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11618        for StreamSocketSetTcpKeepAliveCountRequest
11619    {
11620        #[inline(always)]
11621        fn new_empty() -> Self {
11622            Self { value: fidl::new_empty!(u32, D) }
11623        }
11624
11625        #[inline]
11626        unsafe fn decode(
11627            &mut self,
11628            decoder: &mut fidl::encoding::Decoder<'_, D>,
11629            offset: usize,
11630            _depth: fidl::encoding::Depth,
11631        ) -> fidl::Result<()> {
11632            decoder.debug_check_bounds::<Self>(offset);
11633            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11634            // Verify that padding bytes are zero.
11635            // Copy from the buffer into the object.
11636            unsafe {
11637                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11638            }
11639            Ok(())
11640        }
11641    }
11642
11643    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11644        type Borrowed<'a> = &'a Self;
11645        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11646            value
11647        }
11648    }
11649
11650    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11651        type Owned = Self;
11652
11653        #[inline(always)]
11654        fn inline_align(_context: fidl::encoding::Context) -> usize {
11655            4
11656        }
11657
11658        #[inline(always)]
11659        fn inline_size(_context: fidl::encoding::Context) -> usize {
11660            4
11661        }
11662        #[inline(always)]
11663        fn encode_is_copy() -> bool {
11664            true
11665        }
11666
11667        #[inline(always)]
11668        fn decode_is_copy() -> bool {
11669            true
11670        }
11671    }
11672
11673    unsafe impl<D: fidl::encoding::ResourceDialect>
11674        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D>
11675        for &StreamSocketSetTcpKeepAliveIdleRequest
11676    {
11677        #[inline]
11678        unsafe fn encode(
11679            self,
11680            encoder: &mut fidl::encoding::Encoder<'_, D>,
11681            offset: usize,
11682            _depth: fidl::encoding::Depth,
11683        ) -> fidl::Result<()> {
11684            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11685            unsafe {
11686                // Copy the object into the buffer.
11687                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11688                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIdleRequest).write_unaligned(
11689                    (self as *const StreamSocketSetTcpKeepAliveIdleRequest).read(),
11690                );
11691                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11692                // done second because the memcpy will write garbage to these bytes.
11693            }
11694            Ok(())
11695        }
11696    }
11697    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11698        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D> for (T0,)
11699    {
11700        #[inline]
11701        unsafe fn encode(
11702            self,
11703            encoder: &mut fidl::encoding::Encoder<'_, D>,
11704            offset: usize,
11705            depth: fidl::encoding::Depth,
11706        ) -> fidl::Result<()> {
11707            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11708            // Zero out padding regions. There's no need to apply masks
11709            // because the unmasked parts will be overwritten by fields.
11710            // Write the fields.
11711            self.0.encode(encoder, offset + 0, depth)?;
11712            Ok(())
11713        }
11714    }
11715
11716    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11717        for StreamSocketSetTcpKeepAliveIdleRequest
11718    {
11719        #[inline(always)]
11720        fn new_empty() -> Self {
11721            Self { value_secs: fidl::new_empty!(u32, D) }
11722        }
11723
11724        #[inline]
11725        unsafe fn decode(
11726            &mut self,
11727            decoder: &mut fidl::encoding::Decoder<'_, D>,
11728            offset: usize,
11729            _depth: fidl::encoding::Depth,
11730        ) -> fidl::Result<()> {
11731            decoder.debug_check_bounds::<Self>(offset);
11732            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11733            // Verify that padding bytes are zero.
11734            // Copy from the buffer into the object.
11735            unsafe {
11736                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11737            }
11738            Ok(())
11739        }
11740    }
11741
11742    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
11743        type Borrowed<'a> = &'a Self;
11744        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11745            value
11746        }
11747    }
11748
11749    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
11750        type Owned = Self;
11751
11752        #[inline(always)]
11753        fn inline_align(_context: fidl::encoding::Context) -> usize {
11754            4
11755        }
11756
11757        #[inline(always)]
11758        fn inline_size(_context: fidl::encoding::Context) -> usize {
11759            4
11760        }
11761        #[inline(always)]
11762        fn encode_is_copy() -> bool {
11763            true
11764        }
11765
11766        #[inline(always)]
11767        fn decode_is_copy() -> bool {
11768            true
11769        }
11770    }
11771
11772    unsafe impl<D: fidl::encoding::ResourceDialect>
11773        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D>
11774        for &StreamSocketSetTcpKeepAliveIntervalRequest
11775    {
11776        #[inline]
11777        unsafe fn encode(
11778            self,
11779            encoder: &mut fidl::encoding::Encoder<'_, D>,
11780            offset: usize,
11781            _depth: fidl::encoding::Depth,
11782        ) -> fidl::Result<()> {
11783            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
11784            unsafe {
11785                // Copy the object into the buffer.
11786                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11787                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIntervalRequest).write_unaligned(
11788                    (self as *const StreamSocketSetTcpKeepAliveIntervalRequest).read(),
11789                );
11790                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11791                // done second because the memcpy will write garbage to these bytes.
11792            }
11793            Ok(())
11794        }
11795    }
11796    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11797        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D> for (T0,)
11798    {
11799        #[inline]
11800        unsafe fn encode(
11801            self,
11802            encoder: &mut fidl::encoding::Encoder<'_, D>,
11803            offset: usize,
11804            depth: fidl::encoding::Depth,
11805        ) -> fidl::Result<()> {
11806            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
11807            // Zero out padding regions. There's no need to apply masks
11808            // because the unmasked parts will be overwritten by fields.
11809            // Write the fields.
11810            self.0.encode(encoder, offset + 0, depth)?;
11811            Ok(())
11812        }
11813    }
11814
11815    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11816        for StreamSocketSetTcpKeepAliveIntervalRequest
11817    {
11818        #[inline(always)]
11819        fn new_empty() -> Self {
11820            Self { value_secs: fidl::new_empty!(u32, D) }
11821        }
11822
11823        #[inline]
11824        unsafe fn decode(
11825            &mut self,
11826            decoder: &mut fidl::encoding::Decoder<'_, D>,
11827            offset: usize,
11828            _depth: fidl::encoding::Depth,
11829        ) -> fidl::Result<()> {
11830            decoder.debug_check_bounds::<Self>(offset);
11831            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11832            // Verify that padding bytes are zero.
11833            // Copy from the buffer into the object.
11834            unsafe {
11835                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11836            }
11837            Ok(())
11838        }
11839    }
11840
11841    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpLingerRequest {
11842        type Borrowed<'a> = &'a Self;
11843        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11844            value
11845        }
11846    }
11847
11848    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpLingerRequest {
11849        type Owned = Self;
11850
11851        #[inline(always)]
11852        fn inline_align(_context: fidl::encoding::Context) -> usize {
11853            8
11854        }
11855
11856        #[inline(always)]
11857        fn inline_size(_context: fidl::encoding::Context) -> usize {
11858            16
11859        }
11860    }
11861
11862    unsafe impl<D: fidl::encoding::ResourceDialect>
11863        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D>
11864        for &StreamSocketSetTcpLingerRequest
11865    {
11866        #[inline]
11867        unsafe fn encode(
11868            self,
11869            encoder: &mut fidl::encoding::Encoder<'_, D>,
11870            offset: usize,
11871            _depth: fidl::encoding::Depth,
11872        ) -> fidl::Result<()> {
11873            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
11874            // Delegate to tuple encoding.
11875            fidl::encoding::Encode::<StreamSocketSetTcpLingerRequest, D>::encode(
11876                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
11877                encoder,
11878                offset,
11879                _depth,
11880            )
11881        }
11882    }
11883    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
11884        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D> for (T0,)
11885    {
11886        #[inline]
11887        unsafe fn encode(
11888            self,
11889            encoder: &mut fidl::encoding::Encoder<'_, D>,
11890            offset: usize,
11891            depth: fidl::encoding::Depth,
11892        ) -> fidl::Result<()> {
11893            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
11894            // Zero out padding regions. There's no need to apply masks
11895            // because the unmasked parts will be overwritten by fields.
11896            // Write the fields.
11897            self.0.encode(encoder, offset + 0, depth)?;
11898            Ok(())
11899        }
11900    }
11901
11902    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11903        for StreamSocketSetTcpLingerRequest
11904    {
11905        #[inline(always)]
11906        fn new_empty() -> Self {
11907            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
11908        }
11909
11910        #[inline]
11911        unsafe fn decode(
11912            &mut self,
11913            decoder: &mut fidl::encoding::Decoder<'_, D>,
11914            offset: usize,
11915            _depth: fidl::encoding::Depth,
11916        ) -> fidl::Result<()> {
11917            decoder.debug_check_bounds::<Self>(offset);
11918            // Verify that padding bytes are zero.
11919            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
11920            Ok(())
11921        }
11922    }
11923
11924    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpMaxSegmentRequest {
11925        type Borrowed<'a> = &'a Self;
11926        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11927            value
11928        }
11929    }
11930
11931    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpMaxSegmentRequest {
11932        type Owned = Self;
11933
11934        #[inline(always)]
11935        fn inline_align(_context: fidl::encoding::Context) -> usize {
11936            4
11937        }
11938
11939        #[inline(always)]
11940        fn inline_size(_context: fidl::encoding::Context) -> usize {
11941            4
11942        }
11943        #[inline(always)]
11944        fn encode_is_copy() -> bool {
11945            true
11946        }
11947
11948        #[inline(always)]
11949        fn decode_is_copy() -> bool {
11950            true
11951        }
11952    }
11953
11954    unsafe impl<D: fidl::encoding::ResourceDialect>
11955        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D>
11956        for &StreamSocketSetTcpMaxSegmentRequest
11957    {
11958        #[inline]
11959        unsafe fn encode(
11960            self,
11961            encoder: &mut fidl::encoding::Encoder<'_, D>,
11962            offset: usize,
11963            _depth: fidl::encoding::Depth,
11964        ) -> fidl::Result<()> {
11965            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
11966            unsafe {
11967                // Copy the object into the buffer.
11968                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11969                (buf_ptr as *mut StreamSocketSetTcpMaxSegmentRequest)
11970                    .write_unaligned((self as *const StreamSocketSetTcpMaxSegmentRequest).read());
11971                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11972                // done second because the memcpy will write garbage to these bytes.
11973            }
11974            Ok(())
11975        }
11976    }
11977    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11978        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D> for (T0,)
11979    {
11980        #[inline]
11981        unsafe fn encode(
11982            self,
11983            encoder: &mut fidl::encoding::Encoder<'_, D>,
11984            offset: usize,
11985            depth: fidl::encoding::Depth,
11986        ) -> fidl::Result<()> {
11987            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
11988            // Zero out padding regions. There's no need to apply masks
11989            // because the unmasked parts will be overwritten by fields.
11990            // Write the fields.
11991            self.0.encode(encoder, offset + 0, depth)?;
11992            Ok(())
11993        }
11994    }
11995
11996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11997        for StreamSocketSetTcpMaxSegmentRequest
11998    {
11999        #[inline(always)]
12000        fn new_empty() -> Self {
12001            Self { value_bytes: fidl::new_empty!(u32, D) }
12002        }
12003
12004        #[inline]
12005        unsafe fn decode(
12006            &mut self,
12007            decoder: &mut fidl::encoding::Decoder<'_, D>,
12008            offset: usize,
12009            _depth: fidl::encoding::Depth,
12010        ) -> fidl::Result<()> {
12011            decoder.debug_check_bounds::<Self>(offset);
12012            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12013            // Verify that padding bytes are zero.
12014            // Copy from the buffer into the object.
12015            unsafe {
12016                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12017            }
12018            Ok(())
12019        }
12020    }
12021
12022    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpNoDelayRequest {
12023        type Borrowed<'a> = &'a Self;
12024        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12025            value
12026        }
12027    }
12028
12029    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpNoDelayRequest {
12030        type Owned = Self;
12031
12032        #[inline(always)]
12033        fn inline_align(_context: fidl::encoding::Context) -> usize {
12034            1
12035        }
12036
12037        #[inline(always)]
12038        fn inline_size(_context: fidl::encoding::Context) -> usize {
12039            1
12040        }
12041    }
12042
12043    unsafe impl<D: fidl::encoding::ResourceDialect>
12044        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D>
12045        for &StreamSocketSetTcpNoDelayRequest
12046    {
12047        #[inline]
12048        unsafe fn encode(
12049            self,
12050            encoder: &mut fidl::encoding::Encoder<'_, D>,
12051            offset: usize,
12052            _depth: fidl::encoding::Depth,
12053        ) -> fidl::Result<()> {
12054            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12055            // Delegate to tuple encoding.
12056            fidl::encoding::Encode::<StreamSocketSetTcpNoDelayRequest, D>::encode(
12057                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12058                encoder,
12059                offset,
12060                _depth,
12061            )
12062        }
12063    }
12064    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12065        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D> for (T0,)
12066    {
12067        #[inline]
12068        unsafe fn encode(
12069            self,
12070            encoder: &mut fidl::encoding::Encoder<'_, D>,
12071            offset: usize,
12072            depth: fidl::encoding::Depth,
12073        ) -> fidl::Result<()> {
12074            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12075            // Zero out padding regions. There's no need to apply masks
12076            // because the unmasked parts will be overwritten by fields.
12077            // Write the fields.
12078            self.0.encode(encoder, offset + 0, depth)?;
12079            Ok(())
12080        }
12081    }
12082
12083    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12084        for StreamSocketSetTcpNoDelayRequest
12085    {
12086        #[inline(always)]
12087        fn new_empty() -> Self {
12088            Self { value: fidl::new_empty!(bool, D) }
12089        }
12090
12091        #[inline]
12092        unsafe fn decode(
12093            &mut self,
12094            decoder: &mut fidl::encoding::Decoder<'_, D>,
12095            offset: usize,
12096            _depth: fidl::encoding::Depth,
12097        ) -> fidl::Result<()> {
12098            decoder.debug_check_bounds::<Self>(offset);
12099            // Verify that padding bytes are zero.
12100            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12101            Ok(())
12102        }
12103    }
12104
12105    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpQuickAckRequest {
12106        type Borrowed<'a> = &'a Self;
12107        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12108            value
12109        }
12110    }
12111
12112    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpQuickAckRequest {
12113        type Owned = Self;
12114
12115        #[inline(always)]
12116        fn inline_align(_context: fidl::encoding::Context) -> usize {
12117            1
12118        }
12119
12120        #[inline(always)]
12121        fn inline_size(_context: fidl::encoding::Context) -> usize {
12122            1
12123        }
12124    }
12125
12126    unsafe impl<D: fidl::encoding::ResourceDialect>
12127        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D>
12128        for &StreamSocketSetTcpQuickAckRequest
12129    {
12130        #[inline]
12131        unsafe fn encode(
12132            self,
12133            encoder: &mut fidl::encoding::Encoder<'_, D>,
12134            offset: usize,
12135            _depth: fidl::encoding::Depth,
12136        ) -> fidl::Result<()> {
12137            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12138            // Delegate to tuple encoding.
12139            fidl::encoding::Encode::<StreamSocketSetTcpQuickAckRequest, D>::encode(
12140                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12141                encoder,
12142                offset,
12143                _depth,
12144            )
12145        }
12146    }
12147    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12148        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D> for (T0,)
12149    {
12150        #[inline]
12151        unsafe fn encode(
12152            self,
12153            encoder: &mut fidl::encoding::Encoder<'_, D>,
12154            offset: usize,
12155            depth: fidl::encoding::Depth,
12156        ) -> fidl::Result<()> {
12157            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12158            // Zero out padding regions. There's no need to apply masks
12159            // because the unmasked parts will be overwritten by fields.
12160            // Write the fields.
12161            self.0.encode(encoder, offset + 0, depth)?;
12162            Ok(())
12163        }
12164    }
12165
12166    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12167        for StreamSocketSetTcpQuickAckRequest
12168    {
12169        #[inline(always)]
12170        fn new_empty() -> Self {
12171            Self { value: fidl::new_empty!(bool, D) }
12172        }
12173
12174        #[inline]
12175        unsafe fn decode(
12176            &mut self,
12177            decoder: &mut fidl::encoding::Decoder<'_, D>,
12178            offset: usize,
12179            _depth: fidl::encoding::Depth,
12180        ) -> fidl::Result<()> {
12181            decoder.debug_check_bounds::<Self>(offset);
12182            // Verify that padding bytes are zero.
12183            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12184            Ok(())
12185        }
12186    }
12187
12188    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpSynCountRequest {
12189        type Borrowed<'a> = &'a Self;
12190        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12191            value
12192        }
12193    }
12194
12195    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpSynCountRequest {
12196        type Owned = Self;
12197
12198        #[inline(always)]
12199        fn inline_align(_context: fidl::encoding::Context) -> usize {
12200            4
12201        }
12202
12203        #[inline(always)]
12204        fn inline_size(_context: fidl::encoding::Context) -> usize {
12205            4
12206        }
12207        #[inline(always)]
12208        fn encode_is_copy() -> bool {
12209            true
12210        }
12211
12212        #[inline(always)]
12213        fn decode_is_copy() -> bool {
12214            true
12215        }
12216    }
12217
12218    unsafe impl<D: fidl::encoding::ResourceDialect>
12219        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D>
12220        for &StreamSocketSetTcpSynCountRequest
12221    {
12222        #[inline]
12223        unsafe fn encode(
12224            self,
12225            encoder: &mut fidl::encoding::Encoder<'_, D>,
12226            offset: usize,
12227            _depth: fidl::encoding::Depth,
12228        ) -> fidl::Result<()> {
12229            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12230            unsafe {
12231                // Copy the object into the buffer.
12232                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12233                (buf_ptr as *mut StreamSocketSetTcpSynCountRequest)
12234                    .write_unaligned((self as *const StreamSocketSetTcpSynCountRequest).read());
12235                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12236                // done second because the memcpy will write garbage to these bytes.
12237            }
12238            Ok(())
12239        }
12240    }
12241    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12242        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D> for (T0,)
12243    {
12244        #[inline]
12245        unsafe fn encode(
12246            self,
12247            encoder: &mut fidl::encoding::Encoder<'_, D>,
12248            offset: usize,
12249            depth: fidl::encoding::Depth,
12250        ) -> fidl::Result<()> {
12251            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12252            // Zero out padding regions. There's no need to apply masks
12253            // because the unmasked parts will be overwritten by fields.
12254            // Write the fields.
12255            self.0.encode(encoder, offset + 0, depth)?;
12256            Ok(())
12257        }
12258    }
12259
12260    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12261        for StreamSocketSetTcpSynCountRequest
12262    {
12263        #[inline(always)]
12264        fn new_empty() -> Self {
12265            Self { value: fidl::new_empty!(u32, D) }
12266        }
12267
12268        #[inline]
12269        unsafe fn decode(
12270            &mut self,
12271            decoder: &mut fidl::encoding::Decoder<'_, D>,
12272            offset: usize,
12273            _depth: fidl::encoding::Depth,
12274        ) -> fidl::Result<()> {
12275            decoder.debug_check_bounds::<Self>(offset);
12276            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12277            // Verify that padding bytes are zero.
12278            // Copy from the buffer into the object.
12279            unsafe {
12280                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12281            }
12282            Ok(())
12283        }
12284    }
12285
12286    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12287        type Borrowed<'a> = &'a Self;
12288        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12289            value
12290        }
12291    }
12292
12293    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12294        type Owned = Self;
12295
12296        #[inline(always)]
12297        fn inline_align(_context: fidl::encoding::Context) -> usize {
12298            4
12299        }
12300
12301        #[inline(always)]
12302        fn inline_size(_context: fidl::encoding::Context) -> usize {
12303            4
12304        }
12305        #[inline(always)]
12306        fn encode_is_copy() -> bool {
12307            true
12308        }
12309
12310        #[inline(always)]
12311        fn decode_is_copy() -> bool {
12312            true
12313        }
12314    }
12315
12316    unsafe impl<D: fidl::encoding::ResourceDialect>
12317        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D>
12318        for &StreamSocketSetTcpUserTimeoutRequest
12319    {
12320        #[inline]
12321        unsafe fn encode(
12322            self,
12323            encoder: &mut fidl::encoding::Encoder<'_, D>,
12324            offset: usize,
12325            _depth: fidl::encoding::Depth,
12326        ) -> fidl::Result<()> {
12327            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12328            unsafe {
12329                // Copy the object into the buffer.
12330                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12331                (buf_ptr as *mut StreamSocketSetTcpUserTimeoutRequest)
12332                    .write_unaligned((self as *const StreamSocketSetTcpUserTimeoutRequest).read());
12333                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12334                // done second because the memcpy will write garbage to these bytes.
12335            }
12336            Ok(())
12337        }
12338    }
12339    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12340        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D> for (T0,)
12341    {
12342        #[inline]
12343        unsafe fn encode(
12344            self,
12345            encoder: &mut fidl::encoding::Encoder<'_, D>,
12346            offset: usize,
12347            depth: fidl::encoding::Depth,
12348        ) -> fidl::Result<()> {
12349            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12350            // Zero out padding regions. There's no need to apply masks
12351            // because the unmasked parts will be overwritten by fields.
12352            // Write the fields.
12353            self.0.encode(encoder, offset + 0, depth)?;
12354            Ok(())
12355        }
12356    }
12357
12358    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12359        for StreamSocketSetTcpUserTimeoutRequest
12360    {
12361        #[inline(always)]
12362        fn new_empty() -> Self {
12363            Self { value_millis: fidl::new_empty!(u32, D) }
12364        }
12365
12366        #[inline]
12367        unsafe fn decode(
12368            &mut self,
12369            decoder: &mut fidl::encoding::Decoder<'_, D>,
12370            offset: usize,
12371            _depth: fidl::encoding::Depth,
12372        ) -> fidl::Result<()> {
12373            decoder.debug_check_bounds::<Self>(offset);
12374            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12375            // Verify that padding bytes are zero.
12376            // Copy from the buffer into the object.
12377            unsafe {
12378                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12379            }
12380            Ok(())
12381        }
12382    }
12383
12384    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpWindowClampRequest {
12385        type Borrowed<'a> = &'a Self;
12386        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12387            value
12388        }
12389    }
12390
12391    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpWindowClampRequest {
12392        type Owned = Self;
12393
12394        #[inline(always)]
12395        fn inline_align(_context: fidl::encoding::Context) -> usize {
12396            4
12397        }
12398
12399        #[inline(always)]
12400        fn inline_size(_context: fidl::encoding::Context) -> usize {
12401            4
12402        }
12403        #[inline(always)]
12404        fn encode_is_copy() -> bool {
12405            true
12406        }
12407
12408        #[inline(always)]
12409        fn decode_is_copy() -> bool {
12410            true
12411        }
12412    }
12413
12414    unsafe impl<D: fidl::encoding::ResourceDialect>
12415        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D>
12416        for &StreamSocketSetTcpWindowClampRequest
12417    {
12418        #[inline]
12419        unsafe fn encode(
12420            self,
12421            encoder: &mut fidl::encoding::Encoder<'_, D>,
12422            offset: usize,
12423            _depth: fidl::encoding::Depth,
12424        ) -> fidl::Result<()> {
12425            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12426            unsafe {
12427                // Copy the object into the buffer.
12428                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12429                (buf_ptr as *mut StreamSocketSetTcpWindowClampRequest)
12430                    .write_unaligned((self as *const StreamSocketSetTcpWindowClampRequest).read());
12431                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12432                // done second because the memcpy will write garbage to these bytes.
12433            }
12434            Ok(())
12435        }
12436    }
12437    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12438        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D> for (T0,)
12439    {
12440        #[inline]
12441        unsafe fn encode(
12442            self,
12443            encoder: &mut fidl::encoding::Encoder<'_, D>,
12444            offset: usize,
12445            depth: fidl::encoding::Depth,
12446        ) -> fidl::Result<()> {
12447            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12448            // Zero out padding regions. There's no need to apply masks
12449            // because the unmasked parts will be overwritten by fields.
12450            // Write the fields.
12451            self.0.encode(encoder, offset + 0, depth)?;
12452            Ok(())
12453        }
12454    }
12455
12456    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12457        for StreamSocketSetTcpWindowClampRequest
12458    {
12459        #[inline(always)]
12460        fn new_empty() -> Self {
12461            Self { value: fidl::new_empty!(u32, D) }
12462        }
12463
12464        #[inline]
12465        unsafe fn decode(
12466            &mut self,
12467            decoder: &mut fidl::encoding::Decoder<'_, D>,
12468            offset: usize,
12469            _depth: fidl::encoding::Depth,
12470        ) -> fidl::Result<()> {
12471            decoder.debug_check_bounds::<Self>(offset);
12472            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12473            // Verify that padding bytes are zero.
12474            // Copy from the buffer into the object.
12475            unsafe {
12476                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12477            }
12478            Ok(())
12479        }
12480    }
12481
12482    impl fidl::encoding::ValueTypeMarker for StreamSocketGetInfoResponse {
12483        type Borrowed<'a> = &'a Self;
12484        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12485            value
12486        }
12487    }
12488
12489    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetInfoResponse {
12490        type Owned = Self;
12491
12492        #[inline(always)]
12493        fn inline_align(_context: fidl::encoding::Context) -> usize {
12494            4
12495        }
12496
12497        #[inline(always)]
12498        fn inline_size(_context: fidl::encoding::Context) -> usize {
12499            8
12500        }
12501    }
12502
12503    unsafe impl<D: fidl::encoding::ResourceDialect>
12504        fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for &StreamSocketGetInfoResponse
12505    {
12506        #[inline]
12507        unsafe fn encode(
12508            self,
12509            encoder: &mut fidl::encoding::Encoder<'_, D>,
12510            offset: usize,
12511            _depth: fidl::encoding::Depth,
12512        ) -> fidl::Result<()> {
12513            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12514            // Delegate to tuple encoding.
12515            fidl::encoding::Encode::<StreamSocketGetInfoResponse, D>::encode(
12516                (
12517                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
12518                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
12519                ),
12520                encoder,
12521                offset,
12522                _depth,
12523            )
12524        }
12525    }
12526    unsafe impl<
12527            D: fidl::encoding::ResourceDialect,
12528            T0: fidl::encoding::Encode<Domain, D>,
12529            T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
12530        > fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for (T0, T1)
12531    {
12532        #[inline]
12533        unsafe fn encode(
12534            self,
12535            encoder: &mut fidl::encoding::Encoder<'_, D>,
12536            offset: usize,
12537            depth: fidl::encoding::Depth,
12538        ) -> fidl::Result<()> {
12539            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12540            // Zero out padding regions. There's no need to apply masks
12541            // because the unmasked parts will be overwritten by fields.
12542            unsafe {
12543                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12544                (ptr as *mut u32).write_unaligned(0);
12545            }
12546            // Write the fields.
12547            self.0.encode(encoder, offset + 0, depth)?;
12548            self.1.encode(encoder, offset + 4, depth)?;
12549            Ok(())
12550        }
12551    }
12552
12553    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12554        for StreamSocketGetInfoResponse
12555    {
12556        #[inline(always)]
12557        fn new_empty() -> Self {
12558            Self {
12559                domain: fidl::new_empty!(Domain, D),
12560                proto: fidl::new_empty!(StreamSocketProtocol, D),
12561            }
12562        }
12563
12564        #[inline]
12565        unsafe fn decode(
12566            &mut self,
12567            decoder: &mut fidl::encoding::Decoder<'_, D>,
12568            offset: usize,
12569            _depth: fidl::encoding::Depth,
12570        ) -> fidl::Result<()> {
12571            decoder.debug_check_bounds::<Self>(offset);
12572            // Verify that padding bytes are zero.
12573            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12574            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12575            let mask = 0xffff0000u32;
12576            let maskedval = padval & mask;
12577            if maskedval != 0 {
12578                return Err(fidl::Error::NonZeroPadding {
12579                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12580                });
12581            }
12582            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
12583            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
12584            Ok(())
12585        }
12586    }
12587
12588    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCongestionResponse {
12589        type Borrowed<'a> = &'a Self;
12590        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12591            value
12592        }
12593    }
12594
12595    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCongestionResponse {
12596        type Owned = Self;
12597
12598        #[inline(always)]
12599        fn inline_align(_context: fidl::encoding::Context) -> usize {
12600            4
12601        }
12602
12603        #[inline(always)]
12604        fn inline_size(_context: fidl::encoding::Context) -> usize {
12605            4
12606        }
12607    }
12608
12609    unsafe impl<D: fidl::encoding::ResourceDialect>
12610        fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D>
12611        for &StreamSocketGetTcpCongestionResponse
12612    {
12613        #[inline]
12614        unsafe fn encode(
12615            self,
12616            encoder: &mut fidl::encoding::Encoder<'_, D>,
12617            offset: usize,
12618            _depth: fidl::encoding::Depth,
12619        ) -> fidl::Result<()> {
12620            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12621            // Delegate to tuple encoding.
12622            fidl::encoding::Encode::<StreamSocketGetTcpCongestionResponse, D>::encode(
12623                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12624                encoder,
12625                offset,
12626                _depth,
12627            )
12628        }
12629    }
12630    unsafe impl<
12631            D: fidl::encoding::ResourceDialect,
12632            T0: fidl::encoding::Encode<TcpCongestionControl, D>,
12633        > fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D> for (T0,)
12634    {
12635        #[inline]
12636        unsafe fn encode(
12637            self,
12638            encoder: &mut fidl::encoding::Encoder<'_, D>,
12639            offset: usize,
12640            depth: fidl::encoding::Depth,
12641        ) -> fidl::Result<()> {
12642            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12643            // Zero out padding regions. There's no need to apply masks
12644            // because the unmasked parts will be overwritten by fields.
12645            // Write the fields.
12646            self.0.encode(encoder, offset + 0, depth)?;
12647            Ok(())
12648        }
12649    }
12650
12651    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12652        for StreamSocketGetTcpCongestionResponse
12653    {
12654        #[inline(always)]
12655        fn new_empty() -> Self {
12656            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
12657        }
12658
12659        #[inline]
12660        unsafe fn decode(
12661            &mut self,
12662            decoder: &mut fidl::encoding::Decoder<'_, D>,
12663            offset: usize,
12664            _depth: fidl::encoding::Depth,
12665        ) -> fidl::Result<()> {
12666            decoder.debug_check_bounds::<Self>(offset);
12667            // Verify that padding bytes are zero.
12668            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
12669            Ok(())
12670        }
12671    }
12672
12673    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCorkResponse {
12674        type Borrowed<'a> = &'a Self;
12675        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12676            value
12677        }
12678    }
12679
12680    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCorkResponse {
12681        type Owned = Self;
12682
12683        #[inline(always)]
12684        fn inline_align(_context: fidl::encoding::Context) -> usize {
12685            1
12686        }
12687
12688        #[inline(always)]
12689        fn inline_size(_context: fidl::encoding::Context) -> usize {
12690            1
12691        }
12692    }
12693
12694    unsafe impl<D: fidl::encoding::ResourceDialect>
12695        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D>
12696        for &StreamSocketGetTcpCorkResponse
12697    {
12698        #[inline]
12699        unsafe fn encode(
12700            self,
12701            encoder: &mut fidl::encoding::Encoder<'_, D>,
12702            offset: usize,
12703            _depth: fidl::encoding::Depth,
12704        ) -> fidl::Result<()> {
12705            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12706            // Delegate to tuple encoding.
12707            fidl::encoding::Encode::<StreamSocketGetTcpCorkResponse, D>::encode(
12708                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12709                encoder,
12710                offset,
12711                _depth,
12712            )
12713        }
12714    }
12715    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12716        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D> for (T0,)
12717    {
12718        #[inline]
12719        unsafe fn encode(
12720            self,
12721            encoder: &mut fidl::encoding::Encoder<'_, D>,
12722            offset: usize,
12723            depth: fidl::encoding::Depth,
12724        ) -> fidl::Result<()> {
12725            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12726            // Zero out padding regions. There's no need to apply masks
12727            // because the unmasked parts will be overwritten by fields.
12728            // Write the fields.
12729            self.0.encode(encoder, offset + 0, depth)?;
12730            Ok(())
12731        }
12732    }
12733
12734    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12735        for StreamSocketGetTcpCorkResponse
12736    {
12737        #[inline(always)]
12738        fn new_empty() -> Self {
12739            Self { value: fidl::new_empty!(bool, D) }
12740        }
12741
12742        #[inline]
12743        unsafe fn decode(
12744            &mut self,
12745            decoder: &mut fidl::encoding::Decoder<'_, D>,
12746            offset: usize,
12747            _depth: fidl::encoding::Depth,
12748        ) -> fidl::Result<()> {
12749            decoder.debug_check_bounds::<Self>(offset);
12750            // Verify that padding bytes are zero.
12751            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12752            Ok(())
12753        }
12754    }
12755
12756    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpDeferAcceptResponse {
12757        type Borrowed<'a> = &'a Self;
12758        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12759            value
12760        }
12761    }
12762
12763    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpDeferAcceptResponse {
12764        type Owned = Self;
12765
12766        #[inline(always)]
12767        fn inline_align(_context: fidl::encoding::Context) -> usize {
12768            4
12769        }
12770
12771        #[inline(always)]
12772        fn inline_size(_context: fidl::encoding::Context) -> usize {
12773            4
12774        }
12775        #[inline(always)]
12776        fn encode_is_copy() -> bool {
12777            true
12778        }
12779
12780        #[inline(always)]
12781        fn decode_is_copy() -> bool {
12782            true
12783        }
12784    }
12785
12786    unsafe impl<D: fidl::encoding::ResourceDialect>
12787        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D>
12788        for &StreamSocketGetTcpDeferAcceptResponse
12789    {
12790        #[inline]
12791        unsafe fn encode(
12792            self,
12793            encoder: &mut fidl::encoding::Encoder<'_, D>,
12794            offset: usize,
12795            _depth: fidl::encoding::Depth,
12796        ) -> fidl::Result<()> {
12797            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
12798            unsafe {
12799                // Copy the object into the buffer.
12800                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12801                (buf_ptr as *mut StreamSocketGetTcpDeferAcceptResponse)
12802                    .write_unaligned((self as *const StreamSocketGetTcpDeferAcceptResponse).read());
12803                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12804                // done second because the memcpy will write garbage to these bytes.
12805            }
12806            Ok(())
12807        }
12808    }
12809    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12810        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D> for (T0,)
12811    {
12812        #[inline]
12813        unsafe fn encode(
12814            self,
12815            encoder: &mut fidl::encoding::Encoder<'_, D>,
12816            offset: usize,
12817            depth: fidl::encoding::Depth,
12818        ) -> fidl::Result<()> {
12819            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
12820            // Zero out padding regions. There's no need to apply masks
12821            // because the unmasked parts will be overwritten by fields.
12822            // Write the fields.
12823            self.0.encode(encoder, offset + 0, depth)?;
12824            Ok(())
12825        }
12826    }
12827
12828    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12829        for StreamSocketGetTcpDeferAcceptResponse
12830    {
12831        #[inline(always)]
12832        fn new_empty() -> Self {
12833            Self { value_secs: fidl::new_empty!(u32, D) }
12834        }
12835
12836        #[inline]
12837        unsafe fn decode(
12838            &mut self,
12839            decoder: &mut fidl::encoding::Decoder<'_, D>,
12840            offset: usize,
12841            _depth: fidl::encoding::Depth,
12842        ) -> fidl::Result<()> {
12843            decoder.debug_check_bounds::<Self>(offset);
12844            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12845            // Verify that padding bytes are zero.
12846            // Copy from the buffer into the object.
12847            unsafe {
12848                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12849            }
12850            Ok(())
12851        }
12852    }
12853
12854    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpInfoResponse {
12855        type Borrowed<'a> = &'a Self;
12856        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12857            value
12858        }
12859    }
12860
12861    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpInfoResponse {
12862        type Owned = Self;
12863
12864        #[inline(always)]
12865        fn inline_align(_context: fidl::encoding::Context) -> usize {
12866            8
12867        }
12868
12869        #[inline(always)]
12870        fn inline_size(_context: fidl::encoding::Context) -> usize {
12871            16
12872        }
12873    }
12874
12875    unsafe impl<D: fidl::encoding::ResourceDialect>
12876        fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D>
12877        for &StreamSocketGetTcpInfoResponse
12878    {
12879        #[inline]
12880        unsafe fn encode(
12881            self,
12882            encoder: &mut fidl::encoding::Encoder<'_, D>,
12883            offset: usize,
12884            _depth: fidl::encoding::Depth,
12885        ) -> fidl::Result<()> {
12886            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
12887            // Delegate to tuple encoding.
12888            fidl::encoding::Encode::<StreamSocketGetTcpInfoResponse, D>::encode(
12889                (<TcpInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
12890                encoder,
12891                offset,
12892                _depth,
12893            )
12894        }
12895    }
12896    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TcpInfo, D>>
12897        fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D> for (T0,)
12898    {
12899        #[inline]
12900        unsafe fn encode(
12901            self,
12902            encoder: &mut fidl::encoding::Encoder<'_, D>,
12903            offset: usize,
12904            depth: fidl::encoding::Depth,
12905        ) -> fidl::Result<()> {
12906            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
12907            // Zero out padding regions. There's no need to apply masks
12908            // because the unmasked parts will be overwritten by fields.
12909            // Write the fields.
12910            self.0.encode(encoder, offset + 0, depth)?;
12911            Ok(())
12912        }
12913    }
12914
12915    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12916        for StreamSocketGetTcpInfoResponse
12917    {
12918        #[inline(always)]
12919        fn new_empty() -> Self {
12920            Self { info: fidl::new_empty!(TcpInfo, D) }
12921        }
12922
12923        #[inline]
12924        unsafe fn decode(
12925            &mut self,
12926            decoder: &mut fidl::encoding::Decoder<'_, D>,
12927            offset: usize,
12928            _depth: fidl::encoding::Depth,
12929        ) -> fidl::Result<()> {
12930            decoder.debug_check_bounds::<Self>(offset);
12931            // Verify that padding bytes are zero.
12932            fidl::decode!(TcpInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
12933            Ok(())
12934        }
12935    }
12936
12937    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
12938        type Borrowed<'a> = &'a Self;
12939        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12940            value
12941        }
12942    }
12943
12944    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
12945        type Owned = Self;
12946
12947        #[inline(always)]
12948        fn inline_align(_context: fidl::encoding::Context) -> usize {
12949            4
12950        }
12951
12952        #[inline(always)]
12953        fn inline_size(_context: fidl::encoding::Context) -> usize {
12954            4
12955        }
12956        #[inline(always)]
12957        fn encode_is_copy() -> bool {
12958            true
12959        }
12960
12961        #[inline(always)]
12962        fn decode_is_copy() -> bool {
12963            true
12964        }
12965    }
12966
12967    unsafe impl<D: fidl::encoding::ResourceDialect>
12968        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D>
12969        for &StreamSocketGetTcpKeepAliveCountResponse
12970    {
12971        #[inline]
12972        unsafe fn encode(
12973            self,
12974            encoder: &mut fidl::encoding::Encoder<'_, D>,
12975            offset: usize,
12976            _depth: fidl::encoding::Depth,
12977        ) -> fidl::Result<()> {
12978            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
12979            unsafe {
12980                // Copy the object into the buffer.
12981                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12982                (buf_ptr as *mut StreamSocketGetTcpKeepAliveCountResponse).write_unaligned(
12983                    (self as *const StreamSocketGetTcpKeepAliveCountResponse).read(),
12984                );
12985                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12986                // done second because the memcpy will write garbage to these bytes.
12987            }
12988            Ok(())
12989        }
12990    }
12991    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12992        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D> for (T0,)
12993    {
12994        #[inline]
12995        unsafe fn encode(
12996            self,
12997            encoder: &mut fidl::encoding::Encoder<'_, D>,
12998            offset: usize,
12999            depth: fidl::encoding::Depth,
13000        ) -> fidl::Result<()> {
13001            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13002            // Zero out padding regions. There's no need to apply masks
13003            // because the unmasked parts will be overwritten by fields.
13004            // Write the fields.
13005            self.0.encode(encoder, offset + 0, depth)?;
13006            Ok(())
13007        }
13008    }
13009
13010    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13011        for StreamSocketGetTcpKeepAliveCountResponse
13012    {
13013        #[inline(always)]
13014        fn new_empty() -> Self {
13015            Self { value: fidl::new_empty!(u32, D) }
13016        }
13017
13018        #[inline]
13019        unsafe fn decode(
13020            &mut self,
13021            decoder: &mut fidl::encoding::Decoder<'_, D>,
13022            offset: usize,
13023            _depth: fidl::encoding::Depth,
13024        ) -> fidl::Result<()> {
13025            decoder.debug_check_bounds::<Self>(offset);
13026            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13027            // Verify that padding bytes are zero.
13028            // Copy from the buffer into the object.
13029            unsafe {
13030                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13031            }
13032            Ok(())
13033        }
13034    }
13035
13036    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13037        type Borrowed<'a> = &'a Self;
13038        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13039            value
13040        }
13041    }
13042
13043    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13044        type Owned = Self;
13045
13046        #[inline(always)]
13047        fn inline_align(_context: fidl::encoding::Context) -> usize {
13048            4
13049        }
13050
13051        #[inline(always)]
13052        fn inline_size(_context: fidl::encoding::Context) -> usize {
13053            4
13054        }
13055        #[inline(always)]
13056        fn encode_is_copy() -> bool {
13057            true
13058        }
13059
13060        #[inline(always)]
13061        fn decode_is_copy() -> bool {
13062            true
13063        }
13064    }
13065
13066    unsafe impl<D: fidl::encoding::ResourceDialect>
13067        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D>
13068        for &StreamSocketGetTcpKeepAliveIdleResponse
13069    {
13070        #[inline]
13071        unsafe fn encode(
13072            self,
13073            encoder: &mut fidl::encoding::Encoder<'_, D>,
13074            offset: usize,
13075            _depth: fidl::encoding::Depth,
13076        ) -> fidl::Result<()> {
13077            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13078            unsafe {
13079                // Copy the object into the buffer.
13080                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13081                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIdleResponse).write_unaligned(
13082                    (self as *const StreamSocketGetTcpKeepAliveIdleResponse).read(),
13083                );
13084                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13085                // done second because the memcpy will write garbage to these bytes.
13086            }
13087            Ok(())
13088        }
13089    }
13090    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13091        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D> for (T0,)
13092    {
13093        #[inline]
13094        unsafe fn encode(
13095            self,
13096            encoder: &mut fidl::encoding::Encoder<'_, D>,
13097            offset: usize,
13098            depth: fidl::encoding::Depth,
13099        ) -> fidl::Result<()> {
13100            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13101            // Zero out padding regions. There's no need to apply masks
13102            // because the unmasked parts will be overwritten by fields.
13103            // Write the fields.
13104            self.0.encode(encoder, offset + 0, depth)?;
13105            Ok(())
13106        }
13107    }
13108
13109    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13110        for StreamSocketGetTcpKeepAliveIdleResponse
13111    {
13112        #[inline(always)]
13113        fn new_empty() -> Self {
13114            Self { value_secs: fidl::new_empty!(u32, D) }
13115        }
13116
13117        #[inline]
13118        unsafe fn decode(
13119            &mut self,
13120            decoder: &mut fidl::encoding::Decoder<'_, D>,
13121            offset: usize,
13122            _depth: fidl::encoding::Depth,
13123        ) -> fidl::Result<()> {
13124            decoder.debug_check_bounds::<Self>(offset);
13125            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13126            // Verify that padding bytes are zero.
13127            // Copy from the buffer into the object.
13128            unsafe {
13129                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13130            }
13131            Ok(())
13132        }
13133    }
13134
13135    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13136        type Borrowed<'a> = &'a Self;
13137        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13138            value
13139        }
13140    }
13141
13142    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13143        type Owned = Self;
13144
13145        #[inline(always)]
13146        fn inline_align(_context: fidl::encoding::Context) -> usize {
13147            4
13148        }
13149
13150        #[inline(always)]
13151        fn inline_size(_context: fidl::encoding::Context) -> usize {
13152            4
13153        }
13154        #[inline(always)]
13155        fn encode_is_copy() -> bool {
13156            true
13157        }
13158
13159        #[inline(always)]
13160        fn decode_is_copy() -> bool {
13161            true
13162        }
13163    }
13164
13165    unsafe impl<D: fidl::encoding::ResourceDialect>
13166        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D>
13167        for &StreamSocketGetTcpKeepAliveIntervalResponse
13168    {
13169        #[inline]
13170        unsafe fn encode(
13171            self,
13172            encoder: &mut fidl::encoding::Encoder<'_, D>,
13173            offset: usize,
13174            _depth: fidl::encoding::Depth,
13175        ) -> fidl::Result<()> {
13176            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13177            unsafe {
13178                // Copy the object into the buffer.
13179                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13180                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIntervalResponse).write_unaligned(
13181                    (self as *const StreamSocketGetTcpKeepAliveIntervalResponse).read(),
13182                );
13183                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13184                // done second because the memcpy will write garbage to these bytes.
13185            }
13186            Ok(())
13187        }
13188    }
13189    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13190        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D> for (T0,)
13191    {
13192        #[inline]
13193        unsafe fn encode(
13194            self,
13195            encoder: &mut fidl::encoding::Encoder<'_, D>,
13196            offset: usize,
13197            depth: fidl::encoding::Depth,
13198        ) -> fidl::Result<()> {
13199            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13200            // Zero out padding regions. There's no need to apply masks
13201            // because the unmasked parts will be overwritten by fields.
13202            // Write the fields.
13203            self.0.encode(encoder, offset + 0, depth)?;
13204            Ok(())
13205        }
13206    }
13207
13208    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13209        for StreamSocketGetTcpKeepAliveIntervalResponse
13210    {
13211        #[inline(always)]
13212        fn new_empty() -> Self {
13213            Self { value_secs: fidl::new_empty!(u32, D) }
13214        }
13215
13216        #[inline]
13217        unsafe fn decode(
13218            &mut self,
13219            decoder: &mut fidl::encoding::Decoder<'_, D>,
13220            offset: usize,
13221            _depth: fidl::encoding::Depth,
13222        ) -> fidl::Result<()> {
13223            decoder.debug_check_bounds::<Self>(offset);
13224            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13225            // Verify that padding bytes are zero.
13226            // Copy from the buffer into the object.
13227            unsafe {
13228                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13229            }
13230            Ok(())
13231        }
13232    }
13233
13234    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpLingerResponse {
13235        type Borrowed<'a> = &'a Self;
13236        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13237            value
13238        }
13239    }
13240
13241    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpLingerResponse {
13242        type Owned = Self;
13243
13244        #[inline(always)]
13245        fn inline_align(_context: fidl::encoding::Context) -> usize {
13246            8
13247        }
13248
13249        #[inline(always)]
13250        fn inline_size(_context: fidl::encoding::Context) -> usize {
13251            16
13252        }
13253    }
13254
13255    unsafe impl<D: fidl::encoding::ResourceDialect>
13256        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D>
13257        for &StreamSocketGetTcpLingerResponse
13258    {
13259        #[inline]
13260        unsafe fn encode(
13261            self,
13262            encoder: &mut fidl::encoding::Encoder<'_, D>,
13263            offset: usize,
13264            _depth: fidl::encoding::Depth,
13265        ) -> fidl::Result<()> {
13266            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13267            // Delegate to tuple encoding.
13268            fidl::encoding::Encode::<StreamSocketGetTcpLingerResponse, D>::encode(
13269                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
13270                encoder,
13271                offset,
13272                _depth,
13273            )
13274        }
13275    }
13276    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
13277        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D> for (T0,)
13278    {
13279        #[inline]
13280        unsafe fn encode(
13281            self,
13282            encoder: &mut fidl::encoding::Encoder<'_, D>,
13283            offset: usize,
13284            depth: fidl::encoding::Depth,
13285        ) -> fidl::Result<()> {
13286            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13287            // Zero out padding regions. There's no need to apply masks
13288            // because the unmasked parts will be overwritten by fields.
13289            // Write the fields.
13290            self.0.encode(encoder, offset + 0, depth)?;
13291            Ok(())
13292        }
13293    }
13294
13295    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13296        for StreamSocketGetTcpLingerResponse
13297    {
13298        #[inline(always)]
13299        fn new_empty() -> Self {
13300            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
13301        }
13302
13303        #[inline]
13304        unsafe fn decode(
13305            &mut self,
13306            decoder: &mut fidl::encoding::Decoder<'_, D>,
13307            offset: usize,
13308            _depth: fidl::encoding::Depth,
13309        ) -> fidl::Result<()> {
13310            decoder.debug_check_bounds::<Self>(offset);
13311            // Verify that padding bytes are zero.
13312            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
13313            Ok(())
13314        }
13315    }
13316
13317    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13318        type Borrowed<'a> = &'a Self;
13319        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13320            value
13321        }
13322    }
13323
13324    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13325        type Owned = Self;
13326
13327        #[inline(always)]
13328        fn inline_align(_context: fidl::encoding::Context) -> usize {
13329            4
13330        }
13331
13332        #[inline(always)]
13333        fn inline_size(_context: fidl::encoding::Context) -> usize {
13334            4
13335        }
13336        #[inline(always)]
13337        fn encode_is_copy() -> bool {
13338            true
13339        }
13340
13341        #[inline(always)]
13342        fn decode_is_copy() -> bool {
13343            true
13344        }
13345    }
13346
13347    unsafe impl<D: fidl::encoding::ResourceDialect>
13348        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D>
13349        for &StreamSocketGetTcpMaxSegmentResponse
13350    {
13351        #[inline]
13352        unsafe fn encode(
13353            self,
13354            encoder: &mut fidl::encoding::Encoder<'_, D>,
13355            offset: usize,
13356            _depth: fidl::encoding::Depth,
13357        ) -> fidl::Result<()> {
13358            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13359            unsafe {
13360                // Copy the object into the buffer.
13361                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13362                (buf_ptr as *mut StreamSocketGetTcpMaxSegmentResponse)
13363                    .write_unaligned((self as *const StreamSocketGetTcpMaxSegmentResponse).read());
13364                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13365                // done second because the memcpy will write garbage to these bytes.
13366            }
13367            Ok(())
13368        }
13369    }
13370    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13371        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D> for (T0,)
13372    {
13373        #[inline]
13374        unsafe fn encode(
13375            self,
13376            encoder: &mut fidl::encoding::Encoder<'_, D>,
13377            offset: usize,
13378            depth: fidl::encoding::Depth,
13379        ) -> fidl::Result<()> {
13380            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13381            // Zero out padding regions. There's no need to apply masks
13382            // because the unmasked parts will be overwritten by fields.
13383            // Write the fields.
13384            self.0.encode(encoder, offset + 0, depth)?;
13385            Ok(())
13386        }
13387    }
13388
13389    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13390        for StreamSocketGetTcpMaxSegmentResponse
13391    {
13392        #[inline(always)]
13393        fn new_empty() -> Self {
13394            Self { value_bytes: fidl::new_empty!(u32, D) }
13395        }
13396
13397        #[inline]
13398        unsafe fn decode(
13399            &mut self,
13400            decoder: &mut fidl::encoding::Decoder<'_, D>,
13401            offset: usize,
13402            _depth: fidl::encoding::Depth,
13403        ) -> fidl::Result<()> {
13404            decoder.debug_check_bounds::<Self>(offset);
13405            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13406            // Verify that padding bytes are zero.
13407            // Copy from the buffer into the object.
13408            unsafe {
13409                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13410            }
13411            Ok(())
13412        }
13413    }
13414
13415    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpNoDelayResponse {
13416        type Borrowed<'a> = &'a Self;
13417        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13418            value
13419        }
13420    }
13421
13422    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpNoDelayResponse {
13423        type Owned = Self;
13424
13425        #[inline(always)]
13426        fn inline_align(_context: fidl::encoding::Context) -> usize {
13427            1
13428        }
13429
13430        #[inline(always)]
13431        fn inline_size(_context: fidl::encoding::Context) -> usize {
13432            1
13433        }
13434    }
13435
13436    unsafe impl<D: fidl::encoding::ResourceDialect>
13437        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D>
13438        for &StreamSocketGetTcpNoDelayResponse
13439    {
13440        #[inline]
13441        unsafe fn encode(
13442            self,
13443            encoder: &mut fidl::encoding::Encoder<'_, D>,
13444            offset: usize,
13445            _depth: fidl::encoding::Depth,
13446        ) -> fidl::Result<()> {
13447            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13448            // Delegate to tuple encoding.
13449            fidl::encoding::Encode::<StreamSocketGetTcpNoDelayResponse, D>::encode(
13450                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13451                encoder,
13452                offset,
13453                _depth,
13454            )
13455        }
13456    }
13457    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13458        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D> for (T0,)
13459    {
13460        #[inline]
13461        unsafe fn encode(
13462            self,
13463            encoder: &mut fidl::encoding::Encoder<'_, D>,
13464            offset: usize,
13465            depth: fidl::encoding::Depth,
13466        ) -> fidl::Result<()> {
13467            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13468            // Zero out padding regions. There's no need to apply masks
13469            // because the unmasked parts will be overwritten by fields.
13470            // Write the fields.
13471            self.0.encode(encoder, offset + 0, depth)?;
13472            Ok(())
13473        }
13474    }
13475
13476    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13477        for StreamSocketGetTcpNoDelayResponse
13478    {
13479        #[inline(always)]
13480        fn new_empty() -> Self {
13481            Self { value: fidl::new_empty!(bool, D) }
13482        }
13483
13484        #[inline]
13485        unsafe fn decode(
13486            &mut self,
13487            decoder: &mut fidl::encoding::Decoder<'_, D>,
13488            offset: usize,
13489            _depth: fidl::encoding::Depth,
13490        ) -> fidl::Result<()> {
13491            decoder.debug_check_bounds::<Self>(offset);
13492            // Verify that padding bytes are zero.
13493            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13494            Ok(())
13495        }
13496    }
13497
13498    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpQuickAckResponse {
13499        type Borrowed<'a> = &'a Self;
13500        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13501            value
13502        }
13503    }
13504
13505    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpQuickAckResponse {
13506        type Owned = Self;
13507
13508        #[inline(always)]
13509        fn inline_align(_context: fidl::encoding::Context) -> usize {
13510            1
13511        }
13512
13513        #[inline(always)]
13514        fn inline_size(_context: fidl::encoding::Context) -> usize {
13515            1
13516        }
13517    }
13518
13519    unsafe impl<D: fidl::encoding::ResourceDialect>
13520        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D>
13521        for &StreamSocketGetTcpQuickAckResponse
13522    {
13523        #[inline]
13524        unsafe fn encode(
13525            self,
13526            encoder: &mut fidl::encoding::Encoder<'_, D>,
13527            offset: usize,
13528            _depth: fidl::encoding::Depth,
13529        ) -> fidl::Result<()> {
13530            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13531            // Delegate to tuple encoding.
13532            fidl::encoding::Encode::<StreamSocketGetTcpQuickAckResponse, D>::encode(
13533                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13534                encoder,
13535                offset,
13536                _depth,
13537            )
13538        }
13539    }
13540    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13541        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D> for (T0,)
13542    {
13543        #[inline]
13544        unsafe fn encode(
13545            self,
13546            encoder: &mut fidl::encoding::Encoder<'_, D>,
13547            offset: usize,
13548            depth: fidl::encoding::Depth,
13549        ) -> fidl::Result<()> {
13550            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13551            // Zero out padding regions. There's no need to apply masks
13552            // because the unmasked parts will be overwritten by fields.
13553            // Write the fields.
13554            self.0.encode(encoder, offset + 0, depth)?;
13555            Ok(())
13556        }
13557    }
13558
13559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13560        for StreamSocketGetTcpQuickAckResponse
13561    {
13562        #[inline(always)]
13563        fn new_empty() -> Self {
13564            Self { value: fidl::new_empty!(bool, D) }
13565        }
13566
13567        #[inline]
13568        unsafe fn decode(
13569            &mut self,
13570            decoder: &mut fidl::encoding::Decoder<'_, D>,
13571            offset: usize,
13572            _depth: fidl::encoding::Depth,
13573        ) -> fidl::Result<()> {
13574            decoder.debug_check_bounds::<Self>(offset);
13575            // Verify that padding bytes are zero.
13576            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13577            Ok(())
13578        }
13579    }
13580
13581    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpSynCountResponse {
13582        type Borrowed<'a> = &'a Self;
13583        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13584            value
13585        }
13586    }
13587
13588    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpSynCountResponse {
13589        type Owned = Self;
13590
13591        #[inline(always)]
13592        fn inline_align(_context: fidl::encoding::Context) -> usize {
13593            4
13594        }
13595
13596        #[inline(always)]
13597        fn inline_size(_context: fidl::encoding::Context) -> usize {
13598            4
13599        }
13600        #[inline(always)]
13601        fn encode_is_copy() -> bool {
13602            true
13603        }
13604
13605        #[inline(always)]
13606        fn decode_is_copy() -> bool {
13607            true
13608        }
13609    }
13610
13611    unsafe impl<D: fidl::encoding::ResourceDialect>
13612        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D>
13613        for &StreamSocketGetTcpSynCountResponse
13614    {
13615        #[inline]
13616        unsafe fn encode(
13617            self,
13618            encoder: &mut fidl::encoding::Encoder<'_, D>,
13619            offset: usize,
13620            _depth: fidl::encoding::Depth,
13621        ) -> fidl::Result<()> {
13622            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13623            unsafe {
13624                // Copy the object into the buffer.
13625                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13626                (buf_ptr as *mut StreamSocketGetTcpSynCountResponse)
13627                    .write_unaligned((self as *const StreamSocketGetTcpSynCountResponse).read());
13628                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13629                // done second because the memcpy will write garbage to these bytes.
13630            }
13631            Ok(())
13632        }
13633    }
13634    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13635        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D> for (T0,)
13636    {
13637        #[inline]
13638        unsafe fn encode(
13639            self,
13640            encoder: &mut fidl::encoding::Encoder<'_, D>,
13641            offset: usize,
13642            depth: fidl::encoding::Depth,
13643        ) -> fidl::Result<()> {
13644            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13645            // Zero out padding regions. There's no need to apply masks
13646            // because the unmasked parts will be overwritten by fields.
13647            // Write the fields.
13648            self.0.encode(encoder, offset + 0, depth)?;
13649            Ok(())
13650        }
13651    }
13652
13653    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13654        for StreamSocketGetTcpSynCountResponse
13655    {
13656        #[inline(always)]
13657        fn new_empty() -> Self {
13658            Self { value: fidl::new_empty!(u32, D) }
13659        }
13660
13661        #[inline]
13662        unsafe fn decode(
13663            &mut self,
13664            decoder: &mut fidl::encoding::Decoder<'_, D>,
13665            offset: usize,
13666            _depth: fidl::encoding::Depth,
13667        ) -> fidl::Result<()> {
13668            decoder.debug_check_bounds::<Self>(offset);
13669            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13670            // Verify that padding bytes are zero.
13671            // Copy from the buffer into the object.
13672            unsafe {
13673                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13674            }
13675            Ok(())
13676        }
13677    }
13678
13679    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13680        type Borrowed<'a> = &'a Self;
13681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13682            value
13683        }
13684    }
13685
13686    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13687        type Owned = Self;
13688
13689        #[inline(always)]
13690        fn inline_align(_context: fidl::encoding::Context) -> usize {
13691            4
13692        }
13693
13694        #[inline(always)]
13695        fn inline_size(_context: fidl::encoding::Context) -> usize {
13696            4
13697        }
13698        #[inline(always)]
13699        fn encode_is_copy() -> bool {
13700            true
13701        }
13702
13703        #[inline(always)]
13704        fn decode_is_copy() -> bool {
13705            true
13706        }
13707    }
13708
13709    unsafe impl<D: fidl::encoding::ResourceDialect>
13710        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D>
13711        for &StreamSocketGetTcpUserTimeoutResponse
13712    {
13713        #[inline]
13714        unsafe fn encode(
13715            self,
13716            encoder: &mut fidl::encoding::Encoder<'_, D>,
13717            offset: usize,
13718            _depth: fidl::encoding::Depth,
13719        ) -> fidl::Result<()> {
13720            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
13721            unsafe {
13722                // Copy the object into the buffer.
13723                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13724                (buf_ptr as *mut StreamSocketGetTcpUserTimeoutResponse)
13725                    .write_unaligned((self as *const StreamSocketGetTcpUserTimeoutResponse).read());
13726                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13727                // done second because the memcpy will write garbage to these bytes.
13728            }
13729            Ok(())
13730        }
13731    }
13732    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13733        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D> for (T0,)
13734    {
13735        #[inline]
13736        unsafe fn encode(
13737            self,
13738            encoder: &mut fidl::encoding::Encoder<'_, D>,
13739            offset: usize,
13740            depth: fidl::encoding::Depth,
13741        ) -> fidl::Result<()> {
13742            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
13743            // Zero out padding regions. There's no need to apply masks
13744            // because the unmasked parts will be overwritten by fields.
13745            // Write the fields.
13746            self.0.encode(encoder, offset + 0, depth)?;
13747            Ok(())
13748        }
13749    }
13750
13751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13752        for StreamSocketGetTcpUserTimeoutResponse
13753    {
13754        #[inline(always)]
13755        fn new_empty() -> Self {
13756            Self { value_millis: fidl::new_empty!(u32, D) }
13757        }
13758
13759        #[inline]
13760        unsafe fn decode(
13761            &mut self,
13762            decoder: &mut fidl::encoding::Decoder<'_, D>,
13763            offset: usize,
13764            _depth: fidl::encoding::Depth,
13765        ) -> fidl::Result<()> {
13766            decoder.debug_check_bounds::<Self>(offset);
13767            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13768            // Verify that padding bytes are zero.
13769            // Copy from the buffer into the object.
13770            unsafe {
13771                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13772            }
13773            Ok(())
13774        }
13775    }
13776
13777    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpWindowClampResponse {
13778        type Borrowed<'a> = &'a Self;
13779        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13780            value
13781        }
13782    }
13783
13784    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpWindowClampResponse {
13785        type Owned = Self;
13786
13787        #[inline(always)]
13788        fn inline_align(_context: fidl::encoding::Context) -> usize {
13789            4
13790        }
13791
13792        #[inline(always)]
13793        fn inline_size(_context: fidl::encoding::Context) -> usize {
13794            4
13795        }
13796        #[inline(always)]
13797        fn encode_is_copy() -> bool {
13798            true
13799        }
13800
13801        #[inline(always)]
13802        fn decode_is_copy() -> bool {
13803            true
13804        }
13805    }
13806
13807    unsafe impl<D: fidl::encoding::ResourceDialect>
13808        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D>
13809        for &StreamSocketGetTcpWindowClampResponse
13810    {
13811        #[inline]
13812        unsafe fn encode(
13813            self,
13814            encoder: &mut fidl::encoding::Encoder<'_, D>,
13815            offset: usize,
13816            _depth: fidl::encoding::Depth,
13817        ) -> fidl::Result<()> {
13818            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
13819            unsafe {
13820                // Copy the object into the buffer.
13821                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13822                (buf_ptr as *mut StreamSocketGetTcpWindowClampResponse)
13823                    .write_unaligned((self as *const StreamSocketGetTcpWindowClampResponse).read());
13824                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13825                // done second because the memcpy will write garbage to these bytes.
13826            }
13827            Ok(())
13828        }
13829    }
13830    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13831        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D> for (T0,)
13832    {
13833        #[inline]
13834        unsafe fn encode(
13835            self,
13836            encoder: &mut fidl::encoding::Encoder<'_, D>,
13837            offset: usize,
13838            depth: fidl::encoding::Depth,
13839        ) -> fidl::Result<()> {
13840            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
13841            // Zero out padding regions. There's no need to apply masks
13842            // because the unmasked parts will be overwritten by fields.
13843            // Write the fields.
13844            self.0.encode(encoder, offset + 0, depth)?;
13845            Ok(())
13846        }
13847    }
13848
13849    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13850        for StreamSocketGetTcpWindowClampResponse
13851    {
13852        #[inline(always)]
13853        fn new_empty() -> Self {
13854            Self { value: fidl::new_empty!(u32, D) }
13855        }
13856
13857        #[inline]
13858        unsafe fn decode(
13859            &mut self,
13860            decoder: &mut fidl::encoding::Decoder<'_, D>,
13861            offset: usize,
13862            _depth: fidl::encoding::Depth,
13863        ) -> fidl::Result<()> {
13864            decoder.debug_check_bounds::<Self>(offset);
13865            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13866            // Verify that padding bytes are zero.
13867            // Copy from the buffer into the object.
13868            unsafe {
13869                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13870            }
13871            Ok(())
13872        }
13873    }
13874
13875    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgRequest {
13876        type Borrowed<'a> = &'a Self;
13877        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13878            value
13879        }
13880    }
13881
13882    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgRequest {
13883        type Owned = Self;
13884
13885        #[inline(always)]
13886        fn inline_align(_context: fidl::encoding::Context) -> usize {
13887            4
13888        }
13889
13890        #[inline(always)]
13891        fn inline_size(_context: fidl::encoding::Context) -> usize {
13892            12
13893        }
13894    }
13895
13896    unsafe impl<D: fidl::encoding::ResourceDialect>
13897        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D>
13898        for &SynchronousDatagramSocketRecvMsgRequest
13899    {
13900        #[inline]
13901        unsafe fn encode(
13902            self,
13903            encoder: &mut fidl::encoding::Encoder<'_, D>,
13904            offset: usize,
13905            _depth: fidl::encoding::Depth,
13906        ) -> fidl::Result<()> {
13907            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
13908            // Delegate to tuple encoding.
13909            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgRequest, D>::encode(
13910                (
13911                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),
13912                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_len),
13913                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_control),
13914                    <RecvMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
13915                ),
13916                encoder,
13917                offset,
13918                _depth,
13919            )
13920        }
13921    }
13922    unsafe impl<
13923            D: fidl::encoding::ResourceDialect,
13924            T0: fidl::encoding::Encode<bool, D>,
13925            T1: fidl::encoding::Encode<u32, D>,
13926            T2: fidl::encoding::Encode<bool, D>,
13927            T3: fidl::encoding::Encode<RecvMsgFlags, D>,
13928        > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D> for (T0, T1, T2, T3)
13929    {
13930        #[inline]
13931        unsafe fn encode(
13932            self,
13933            encoder: &mut fidl::encoding::Encoder<'_, D>,
13934            offset: usize,
13935            depth: fidl::encoding::Depth,
13936        ) -> fidl::Result<()> {
13937            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
13938            // Zero out padding regions. There's no need to apply masks
13939            // because the unmasked parts will be overwritten by fields.
13940            unsafe {
13941                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
13942                (ptr as *mut u32).write_unaligned(0);
13943            }
13944            unsafe {
13945                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
13946                (ptr as *mut u32).write_unaligned(0);
13947            }
13948            // Write the fields.
13949            self.0.encode(encoder, offset + 0, depth)?;
13950            self.1.encode(encoder, offset + 4, depth)?;
13951            self.2.encode(encoder, offset + 8, depth)?;
13952            self.3.encode(encoder, offset + 10, depth)?;
13953            Ok(())
13954        }
13955    }
13956
13957    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13958        for SynchronousDatagramSocketRecvMsgRequest
13959    {
13960        #[inline(always)]
13961        fn new_empty() -> Self {
13962            Self {
13963                want_addr: fidl::new_empty!(bool, D),
13964                data_len: fidl::new_empty!(u32, D),
13965                want_control: fidl::new_empty!(bool, D),
13966                flags: fidl::new_empty!(RecvMsgFlags, D),
13967            }
13968        }
13969
13970        #[inline]
13971        unsafe fn decode(
13972            &mut self,
13973            decoder: &mut fidl::encoding::Decoder<'_, D>,
13974            offset: usize,
13975            _depth: fidl::encoding::Depth,
13976        ) -> fidl::Result<()> {
13977            decoder.debug_check_bounds::<Self>(offset);
13978            // Verify that padding bytes are zero.
13979            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
13980            let padval = unsafe { (ptr as *const u32).read_unaligned() };
13981            let mask = 0xffffff00u32;
13982            let maskedval = padval & mask;
13983            if maskedval != 0 {
13984                return Err(fidl::Error::NonZeroPadding {
13985                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
13986                });
13987            }
13988            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
13989            let padval = unsafe { (ptr as *const u32).read_unaligned() };
13990            let mask = 0xff00u32;
13991            let maskedval = padval & mask;
13992            if maskedval != 0 {
13993                return Err(fidl::Error::NonZeroPadding {
13994                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13995                });
13996            }
13997            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
13998            fidl::decode!(u32, D, &mut self.data_len, decoder, offset + 4, _depth)?;
13999            fidl::decode!(bool, D, &mut self.want_control, decoder, offset + 8, _depth)?;
14000            fidl::decode!(RecvMsgFlags, D, &mut self.flags, decoder, offset + 10, _depth)?;
14001            Ok(())
14002        }
14003    }
14004
14005    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgRequest {
14006        type Borrowed<'a> = &'a Self;
14007        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14008            value
14009        }
14010    }
14011
14012    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgRequest {
14013        type Owned = Self;
14014
14015        #[inline(always)]
14016        fn inline_align(_context: fidl::encoding::Context) -> usize {
14017            8
14018        }
14019
14020        #[inline(always)]
14021        fn inline_size(_context: fidl::encoding::Context) -> usize {
14022            56
14023        }
14024    }
14025
14026    unsafe impl<D: fidl::encoding::ResourceDialect>
14027        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D>
14028        for &SynchronousDatagramSocketSendMsgRequest
14029    {
14030        #[inline]
14031        unsafe fn encode(
14032            self,
14033            encoder: &mut fidl::encoding::Encoder<'_, D>,
14034            offset: usize,
14035            _depth: fidl::encoding::Depth,
14036        ) -> fidl::Result<()> {
14037            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14038            // Delegate to tuple encoding.
14039            fidl::encoding::Encode::<SynchronousDatagramSocketSendMsgRequest, D>::encode(
14040                (
14041                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14042                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14043                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14044                    <SendMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14045                ),
14046                encoder, offset, _depth
14047            )
14048        }
14049    }
14050    unsafe impl<
14051            D: fidl::encoding::ResourceDialect,
14052            T0: fidl::encoding::Encode<
14053                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14054                D,
14055            >,
14056            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14057            T2: fidl::encoding::Encode<DatagramSocketSendControlData, D>,
14058            T3: fidl::encoding::Encode<SendMsgFlags, D>,
14059        > fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D> for (T0, T1, T2, T3)
14060    {
14061        #[inline]
14062        unsafe fn encode(
14063            self,
14064            encoder: &mut fidl::encoding::Encoder<'_, D>,
14065            offset: usize,
14066            depth: fidl::encoding::Depth,
14067        ) -> fidl::Result<()> {
14068            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14069            // Zero out padding regions. There's no need to apply masks
14070            // because the unmasked parts will be overwritten by fields.
14071            unsafe {
14072                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14073                (ptr as *mut u64).write_unaligned(0);
14074            }
14075            // Write the fields.
14076            self.0.encode(encoder, offset + 0, depth)?;
14077            self.1.encode(encoder, offset + 16, depth)?;
14078            self.2.encode(encoder, offset + 32, depth)?;
14079            self.3.encode(encoder, offset + 48, depth)?;
14080            Ok(())
14081        }
14082    }
14083
14084    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14085        for SynchronousDatagramSocketSendMsgRequest
14086    {
14087        #[inline(always)]
14088        fn new_empty() -> Self {
14089            Self {
14090                addr: fidl::new_empty!(
14091                    fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14092                    D
14093                ),
14094                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14095                control: fidl::new_empty!(DatagramSocketSendControlData, D),
14096                flags: fidl::new_empty!(SendMsgFlags, D),
14097            }
14098        }
14099
14100        #[inline]
14101        unsafe fn decode(
14102            &mut self,
14103            decoder: &mut fidl::encoding::Decoder<'_, D>,
14104            offset: usize,
14105            _depth: fidl::encoding::Depth,
14106        ) -> fidl::Result<()> {
14107            decoder.debug_check_bounds::<Self>(offset);
14108            // Verify that padding bytes are zero.
14109            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14110            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14111            let mask = 0xffffffffffff0000u64;
14112            let maskedval = padval & mask;
14113            if maskedval != 0 {
14114                return Err(fidl::Error::NonZeroPadding {
14115                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14116                });
14117            }
14118            fidl::decode!(
14119                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14120                D,
14121                &mut self.addr,
14122                decoder,
14123                offset + 0,
14124                _depth
14125            )?;
14126            fidl::decode!(
14127                fidl::encoding::UnboundedVector<u8>,
14128                D,
14129                &mut self.data,
14130                decoder,
14131                offset + 16,
14132                _depth
14133            )?;
14134            fidl::decode!(
14135                DatagramSocketSendControlData,
14136                D,
14137                &mut self.control,
14138                decoder,
14139                offset + 32,
14140                _depth
14141            )?;
14142            fidl::decode!(SendMsgFlags, D, &mut self.flags, decoder, offset + 48, _depth)?;
14143            Ok(())
14144        }
14145    }
14146
14147    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14148        type Borrowed<'a> = &'a Self;
14149        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14150            value
14151        }
14152    }
14153
14154    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14155        type Owned = Self;
14156
14157        #[inline(always)]
14158        fn inline_align(_context: fidl::encoding::Context) -> usize {
14159            8
14160        }
14161
14162        #[inline(always)]
14163        fn inline_size(_context: fidl::encoding::Context) -> usize {
14164            56
14165        }
14166    }
14167
14168    unsafe impl<D: fidl::encoding::ResourceDialect>
14169        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D>
14170        for &SynchronousDatagramSocketRecvMsgResponse
14171    {
14172        #[inline]
14173        unsafe fn encode(
14174            self,
14175            encoder: &mut fidl::encoding::Encoder<'_, D>,
14176            offset: usize,
14177            _depth: fidl::encoding::Depth,
14178        ) -> fidl::Result<()> {
14179            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14180            // Delegate to tuple encoding.
14181            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgResponse, D>::encode(
14182                (
14183                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14184                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14185                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14186                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.truncated),
14187                ),
14188                encoder, offset, _depth
14189            )
14190        }
14191    }
14192    unsafe impl<
14193            D: fidl::encoding::ResourceDialect,
14194            T0: fidl::encoding::Encode<
14195                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14196                D,
14197            >,
14198            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14199            T2: fidl::encoding::Encode<DatagramSocketRecvControlData, D>,
14200            T3: fidl::encoding::Encode<u32, D>,
14201        > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D> for (T0, T1, T2, T3)
14202    {
14203        #[inline]
14204        unsafe fn encode(
14205            self,
14206            encoder: &mut fidl::encoding::Encoder<'_, D>,
14207            offset: usize,
14208            depth: fidl::encoding::Depth,
14209        ) -> fidl::Result<()> {
14210            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14211            // Zero out padding regions. There's no need to apply masks
14212            // because the unmasked parts will be overwritten by fields.
14213            unsafe {
14214                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14215                (ptr as *mut u64).write_unaligned(0);
14216            }
14217            // Write the fields.
14218            self.0.encode(encoder, offset + 0, depth)?;
14219            self.1.encode(encoder, offset + 16, depth)?;
14220            self.2.encode(encoder, offset + 32, depth)?;
14221            self.3.encode(encoder, offset + 48, depth)?;
14222            Ok(())
14223        }
14224    }
14225
14226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14227        for SynchronousDatagramSocketRecvMsgResponse
14228    {
14229        #[inline(always)]
14230        fn new_empty() -> Self {
14231            Self {
14232                addr: fidl::new_empty!(
14233                    fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14234                    D
14235                ),
14236                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14237                control: fidl::new_empty!(DatagramSocketRecvControlData, D),
14238                truncated: fidl::new_empty!(u32, D),
14239            }
14240        }
14241
14242        #[inline]
14243        unsafe fn decode(
14244            &mut self,
14245            decoder: &mut fidl::encoding::Decoder<'_, D>,
14246            offset: usize,
14247            _depth: fidl::encoding::Depth,
14248        ) -> fidl::Result<()> {
14249            decoder.debug_check_bounds::<Self>(offset);
14250            // Verify that padding bytes are zero.
14251            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14252            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14253            let mask = 0xffffffff00000000u64;
14254            let maskedval = padval & mask;
14255            if maskedval != 0 {
14256                return Err(fidl::Error::NonZeroPadding {
14257                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14258                });
14259            }
14260            fidl::decode!(
14261                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14262                D,
14263                &mut self.addr,
14264                decoder,
14265                offset + 0,
14266                _depth
14267            )?;
14268            fidl::decode!(
14269                fidl::encoding::UnboundedVector<u8>,
14270                D,
14271                &mut self.data,
14272                decoder,
14273                offset + 16,
14274                _depth
14275            )?;
14276            fidl::decode!(
14277                DatagramSocketRecvControlData,
14278                D,
14279                &mut self.control,
14280                decoder,
14281                offset + 32,
14282                _depth
14283            )?;
14284            fidl::decode!(u32, D, &mut self.truncated, decoder, offset + 48, _depth)?;
14285            Ok(())
14286        }
14287    }
14288
14289    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgResponse {
14290        type Borrowed<'a> = &'a Self;
14291        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14292            value
14293        }
14294    }
14295
14296    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgResponse {
14297        type Owned = Self;
14298
14299        #[inline(always)]
14300        fn inline_align(_context: fidl::encoding::Context) -> usize {
14301            8
14302        }
14303
14304        #[inline(always)]
14305        fn inline_size(_context: fidl::encoding::Context) -> usize {
14306            8
14307        }
14308        #[inline(always)]
14309        fn encode_is_copy() -> bool {
14310            true
14311        }
14312
14313        #[inline(always)]
14314        fn decode_is_copy() -> bool {
14315            true
14316        }
14317    }
14318
14319    unsafe impl<D: fidl::encoding::ResourceDialect>
14320        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D>
14321        for &SynchronousDatagramSocketSendMsgResponse
14322    {
14323        #[inline]
14324        unsafe fn encode(
14325            self,
14326            encoder: &mut fidl::encoding::Encoder<'_, D>,
14327            offset: usize,
14328            _depth: fidl::encoding::Depth,
14329        ) -> fidl::Result<()> {
14330            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14331            unsafe {
14332                // Copy the object into the buffer.
14333                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14334                (buf_ptr as *mut SynchronousDatagramSocketSendMsgResponse).write_unaligned(
14335                    (self as *const SynchronousDatagramSocketSendMsgResponse).read(),
14336                );
14337                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14338                // done second because the memcpy will write garbage to these bytes.
14339            }
14340            Ok(())
14341        }
14342    }
14343    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
14344        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D> for (T0,)
14345    {
14346        #[inline]
14347        unsafe fn encode(
14348            self,
14349            encoder: &mut fidl::encoding::Encoder<'_, D>,
14350            offset: usize,
14351            depth: fidl::encoding::Depth,
14352        ) -> fidl::Result<()> {
14353            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14354            // Zero out padding regions. There's no need to apply masks
14355            // because the unmasked parts will be overwritten by fields.
14356            // Write the fields.
14357            self.0.encode(encoder, offset + 0, depth)?;
14358            Ok(())
14359        }
14360    }
14361
14362    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14363        for SynchronousDatagramSocketSendMsgResponse
14364    {
14365        #[inline(always)]
14366        fn new_empty() -> Self {
14367            Self { len: fidl::new_empty!(i64, D) }
14368        }
14369
14370        #[inline]
14371        unsafe fn decode(
14372            &mut self,
14373            decoder: &mut fidl::encoding::Decoder<'_, D>,
14374            offset: usize,
14375            _depth: fidl::encoding::Depth,
14376        ) -> fidl::Result<()> {
14377            decoder.debug_check_bounds::<Self>(offset);
14378            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14379            // Verify that padding bytes are zero.
14380            // Copy from the buffer into the object.
14381            unsafe {
14382                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
14383            }
14384            Ok(())
14385        }
14386    }
14387
14388    impl fidl::encoding::ValueTypeMarker for Timestamp {
14389        type Borrowed<'a> = &'a Self;
14390        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14391            value
14392        }
14393    }
14394
14395    unsafe impl fidl::encoding::TypeMarker for Timestamp {
14396        type Owned = Self;
14397
14398        #[inline(always)]
14399        fn inline_align(_context: fidl::encoding::Context) -> usize {
14400            8
14401        }
14402
14403        #[inline(always)]
14404        fn inline_size(_context: fidl::encoding::Context) -> usize {
14405            16
14406        }
14407    }
14408
14409    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Timestamp, D>
14410        for &Timestamp
14411    {
14412        #[inline]
14413        unsafe fn encode(
14414            self,
14415            encoder: &mut fidl::encoding::Encoder<'_, D>,
14416            offset: usize,
14417            _depth: fidl::encoding::Depth,
14418        ) -> fidl::Result<()> {
14419            encoder.debug_check_bounds::<Timestamp>(offset);
14420            // Delegate to tuple encoding.
14421            fidl::encoding::Encode::<Timestamp, D>::encode(
14422                (
14423                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.nanoseconds),
14424                    <TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.requested),
14425                ),
14426                encoder,
14427                offset,
14428                _depth,
14429            )
14430        }
14431    }
14432    unsafe impl<
14433            D: fidl::encoding::ResourceDialect,
14434            T0: fidl::encoding::Encode<i64, D>,
14435            T1: fidl::encoding::Encode<TimestampOption, D>,
14436        > fidl::encoding::Encode<Timestamp, D> for (T0, T1)
14437    {
14438        #[inline]
14439        unsafe fn encode(
14440            self,
14441            encoder: &mut fidl::encoding::Encoder<'_, D>,
14442            offset: usize,
14443            depth: fidl::encoding::Depth,
14444        ) -> fidl::Result<()> {
14445            encoder.debug_check_bounds::<Timestamp>(offset);
14446            // Zero out padding regions. There's no need to apply masks
14447            // because the unmasked parts will be overwritten by fields.
14448            unsafe {
14449                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14450                (ptr as *mut u64).write_unaligned(0);
14451            }
14452            // Write the fields.
14453            self.0.encode(encoder, offset + 0, depth)?;
14454            self.1.encode(encoder, offset + 8, depth)?;
14455            Ok(())
14456        }
14457    }
14458
14459    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Timestamp {
14460        #[inline(always)]
14461        fn new_empty() -> Self {
14462            Self {
14463                nanoseconds: fidl::new_empty!(i64, D),
14464                requested: fidl::new_empty!(TimestampOption, D),
14465            }
14466        }
14467
14468        #[inline]
14469        unsafe fn decode(
14470            &mut self,
14471            decoder: &mut fidl::encoding::Decoder<'_, D>,
14472            offset: usize,
14473            _depth: fidl::encoding::Depth,
14474        ) -> fidl::Result<()> {
14475            decoder.debug_check_bounds::<Self>(offset);
14476            // Verify that padding bytes are zero.
14477            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14478            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14479            let mask = 0xffffffff00000000u64;
14480            let maskedval = padval & mask;
14481            if maskedval != 0 {
14482                return Err(fidl::Error::NonZeroPadding {
14483                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14484                });
14485            }
14486            fidl::decode!(i64, D, &mut self.nanoseconds, decoder, offset + 0, _depth)?;
14487            fidl::decode!(TimestampOption, D, &mut self.requested, decoder, offset + 8, _depth)?;
14488            Ok(())
14489        }
14490    }
14491
14492    impl DatagramSocketRecvControlData {
14493        #[inline(always)]
14494        fn max_ordinal_present(&self) -> u64 {
14495            if let Some(_) = self.network {
14496                return 1;
14497            }
14498            0
14499        }
14500    }
14501
14502    impl fidl::encoding::ValueTypeMarker for DatagramSocketRecvControlData {
14503        type Borrowed<'a> = &'a Self;
14504        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14505            value
14506        }
14507    }
14508
14509    unsafe impl fidl::encoding::TypeMarker for DatagramSocketRecvControlData {
14510        type Owned = Self;
14511
14512        #[inline(always)]
14513        fn inline_align(_context: fidl::encoding::Context) -> usize {
14514            8
14515        }
14516
14517        #[inline(always)]
14518        fn inline_size(_context: fidl::encoding::Context) -> usize {
14519            16
14520        }
14521    }
14522
14523    unsafe impl<D: fidl::encoding::ResourceDialect>
14524        fidl::encoding::Encode<DatagramSocketRecvControlData, D>
14525        for &DatagramSocketRecvControlData
14526    {
14527        unsafe fn encode(
14528            self,
14529            encoder: &mut fidl::encoding::Encoder<'_, D>,
14530            offset: usize,
14531            mut depth: fidl::encoding::Depth,
14532        ) -> fidl::Result<()> {
14533            encoder.debug_check_bounds::<DatagramSocketRecvControlData>(offset);
14534            // Vector header
14535            let max_ordinal: u64 = self.max_ordinal_present();
14536            encoder.write_num(max_ordinal, offset);
14537            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14538            // Calling encoder.out_of_line_offset(0) is not allowed.
14539            if max_ordinal == 0 {
14540                return Ok(());
14541            }
14542            depth.increment()?;
14543            let envelope_size = 8;
14544            let bytes_len = max_ordinal as usize * envelope_size;
14545            #[allow(unused_variables)]
14546            let offset = encoder.out_of_line_offset(bytes_len);
14547            let mut _prev_end_offset: usize = 0;
14548            if 1 > max_ordinal {
14549                return Ok(());
14550            }
14551
14552            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14553            // are envelope_size bytes.
14554            let cur_offset: usize = (1 - 1) * envelope_size;
14555
14556            // Zero reserved fields.
14557            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14558
14559            // Safety:
14560            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14561            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14562            //   envelope_size bytes, there is always sufficient room.
14563            fidl::encoding::encode_in_envelope_optional::<NetworkSocketRecvControlData, D>(
14564                self.network
14565                    .as_ref()
14566                    .map(<NetworkSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
14567                encoder,
14568                offset + cur_offset,
14569                depth,
14570            )?;
14571
14572            _prev_end_offset = cur_offset + envelope_size;
14573
14574            Ok(())
14575        }
14576    }
14577
14578    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14579        for DatagramSocketRecvControlData
14580    {
14581        #[inline(always)]
14582        fn new_empty() -> Self {
14583            Self::default()
14584        }
14585
14586        unsafe fn decode(
14587            &mut self,
14588            decoder: &mut fidl::encoding::Decoder<'_, D>,
14589            offset: usize,
14590            mut depth: fidl::encoding::Depth,
14591        ) -> fidl::Result<()> {
14592            decoder.debug_check_bounds::<Self>(offset);
14593            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14594                None => return Err(fidl::Error::NotNullable),
14595                Some(len) => len,
14596            };
14597            // Calling decoder.out_of_line_offset(0) is not allowed.
14598            if len == 0 {
14599                return Ok(());
14600            };
14601            depth.increment()?;
14602            let envelope_size = 8;
14603            let bytes_len = len * envelope_size;
14604            let offset = decoder.out_of_line_offset(bytes_len)?;
14605            // Decode the envelope for each type.
14606            let mut _next_ordinal_to_read = 0;
14607            let mut next_offset = offset;
14608            let end_offset = offset + bytes_len;
14609            _next_ordinal_to_read += 1;
14610            if next_offset >= end_offset {
14611                return Ok(());
14612            }
14613
14614            // Decode unknown envelopes for gaps in ordinals.
14615            while _next_ordinal_to_read < 1 {
14616                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14617                _next_ordinal_to_read += 1;
14618                next_offset += envelope_size;
14619            }
14620
14621            let next_out_of_line = decoder.next_out_of_line();
14622            let handles_before = decoder.remaining_handles();
14623            if let Some((inlined, num_bytes, num_handles)) =
14624                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14625            {
14626                let member_inline_size =
14627                    <NetworkSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
14628                        decoder.context,
14629                    );
14630                if inlined != (member_inline_size <= 4) {
14631                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14632                }
14633                let inner_offset;
14634                let mut inner_depth = depth.clone();
14635                if inlined {
14636                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14637                    inner_offset = next_offset;
14638                } else {
14639                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14640                    inner_depth.increment()?;
14641                }
14642                let val_ref = self
14643                    .network
14644                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketRecvControlData, D));
14645                fidl::decode!(
14646                    NetworkSocketRecvControlData,
14647                    D,
14648                    val_ref,
14649                    decoder,
14650                    inner_offset,
14651                    inner_depth
14652                )?;
14653                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14654                {
14655                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14656                }
14657                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14658                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14659                }
14660            }
14661
14662            next_offset += envelope_size;
14663
14664            // Decode the remaining unknown envelopes.
14665            while next_offset < end_offset {
14666                _next_ordinal_to_read += 1;
14667                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14668                next_offset += envelope_size;
14669            }
14670
14671            Ok(())
14672        }
14673    }
14674
14675    impl DatagramSocketSendControlData {
14676        #[inline(always)]
14677        fn max_ordinal_present(&self) -> u64 {
14678            if let Some(_) = self.network {
14679                return 1;
14680            }
14681            0
14682        }
14683    }
14684
14685    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendControlData {
14686        type Borrowed<'a> = &'a Self;
14687        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14688            value
14689        }
14690    }
14691
14692    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendControlData {
14693        type Owned = Self;
14694
14695        #[inline(always)]
14696        fn inline_align(_context: fidl::encoding::Context) -> usize {
14697            8
14698        }
14699
14700        #[inline(always)]
14701        fn inline_size(_context: fidl::encoding::Context) -> usize {
14702            16
14703        }
14704    }
14705
14706    unsafe impl<D: fidl::encoding::ResourceDialect>
14707        fidl::encoding::Encode<DatagramSocketSendControlData, D>
14708        for &DatagramSocketSendControlData
14709    {
14710        unsafe fn encode(
14711            self,
14712            encoder: &mut fidl::encoding::Encoder<'_, D>,
14713            offset: usize,
14714            mut depth: fidl::encoding::Depth,
14715        ) -> fidl::Result<()> {
14716            encoder.debug_check_bounds::<DatagramSocketSendControlData>(offset);
14717            // Vector header
14718            let max_ordinal: u64 = self.max_ordinal_present();
14719            encoder.write_num(max_ordinal, offset);
14720            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14721            // Calling encoder.out_of_line_offset(0) is not allowed.
14722            if max_ordinal == 0 {
14723                return Ok(());
14724            }
14725            depth.increment()?;
14726            let envelope_size = 8;
14727            let bytes_len = max_ordinal as usize * envelope_size;
14728            #[allow(unused_variables)]
14729            let offset = encoder.out_of_line_offset(bytes_len);
14730            let mut _prev_end_offset: usize = 0;
14731            if 1 > max_ordinal {
14732                return Ok(());
14733            }
14734
14735            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14736            // are envelope_size bytes.
14737            let cur_offset: usize = (1 - 1) * envelope_size;
14738
14739            // Zero reserved fields.
14740            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14741
14742            // Safety:
14743            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14744            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14745            //   envelope_size bytes, there is always sufficient room.
14746            fidl::encoding::encode_in_envelope_optional::<NetworkSocketSendControlData, D>(
14747                self.network
14748                    .as_ref()
14749                    .map(<NetworkSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
14750                encoder,
14751                offset + cur_offset,
14752                depth,
14753            )?;
14754
14755            _prev_end_offset = cur_offset + envelope_size;
14756
14757            Ok(())
14758        }
14759    }
14760
14761    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14762        for DatagramSocketSendControlData
14763    {
14764        #[inline(always)]
14765        fn new_empty() -> Self {
14766            Self::default()
14767        }
14768
14769        unsafe fn decode(
14770            &mut self,
14771            decoder: &mut fidl::encoding::Decoder<'_, D>,
14772            offset: usize,
14773            mut depth: fidl::encoding::Depth,
14774        ) -> fidl::Result<()> {
14775            decoder.debug_check_bounds::<Self>(offset);
14776            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14777                None => return Err(fidl::Error::NotNullable),
14778                Some(len) => len,
14779            };
14780            // Calling decoder.out_of_line_offset(0) is not allowed.
14781            if len == 0 {
14782                return Ok(());
14783            };
14784            depth.increment()?;
14785            let envelope_size = 8;
14786            let bytes_len = len * envelope_size;
14787            let offset = decoder.out_of_line_offset(bytes_len)?;
14788            // Decode the envelope for each type.
14789            let mut _next_ordinal_to_read = 0;
14790            let mut next_offset = offset;
14791            let end_offset = offset + bytes_len;
14792            _next_ordinal_to_read += 1;
14793            if next_offset >= end_offset {
14794                return Ok(());
14795            }
14796
14797            // Decode unknown envelopes for gaps in ordinals.
14798            while _next_ordinal_to_read < 1 {
14799                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14800                _next_ordinal_to_read += 1;
14801                next_offset += envelope_size;
14802            }
14803
14804            let next_out_of_line = decoder.next_out_of_line();
14805            let handles_before = decoder.remaining_handles();
14806            if let Some((inlined, num_bytes, num_handles)) =
14807                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14808            {
14809                let member_inline_size =
14810                    <NetworkSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
14811                        decoder.context,
14812                    );
14813                if inlined != (member_inline_size <= 4) {
14814                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14815                }
14816                let inner_offset;
14817                let mut inner_depth = depth.clone();
14818                if inlined {
14819                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14820                    inner_offset = next_offset;
14821                } else {
14822                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14823                    inner_depth.increment()?;
14824                }
14825                let val_ref = self
14826                    .network
14827                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketSendControlData, D));
14828                fidl::decode!(
14829                    NetworkSocketSendControlData,
14830                    D,
14831                    val_ref,
14832                    decoder,
14833                    inner_offset,
14834                    inner_depth
14835                )?;
14836                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14837                {
14838                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14839                }
14840                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14841                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14842                }
14843            }
14844
14845            next_offset += envelope_size;
14846
14847            // Decode the remaining unknown envelopes.
14848            while next_offset < end_offset {
14849                _next_ordinal_to_read += 1;
14850                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14851                next_offset += envelope_size;
14852            }
14853
14854            Ok(())
14855        }
14856    }
14857
14858    impl DatagramSocketSendMsgPreflightRequest {
14859        #[inline(always)]
14860        fn max_ordinal_present(&self) -> u64 {
14861            if let Some(_) = self.ipv6_pktinfo {
14862                return 2;
14863            }
14864            if let Some(_) = self.to {
14865                return 1;
14866            }
14867            0
14868        }
14869    }
14870
14871    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendMsgPreflightRequest {
14872        type Borrowed<'a> = &'a Self;
14873        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14874            value
14875        }
14876    }
14877
14878    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendMsgPreflightRequest {
14879        type Owned = Self;
14880
14881        #[inline(always)]
14882        fn inline_align(_context: fidl::encoding::Context) -> usize {
14883            8
14884        }
14885
14886        #[inline(always)]
14887        fn inline_size(_context: fidl::encoding::Context) -> usize {
14888            16
14889        }
14890    }
14891
14892    unsafe impl<D: fidl::encoding::ResourceDialect>
14893        fidl::encoding::Encode<DatagramSocketSendMsgPreflightRequest, D>
14894        for &DatagramSocketSendMsgPreflightRequest
14895    {
14896        unsafe fn encode(
14897            self,
14898            encoder: &mut fidl::encoding::Encoder<'_, D>,
14899            offset: usize,
14900            mut depth: fidl::encoding::Depth,
14901        ) -> fidl::Result<()> {
14902            encoder.debug_check_bounds::<DatagramSocketSendMsgPreflightRequest>(offset);
14903            // Vector header
14904            let max_ordinal: u64 = self.max_ordinal_present();
14905            encoder.write_num(max_ordinal, offset);
14906            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14907            // Calling encoder.out_of_line_offset(0) is not allowed.
14908            if max_ordinal == 0 {
14909                return Ok(());
14910            }
14911            depth.increment()?;
14912            let envelope_size = 8;
14913            let bytes_len = max_ordinal as usize * envelope_size;
14914            #[allow(unused_variables)]
14915            let offset = encoder.out_of_line_offset(bytes_len);
14916            let mut _prev_end_offset: usize = 0;
14917            if 1 > max_ordinal {
14918                return Ok(());
14919            }
14920
14921            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14922            // are envelope_size bytes.
14923            let cur_offset: usize = (1 - 1) * envelope_size;
14924
14925            // Zero reserved fields.
14926            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14927
14928            // Safety:
14929            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14930            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14931            //   envelope_size bytes, there is always sufficient room.
14932            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
14933            self.to.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
14934            encoder, offset + cur_offset, depth
14935        )?;
14936
14937            _prev_end_offset = cur_offset + envelope_size;
14938            if 2 > max_ordinal {
14939                return Ok(());
14940            }
14941
14942            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14943            // are envelope_size bytes.
14944            let cur_offset: usize = (2 - 1) * envelope_size;
14945
14946            // Zero reserved fields.
14947            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14948
14949            // Safety:
14950            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14951            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14952            //   envelope_size bytes, there is always sufficient room.
14953            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
14954                self.ipv6_pktinfo
14955                    .as_ref()
14956                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
14957                encoder,
14958                offset + cur_offset,
14959                depth,
14960            )?;
14961
14962            _prev_end_offset = cur_offset + envelope_size;
14963
14964            Ok(())
14965        }
14966    }
14967
14968    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14969        for DatagramSocketSendMsgPreflightRequest
14970    {
14971        #[inline(always)]
14972        fn new_empty() -> Self {
14973            Self::default()
14974        }
14975
14976        unsafe fn decode(
14977            &mut self,
14978            decoder: &mut fidl::encoding::Decoder<'_, D>,
14979            offset: usize,
14980            mut depth: fidl::encoding::Depth,
14981        ) -> fidl::Result<()> {
14982            decoder.debug_check_bounds::<Self>(offset);
14983            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14984                None => return Err(fidl::Error::NotNullable),
14985                Some(len) => len,
14986            };
14987            // Calling decoder.out_of_line_offset(0) is not allowed.
14988            if len == 0 {
14989                return Ok(());
14990            };
14991            depth.increment()?;
14992            let envelope_size = 8;
14993            let bytes_len = len * envelope_size;
14994            let offset = decoder.out_of_line_offset(bytes_len)?;
14995            // Decode the envelope for each type.
14996            let mut _next_ordinal_to_read = 0;
14997            let mut next_offset = offset;
14998            let end_offset = offset + bytes_len;
14999            _next_ordinal_to_read += 1;
15000            if next_offset >= end_offset {
15001                return Ok(());
15002            }
15003
15004            // Decode unknown envelopes for gaps in ordinals.
15005            while _next_ordinal_to_read < 1 {
15006                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15007                _next_ordinal_to_read += 1;
15008                next_offset += envelope_size;
15009            }
15010
15011            let next_out_of_line = decoder.next_out_of_line();
15012            let handles_before = decoder.remaining_handles();
15013            if let Some((inlined, num_bytes, num_handles)) =
15014                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15015            {
15016                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15017                if inlined != (member_inline_size <= 4) {
15018                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15019                }
15020                let inner_offset;
15021                let mut inner_depth = depth.clone();
15022                if inlined {
15023                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15024                    inner_offset = next_offset;
15025                } else {
15026                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15027                    inner_depth.increment()?;
15028                }
15029                let val_ref = self.to.get_or_insert_with(|| {
15030                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
15031                });
15032                fidl::decode!(
15033                    fidl_fuchsia_net__common::SocketAddress,
15034                    D,
15035                    val_ref,
15036                    decoder,
15037                    inner_offset,
15038                    inner_depth
15039                )?;
15040                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15041                {
15042                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15043                }
15044                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15045                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15046                }
15047            }
15048
15049            next_offset += envelope_size;
15050            _next_ordinal_to_read += 1;
15051            if next_offset >= end_offset {
15052                return Ok(());
15053            }
15054
15055            // Decode unknown envelopes for gaps in ordinals.
15056            while _next_ordinal_to_read < 2 {
15057                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15058                _next_ordinal_to_read += 1;
15059                next_offset += envelope_size;
15060            }
15061
15062            let next_out_of_line = decoder.next_out_of_line();
15063            let handles_before = decoder.remaining_handles();
15064            if let Some((inlined, num_bytes, num_handles)) =
15065                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15066            {
15067                let member_inline_size =
15068                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
15069                        decoder.context,
15070                    );
15071                if inlined != (member_inline_size <= 4) {
15072                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15073                }
15074                let inner_offset;
15075                let mut inner_depth = depth.clone();
15076                if inlined {
15077                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15078                    inner_offset = next_offset;
15079                } else {
15080                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15081                    inner_depth.increment()?;
15082                }
15083                let val_ref = self
15084                    .ipv6_pktinfo
15085                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
15086                fidl::decode!(
15087                    Ipv6PktInfoSendControlData,
15088                    D,
15089                    val_ref,
15090                    decoder,
15091                    inner_offset,
15092                    inner_depth
15093                )?;
15094                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15095                {
15096                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15097                }
15098                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15099                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15100                }
15101            }
15102
15103            next_offset += envelope_size;
15104
15105            // Decode the remaining unknown envelopes.
15106            while next_offset < end_offset {
15107                _next_ordinal_to_read += 1;
15108                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15109                next_offset += envelope_size;
15110            }
15111
15112            Ok(())
15113        }
15114    }
15115
15116    impl InterfaceAddresses {
15117        #[inline(always)]
15118        fn max_ordinal_present(&self) -> u64 {
15119            if let Some(_) = self.interface_flags {
15120                return 5;
15121            }
15122            if let Some(_) = self.addresses {
15123                return 4;
15124            }
15125            if let Some(_) = self.name {
15126                return 2;
15127            }
15128            if let Some(_) = self.id {
15129                return 1;
15130            }
15131            0
15132        }
15133    }
15134
15135    impl fidl::encoding::ValueTypeMarker for InterfaceAddresses {
15136        type Borrowed<'a> = &'a Self;
15137        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15138            value
15139        }
15140    }
15141
15142    unsafe impl fidl::encoding::TypeMarker for InterfaceAddresses {
15143        type Owned = Self;
15144
15145        #[inline(always)]
15146        fn inline_align(_context: fidl::encoding::Context) -> usize {
15147            8
15148        }
15149
15150        #[inline(always)]
15151        fn inline_size(_context: fidl::encoding::Context) -> usize {
15152            16
15153        }
15154    }
15155
15156    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterfaceAddresses, D>
15157        for &InterfaceAddresses
15158    {
15159        unsafe fn encode(
15160            self,
15161            encoder: &mut fidl::encoding::Encoder<'_, D>,
15162            offset: usize,
15163            mut depth: fidl::encoding::Depth,
15164        ) -> fidl::Result<()> {
15165            encoder.debug_check_bounds::<InterfaceAddresses>(offset);
15166            // Vector header
15167            let max_ordinal: u64 = self.max_ordinal_present();
15168            encoder.write_num(max_ordinal, offset);
15169            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15170            // Calling encoder.out_of_line_offset(0) is not allowed.
15171            if max_ordinal == 0 {
15172                return Ok(());
15173            }
15174            depth.increment()?;
15175            let envelope_size = 8;
15176            let bytes_len = max_ordinal as usize * envelope_size;
15177            #[allow(unused_variables)]
15178            let offset = encoder.out_of_line_offset(bytes_len);
15179            let mut _prev_end_offset: usize = 0;
15180            if 1 > max_ordinal {
15181                return Ok(());
15182            }
15183
15184            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15185            // are envelope_size bytes.
15186            let cur_offset: usize = (1 - 1) * envelope_size;
15187
15188            // Zero reserved fields.
15189            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15190
15191            // Safety:
15192            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15193            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15194            //   envelope_size bytes, there is always sufficient room.
15195            fidl::encoding::encode_in_envelope_optional::<u64, D>(
15196                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15197                encoder,
15198                offset + cur_offset,
15199                depth,
15200            )?;
15201
15202            _prev_end_offset = cur_offset + envelope_size;
15203            if 2 > max_ordinal {
15204                return Ok(());
15205            }
15206
15207            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15208            // are envelope_size bytes.
15209            let cur_offset: usize = (2 - 1) * envelope_size;
15210
15211            // Zero reserved fields.
15212            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15213
15214            // Safety:
15215            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15216            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15217            //   envelope_size bytes, there is always sufficient room.
15218            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
15219                self.name.as_ref().map(
15220                    <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow,
15221                ),
15222                encoder,
15223                offset + cur_offset,
15224                depth,
15225            )?;
15226
15227            _prev_end_offset = cur_offset + envelope_size;
15228            if 4 > max_ordinal {
15229                return Ok(());
15230            }
15231
15232            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15233            // are envelope_size bytes.
15234            let cur_offset: usize = (4 - 1) * envelope_size;
15235
15236            // Zero reserved fields.
15237            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15238
15239            // Safety:
15240            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15241            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15242            //   envelope_size bytes, there is always sufficient room.
15243            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet>, D>(
15244            self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
15245            encoder, offset + cur_offset, depth
15246        )?;
15247
15248            _prev_end_offset = cur_offset + envelope_size;
15249            if 5 > max_ordinal {
15250                return Ok(());
15251            }
15252
15253            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15254            // are envelope_size bytes.
15255            let cur_offset: usize = (5 - 1) * envelope_size;
15256
15257            // Zero reserved fields.
15258            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15259
15260            // Safety:
15261            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15262            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15263            //   envelope_size bytes, there is always sufficient room.
15264            fidl::encoding::encode_in_envelope_optional::<InterfaceFlags, D>(
15265                self.interface_flags
15266                    .as_ref()
15267                    .map(<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow),
15268                encoder,
15269                offset + cur_offset,
15270                depth,
15271            )?;
15272
15273            _prev_end_offset = cur_offset + envelope_size;
15274
15275            Ok(())
15276        }
15277    }
15278
15279    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceAddresses {
15280        #[inline(always)]
15281        fn new_empty() -> Self {
15282            Self::default()
15283        }
15284
15285        unsafe fn decode(
15286            &mut self,
15287            decoder: &mut fidl::encoding::Decoder<'_, D>,
15288            offset: usize,
15289            mut depth: fidl::encoding::Depth,
15290        ) -> fidl::Result<()> {
15291            decoder.debug_check_bounds::<Self>(offset);
15292            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15293                None => return Err(fidl::Error::NotNullable),
15294                Some(len) => len,
15295            };
15296            // Calling decoder.out_of_line_offset(0) is not allowed.
15297            if len == 0 {
15298                return Ok(());
15299            };
15300            depth.increment()?;
15301            let envelope_size = 8;
15302            let bytes_len = len * envelope_size;
15303            let offset = decoder.out_of_line_offset(bytes_len)?;
15304            // Decode the envelope for each type.
15305            let mut _next_ordinal_to_read = 0;
15306            let mut next_offset = offset;
15307            let end_offset = offset + bytes_len;
15308            _next_ordinal_to_read += 1;
15309            if next_offset >= end_offset {
15310                return Ok(());
15311            }
15312
15313            // Decode unknown envelopes for gaps in ordinals.
15314            while _next_ordinal_to_read < 1 {
15315                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15316                _next_ordinal_to_read += 1;
15317                next_offset += envelope_size;
15318            }
15319
15320            let next_out_of_line = decoder.next_out_of_line();
15321            let handles_before = decoder.remaining_handles();
15322            if let Some((inlined, num_bytes, num_handles)) =
15323                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15324            {
15325                let member_inline_size =
15326                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15327                if inlined != (member_inline_size <= 4) {
15328                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15329                }
15330                let inner_offset;
15331                let mut inner_depth = depth.clone();
15332                if inlined {
15333                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15334                    inner_offset = next_offset;
15335                } else {
15336                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15337                    inner_depth.increment()?;
15338                }
15339                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
15340                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15341                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15342                {
15343                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15344                }
15345                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15346                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15347                }
15348            }
15349
15350            next_offset += envelope_size;
15351            _next_ordinal_to_read += 1;
15352            if next_offset >= end_offset {
15353                return Ok(());
15354            }
15355
15356            // Decode unknown envelopes for gaps in ordinals.
15357            while _next_ordinal_to_read < 2 {
15358                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15359                _next_ordinal_to_read += 1;
15360                next_offset += envelope_size;
15361            }
15362
15363            let next_out_of_line = decoder.next_out_of_line();
15364            let handles_before = decoder.remaining_handles();
15365            if let Some((inlined, num_bytes, num_handles)) =
15366                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15367            {
15368                let member_inline_size =
15369                    <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
15370                        decoder.context,
15371                    );
15372                if inlined != (member_inline_size <= 4) {
15373                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15374                }
15375                let inner_offset;
15376                let mut inner_depth = depth.clone();
15377                if inlined {
15378                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15379                    inner_offset = next_offset;
15380                } else {
15381                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15382                    inner_depth.increment()?;
15383                }
15384                let val_ref = self
15385                    .name
15386                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
15387                fidl::decode!(
15388                    fidl::encoding::BoundedString<15>,
15389                    D,
15390                    val_ref,
15391                    decoder,
15392                    inner_offset,
15393                    inner_depth
15394                )?;
15395                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15396                {
15397                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15398                }
15399                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15400                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15401                }
15402            }
15403
15404            next_offset += envelope_size;
15405            _next_ordinal_to_read += 1;
15406            if next_offset >= end_offset {
15407                return Ok(());
15408            }
15409
15410            // Decode unknown envelopes for gaps in ordinals.
15411            while _next_ordinal_to_read < 4 {
15412                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15413                _next_ordinal_to_read += 1;
15414                next_offset += envelope_size;
15415            }
15416
15417            let next_out_of_line = decoder.next_out_of_line();
15418            let handles_before = decoder.remaining_handles();
15419            if let Some((inlined, num_bytes, num_handles)) =
15420                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15421            {
15422                let member_inline_size = <fidl::encoding::UnboundedVector<
15423                    fidl_fuchsia_net__common::Subnet,
15424                > as fidl::encoding::TypeMarker>::inline_size(
15425                    decoder.context
15426                );
15427                if inlined != (member_inline_size <= 4) {
15428                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15429                }
15430                let inner_offset;
15431                let mut inner_depth = depth.clone();
15432                if inlined {
15433                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15434                    inner_offset = next_offset;
15435                } else {
15436                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15437                    inner_depth.increment()?;
15438                }
15439                let val_ref = self.addresses.get_or_insert_with(|| {
15440                    fidl::new_empty!(
15441                        fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet>,
15442                        D
15443                    )
15444                });
15445                fidl::decode!(
15446                    fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet>,
15447                    D,
15448                    val_ref,
15449                    decoder,
15450                    inner_offset,
15451                    inner_depth
15452                )?;
15453                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15454                {
15455                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15456                }
15457                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15458                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15459                }
15460            }
15461
15462            next_offset += envelope_size;
15463            _next_ordinal_to_read += 1;
15464            if next_offset >= end_offset {
15465                return Ok(());
15466            }
15467
15468            // Decode unknown envelopes for gaps in ordinals.
15469            while _next_ordinal_to_read < 5 {
15470                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15471                _next_ordinal_to_read += 1;
15472                next_offset += envelope_size;
15473            }
15474
15475            let next_out_of_line = decoder.next_out_of_line();
15476            let handles_before = decoder.remaining_handles();
15477            if let Some((inlined, num_bytes, num_handles)) =
15478                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15479            {
15480                let member_inline_size =
15481                    <InterfaceFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15482                if inlined != (member_inline_size <= 4) {
15483                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15484                }
15485                let inner_offset;
15486                let mut inner_depth = depth.clone();
15487                if inlined {
15488                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15489                    inner_offset = next_offset;
15490                } else {
15491                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15492                    inner_depth.increment()?;
15493                }
15494                let val_ref =
15495                    self.interface_flags.get_or_insert_with(|| fidl::new_empty!(InterfaceFlags, D));
15496                fidl::decode!(InterfaceFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
15497                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15498                {
15499                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15500                }
15501                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15502                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15503                }
15504            }
15505
15506            next_offset += envelope_size;
15507
15508            // Decode the remaining unknown envelopes.
15509            while next_offset < end_offset {
15510                _next_ordinal_to_read += 1;
15511                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15512                next_offset += envelope_size;
15513            }
15514
15515            Ok(())
15516        }
15517    }
15518
15519    impl IpRecvControlData {
15520        #[inline(always)]
15521        fn max_ordinal_present(&self) -> u64 {
15522            if let Some(_) = self.original_destination_address {
15523                return 3;
15524            }
15525            if let Some(_) = self.ttl {
15526                return 2;
15527            }
15528            if let Some(_) = self.tos {
15529                return 1;
15530            }
15531            0
15532        }
15533    }
15534
15535    impl fidl::encoding::ValueTypeMarker for IpRecvControlData {
15536        type Borrowed<'a> = &'a Self;
15537        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15538            value
15539        }
15540    }
15541
15542    unsafe impl fidl::encoding::TypeMarker for IpRecvControlData {
15543        type Owned = Self;
15544
15545        #[inline(always)]
15546        fn inline_align(_context: fidl::encoding::Context) -> usize {
15547            8
15548        }
15549
15550        #[inline(always)]
15551        fn inline_size(_context: fidl::encoding::Context) -> usize {
15552            16
15553        }
15554    }
15555
15556    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpRecvControlData, D>
15557        for &IpRecvControlData
15558    {
15559        unsafe fn encode(
15560            self,
15561            encoder: &mut fidl::encoding::Encoder<'_, D>,
15562            offset: usize,
15563            mut depth: fidl::encoding::Depth,
15564        ) -> fidl::Result<()> {
15565            encoder.debug_check_bounds::<IpRecvControlData>(offset);
15566            // Vector header
15567            let max_ordinal: u64 = self.max_ordinal_present();
15568            encoder.write_num(max_ordinal, offset);
15569            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15570            // Calling encoder.out_of_line_offset(0) is not allowed.
15571            if max_ordinal == 0 {
15572                return Ok(());
15573            }
15574            depth.increment()?;
15575            let envelope_size = 8;
15576            let bytes_len = max_ordinal as usize * envelope_size;
15577            #[allow(unused_variables)]
15578            let offset = encoder.out_of_line_offset(bytes_len);
15579            let mut _prev_end_offset: usize = 0;
15580            if 1 > max_ordinal {
15581                return Ok(());
15582            }
15583
15584            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15585            // are envelope_size bytes.
15586            let cur_offset: usize = (1 - 1) * envelope_size;
15587
15588            // Zero reserved fields.
15589            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15590
15591            // Safety:
15592            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15593            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15594            //   envelope_size bytes, there is always sufficient room.
15595            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15596                self.tos.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15597                encoder,
15598                offset + cur_offset,
15599                depth,
15600            )?;
15601
15602            _prev_end_offset = cur_offset + envelope_size;
15603            if 2 > max_ordinal {
15604                return Ok(());
15605            }
15606
15607            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15608            // are envelope_size bytes.
15609            let cur_offset: usize = (2 - 1) * envelope_size;
15610
15611            // Zero reserved fields.
15612            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15613
15614            // Safety:
15615            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15616            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15617            //   envelope_size bytes, there is always sufficient room.
15618            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15619                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15620                encoder,
15621                offset + cur_offset,
15622                depth,
15623            )?;
15624
15625            _prev_end_offset = cur_offset + envelope_size;
15626            if 3 > max_ordinal {
15627                return Ok(());
15628            }
15629
15630            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15631            // are envelope_size bytes.
15632            let cur_offset: usize = (3 - 1) * envelope_size;
15633
15634            // Zero reserved fields.
15635            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15636
15637            // Safety:
15638            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15639            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15640            //   envelope_size bytes, there is always sufficient room.
15641            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
15642            self.original_destination_address.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
15643            encoder, offset + cur_offset, depth
15644        )?;
15645
15646            _prev_end_offset = cur_offset + envelope_size;
15647
15648            Ok(())
15649        }
15650    }
15651
15652    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpRecvControlData {
15653        #[inline(always)]
15654        fn new_empty() -> Self {
15655            Self::default()
15656        }
15657
15658        unsafe fn decode(
15659            &mut self,
15660            decoder: &mut fidl::encoding::Decoder<'_, D>,
15661            offset: usize,
15662            mut depth: fidl::encoding::Depth,
15663        ) -> fidl::Result<()> {
15664            decoder.debug_check_bounds::<Self>(offset);
15665            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15666                None => return Err(fidl::Error::NotNullable),
15667                Some(len) => len,
15668            };
15669            // Calling decoder.out_of_line_offset(0) is not allowed.
15670            if len == 0 {
15671                return Ok(());
15672            };
15673            depth.increment()?;
15674            let envelope_size = 8;
15675            let bytes_len = len * envelope_size;
15676            let offset = decoder.out_of_line_offset(bytes_len)?;
15677            // Decode the envelope for each type.
15678            let mut _next_ordinal_to_read = 0;
15679            let mut next_offset = offset;
15680            let end_offset = offset + bytes_len;
15681            _next_ordinal_to_read += 1;
15682            if next_offset >= end_offset {
15683                return Ok(());
15684            }
15685
15686            // Decode unknown envelopes for gaps in ordinals.
15687            while _next_ordinal_to_read < 1 {
15688                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15689                _next_ordinal_to_read += 1;
15690                next_offset += envelope_size;
15691            }
15692
15693            let next_out_of_line = decoder.next_out_of_line();
15694            let handles_before = decoder.remaining_handles();
15695            if let Some((inlined, num_bytes, num_handles)) =
15696                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15697            {
15698                let member_inline_size =
15699                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15700                if inlined != (member_inline_size <= 4) {
15701                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15702                }
15703                let inner_offset;
15704                let mut inner_depth = depth.clone();
15705                if inlined {
15706                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15707                    inner_offset = next_offset;
15708                } else {
15709                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15710                    inner_depth.increment()?;
15711                }
15712                let val_ref = self.tos.get_or_insert_with(|| fidl::new_empty!(u8, D));
15713                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15714                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15715                {
15716                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15717                }
15718                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15719                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15720                }
15721            }
15722
15723            next_offset += envelope_size;
15724            _next_ordinal_to_read += 1;
15725            if next_offset >= end_offset {
15726                return Ok(());
15727            }
15728
15729            // Decode unknown envelopes for gaps in ordinals.
15730            while _next_ordinal_to_read < 2 {
15731                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15732                _next_ordinal_to_read += 1;
15733                next_offset += envelope_size;
15734            }
15735
15736            let next_out_of_line = decoder.next_out_of_line();
15737            let handles_before = decoder.remaining_handles();
15738            if let Some((inlined, num_bytes, num_handles)) =
15739                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15740            {
15741                let member_inline_size =
15742                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15743                if inlined != (member_inline_size <= 4) {
15744                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15745                }
15746                let inner_offset;
15747                let mut inner_depth = depth.clone();
15748                if inlined {
15749                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15750                    inner_offset = next_offset;
15751                } else {
15752                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15753                    inner_depth.increment()?;
15754                }
15755                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
15756                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15757                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15758                {
15759                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15760                }
15761                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15762                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15763                }
15764            }
15765
15766            next_offset += envelope_size;
15767            _next_ordinal_to_read += 1;
15768            if next_offset >= end_offset {
15769                return Ok(());
15770            }
15771
15772            // Decode unknown envelopes for gaps in ordinals.
15773            while _next_ordinal_to_read < 3 {
15774                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15775                _next_ordinal_to_read += 1;
15776                next_offset += envelope_size;
15777            }
15778
15779            let next_out_of_line = decoder.next_out_of_line();
15780            let handles_before = decoder.remaining_handles();
15781            if let Some((inlined, num_bytes, num_handles)) =
15782                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15783            {
15784                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15785                if inlined != (member_inline_size <= 4) {
15786                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15787                }
15788                let inner_offset;
15789                let mut inner_depth = depth.clone();
15790                if inlined {
15791                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15792                    inner_offset = next_offset;
15793                } else {
15794                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15795                    inner_depth.increment()?;
15796                }
15797                let val_ref = self.original_destination_address.get_or_insert_with(|| {
15798                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
15799                });
15800                fidl::decode!(
15801                    fidl_fuchsia_net__common::SocketAddress,
15802                    D,
15803                    val_ref,
15804                    decoder,
15805                    inner_offset,
15806                    inner_depth
15807                )?;
15808                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15809                {
15810                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15811                }
15812                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15813                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15814                }
15815            }
15816
15817            next_offset += envelope_size;
15818
15819            // Decode the remaining unknown envelopes.
15820            while next_offset < end_offset {
15821                _next_ordinal_to_read += 1;
15822                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15823                next_offset += envelope_size;
15824            }
15825
15826            Ok(())
15827        }
15828    }
15829
15830    impl IpSendControlData {
15831        #[inline(always)]
15832        fn max_ordinal_present(&self) -> u64 {
15833            if let Some(_) = self.ttl {
15834                return 2;
15835            }
15836            0
15837        }
15838    }
15839
15840    impl fidl::encoding::ValueTypeMarker for IpSendControlData {
15841        type Borrowed<'a> = &'a Self;
15842        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15843            value
15844        }
15845    }
15846
15847    unsafe impl fidl::encoding::TypeMarker for IpSendControlData {
15848        type Owned = Self;
15849
15850        #[inline(always)]
15851        fn inline_align(_context: fidl::encoding::Context) -> usize {
15852            8
15853        }
15854
15855        #[inline(always)]
15856        fn inline_size(_context: fidl::encoding::Context) -> usize {
15857            16
15858        }
15859    }
15860
15861    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpSendControlData, D>
15862        for &IpSendControlData
15863    {
15864        unsafe fn encode(
15865            self,
15866            encoder: &mut fidl::encoding::Encoder<'_, D>,
15867            offset: usize,
15868            mut depth: fidl::encoding::Depth,
15869        ) -> fidl::Result<()> {
15870            encoder.debug_check_bounds::<IpSendControlData>(offset);
15871            // Vector header
15872            let max_ordinal: u64 = self.max_ordinal_present();
15873            encoder.write_num(max_ordinal, offset);
15874            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15875            // Calling encoder.out_of_line_offset(0) is not allowed.
15876            if max_ordinal == 0 {
15877                return Ok(());
15878            }
15879            depth.increment()?;
15880            let envelope_size = 8;
15881            let bytes_len = max_ordinal as usize * envelope_size;
15882            #[allow(unused_variables)]
15883            let offset = encoder.out_of_line_offset(bytes_len);
15884            let mut _prev_end_offset: usize = 0;
15885            if 2 > max_ordinal {
15886                return Ok(());
15887            }
15888
15889            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15890            // are envelope_size bytes.
15891            let cur_offset: usize = (2 - 1) * envelope_size;
15892
15893            // Zero reserved fields.
15894            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15895
15896            // Safety:
15897            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15898            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15899            //   envelope_size bytes, there is always sufficient room.
15900            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15901                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15902                encoder,
15903                offset + cur_offset,
15904                depth,
15905            )?;
15906
15907            _prev_end_offset = cur_offset + envelope_size;
15908
15909            Ok(())
15910        }
15911    }
15912
15913    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpSendControlData {
15914        #[inline(always)]
15915        fn new_empty() -> Self {
15916            Self::default()
15917        }
15918
15919        unsafe fn decode(
15920            &mut self,
15921            decoder: &mut fidl::encoding::Decoder<'_, D>,
15922            offset: usize,
15923            mut depth: fidl::encoding::Depth,
15924        ) -> fidl::Result<()> {
15925            decoder.debug_check_bounds::<Self>(offset);
15926            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15927                None => return Err(fidl::Error::NotNullable),
15928                Some(len) => len,
15929            };
15930            // Calling decoder.out_of_line_offset(0) is not allowed.
15931            if len == 0 {
15932                return Ok(());
15933            };
15934            depth.increment()?;
15935            let envelope_size = 8;
15936            let bytes_len = len * envelope_size;
15937            let offset = decoder.out_of_line_offset(bytes_len)?;
15938            // Decode the envelope for each type.
15939            let mut _next_ordinal_to_read = 0;
15940            let mut next_offset = offset;
15941            let end_offset = offset + bytes_len;
15942            _next_ordinal_to_read += 1;
15943            if next_offset >= end_offset {
15944                return Ok(());
15945            }
15946
15947            // Decode unknown envelopes for gaps in ordinals.
15948            while _next_ordinal_to_read < 2 {
15949                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15950                _next_ordinal_to_read += 1;
15951                next_offset += envelope_size;
15952            }
15953
15954            let next_out_of_line = decoder.next_out_of_line();
15955            let handles_before = decoder.remaining_handles();
15956            if let Some((inlined, num_bytes, num_handles)) =
15957                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15958            {
15959                let member_inline_size =
15960                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15961                if inlined != (member_inline_size <= 4) {
15962                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15963                }
15964                let inner_offset;
15965                let mut inner_depth = depth.clone();
15966                if inlined {
15967                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15968                    inner_offset = next_offset;
15969                } else {
15970                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15971                    inner_depth.increment()?;
15972                }
15973                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
15974                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15975                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15976                {
15977                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15978                }
15979                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15980                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15981                }
15982            }
15983
15984            next_offset += envelope_size;
15985
15986            // Decode the remaining unknown envelopes.
15987            while next_offset < end_offset {
15988                _next_ordinal_to_read += 1;
15989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15990                next_offset += envelope_size;
15991            }
15992
15993            Ok(())
15994        }
15995    }
15996
15997    impl Ipv6RecvControlData {
15998        #[inline(always)]
15999        fn max_ordinal_present(&self) -> u64 {
16000            if let Some(_) = self.pktinfo {
16001                return 3;
16002            }
16003            if let Some(_) = self.hoplimit {
16004                return 2;
16005            }
16006            if let Some(_) = self.tclass {
16007                return 1;
16008            }
16009            0
16010        }
16011    }
16012
16013    impl fidl::encoding::ValueTypeMarker for Ipv6RecvControlData {
16014        type Borrowed<'a> = &'a Self;
16015        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16016            value
16017        }
16018    }
16019
16020    unsafe impl fidl::encoding::TypeMarker for Ipv6RecvControlData {
16021        type Owned = Self;
16022
16023        #[inline(always)]
16024        fn inline_align(_context: fidl::encoding::Context) -> usize {
16025            8
16026        }
16027
16028        #[inline(always)]
16029        fn inline_size(_context: fidl::encoding::Context) -> usize {
16030            16
16031        }
16032    }
16033
16034    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6RecvControlData, D>
16035        for &Ipv6RecvControlData
16036    {
16037        unsafe fn encode(
16038            self,
16039            encoder: &mut fidl::encoding::Encoder<'_, D>,
16040            offset: usize,
16041            mut depth: fidl::encoding::Depth,
16042        ) -> fidl::Result<()> {
16043            encoder.debug_check_bounds::<Ipv6RecvControlData>(offset);
16044            // Vector header
16045            let max_ordinal: u64 = self.max_ordinal_present();
16046            encoder.write_num(max_ordinal, offset);
16047            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16048            // Calling encoder.out_of_line_offset(0) is not allowed.
16049            if max_ordinal == 0 {
16050                return Ok(());
16051            }
16052            depth.increment()?;
16053            let envelope_size = 8;
16054            let bytes_len = max_ordinal as usize * envelope_size;
16055            #[allow(unused_variables)]
16056            let offset = encoder.out_of_line_offset(bytes_len);
16057            let mut _prev_end_offset: usize = 0;
16058            if 1 > max_ordinal {
16059                return Ok(());
16060            }
16061
16062            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16063            // are envelope_size bytes.
16064            let cur_offset: usize = (1 - 1) * envelope_size;
16065
16066            // Zero reserved fields.
16067            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16068
16069            // Safety:
16070            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16071            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16072            //   envelope_size bytes, there is always sufficient room.
16073            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16074                self.tclass.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16075                encoder,
16076                offset + cur_offset,
16077                depth,
16078            )?;
16079
16080            _prev_end_offset = cur_offset + envelope_size;
16081            if 2 > max_ordinal {
16082                return Ok(());
16083            }
16084
16085            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16086            // are envelope_size bytes.
16087            let cur_offset: usize = (2 - 1) * envelope_size;
16088
16089            // Zero reserved fields.
16090            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16091
16092            // Safety:
16093            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16094            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16095            //   envelope_size bytes, there is always sufficient room.
16096            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16097                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16098                encoder,
16099                offset + cur_offset,
16100                depth,
16101            )?;
16102
16103            _prev_end_offset = cur_offset + envelope_size;
16104            if 3 > max_ordinal {
16105                return Ok(());
16106            }
16107
16108            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16109            // are envelope_size bytes.
16110            let cur_offset: usize = (3 - 1) * envelope_size;
16111
16112            // Zero reserved fields.
16113            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16114
16115            // Safety:
16116            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16117            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16118            //   envelope_size bytes, there is always sufficient room.
16119            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoRecvControlData, D>(
16120                self.pktinfo
16121                    .as_ref()
16122                    .map(<Ipv6PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16123                encoder,
16124                offset + cur_offset,
16125                depth,
16126            )?;
16127
16128            _prev_end_offset = cur_offset + envelope_size;
16129
16130            Ok(())
16131        }
16132    }
16133
16134    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6RecvControlData {
16135        #[inline(always)]
16136        fn new_empty() -> Self {
16137            Self::default()
16138        }
16139
16140        unsafe fn decode(
16141            &mut self,
16142            decoder: &mut fidl::encoding::Decoder<'_, D>,
16143            offset: usize,
16144            mut depth: fidl::encoding::Depth,
16145        ) -> fidl::Result<()> {
16146            decoder.debug_check_bounds::<Self>(offset);
16147            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16148                None => return Err(fidl::Error::NotNullable),
16149                Some(len) => len,
16150            };
16151            // Calling decoder.out_of_line_offset(0) is not allowed.
16152            if len == 0 {
16153                return Ok(());
16154            };
16155            depth.increment()?;
16156            let envelope_size = 8;
16157            let bytes_len = len * envelope_size;
16158            let offset = decoder.out_of_line_offset(bytes_len)?;
16159            // Decode the envelope for each type.
16160            let mut _next_ordinal_to_read = 0;
16161            let mut next_offset = offset;
16162            let end_offset = offset + bytes_len;
16163            _next_ordinal_to_read += 1;
16164            if next_offset >= end_offset {
16165                return Ok(());
16166            }
16167
16168            // Decode unknown envelopes for gaps in ordinals.
16169            while _next_ordinal_to_read < 1 {
16170                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16171                _next_ordinal_to_read += 1;
16172                next_offset += envelope_size;
16173            }
16174
16175            let next_out_of_line = decoder.next_out_of_line();
16176            let handles_before = decoder.remaining_handles();
16177            if let Some((inlined, num_bytes, num_handles)) =
16178                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16179            {
16180                let member_inline_size =
16181                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16182                if inlined != (member_inline_size <= 4) {
16183                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16184                }
16185                let inner_offset;
16186                let mut inner_depth = depth.clone();
16187                if inlined {
16188                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16189                    inner_offset = next_offset;
16190                } else {
16191                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16192                    inner_depth.increment()?;
16193                }
16194                let val_ref = self.tclass.get_or_insert_with(|| fidl::new_empty!(u8, D));
16195                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16196                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16197                {
16198                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16199                }
16200                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16201                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16202                }
16203            }
16204
16205            next_offset += envelope_size;
16206            _next_ordinal_to_read += 1;
16207            if next_offset >= end_offset {
16208                return Ok(());
16209            }
16210
16211            // Decode unknown envelopes for gaps in ordinals.
16212            while _next_ordinal_to_read < 2 {
16213                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16214                _next_ordinal_to_read += 1;
16215                next_offset += envelope_size;
16216            }
16217
16218            let next_out_of_line = decoder.next_out_of_line();
16219            let handles_before = decoder.remaining_handles();
16220            if let Some((inlined, num_bytes, num_handles)) =
16221                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16222            {
16223                let member_inline_size =
16224                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16225                if inlined != (member_inline_size <= 4) {
16226                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16227                }
16228                let inner_offset;
16229                let mut inner_depth = depth.clone();
16230                if inlined {
16231                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16232                    inner_offset = next_offset;
16233                } else {
16234                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16235                    inner_depth.increment()?;
16236                }
16237                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16238                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16239                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16240                {
16241                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16242                }
16243                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16244                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16245                }
16246            }
16247
16248            next_offset += envelope_size;
16249            _next_ordinal_to_read += 1;
16250            if next_offset >= end_offset {
16251                return Ok(());
16252            }
16253
16254            // Decode unknown envelopes for gaps in ordinals.
16255            while _next_ordinal_to_read < 3 {
16256                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16257                _next_ordinal_to_read += 1;
16258                next_offset += envelope_size;
16259            }
16260
16261            let next_out_of_line = decoder.next_out_of_line();
16262            let handles_before = decoder.remaining_handles();
16263            if let Some((inlined, num_bytes, num_handles)) =
16264                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16265            {
16266                let member_inline_size =
16267                    <Ipv6PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16268                        decoder.context,
16269                    );
16270                if inlined != (member_inline_size <= 4) {
16271                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16272                }
16273                let inner_offset;
16274                let mut inner_depth = depth.clone();
16275                if inlined {
16276                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16277                    inner_offset = next_offset;
16278                } else {
16279                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16280                    inner_depth.increment()?;
16281                }
16282                let val_ref = self
16283                    .pktinfo
16284                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoRecvControlData, D));
16285                fidl::decode!(
16286                    Ipv6PktInfoRecvControlData,
16287                    D,
16288                    val_ref,
16289                    decoder,
16290                    inner_offset,
16291                    inner_depth
16292                )?;
16293                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16294                {
16295                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16296                }
16297                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16298                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16299                }
16300            }
16301
16302            next_offset += envelope_size;
16303
16304            // Decode the remaining unknown envelopes.
16305            while next_offset < end_offset {
16306                _next_ordinal_to_read += 1;
16307                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16308                next_offset += envelope_size;
16309            }
16310
16311            Ok(())
16312        }
16313    }
16314
16315    impl Ipv6SendControlData {
16316        #[inline(always)]
16317        fn max_ordinal_present(&self) -> u64 {
16318            if let Some(_) = self.pktinfo {
16319                return 3;
16320            }
16321            if let Some(_) = self.hoplimit {
16322                return 2;
16323            }
16324            0
16325        }
16326    }
16327
16328    impl fidl::encoding::ValueTypeMarker for Ipv6SendControlData {
16329        type Borrowed<'a> = &'a Self;
16330        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16331            value
16332        }
16333    }
16334
16335    unsafe impl fidl::encoding::TypeMarker for Ipv6SendControlData {
16336        type Owned = Self;
16337
16338        #[inline(always)]
16339        fn inline_align(_context: fidl::encoding::Context) -> usize {
16340            8
16341        }
16342
16343        #[inline(always)]
16344        fn inline_size(_context: fidl::encoding::Context) -> usize {
16345            16
16346        }
16347    }
16348
16349    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6SendControlData, D>
16350        for &Ipv6SendControlData
16351    {
16352        unsafe fn encode(
16353            self,
16354            encoder: &mut fidl::encoding::Encoder<'_, D>,
16355            offset: usize,
16356            mut depth: fidl::encoding::Depth,
16357        ) -> fidl::Result<()> {
16358            encoder.debug_check_bounds::<Ipv6SendControlData>(offset);
16359            // Vector header
16360            let max_ordinal: u64 = self.max_ordinal_present();
16361            encoder.write_num(max_ordinal, offset);
16362            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16363            // Calling encoder.out_of_line_offset(0) is not allowed.
16364            if max_ordinal == 0 {
16365                return Ok(());
16366            }
16367            depth.increment()?;
16368            let envelope_size = 8;
16369            let bytes_len = max_ordinal as usize * envelope_size;
16370            #[allow(unused_variables)]
16371            let offset = encoder.out_of_line_offset(bytes_len);
16372            let mut _prev_end_offset: usize = 0;
16373            if 2 > max_ordinal {
16374                return Ok(());
16375            }
16376
16377            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16378            // are envelope_size bytes.
16379            let cur_offset: usize = (2 - 1) * envelope_size;
16380
16381            // Zero reserved fields.
16382            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16383
16384            // Safety:
16385            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16386            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16387            //   envelope_size bytes, there is always sufficient room.
16388            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16389                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16390                encoder,
16391                offset + cur_offset,
16392                depth,
16393            )?;
16394
16395            _prev_end_offset = cur_offset + envelope_size;
16396            if 3 > max_ordinal {
16397                return Ok(());
16398            }
16399
16400            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16401            // are envelope_size bytes.
16402            let cur_offset: usize = (3 - 1) * envelope_size;
16403
16404            // Zero reserved fields.
16405            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16406
16407            // Safety:
16408            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16409            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16410            //   envelope_size bytes, there is always sufficient room.
16411            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
16412                self.pktinfo
16413                    .as_ref()
16414                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16415                encoder,
16416                offset + cur_offset,
16417                depth,
16418            )?;
16419
16420            _prev_end_offset = cur_offset + envelope_size;
16421
16422            Ok(())
16423        }
16424    }
16425
16426    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6SendControlData {
16427        #[inline(always)]
16428        fn new_empty() -> Self {
16429            Self::default()
16430        }
16431
16432        unsafe fn decode(
16433            &mut self,
16434            decoder: &mut fidl::encoding::Decoder<'_, D>,
16435            offset: usize,
16436            mut depth: fidl::encoding::Depth,
16437        ) -> fidl::Result<()> {
16438            decoder.debug_check_bounds::<Self>(offset);
16439            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16440                None => return Err(fidl::Error::NotNullable),
16441                Some(len) => len,
16442            };
16443            // Calling decoder.out_of_line_offset(0) is not allowed.
16444            if len == 0 {
16445                return Ok(());
16446            };
16447            depth.increment()?;
16448            let envelope_size = 8;
16449            let bytes_len = len * envelope_size;
16450            let offset = decoder.out_of_line_offset(bytes_len)?;
16451            // Decode the envelope for each type.
16452            let mut _next_ordinal_to_read = 0;
16453            let mut next_offset = offset;
16454            let end_offset = offset + bytes_len;
16455            _next_ordinal_to_read += 1;
16456            if next_offset >= end_offset {
16457                return Ok(());
16458            }
16459
16460            // Decode unknown envelopes for gaps in ordinals.
16461            while _next_ordinal_to_read < 2 {
16462                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16463                _next_ordinal_to_read += 1;
16464                next_offset += envelope_size;
16465            }
16466
16467            let next_out_of_line = decoder.next_out_of_line();
16468            let handles_before = decoder.remaining_handles();
16469            if let Some((inlined, num_bytes, num_handles)) =
16470                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16471            {
16472                let member_inline_size =
16473                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16474                if inlined != (member_inline_size <= 4) {
16475                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16476                }
16477                let inner_offset;
16478                let mut inner_depth = depth.clone();
16479                if inlined {
16480                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16481                    inner_offset = next_offset;
16482                } else {
16483                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16484                    inner_depth.increment()?;
16485                }
16486                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16487                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16488                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16489                {
16490                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16491                }
16492                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16493                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16494                }
16495            }
16496
16497            next_offset += envelope_size;
16498            _next_ordinal_to_read += 1;
16499            if next_offset >= end_offset {
16500                return Ok(());
16501            }
16502
16503            // Decode unknown envelopes for gaps in ordinals.
16504            while _next_ordinal_to_read < 3 {
16505                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16506                _next_ordinal_to_read += 1;
16507                next_offset += envelope_size;
16508            }
16509
16510            let next_out_of_line = decoder.next_out_of_line();
16511            let handles_before = decoder.remaining_handles();
16512            if let Some((inlined, num_bytes, num_handles)) =
16513                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16514            {
16515                let member_inline_size =
16516                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
16517                        decoder.context,
16518                    );
16519                if inlined != (member_inline_size <= 4) {
16520                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16521                }
16522                let inner_offset;
16523                let mut inner_depth = depth.clone();
16524                if inlined {
16525                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16526                    inner_offset = next_offset;
16527                } else {
16528                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16529                    inner_depth.increment()?;
16530                }
16531                let val_ref = self
16532                    .pktinfo
16533                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
16534                fidl::decode!(
16535                    Ipv6PktInfoSendControlData,
16536                    D,
16537                    val_ref,
16538                    decoder,
16539                    inner_offset,
16540                    inner_depth
16541                )?;
16542                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16543                {
16544                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16545                }
16546                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16547                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16548                }
16549            }
16550
16551            next_offset += envelope_size;
16552
16553            // Decode the remaining unknown envelopes.
16554            while next_offset < end_offset {
16555                _next_ordinal_to_read += 1;
16556                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16557                next_offset += envelope_size;
16558            }
16559
16560            Ok(())
16561        }
16562    }
16563
16564    impl NetworkSocketRecvControlData {
16565        #[inline(always)]
16566        fn max_ordinal_present(&self) -> u64 {
16567            if let Some(_) = self.ipv6 {
16568                return 3;
16569            }
16570            if let Some(_) = self.ip {
16571                return 2;
16572            }
16573            if let Some(_) = self.socket {
16574                return 1;
16575            }
16576            0
16577        }
16578    }
16579
16580    impl fidl::encoding::ValueTypeMarker for NetworkSocketRecvControlData {
16581        type Borrowed<'a> = &'a Self;
16582        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16583            value
16584        }
16585    }
16586
16587    unsafe impl fidl::encoding::TypeMarker for NetworkSocketRecvControlData {
16588        type Owned = Self;
16589
16590        #[inline(always)]
16591        fn inline_align(_context: fidl::encoding::Context) -> usize {
16592            8
16593        }
16594
16595        #[inline(always)]
16596        fn inline_size(_context: fidl::encoding::Context) -> usize {
16597            16
16598        }
16599    }
16600
16601    unsafe impl<D: fidl::encoding::ResourceDialect>
16602        fidl::encoding::Encode<NetworkSocketRecvControlData, D> for &NetworkSocketRecvControlData
16603    {
16604        unsafe fn encode(
16605            self,
16606            encoder: &mut fidl::encoding::Encoder<'_, D>,
16607            offset: usize,
16608            mut depth: fidl::encoding::Depth,
16609        ) -> fidl::Result<()> {
16610            encoder.debug_check_bounds::<NetworkSocketRecvControlData>(offset);
16611            // Vector header
16612            let max_ordinal: u64 = self.max_ordinal_present();
16613            encoder.write_num(max_ordinal, offset);
16614            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16615            // Calling encoder.out_of_line_offset(0) is not allowed.
16616            if max_ordinal == 0 {
16617                return Ok(());
16618            }
16619            depth.increment()?;
16620            let envelope_size = 8;
16621            let bytes_len = max_ordinal as usize * envelope_size;
16622            #[allow(unused_variables)]
16623            let offset = encoder.out_of_line_offset(bytes_len);
16624            let mut _prev_end_offset: usize = 0;
16625            if 1 > max_ordinal {
16626                return Ok(());
16627            }
16628
16629            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16630            // are envelope_size bytes.
16631            let cur_offset: usize = (1 - 1) * envelope_size;
16632
16633            // Zero reserved fields.
16634            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16635
16636            // Safety:
16637            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16638            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16639            //   envelope_size bytes, there is always sufficient room.
16640            fidl::encoding::encode_in_envelope_optional::<SocketRecvControlData, D>(
16641                self.socket
16642                    .as_ref()
16643                    .map(<SocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16644                encoder,
16645                offset + cur_offset,
16646                depth,
16647            )?;
16648
16649            _prev_end_offset = cur_offset + envelope_size;
16650            if 2 > max_ordinal {
16651                return Ok(());
16652            }
16653
16654            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16655            // are envelope_size bytes.
16656            let cur_offset: usize = (2 - 1) * envelope_size;
16657
16658            // Zero reserved fields.
16659            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16660
16661            // Safety:
16662            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16663            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16664            //   envelope_size bytes, there is always sufficient room.
16665            fidl::encoding::encode_in_envelope_optional::<IpRecvControlData, D>(
16666                self.ip
16667                    .as_ref()
16668                    .map(<IpRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16669                encoder,
16670                offset + cur_offset,
16671                depth,
16672            )?;
16673
16674            _prev_end_offset = cur_offset + envelope_size;
16675            if 3 > max_ordinal {
16676                return Ok(());
16677            }
16678
16679            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16680            // are envelope_size bytes.
16681            let cur_offset: usize = (3 - 1) * envelope_size;
16682
16683            // Zero reserved fields.
16684            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16685
16686            // Safety:
16687            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16688            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16689            //   envelope_size bytes, there is always sufficient room.
16690            fidl::encoding::encode_in_envelope_optional::<Ipv6RecvControlData, D>(
16691                self.ipv6
16692                    .as_ref()
16693                    .map(<Ipv6RecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16694                encoder,
16695                offset + cur_offset,
16696                depth,
16697            )?;
16698
16699            _prev_end_offset = cur_offset + envelope_size;
16700
16701            Ok(())
16702        }
16703    }
16704
16705    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
16706        for NetworkSocketRecvControlData
16707    {
16708        #[inline(always)]
16709        fn new_empty() -> Self {
16710            Self::default()
16711        }
16712
16713        unsafe fn decode(
16714            &mut self,
16715            decoder: &mut fidl::encoding::Decoder<'_, D>,
16716            offset: usize,
16717            mut depth: fidl::encoding::Depth,
16718        ) -> fidl::Result<()> {
16719            decoder.debug_check_bounds::<Self>(offset);
16720            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16721                None => return Err(fidl::Error::NotNullable),
16722                Some(len) => len,
16723            };
16724            // Calling decoder.out_of_line_offset(0) is not allowed.
16725            if len == 0 {
16726                return Ok(());
16727            };
16728            depth.increment()?;
16729            let envelope_size = 8;
16730            let bytes_len = len * envelope_size;
16731            let offset = decoder.out_of_line_offset(bytes_len)?;
16732            // Decode the envelope for each type.
16733            let mut _next_ordinal_to_read = 0;
16734            let mut next_offset = offset;
16735            let end_offset = offset + bytes_len;
16736            _next_ordinal_to_read += 1;
16737            if next_offset >= end_offset {
16738                return Ok(());
16739            }
16740
16741            // Decode unknown envelopes for gaps in ordinals.
16742            while _next_ordinal_to_read < 1 {
16743                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16744                _next_ordinal_to_read += 1;
16745                next_offset += envelope_size;
16746            }
16747
16748            let next_out_of_line = decoder.next_out_of_line();
16749            let handles_before = decoder.remaining_handles();
16750            if let Some((inlined, num_bytes, num_handles)) =
16751                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16752            {
16753                let member_inline_size =
16754                    <SocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16755                        decoder.context,
16756                    );
16757                if inlined != (member_inline_size <= 4) {
16758                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16759                }
16760                let inner_offset;
16761                let mut inner_depth = depth.clone();
16762                if inlined {
16763                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16764                    inner_offset = next_offset;
16765                } else {
16766                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16767                    inner_depth.increment()?;
16768                }
16769                let val_ref =
16770                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketRecvControlData, D));
16771                fidl::decode!(
16772                    SocketRecvControlData,
16773                    D,
16774                    val_ref,
16775                    decoder,
16776                    inner_offset,
16777                    inner_depth
16778                )?;
16779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16780                {
16781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16782                }
16783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16785                }
16786            }
16787
16788            next_offset += envelope_size;
16789            _next_ordinal_to_read += 1;
16790            if next_offset >= end_offset {
16791                return Ok(());
16792            }
16793
16794            // Decode unknown envelopes for gaps in ordinals.
16795            while _next_ordinal_to_read < 2 {
16796                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16797                _next_ordinal_to_read += 1;
16798                next_offset += envelope_size;
16799            }
16800
16801            let next_out_of_line = decoder.next_out_of_line();
16802            let handles_before = decoder.remaining_handles();
16803            if let Some((inlined, num_bytes, num_handles)) =
16804                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16805            {
16806                let member_inline_size =
16807                    <IpRecvControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16808                if inlined != (member_inline_size <= 4) {
16809                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16810                }
16811                let inner_offset;
16812                let mut inner_depth = depth.clone();
16813                if inlined {
16814                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16815                    inner_offset = next_offset;
16816                } else {
16817                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16818                    inner_depth.increment()?;
16819                }
16820                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpRecvControlData, D));
16821                fidl::decode!(IpRecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
16822                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16823                {
16824                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16825                }
16826                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16827                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16828                }
16829            }
16830
16831            next_offset += envelope_size;
16832            _next_ordinal_to_read += 1;
16833            if next_offset >= end_offset {
16834                return Ok(());
16835            }
16836
16837            // Decode unknown envelopes for gaps in ordinals.
16838            while _next_ordinal_to_read < 3 {
16839                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16840                _next_ordinal_to_read += 1;
16841                next_offset += envelope_size;
16842            }
16843
16844            let next_out_of_line = decoder.next_out_of_line();
16845            let handles_before = decoder.remaining_handles();
16846            if let Some((inlined, num_bytes, num_handles)) =
16847                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16848            {
16849                let member_inline_size =
16850                    <Ipv6RecvControlData as fidl::encoding::TypeMarker>::inline_size(
16851                        decoder.context,
16852                    );
16853                if inlined != (member_inline_size <= 4) {
16854                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16855                }
16856                let inner_offset;
16857                let mut inner_depth = depth.clone();
16858                if inlined {
16859                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16860                    inner_offset = next_offset;
16861                } else {
16862                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16863                    inner_depth.increment()?;
16864                }
16865                let val_ref =
16866                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6RecvControlData, D));
16867                fidl::decode!(Ipv6RecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
16868                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16869                {
16870                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16871                }
16872                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16873                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16874                }
16875            }
16876
16877            next_offset += envelope_size;
16878
16879            // Decode the remaining unknown envelopes.
16880            while next_offset < end_offset {
16881                _next_ordinal_to_read += 1;
16882                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16883                next_offset += envelope_size;
16884            }
16885
16886            Ok(())
16887        }
16888    }
16889
16890    impl NetworkSocketSendControlData {
16891        #[inline(always)]
16892        fn max_ordinal_present(&self) -> u64 {
16893            if let Some(_) = self.ipv6 {
16894                return 3;
16895            }
16896            if let Some(_) = self.ip {
16897                return 2;
16898            }
16899            if let Some(_) = self.socket {
16900                return 1;
16901            }
16902            0
16903        }
16904    }
16905
16906    impl fidl::encoding::ValueTypeMarker for NetworkSocketSendControlData {
16907        type Borrowed<'a> = &'a Self;
16908        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16909            value
16910        }
16911    }
16912
16913    unsafe impl fidl::encoding::TypeMarker for NetworkSocketSendControlData {
16914        type Owned = Self;
16915
16916        #[inline(always)]
16917        fn inline_align(_context: fidl::encoding::Context) -> usize {
16918            8
16919        }
16920
16921        #[inline(always)]
16922        fn inline_size(_context: fidl::encoding::Context) -> usize {
16923            16
16924        }
16925    }
16926
16927    unsafe impl<D: fidl::encoding::ResourceDialect>
16928        fidl::encoding::Encode<NetworkSocketSendControlData, D> for &NetworkSocketSendControlData
16929    {
16930        unsafe fn encode(
16931            self,
16932            encoder: &mut fidl::encoding::Encoder<'_, D>,
16933            offset: usize,
16934            mut depth: fidl::encoding::Depth,
16935        ) -> fidl::Result<()> {
16936            encoder.debug_check_bounds::<NetworkSocketSendControlData>(offset);
16937            // Vector header
16938            let max_ordinal: u64 = self.max_ordinal_present();
16939            encoder.write_num(max_ordinal, offset);
16940            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16941            // Calling encoder.out_of_line_offset(0) is not allowed.
16942            if max_ordinal == 0 {
16943                return Ok(());
16944            }
16945            depth.increment()?;
16946            let envelope_size = 8;
16947            let bytes_len = max_ordinal as usize * envelope_size;
16948            #[allow(unused_variables)]
16949            let offset = encoder.out_of_line_offset(bytes_len);
16950            let mut _prev_end_offset: usize = 0;
16951            if 1 > max_ordinal {
16952                return Ok(());
16953            }
16954
16955            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16956            // are envelope_size bytes.
16957            let cur_offset: usize = (1 - 1) * envelope_size;
16958
16959            // Zero reserved fields.
16960            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16961
16962            // Safety:
16963            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16964            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16965            //   envelope_size bytes, there is always sufficient room.
16966            fidl::encoding::encode_in_envelope_optional::<SocketSendControlData, D>(
16967                self.socket
16968                    .as_ref()
16969                    .map(<SocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16970                encoder,
16971                offset + cur_offset,
16972                depth,
16973            )?;
16974
16975            _prev_end_offset = cur_offset + envelope_size;
16976            if 2 > max_ordinal {
16977                return Ok(());
16978            }
16979
16980            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16981            // are envelope_size bytes.
16982            let cur_offset: usize = (2 - 1) * envelope_size;
16983
16984            // Zero reserved fields.
16985            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16986
16987            // Safety:
16988            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16989            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16990            //   envelope_size bytes, there is always sufficient room.
16991            fidl::encoding::encode_in_envelope_optional::<IpSendControlData, D>(
16992                self.ip
16993                    .as_ref()
16994                    .map(<IpSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16995                encoder,
16996                offset + cur_offset,
16997                depth,
16998            )?;
16999
17000            _prev_end_offset = cur_offset + envelope_size;
17001            if 3 > max_ordinal {
17002                return Ok(());
17003            }
17004
17005            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17006            // are envelope_size bytes.
17007            let cur_offset: usize = (3 - 1) * envelope_size;
17008
17009            // Zero reserved fields.
17010            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17011
17012            // Safety:
17013            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17014            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17015            //   envelope_size bytes, there is always sufficient room.
17016            fidl::encoding::encode_in_envelope_optional::<Ipv6SendControlData, D>(
17017                self.ipv6
17018                    .as_ref()
17019                    .map(<Ipv6SendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17020                encoder,
17021                offset + cur_offset,
17022                depth,
17023            )?;
17024
17025            _prev_end_offset = cur_offset + envelope_size;
17026
17027            Ok(())
17028        }
17029    }
17030
17031    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17032        for NetworkSocketSendControlData
17033    {
17034        #[inline(always)]
17035        fn new_empty() -> Self {
17036            Self::default()
17037        }
17038
17039        unsafe fn decode(
17040            &mut self,
17041            decoder: &mut fidl::encoding::Decoder<'_, D>,
17042            offset: usize,
17043            mut depth: fidl::encoding::Depth,
17044        ) -> fidl::Result<()> {
17045            decoder.debug_check_bounds::<Self>(offset);
17046            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17047                None => return Err(fidl::Error::NotNullable),
17048                Some(len) => len,
17049            };
17050            // Calling decoder.out_of_line_offset(0) is not allowed.
17051            if len == 0 {
17052                return Ok(());
17053            };
17054            depth.increment()?;
17055            let envelope_size = 8;
17056            let bytes_len = len * envelope_size;
17057            let offset = decoder.out_of_line_offset(bytes_len)?;
17058            // Decode the envelope for each type.
17059            let mut _next_ordinal_to_read = 0;
17060            let mut next_offset = offset;
17061            let end_offset = offset + bytes_len;
17062            _next_ordinal_to_read += 1;
17063            if next_offset >= end_offset {
17064                return Ok(());
17065            }
17066
17067            // Decode unknown envelopes for gaps in ordinals.
17068            while _next_ordinal_to_read < 1 {
17069                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17070                _next_ordinal_to_read += 1;
17071                next_offset += envelope_size;
17072            }
17073
17074            let next_out_of_line = decoder.next_out_of_line();
17075            let handles_before = decoder.remaining_handles();
17076            if let Some((inlined, num_bytes, num_handles)) =
17077                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17078            {
17079                let member_inline_size =
17080                    <SocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17081                        decoder.context,
17082                    );
17083                if inlined != (member_inline_size <= 4) {
17084                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17085                }
17086                let inner_offset;
17087                let mut inner_depth = depth.clone();
17088                if inlined {
17089                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17090                    inner_offset = next_offset;
17091                } else {
17092                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17093                    inner_depth.increment()?;
17094                }
17095                let val_ref =
17096                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketSendControlData, D));
17097                fidl::decode!(
17098                    SocketSendControlData,
17099                    D,
17100                    val_ref,
17101                    decoder,
17102                    inner_offset,
17103                    inner_depth
17104                )?;
17105                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17106                {
17107                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17108                }
17109                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17110                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17111                }
17112            }
17113
17114            next_offset += envelope_size;
17115            _next_ordinal_to_read += 1;
17116            if next_offset >= end_offset {
17117                return Ok(());
17118            }
17119
17120            // Decode unknown envelopes for gaps in ordinals.
17121            while _next_ordinal_to_read < 2 {
17122                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17123                _next_ordinal_to_read += 1;
17124                next_offset += envelope_size;
17125            }
17126
17127            let next_out_of_line = decoder.next_out_of_line();
17128            let handles_before = decoder.remaining_handles();
17129            if let Some((inlined, num_bytes, num_handles)) =
17130                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17131            {
17132                let member_inline_size =
17133                    <IpSendControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17134                if inlined != (member_inline_size <= 4) {
17135                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17136                }
17137                let inner_offset;
17138                let mut inner_depth = depth.clone();
17139                if inlined {
17140                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17141                    inner_offset = next_offset;
17142                } else {
17143                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17144                    inner_depth.increment()?;
17145                }
17146                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpSendControlData, D));
17147                fidl::decode!(IpSendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17148                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17149                {
17150                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17151                }
17152                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17153                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17154                }
17155            }
17156
17157            next_offset += envelope_size;
17158            _next_ordinal_to_read += 1;
17159            if next_offset >= end_offset {
17160                return Ok(());
17161            }
17162
17163            // Decode unknown envelopes for gaps in ordinals.
17164            while _next_ordinal_to_read < 3 {
17165                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17166                _next_ordinal_to_read += 1;
17167                next_offset += envelope_size;
17168            }
17169
17170            let next_out_of_line = decoder.next_out_of_line();
17171            let handles_before = decoder.remaining_handles();
17172            if let Some((inlined, num_bytes, num_handles)) =
17173                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17174            {
17175                let member_inline_size =
17176                    <Ipv6SendControlData as fidl::encoding::TypeMarker>::inline_size(
17177                        decoder.context,
17178                    );
17179                if inlined != (member_inline_size <= 4) {
17180                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17181                }
17182                let inner_offset;
17183                let mut inner_depth = depth.clone();
17184                if inlined {
17185                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17186                    inner_offset = next_offset;
17187                } else {
17188                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17189                    inner_depth.increment()?;
17190                }
17191                let val_ref =
17192                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6SendControlData, D));
17193                fidl::decode!(Ipv6SendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17194                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17195                {
17196                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17197                }
17198                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17199                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17200                }
17201            }
17202
17203            next_offset += envelope_size;
17204
17205            // Decode the remaining unknown envelopes.
17206            while next_offset < end_offset {
17207                _next_ordinal_to_read += 1;
17208                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17209                next_offset += envelope_size;
17210            }
17211
17212            Ok(())
17213        }
17214    }
17215
17216    impl RecvMsgMeta {
17217        #[inline(always)]
17218        fn max_ordinal_present(&self) -> u64 {
17219            if let Some(_) = self.payload_len {
17220                return 3;
17221            }
17222            if let Some(_) = self.control {
17223                return 2;
17224            }
17225            if let Some(_) = self.from {
17226                return 1;
17227            }
17228            0
17229        }
17230    }
17231
17232    impl fidl::encoding::ValueTypeMarker for RecvMsgMeta {
17233        type Borrowed<'a> = &'a Self;
17234        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17235            value
17236        }
17237    }
17238
17239    unsafe impl fidl::encoding::TypeMarker for RecvMsgMeta {
17240        type Owned = Self;
17241
17242        #[inline(always)]
17243        fn inline_align(_context: fidl::encoding::Context) -> usize {
17244            8
17245        }
17246
17247        #[inline(always)]
17248        fn inline_size(_context: fidl::encoding::Context) -> usize {
17249            16
17250        }
17251    }
17252
17253    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecvMsgMeta, D>
17254        for &RecvMsgMeta
17255    {
17256        unsafe fn encode(
17257            self,
17258            encoder: &mut fidl::encoding::Encoder<'_, D>,
17259            offset: usize,
17260            mut depth: fidl::encoding::Depth,
17261        ) -> fidl::Result<()> {
17262            encoder.debug_check_bounds::<RecvMsgMeta>(offset);
17263            // Vector header
17264            let max_ordinal: u64 = self.max_ordinal_present();
17265            encoder.write_num(max_ordinal, offset);
17266            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17267            // Calling encoder.out_of_line_offset(0) is not allowed.
17268            if max_ordinal == 0 {
17269                return Ok(());
17270            }
17271            depth.increment()?;
17272            let envelope_size = 8;
17273            let bytes_len = max_ordinal as usize * envelope_size;
17274            #[allow(unused_variables)]
17275            let offset = encoder.out_of_line_offset(bytes_len);
17276            let mut _prev_end_offset: usize = 0;
17277            if 1 > max_ordinal {
17278                return Ok(());
17279            }
17280
17281            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17282            // are envelope_size bytes.
17283            let cur_offset: usize = (1 - 1) * envelope_size;
17284
17285            // Zero reserved fields.
17286            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17287
17288            // Safety:
17289            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17290            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17291            //   envelope_size bytes, there is always sufficient room.
17292            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
17293            self.from.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17294            encoder, offset + cur_offset, depth
17295        )?;
17296
17297            _prev_end_offset = cur_offset + envelope_size;
17298            if 2 > max_ordinal {
17299                return Ok(());
17300            }
17301
17302            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17303            // are envelope_size bytes.
17304            let cur_offset: usize = (2 - 1) * envelope_size;
17305
17306            // Zero reserved fields.
17307            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17308
17309            // Safety:
17310            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17311            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17312            //   envelope_size bytes, there is always sufficient room.
17313            fidl::encoding::encode_in_envelope_optional::<DatagramSocketRecvControlData, D>(
17314                self.control.as_ref().map(
17315                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow,
17316                ),
17317                encoder,
17318                offset + cur_offset,
17319                depth,
17320            )?;
17321
17322            _prev_end_offset = cur_offset + envelope_size;
17323            if 3 > max_ordinal {
17324                return Ok(());
17325            }
17326
17327            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17328            // are envelope_size bytes.
17329            let cur_offset: usize = (3 - 1) * envelope_size;
17330
17331            // Zero reserved fields.
17332            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17333
17334            // Safety:
17335            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17336            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17337            //   envelope_size bytes, there is always sufficient room.
17338            fidl::encoding::encode_in_envelope_optional::<u16, D>(
17339                self.payload_len.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17340                encoder,
17341                offset + cur_offset,
17342                depth,
17343            )?;
17344
17345            _prev_end_offset = cur_offset + envelope_size;
17346
17347            Ok(())
17348        }
17349    }
17350
17351    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgMeta {
17352        #[inline(always)]
17353        fn new_empty() -> Self {
17354            Self::default()
17355        }
17356
17357        unsafe fn decode(
17358            &mut self,
17359            decoder: &mut fidl::encoding::Decoder<'_, D>,
17360            offset: usize,
17361            mut depth: fidl::encoding::Depth,
17362        ) -> fidl::Result<()> {
17363            decoder.debug_check_bounds::<Self>(offset);
17364            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17365                None => return Err(fidl::Error::NotNullable),
17366                Some(len) => len,
17367            };
17368            // Calling decoder.out_of_line_offset(0) is not allowed.
17369            if len == 0 {
17370                return Ok(());
17371            };
17372            depth.increment()?;
17373            let envelope_size = 8;
17374            let bytes_len = len * envelope_size;
17375            let offset = decoder.out_of_line_offset(bytes_len)?;
17376            // Decode the envelope for each type.
17377            let mut _next_ordinal_to_read = 0;
17378            let mut next_offset = offset;
17379            let end_offset = offset + bytes_len;
17380            _next_ordinal_to_read += 1;
17381            if next_offset >= end_offset {
17382                return Ok(());
17383            }
17384
17385            // Decode unknown envelopes for gaps in ordinals.
17386            while _next_ordinal_to_read < 1 {
17387                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17388                _next_ordinal_to_read += 1;
17389                next_offset += envelope_size;
17390            }
17391
17392            let next_out_of_line = decoder.next_out_of_line();
17393            let handles_before = decoder.remaining_handles();
17394            if let Some((inlined, num_bytes, num_handles)) =
17395                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17396            {
17397                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17398                if inlined != (member_inline_size <= 4) {
17399                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17400                }
17401                let inner_offset;
17402                let mut inner_depth = depth.clone();
17403                if inlined {
17404                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17405                    inner_offset = next_offset;
17406                } else {
17407                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17408                    inner_depth.increment()?;
17409                }
17410                let val_ref = self.from.get_or_insert_with(|| {
17411                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
17412                });
17413                fidl::decode!(
17414                    fidl_fuchsia_net__common::SocketAddress,
17415                    D,
17416                    val_ref,
17417                    decoder,
17418                    inner_offset,
17419                    inner_depth
17420                )?;
17421                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17422                {
17423                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17424                }
17425                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17426                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17427                }
17428            }
17429
17430            next_offset += envelope_size;
17431            _next_ordinal_to_read += 1;
17432            if next_offset >= end_offset {
17433                return Ok(());
17434            }
17435
17436            // Decode unknown envelopes for gaps in ordinals.
17437            while _next_ordinal_to_read < 2 {
17438                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17439                _next_ordinal_to_read += 1;
17440                next_offset += envelope_size;
17441            }
17442
17443            let next_out_of_line = decoder.next_out_of_line();
17444            let handles_before = decoder.remaining_handles();
17445            if let Some((inlined, num_bytes, num_handles)) =
17446                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17447            {
17448                let member_inline_size =
17449                    <DatagramSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17450                        decoder.context,
17451                    );
17452                if inlined != (member_inline_size <= 4) {
17453                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17454                }
17455                let inner_offset;
17456                let mut inner_depth = depth.clone();
17457                if inlined {
17458                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17459                    inner_offset = next_offset;
17460                } else {
17461                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17462                    inner_depth.increment()?;
17463                }
17464                let val_ref = self
17465                    .control
17466                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketRecvControlData, D));
17467                fidl::decode!(
17468                    DatagramSocketRecvControlData,
17469                    D,
17470                    val_ref,
17471                    decoder,
17472                    inner_offset,
17473                    inner_depth
17474                )?;
17475                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17476                {
17477                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17478                }
17479                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17480                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17481                }
17482            }
17483
17484            next_offset += envelope_size;
17485            _next_ordinal_to_read += 1;
17486            if next_offset >= end_offset {
17487                return Ok(());
17488            }
17489
17490            // Decode unknown envelopes for gaps in ordinals.
17491            while _next_ordinal_to_read < 3 {
17492                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17493                _next_ordinal_to_read += 1;
17494                next_offset += envelope_size;
17495            }
17496
17497            let next_out_of_line = decoder.next_out_of_line();
17498            let handles_before = decoder.remaining_handles();
17499            if let Some((inlined, num_bytes, num_handles)) =
17500                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17501            {
17502                let member_inline_size =
17503                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17504                if inlined != (member_inline_size <= 4) {
17505                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17506                }
17507                let inner_offset;
17508                let mut inner_depth = depth.clone();
17509                if inlined {
17510                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17511                    inner_offset = next_offset;
17512                } else {
17513                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17514                    inner_depth.increment()?;
17515                }
17516                let val_ref = self.payload_len.get_or_insert_with(|| fidl::new_empty!(u16, D));
17517                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
17518                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17519                {
17520                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17521                }
17522                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17523                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17524                }
17525            }
17526
17527            next_offset += envelope_size;
17528
17529            // Decode the remaining unknown envelopes.
17530            while next_offset < end_offset {
17531                _next_ordinal_to_read += 1;
17532                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17533                next_offset += envelope_size;
17534            }
17535
17536            Ok(())
17537        }
17538    }
17539
17540    impl SendMsgMeta {
17541        #[inline(always)]
17542        fn max_ordinal_present(&self) -> u64 {
17543            if let Some(_) = self.control {
17544                return 2;
17545            }
17546            if let Some(_) = self.to {
17547                return 1;
17548            }
17549            0
17550        }
17551    }
17552
17553    impl fidl::encoding::ValueTypeMarker for SendMsgMeta {
17554        type Borrowed<'a> = &'a Self;
17555        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17556            value
17557        }
17558    }
17559
17560    unsafe impl fidl::encoding::TypeMarker for SendMsgMeta {
17561        type Owned = Self;
17562
17563        #[inline(always)]
17564        fn inline_align(_context: fidl::encoding::Context) -> usize {
17565            8
17566        }
17567
17568        #[inline(always)]
17569        fn inline_size(_context: fidl::encoding::Context) -> usize {
17570            16
17571        }
17572    }
17573
17574    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SendMsgMeta, D>
17575        for &SendMsgMeta
17576    {
17577        unsafe fn encode(
17578            self,
17579            encoder: &mut fidl::encoding::Encoder<'_, D>,
17580            offset: usize,
17581            mut depth: fidl::encoding::Depth,
17582        ) -> fidl::Result<()> {
17583            encoder.debug_check_bounds::<SendMsgMeta>(offset);
17584            // Vector header
17585            let max_ordinal: u64 = self.max_ordinal_present();
17586            encoder.write_num(max_ordinal, offset);
17587            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17588            // Calling encoder.out_of_line_offset(0) is not allowed.
17589            if max_ordinal == 0 {
17590                return Ok(());
17591            }
17592            depth.increment()?;
17593            let envelope_size = 8;
17594            let bytes_len = max_ordinal as usize * envelope_size;
17595            #[allow(unused_variables)]
17596            let offset = encoder.out_of_line_offset(bytes_len);
17597            let mut _prev_end_offset: usize = 0;
17598            if 1 > max_ordinal {
17599                return Ok(());
17600            }
17601
17602            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17603            // are envelope_size bytes.
17604            let cur_offset: usize = (1 - 1) * envelope_size;
17605
17606            // Zero reserved fields.
17607            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17608
17609            // Safety:
17610            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17611            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17612            //   envelope_size bytes, there is always sufficient room.
17613            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
17614            self.to.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17615            encoder, offset + cur_offset, depth
17616        )?;
17617
17618            _prev_end_offset = cur_offset + envelope_size;
17619            if 2 > max_ordinal {
17620                return Ok(());
17621            }
17622
17623            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17624            // are envelope_size bytes.
17625            let cur_offset: usize = (2 - 1) * envelope_size;
17626
17627            // Zero reserved fields.
17628            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17629
17630            // Safety:
17631            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17632            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17633            //   envelope_size bytes, there is always sufficient room.
17634            fidl::encoding::encode_in_envelope_optional::<DatagramSocketSendControlData, D>(
17635                self.control.as_ref().map(
17636                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow,
17637                ),
17638                encoder,
17639                offset + cur_offset,
17640                depth,
17641            )?;
17642
17643            _prev_end_offset = cur_offset + envelope_size;
17644
17645            Ok(())
17646        }
17647    }
17648
17649    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgMeta {
17650        #[inline(always)]
17651        fn new_empty() -> Self {
17652            Self::default()
17653        }
17654
17655        unsafe fn decode(
17656            &mut self,
17657            decoder: &mut fidl::encoding::Decoder<'_, D>,
17658            offset: usize,
17659            mut depth: fidl::encoding::Depth,
17660        ) -> fidl::Result<()> {
17661            decoder.debug_check_bounds::<Self>(offset);
17662            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17663                None => return Err(fidl::Error::NotNullable),
17664                Some(len) => len,
17665            };
17666            // Calling decoder.out_of_line_offset(0) is not allowed.
17667            if len == 0 {
17668                return Ok(());
17669            };
17670            depth.increment()?;
17671            let envelope_size = 8;
17672            let bytes_len = len * envelope_size;
17673            let offset = decoder.out_of_line_offset(bytes_len)?;
17674            // Decode the envelope for each type.
17675            let mut _next_ordinal_to_read = 0;
17676            let mut next_offset = offset;
17677            let end_offset = offset + bytes_len;
17678            _next_ordinal_to_read += 1;
17679            if next_offset >= end_offset {
17680                return Ok(());
17681            }
17682
17683            // Decode unknown envelopes for gaps in ordinals.
17684            while _next_ordinal_to_read < 1 {
17685                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17686                _next_ordinal_to_read += 1;
17687                next_offset += envelope_size;
17688            }
17689
17690            let next_out_of_line = decoder.next_out_of_line();
17691            let handles_before = decoder.remaining_handles();
17692            if let Some((inlined, num_bytes, num_handles)) =
17693                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17694            {
17695                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17696                if inlined != (member_inline_size <= 4) {
17697                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17698                }
17699                let inner_offset;
17700                let mut inner_depth = depth.clone();
17701                if inlined {
17702                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17703                    inner_offset = next_offset;
17704                } else {
17705                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17706                    inner_depth.increment()?;
17707                }
17708                let val_ref = self.to.get_or_insert_with(|| {
17709                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
17710                });
17711                fidl::decode!(
17712                    fidl_fuchsia_net__common::SocketAddress,
17713                    D,
17714                    val_ref,
17715                    decoder,
17716                    inner_offset,
17717                    inner_depth
17718                )?;
17719                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17720                {
17721                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17722                }
17723                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17724                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17725                }
17726            }
17727
17728            next_offset += envelope_size;
17729            _next_ordinal_to_read += 1;
17730            if next_offset >= end_offset {
17731                return Ok(());
17732            }
17733
17734            // Decode unknown envelopes for gaps in ordinals.
17735            while _next_ordinal_to_read < 2 {
17736                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17737                _next_ordinal_to_read += 1;
17738                next_offset += envelope_size;
17739            }
17740
17741            let next_out_of_line = decoder.next_out_of_line();
17742            let handles_before = decoder.remaining_handles();
17743            if let Some((inlined, num_bytes, num_handles)) =
17744                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17745            {
17746                let member_inline_size =
17747                    <DatagramSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17748                        decoder.context,
17749                    );
17750                if inlined != (member_inline_size <= 4) {
17751                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17752                }
17753                let inner_offset;
17754                let mut inner_depth = depth.clone();
17755                if inlined {
17756                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17757                    inner_offset = next_offset;
17758                } else {
17759                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17760                    inner_depth.increment()?;
17761                }
17762                let val_ref = self
17763                    .control
17764                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketSendControlData, D));
17765                fidl::decode!(
17766                    DatagramSocketSendControlData,
17767                    D,
17768                    val_ref,
17769                    decoder,
17770                    inner_offset,
17771                    inner_depth
17772                )?;
17773                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17774                {
17775                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17776                }
17777                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17778                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17779                }
17780            }
17781
17782            next_offset += envelope_size;
17783
17784            // Decode the remaining unknown envelopes.
17785            while next_offset < end_offset {
17786                _next_ordinal_to_read += 1;
17787                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17788                next_offset += envelope_size;
17789            }
17790
17791            Ok(())
17792        }
17793    }
17794
17795    impl SocketCreationOptions {
17796        #[inline(always)]
17797        fn max_ordinal_present(&self) -> u64 {
17798            if let Some(_) = self.marks {
17799                return 1;
17800            }
17801            0
17802        }
17803    }
17804
17805    impl fidl::encoding::ValueTypeMarker for SocketCreationOptions {
17806        type Borrowed<'a> = &'a Self;
17807        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17808            value
17809        }
17810    }
17811
17812    unsafe impl fidl::encoding::TypeMarker for SocketCreationOptions {
17813        type Owned = Self;
17814
17815        #[inline(always)]
17816        fn inline_align(_context: fidl::encoding::Context) -> usize {
17817            8
17818        }
17819
17820        #[inline(always)]
17821        fn inline_size(_context: fidl::encoding::Context) -> usize {
17822            16
17823        }
17824    }
17825
17826    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketCreationOptions, D>
17827        for &SocketCreationOptions
17828    {
17829        unsafe fn encode(
17830            self,
17831            encoder: &mut fidl::encoding::Encoder<'_, D>,
17832            offset: usize,
17833            mut depth: fidl::encoding::Depth,
17834        ) -> fidl::Result<()> {
17835            encoder.debug_check_bounds::<SocketCreationOptions>(offset);
17836            // Vector header
17837            let max_ordinal: u64 = self.max_ordinal_present();
17838            encoder.write_num(max_ordinal, offset);
17839            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17840            // Calling encoder.out_of_line_offset(0) is not allowed.
17841            if max_ordinal == 0 {
17842                return Ok(());
17843            }
17844            depth.increment()?;
17845            let envelope_size = 8;
17846            let bytes_len = max_ordinal as usize * envelope_size;
17847            #[allow(unused_variables)]
17848            let offset = encoder.out_of_line_offset(bytes_len);
17849            let mut _prev_end_offset: usize = 0;
17850            if 1 > max_ordinal {
17851                return Ok(());
17852            }
17853
17854            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17855            // are envelope_size bytes.
17856            let cur_offset: usize = (1 - 1) * envelope_size;
17857
17858            // Zero reserved fields.
17859            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17860
17861            // Safety:
17862            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17863            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17864            //   envelope_size bytes, there is always sufficient room.
17865            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::Marks, D>(
17866                self.marks.as_ref().map(
17867                    <fidl_fuchsia_net__common::Marks as fidl::encoding::ValueTypeMarker>::borrow,
17868                ),
17869                encoder,
17870                offset + cur_offset,
17871                depth,
17872            )?;
17873
17874            _prev_end_offset = cur_offset + envelope_size;
17875
17876            Ok(())
17877        }
17878    }
17879
17880    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketCreationOptions {
17881        #[inline(always)]
17882        fn new_empty() -> Self {
17883            Self::default()
17884        }
17885
17886        unsafe fn decode(
17887            &mut self,
17888            decoder: &mut fidl::encoding::Decoder<'_, D>,
17889            offset: usize,
17890            mut depth: fidl::encoding::Depth,
17891        ) -> fidl::Result<()> {
17892            decoder.debug_check_bounds::<Self>(offset);
17893            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17894                None => return Err(fidl::Error::NotNullable),
17895                Some(len) => len,
17896            };
17897            // Calling decoder.out_of_line_offset(0) is not allowed.
17898            if len == 0 {
17899                return Ok(());
17900            };
17901            depth.increment()?;
17902            let envelope_size = 8;
17903            let bytes_len = len * envelope_size;
17904            let offset = decoder.out_of_line_offset(bytes_len)?;
17905            // Decode the envelope for each type.
17906            let mut _next_ordinal_to_read = 0;
17907            let mut next_offset = offset;
17908            let end_offset = offset + bytes_len;
17909            _next_ordinal_to_read += 1;
17910            if next_offset >= end_offset {
17911                return Ok(());
17912            }
17913
17914            // Decode unknown envelopes for gaps in ordinals.
17915            while _next_ordinal_to_read < 1 {
17916                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17917                _next_ordinal_to_read += 1;
17918                next_offset += envelope_size;
17919            }
17920
17921            let next_out_of_line = decoder.next_out_of_line();
17922            let handles_before = decoder.remaining_handles();
17923            if let Some((inlined, num_bytes, num_handles)) =
17924                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17925            {
17926                let member_inline_size =
17927                    <fidl_fuchsia_net__common::Marks as fidl::encoding::TypeMarker>::inline_size(
17928                        decoder.context,
17929                    );
17930                if inlined != (member_inline_size <= 4) {
17931                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17932                }
17933                let inner_offset;
17934                let mut inner_depth = depth.clone();
17935                if inlined {
17936                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17937                    inner_offset = next_offset;
17938                } else {
17939                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17940                    inner_depth.increment()?;
17941                }
17942                let val_ref = self
17943                    .marks
17944                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net__common::Marks, D));
17945                fidl::decode!(
17946                    fidl_fuchsia_net__common::Marks,
17947                    D,
17948                    val_ref,
17949                    decoder,
17950                    inner_offset,
17951                    inner_depth
17952                )?;
17953                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17954                {
17955                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17956                }
17957                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17958                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17959                }
17960            }
17961
17962            next_offset += envelope_size;
17963
17964            // Decode the remaining unknown envelopes.
17965            while next_offset < end_offset {
17966                _next_ordinal_to_read += 1;
17967                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17968                next_offset += envelope_size;
17969            }
17970
17971            Ok(())
17972        }
17973    }
17974
17975    impl SocketRecvControlData {
17976        #[inline(always)]
17977        fn max_ordinal_present(&self) -> u64 {
17978            if let Some(_) = self.timestamp {
17979                return 3;
17980            }
17981            0
17982        }
17983    }
17984
17985    impl fidl::encoding::ValueTypeMarker for SocketRecvControlData {
17986        type Borrowed<'a> = &'a Self;
17987        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17988            value
17989        }
17990    }
17991
17992    unsafe impl fidl::encoding::TypeMarker for SocketRecvControlData {
17993        type Owned = Self;
17994
17995        #[inline(always)]
17996        fn inline_align(_context: fidl::encoding::Context) -> usize {
17997            8
17998        }
17999
18000        #[inline(always)]
18001        fn inline_size(_context: fidl::encoding::Context) -> usize {
18002            16
18003        }
18004    }
18005
18006    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketRecvControlData, D>
18007        for &SocketRecvControlData
18008    {
18009        unsafe fn encode(
18010            self,
18011            encoder: &mut fidl::encoding::Encoder<'_, D>,
18012            offset: usize,
18013            mut depth: fidl::encoding::Depth,
18014        ) -> fidl::Result<()> {
18015            encoder.debug_check_bounds::<SocketRecvControlData>(offset);
18016            // Vector header
18017            let max_ordinal: u64 = self.max_ordinal_present();
18018            encoder.write_num(max_ordinal, offset);
18019            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18020            // Calling encoder.out_of_line_offset(0) is not allowed.
18021            if max_ordinal == 0 {
18022                return Ok(());
18023            }
18024            depth.increment()?;
18025            let envelope_size = 8;
18026            let bytes_len = max_ordinal as usize * envelope_size;
18027            #[allow(unused_variables)]
18028            let offset = encoder.out_of_line_offset(bytes_len);
18029            let mut _prev_end_offset: usize = 0;
18030            if 3 > max_ordinal {
18031                return Ok(());
18032            }
18033
18034            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18035            // are envelope_size bytes.
18036            let cur_offset: usize = (3 - 1) * envelope_size;
18037
18038            // Zero reserved fields.
18039            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18040
18041            // Safety:
18042            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18043            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18044            //   envelope_size bytes, there is always sufficient room.
18045            fidl::encoding::encode_in_envelope_optional::<Timestamp, D>(
18046                self.timestamp.as_ref().map(<Timestamp as fidl::encoding::ValueTypeMarker>::borrow),
18047                encoder,
18048                offset + cur_offset,
18049                depth,
18050            )?;
18051
18052            _prev_end_offset = cur_offset + envelope_size;
18053
18054            Ok(())
18055        }
18056    }
18057
18058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketRecvControlData {
18059        #[inline(always)]
18060        fn new_empty() -> Self {
18061            Self::default()
18062        }
18063
18064        unsafe fn decode(
18065            &mut self,
18066            decoder: &mut fidl::encoding::Decoder<'_, D>,
18067            offset: usize,
18068            mut depth: fidl::encoding::Depth,
18069        ) -> fidl::Result<()> {
18070            decoder.debug_check_bounds::<Self>(offset);
18071            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18072                None => return Err(fidl::Error::NotNullable),
18073                Some(len) => len,
18074            };
18075            // Calling decoder.out_of_line_offset(0) is not allowed.
18076            if len == 0 {
18077                return Ok(());
18078            };
18079            depth.increment()?;
18080            let envelope_size = 8;
18081            let bytes_len = len * envelope_size;
18082            let offset = decoder.out_of_line_offset(bytes_len)?;
18083            // Decode the envelope for each type.
18084            let mut _next_ordinal_to_read = 0;
18085            let mut next_offset = offset;
18086            let end_offset = offset + bytes_len;
18087            _next_ordinal_to_read += 1;
18088            if next_offset >= end_offset {
18089                return Ok(());
18090            }
18091
18092            // Decode unknown envelopes for gaps in ordinals.
18093            while _next_ordinal_to_read < 3 {
18094                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18095                _next_ordinal_to_read += 1;
18096                next_offset += envelope_size;
18097            }
18098
18099            let next_out_of_line = decoder.next_out_of_line();
18100            let handles_before = decoder.remaining_handles();
18101            if let Some((inlined, num_bytes, num_handles)) =
18102                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18103            {
18104                let member_inline_size =
18105                    <Timestamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18106                if inlined != (member_inline_size <= 4) {
18107                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18108                }
18109                let inner_offset;
18110                let mut inner_depth = depth.clone();
18111                if inlined {
18112                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18113                    inner_offset = next_offset;
18114                } else {
18115                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18116                    inner_depth.increment()?;
18117                }
18118                let val_ref = self.timestamp.get_or_insert_with(|| fidl::new_empty!(Timestamp, D));
18119                fidl::decode!(Timestamp, D, val_ref, decoder, inner_offset, inner_depth)?;
18120                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18121                {
18122                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18123                }
18124                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18125                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18126                }
18127            }
18128
18129            next_offset += envelope_size;
18130
18131            // Decode the remaining unknown envelopes.
18132            while next_offset < end_offset {
18133                _next_ordinal_to_read += 1;
18134                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18135                next_offset += envelope_size;
18136            }
18137
18138            Ok(())
18139        }
18140    }
18141
18142    impl SocketSendControlData {
18143        #[inline(always)]
18144        fn max_ordinal_present(&self) -> u64 {
18145            0
18146        }
18147    }
18148
18149    impl fidl::encoding::ValueTypeMarker for SocketSendControlData {
18150        type Borrowed<'a> = &'a Self;
18151        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18152            value
18153        }
18154    }
18155
18156    unsafe impl fidl::encoding::TypeMarker for SocketSendControlData {
18157        type Owned = Self;
18158
18159        #[inline(always)]
18160        fn inline_align(_context: fidl::encoding::Context) -> usize {
18161            8
18162        }
18163
18164        #[inline(always)]
18165        fn inline_size(_context: fidl::encoding::Context) -> usize {
18166            16
18167        }
18168    }
18169
18170    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketSendControlData, D>
18171        for &SocketSendControlData
18172    {
18173        unsafe fn encode(
18174            self,
18175            encoder: &mut fidl::encoding::Encoder<'_, D>,
18176            offset: usize,
18177            mut depth: fidl::encoding::Depth,
18178        ) -> fidl::Result<()> {
18179            encoder.debug_check_bounds::<SocketSendControlData>(offset);
18180            // Vector header
18181            let max_ordinal: u64 = self.max_ordinal_present();
18182            encoder.write_num(max_ordinal, offset);
18183            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18184            // Calling encoder.out_of_line_offset(0) is not allowed.
18185            if max_ordinal == 0 {
18186                return Ok(());
18187            }
18188            depth.increment()?;
18189            let envelope_size = 8;
18190            let bytes_len = max_ordinal as usize * envelope_size;
18191            #[allow(unused_variables)]
18192            let offset = encoder.out_of_line_offset(bytes_len);
18193            let mut _prev_end_offset: usize = 0;
18194
18195            Ok(())
18196        }
18197    }
18198
18199    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketSendControlData {
18200        #[inline(always)]
18201        fn new_empty() -> Self {
18202            Self::default()
18203        }
18204
18205        unsafe fn decode(
18206            &mut self,
18207            decoder: &mut fidl::encoding::Decoder<'_, D>,
18208            offset: usize,
18209            mut depth: fidl::encoding::Depth,
18210        ) -> fidl::Result<()> {
18211            decoder.debug_check_bounds::<Self>(offset);
18212            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18213                None => return Err(fidl::Error::NotNullable),
18214                Some(len) => len,
18215            };
18216            // Calling decoder.out_of_line_offset(0) is not allowed.
18217            if len == 0 {
18218                return Ok(());
18219            };
18220            depth.increment()?;
18221            let envelope_size = 8;
18222            let bytes_len = len * envelope_size;
18223            let offset = decoder.out_of_line_offset(bytes_len)?;
18224            // Decode the envelope for each type.
18225            let mut _next_ordinal_to_read = 0;
18226            let mut next_offset = offset;
18227            let end_offset = offset + bytes_len;
18228
18229            // Decode the remaining unknown envelopes.
18230            while next_offset < end_offset {
18231                _next_ordinal_to_read += 1;
18232                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18233                next_offset += envelope_size;
18234            }
18235
18236            Ok(())
18237        }
18238    }
18239
18240    impl TcpInfo {
18241        #[inline(always)]
18242        fn max_ordinal_present(&self) -> u64 {
18243            if let Some(_) = self.reorder_seen {
18244                return 54;
18245            }
18246            if let Some(_) = self.snd_cwnd {
18247                return 29;
18248            }
18249            if let Some(_) = self.snd_ssthresh {
18250                return 28;
18251            }
18252            if let Some(_) = self.rtt_var_usec {
18253                return 27;
18254            }
18255            if let Some(_) = self.rtt_usec {
18256                return 26;
18257            }
18258            if let Some(_) = self.rto_usec {
18259                return 11;
18260            }
18261            if let Some(_) = self.ca_state {
18262                return 2;
18263            }
18264            if let Some(_) = self.state {
18265                return 1;
18266            }
18267            0
18268        }
18269    }
18270
18271    impl fidl::encoding::ValueTypeMarker for TcpInfo {
18272        type Borrowed<'a> = &'a Self;
18273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18274            value
18275        }
18276    }
18277
18278    unsafe impl fidl::encoding::TypeMarker for TcpInfo {
18279        type Owned = Self;
18280
18281        #[inline(always)]
18282        fn inline_align(_context: fidl::encoding::Context) -> usize {
18283            8
18284        }
18285
18286        #[inline(always)]
18287        fn inline_size(_context: fidl::encoding::Context) -> usize {
18288            16
18289        }
18290    }
18291
18292    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TcpInfo, D> for &TcpInfo {
18293        unsafe fn encode(
18294            self,
18295            encoder: &mut fidl::encoding::Encoder<'_, D>,
18296            offset: usize,
18297            mut depth: fidl::encoding::Depth,
18298        ) -> fidl::Result<()> {
18299            encoder.debug_check_bounds::<TcpInfo>(offset);
18300            // Vector header
18301            let max_ordinal: u64 = self.max_ordinal_present();
18302            encoder.write_num(max_ordinal, offset);
18303            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18304            // Calling encoder.out_of_line_offset(0) is not allowed.
18305            if max_ordinal == 0 {
18306                return Ok(());
18307            }
18308            depth.increment()?;
18309            let envelope_size = 8;
18310            let bytes_len = max_ordinal as usize * envelope_size;
18311            #[allow(unused_variables)]
18312            let offset = encoder.out_of_line_offset(bytes_len);
18313            let mut _prev_end_offset: usize = 0;
18314            if 1 > max_ordinal {
18315                return Ok(());
18316            }
18317
18318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18319            // are envelope_size bytes.
18320            let cur_offset: usize = (1 - 1) * envelope_size;
18321
18322            // Zero reserved fields.
18323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18324
18325            // Safety:
18326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18328            //   envelope_size bytes, there is always sufficient room.
18329            fidl::encoding::encode_in_envelope_optional::<TcpState, D>(
18330                self.state.as_ref().map(<TcpState as fidl::encoding::ValueTypeMarker>::borrow),
18331                encoder,
18332                offset + cur_offset,
18333                depth,
18334            )?;
18335
18336            _prev_end_offset = cur_offset + envelope_size;
18337            if 2 > max_ordinal {
18338                return Ok(());
18339            }
18340
18341            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18342            // are envelope_size bytes.
18343            let cur_offset: usize = (2 - 1) * envelope_size;
18344
18345            // Zero reserved fields.
18346            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18347
18348            // Safety:
18349            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18350            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18351            //   envelope_size bytes, there is always sufficient room.
18352            fidl::encoding::encode_in_envelope_optional::<TcpCongestionControlState, D>(
18353                self.ca_state
18354                    .as_ref()
18355                    .map(<TcpCongestionControlState as fidl::encoding::ValueTypeMarker>::borrow),
18356                encoder,
18357                offset + cur_offset,
18358                depth,
18359            )?;
18360
18361            _prev_end_offset = cur_offset + envelope_size;
18362            if 11 > max_ordinal {
18363                return Ok(());
18364            }
18365
18366            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18367            // are envelope_size bytes.
18368            let cur_offset: usize = (11 - 1) * envelope_size;
18369
18370            // Zero reserved fields.
18371            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18372
18373            // Safety:
18374            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18375            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18376            //   envelope_size bytes, there is always sufficient room.
18377            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18378                self.rto_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18379                encoder,
18380                offset + cur_offset,
18381                depth,
18382            )?;
18383
18384            _prev_end_offset = cur_offset + envelope_size;
18385            if 26 > max_ordinal {
18386                return Ok(());
18387            }
18388
18389            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18390            // are envelope_size bytes.
18391            let cur_offset: usize = (26 - 1) * envelope_size;
18392
18393            // Zero reserved fields.
18394            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18395
18396            // Safety:
18397            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18398            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18399            //   envelope_size bytes, there is always sufficient room.
18400            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18401                self.rtt_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18402                encoder,
18403                offset + cur_offset,
18404                depth,
18405            )?;
18406
18407            _prev_end_offset = cur_offset + envelope_size;
18408            if 27 > max_ordinal {
18409                return Ok(());
18410            }
18411
18412            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18413            // are envelope_size bytes.
18414            let cur_offset: usize = (27 - 1) * envelope_size;
18415
18416            // Zero reserved fields.
18417            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18418
18419            // Safety:
18420            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18421            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18422            //   envelope_size bytes, there is always sufficient room.
18423            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18424                self.rtt_var_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18425                encoder,
18426                offset + cur_offset,
18427                depth,
18428            )?;
18429
18430            _prev_end_offset = cur_offset + envelope_size;
18431            if 28 > max_ordinal {
18432                return Ok(());
18433            }
18434
18435            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18436            // are envelope_size bytes.
18437            let cur_offset: usize = (28 - 1) * envelope_size;
18438
18439            // Zero reserved fields.
18440            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18441
18442            // Safety:
18443            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18444            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18445            //   envelope_size bytes, there is always sufficient room.
18446            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18447                self.snd_ssthresh.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18448                encoder,
18449                offset + cur_offset,
18450                depth,
18451            )?;
18452
18453            _prev_end_offset = cur_offset + envelope_size;
18454            if 29 > max_ordinal {
18455                return Ok(());
18456            }
18457
18458            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18459            // are envelope_size bytes.
18460            let cur_offset: usize = (29 - 1) * envelope_size;
18461
18462            // Zero reserved fields.
18463            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18464
18465            // Safety:
18466            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18467            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18468            //   envelope_size bytes, there is always sufficient room.
18469            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18470                self.snd_cwnd.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18471                encoder,
18472                offset + cur_offset,
18473                depth,
18474            )?;
18475
18476            _prev_end_offset = cur_offset + envelope_size;
18477            if 54 > max_ordinal {
18478                return Ok(());
18479            }
18480
18481            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18482            // are envelope_size bytes.
18483            let cur_offset: usize = (54 - 1) * envelope_size;
18484
18485            // Zero reserved fields.
18486            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18487
18488            // Safety:
18489            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18490            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18491            //   envelope_size bytes, there is always sufficient room.
18492            fidl::encoding::encode_in_envelope_optional::<bool, D>(
18493                self.reorder_seen.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
18494                encoder,
18495                offset + cur_offset,
18496                depth,
18497            )?;
18498
18499            _prev_end_offset = cur_offset + envelope_size;
18500
18501            Ok(())
18502        }
18503    }
18504
18505    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpInfo {
18506        #[inline(always)]
18507        fn new_empty() -> Self {
18508            Self::default()
18509        }
18510
18511        unsafe fn decode(
18512            &mut self,
18513            decoder: &mut fidl::encoding::Decoder<'_, D>,
18514            offset: usize,
18515            mut depth: fidl::encoding::Depth,
18516        ) -> fidl::Result<()> {
18517            decoder.debug_check_bounds::<Self>(offset);
18518            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18519                None => return Err(fidl::Error::NotNullable),
18520                Some(len) => len,
18521            };
18522            // Calling decoder.out_of_line_offset(0) is not allowed.
18523            if len == 0 {
18524                return Ok(());
18525            };
18526            depth.increment()?;
18527            let envelope_size = 8;
18528            let bytes_len = len * envelope_size;
18529            let offset = decoder.out_of_line_offset(bytes_len)?;
18530            // Decode the envelope for each type.
18531            let mut _next_ordinal_to_read = 0;
18532            let mut next_offset = offset;
18533            let end_offset = offset + bytes_len;
18534            _next_ordinal_to_read += 1;
18535            if next_offset >= end_offset {
18536                return Ok(());
18537            }
18538
18539            // Decode unknown envelopes for gaps in ordinals.
18540            while _next_ordinal_to_read < 1 {
18541                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18542                _next_ordinal_to_read += 1;
18543                next_offset += envelope_size;
18544            }
18545
18546            let next_out_of_line = decoder.next_out_of_line();
18547            let handles_before = decoder.remaining_handles();
18548            if let Some((inlined, num_bytes, num_handles)) =
18549                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18550            {
18551                let member_inline_size =
18552                    <TcpState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18553                if inlined != (member_inline_size <= 4) {
18554                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18555                }
18556                let inner_offset;
18557                let mut inner_depth = depth.clone();
18558                if inlined {
18559                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18560                    inner_offset = next_offset;
18561                } else {
18562                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18563                    inner_depth.increment()?;
18564                }
18565                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(TcpState, D));
18566                fidl::decode!(TcpState, D, val_ref, decoder, inner_offset, inner_depth)?;
18567                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18568                {
18569                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18570                }
18571                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18572                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18573                }
18574            }
18575
18576            next_offset += envelope_size;
18577            _next_ordinal_to_read += 1;
18578            if next_offset >= end_offset {
18579                return Ok(());
18580            }
18581
18582            // Decode unknown envelopes for gaps in ordinals.
18583            while _next_ordinal_to_read < 2 {
18584                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18585                _next_ordinal_to_read += 1;
18586                next_offset += envelope_size;
18587            }
18588
18589            let next_out_of_line = decoder.next_out_of_line();
18590            let handles_before = decoder.remaining_handles();
18591            if let Some((inlined, num_bytes, num_handles)) =
18592                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18593            {
18594                let member_inline_size =
18595                    <TcpCongestionControlState as fidl::encoding::TypeMarker>::inline_size(
18596                        decoder.context,
18597                    );
18598                if inlined != (member_inline_size <= 4) {
18599                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18600                }
18601                let inner_offset;
18602                let mut inner_depth = depth.clone();
18603                if inlined {
18604                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18605                    inner_offset = next_offset;
18606                } else {
18607                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18608                    inner_depth.increment()?;
18609                }
18610                let val_ref = self
18611                    .ca_state
18612                    .get_or_insert_with(|| fidl::new_empty!(TcpCongestionControlState, D));
18613                fidl::decode!(
18614                    TcpCongestionControlState,
18615                    D,
18616                    val_ref,
18617                    decoder,
18618                    inner_offset,
18619                    inner_depth
18620                )?;
18621                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18622                {
18623                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18624                }
18625                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18626                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18627                }
18628            }
18629
18630            next_offset += envelope_size;
18631            _next_ordinal_to_read += 1;
18632            if next_offset >= end_offset {
18633                return Ok(());
18634            }
18635
18636            // Decode unknown envelopes for gaps in ordinals.
18637            while _next_ordinal_to_read < 11 {
18638                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18639                _next_ordinal_to_read += 1;
18640                next_offset += envelope_size;
18641            }
18642
18643            let next_out_of_line = decoder.next_out_of_line();
18644            let handles_before = decoder.remaining_handles();
18645            if let Some((inlined, num_bytes, num_handles)) =
18646                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18647            {
18648                let member_inline_size =
18649                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18650                if inlined != (member_inline_size <= 4) {
18651                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18652                }
18653                let inner_offset;
18654                let mut inner_depth = depth.clone();
18655                if inlined {
18656                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18657                    inner_offset = next_offset;
18658                } else {
18659                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18660                    inner_depth.increment()?;
18661                }
18662                let val_ref = self.rto_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
18663                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18664                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18665                {
18666                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18667                }
18668                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18669                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18670                }
18671            }
18672
18673            next_offset += envelope_size;
18674            _next_ordinal_to_read += 1;
18675            if next_offset >= end_offset {
18676                return Ok(());
18677            }
18678
18679            // Decode unknown envelopes for gaps in ordinals.
18680            while _next_ordinal_to_read < 26 {
18681                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18682                _next_ordinal_to_read += 1;
18683                next_offset += envelope_size;
18684            }
18685
18686            let next_out_of_line = decoder.next_out_of_line();
18687            let handles_before = decoder.remaining_handles();
18688            if let Some((inlined, num_bytes, num_handles)) =
18689                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18690            {
18691                let member_inline_size =
18692                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18693                if inlined != (member_inline_size <= 4) {
18694                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18695                }
18696                let inner_offset;
18697                let mut inner_depth = depth.clone();
18698                if inlined {
18699                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18700                    inner_offset = next_offset;
18701                } else {
18702                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18703                    inner_depth.increment()?;
18704                }
18705                let val_ref = self.rtt_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
18706                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18707                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18708                {
18709                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18710                }
18711                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18712                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18713                }
18714            }
18715
18716            next_offset += envelope_size;
18717            _next_ordinal_to_read += 1;
18718            if next_offset >= end_offset {
18719                return Ok(());
18720            }
18721
18722            // Decode unknown envelopes for gaps in ordinals.
18723            while _next_ordinal_to_read < 27 {
18724                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18725                _next_ordinal_to_read += 1;
18726                next_offset += envelope_size;
18727            }
18728
18729            let next_out_of_line = decoder.next_out_of_line();
18730            let handles_before = decoder.remaining_handles();
18731            if let Some((inlined, num_bytes, num_handles)) =
18732                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18733            {
18734                let member_inline_size =
18735                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18736                if inlined != (member_inline_size <= 4) {
18737                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18738                }
18739                let inner_offset;
18740                let mut inner_depth = depth.clone();
18741                if inlined {
18742                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18743                    inner_offset = next_offset;
18744                } else {
18745                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18746                    inner_depth.increment()?;
18747                }
18748                let val_ref = self.rtt_var_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
18749                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18750                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18751                {
18752                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18753                }
18754                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18755                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18756                }
18757            }
18758
18759            next_offset += envelope_size;
18760            _next_ordinal_to_read += 1;
18761            if next_offset >= end_offset {
18762                return Ok(());
18763            }
18764
18765            // Decode unknown envelopes for gaps in ordinals.
18766            while _next_ordinal_to_read < 28 {
18767                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18768                _next_ordinal_to_read += 1;
18769                next_offset += envelope_size;
18770            }
18771
18772            let next_out_of_line = decoder.next_out_of_line();
18773            let handles_before = decoder.remaining_handles();
18774            if let Some((inlined, num_bytes, num_handles)) =
18775                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18776            {
18777                let member_inline_size =
18778                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18779                if inlined != (member_inline_size <= 4) {
18780                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18781                }
18782                let inner_offset;
18783                let mut inner_depth = depth.clone();
18784                if inlined {
18785                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18786                    inner_offset = next_offset;
18787                } else {
18788                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18789                    inner_depth.increment()?;
18790                }
18791                let val_ref = self.snd_ssthresh.get_or_insert_with(|| fidl::new_empty!(u32, D));
18792                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18793                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18794                {
18795                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18796                }
18797                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18798                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18799                }
18800            }
18801
18802            next_offset += envelope_size;
18803            _next_ordinal_to_read += 1;
18804            if next_offset >= end_offset {
18805                return Ok(());
18806            }
18807
18808            // Decode unknown envelopes for gaps in ordinals.
18809            while _next_ordinal_to_read < 29 {
18810                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18811                _next_ordinal_to_read += 1;
18812                next_offset += envelope_size;
18813            }
18814
18815            let next_out_of_line = decoder.next_out_of_line();
18816            let handles_before = decoder.remaining_handles();
18817            if let Some((inlined, num_bytes, num_handles)) =
18818                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18819            {
18820                let member_inline_size =
18821                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18822                if inlined != (member_inline_size <= 4) {
18823                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18824                }
18825                let inner_offset;
18826                let mut inner_depth = depth.clone();
18827                if inlined {
18828                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18829                    inner_offset = next_offset;
18830                } else {
18831                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18832                    inner_depth.increment()?;
18833                }
18834                let val_ref = self.snd_cwnd.get_or_insert_with(|| fidl::new_empty!(u32, D));
18835                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18836                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18837                {
18838                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18839                }
18840                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18841                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18842                }
18843            }
18844
18845            next_offset += envelope_size;
18846            _next_ordinal_to_read += 1;
18847            if next_offset >= end_offset {
18848                return Ok(());
18849            }
18850
18851            // Decode unknown envelopes for gaps in ordinals.
18852            while _next_ordinal_to_read < 54 {
18853                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18854                _next_ordinal_to_read += 1;
18855                next_offset += envelope_size;
18856            }
18857
18858            let next_out_of_line = decoder.next_out_of_line();
18859            let handles_before = decoder.remaining_handles();
18860            if let Some((inlined, num_bytes, num_handles)) =
18861                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18862            {
18863                let member_inline_size =
18864                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18865                if inlined != (member_inline_size <= 4) {
18866                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18867                }
18868                let inner_offset;
18869                let mut inner_depth = depth.clone();
18870                if inlined {
18871                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18872                    inner_offset = next_offset;
18873                } else {
18874                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18875                    inner_depth.increment()?;
18876                }
18877                let val_ref = self.reorder_seen.get_or_insert_with(|| fidl::new_empty!(bool, D));
18878                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
18879                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18880                {
18881                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18882                }
18883                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18884                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18885                }
18886            }
18887
18888            next_offset += envelope_size;
18889
18890            // Decode the remaining unknown envelopes.
18891            while next_offset < end_offset {
18892                _next_ordinal_to_read += 1;
18893                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18894                next_offset += envelope_size;
18895            }
18896
18897            Ok(())
18898        }
18899    }
18900
18901    impl fidl::encoding::ValueTypeMarker for OptionalUint32 {
18902        type Borrowed<'a> = &'a Self;
18903        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18904            value
18905        }
18906    }
18907
18908    unsafe impl fidl::encoding::TypeMarker for OptionalUint32 {
18909        type Owned = Self;
18910
18911        #[inline(always)]
18912        fn inline_align(_context: fidl::encoding::Context) -> usize {
18913            8
18914        }
18915
18916        #[inline(always)]
18917        fn inline_size(_context: fidl::encoding::Context) -> usize {
18918            16
18919        }
18920    }
18921
18922    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint32, D>
18923        for &OptionalUint32
18924    {
18925        #[inline]
18926        unsafe fn encode(
18927            self,
18928            encoder: &mut fidl::encoding::Encoder<'_, D>,
18929            offset: usize,
18930            _depth: fidl::encoding::Depth,
18931        ) -> fidl::Result<()> {
18932            encoder.debug_check_bounds::<OptionalUint32>(offset);
18933            encoder.write_num::<u64>(self.ordinal(), offset);
18934            match self {
18935                OptionalUint32::Value(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
18936                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
18937                    encoder,
18938                    offset + 8,
18939                    _depth,
18940                ),
18941                OptionalUint32::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
18942                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
18943                    encoder,
18944                    offset + 8,
18945                    _depth,
18946                ),
18947            }
18948        }
18949    }
18950
18951    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint32 {
18952        #[inline(always)]
18953        fn new_empty() -> Self {
18954            Self::Value(fidl::new_empty!(u32, D))
18955        }
18956
18957        #[inline]
18958        unsafe fn decode(
18959            &mut self,
18960            decoder: &mut fidl::encoding::Decoder<'_, D>,
18961            offset: usize,
18962            mut depth: fidl::encoding::Depth,
18963        ) -> fidl::Result<()> {
18964            decoder.debug_check_bounds::<Self>(offset);
18965            #[allow(unused_variables)]
18966            let next_out_of_line = decoder.next_out_of_line();
18967            let handles_before = decoder.remaining_handles();
18968            let (ordinal, inlined, num_bytes, num_handles) =
18969                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
18970
18971            let member_inline_size = match ordinal {
18972                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18973                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18974                _ => return Err(fidl::Error::UnknownUnionTag),
18975            };
18976
18977            if inlined != (member_inline_size <= 4) {
18978                return Err(fidl::Error::InvalidInlineBitInEnvelope);
18979            }
18980            let _inner_offset;
18981            if inlined {
18982                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
18983                _inner_offset = offset + 8;
18984            } else {
18985                depth.increment()?;
18986                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18987            }
18988            match ordinal {
18989                1 => {
18990                    #[allow(irrefutable_let_patterns)]
18991                    if let OptionalUint32::Value(_) = self {
18992                        // Do nothing, read the value into the object
18993                    } else {
18994                        // Initialize `self` to the right variant
18995                        *self = OptionalUint32::Value(fidl::new_empty!(u32, D));
18996                    }
18997                    #[allow(irrefutable_let_patterns)]
18998                    if let OptionalUint32::Value(ref mut val) = self {
18999                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
19000                    } else {
19001                        unreachable!()
19002                    }
19003                }
19004                2 => {
19005                    #[allow(irrefutable_let_patterns)]
19006                    if let OptionalUint32::Unset(_) = self {
19007                        // Do nothing, read the value into the object
19008                    } else {
19009                        // Initialize `self` to the right variant
19010                        *self = OptionalUint32::Unset(fidl::new_empty!(Empty, D));
19011                    }
19012                    #[allow(irrefutable_let_patterns)]
19013                    if let OptionalUint32::Unset(ref mut val) = self {
19014                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
19015                    } else {
19016                        unreachable!()
19017                    }
19018                }
19019                ordinal => panic!("unexpected ordinal {:?}", ordinal),
19020            }
19021            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19022                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19023            }
19024            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19025                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19026            }
19027            Ok(())
19028        }
19029    }
19030
19031    impl fidl::encoding::ValueTypeMarker for OptionalUint8 {
19032        type Borrowed<'a> = &'a Self;
19033        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19034            value
19035        }
19036    }
19037
19038    unsafe impl fidl::encoding::TypeMarker for OptionalUint8 {
19039        type Owned = Self;
19040
19041        #[inline(always)]
19042        fn inline_align(_context: fidl::encoding::Context) -> usize {
19043            8
19044        }
19045
19046        #[inline(always)]
19047        fn inline_size(_context: fidl::encoding::Context) -> usize {
19048            16
19049        }
19050    }
19051
19052    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint8, D>
19053        for &OptionalUint8
19054    {
19055        #[inline]
19056        unsafe fn encode(
19057            self,
19058            encoder: &mut fidl::encoding::Encoder<'_, D>,
19059            offset: usize,
19060            _depth: fidl::encoding::Depth,
19061        ) -> fidl::Result<()> {
19062            encoder.debug_check_bounds::<OptionalUint8>(offset);
19063            encoder.write_num::<u64>(self.ordinal(), offset);
19064            match self {
19065                OptionalUint8::Value(ref val) => fidl::encoding::encode_in_envelope::<u8, D>(
19066                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
19067                    encoder,
19068                    offset + 8,
19069                    _depth,
19070                ),
19071                OptionalUint8::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
19072                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
19073                    encoder,
19074                    offset + 8,
19075                    _depth,
19076                ),
19077            }
19078        }
19079    }
19080
19081    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint8 {
19082        #[inline(always)]
19083        fn new_empty() -> Self {
19084            Self::Value(fidl::new_empty!(u8, D))
19085        }
19086
19087        #[inline]
19088        unsafe fn decode(
19089            &mut self,
19090            decoder: &mut fidl::encoding::Decoder<'_, D>,
19091            offset: usize,
19092            mut depth: fidl::encoding::Depth,
19093        ) -> fidl::Result<()> {
19094            decoder.debug_check_bounds::<Self>(offset);
19095            #[allow(unused_variables)]
19096            let next_out_of_line = decoder.next_out_of_line();
19097            let handles_before = decoder.remaining_handles();
19098            let (ordinal, inlined, num_bytes, num_handles) =
19099                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19100
19101            let member_inline_size = match ordinal {
19102                1 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19103                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19104                _ => return Err(fidl::Error::UnknownUnionTag),
19105            };
19106
19107            if inlined != (member_inline_size <= 4) {
19108                return Err(fidl::Error::InvalidInlineBitInEnvelope);
19109            }
19110            let _inner_offset;
19111            if inlined {
19112                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19113                _inner_offset = offset + 8;
19114            } else {
19115                depth.increment()?;
19116                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19117            }
19118            match ordinal {
19119                1 => {
19120                    #[allow(irrefutable_let_patterns)]
19121                    if let OptionalUint8::Value(_) = self {
19122                        // Do nothing, read the value into the object
19123                    } else {
19124                        // Initialize `self` to the right variant
19125                        *self = OptionalUint8::Value(fidl::new_empty!(u8, D));
19126                    }
19127                    #[allow(irrefutable_let_patterns)]
19128                    if let OptionalUint8::Value(ref mut val) = self {
19129                        fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
19130                    } else {
19131                        unreachable!()
19132                    }
19133                }
19134                2 => {
19135                    #[allow(irrefutable_let_patterns)]
19136                    if let OptionalUint8::Unset(_) = self {
19137                        // Do nothing, read the value into the object
19138                    } else {
19139                        // Initialize `self` to the right variant
19140                        *self = OptionalUint8::Unset(fidl::new_empty!(Empty, D));
19141                    }
19142                    #[allow(irrefutable_let_patterns)]
19143                    if let OptionalUint8::Unset(ref mut val) = self {
19144                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
19145                    } else {
19146                        unreachable!()
19147                    }
19148                }
19149                ordinal => panic!("unexpected ordinal {:?}", ordinal),
19150            }
19151            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19152                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19153            }
19154            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19155                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19156            }
19157            Ok(())
19158        }
19159    }
19160}