Skip to main content

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
11/// TCP congestion control state machine state.
12pub type TcpCongestionControlState = fidl_fuchsia_net_tcp_common::CongestionControlState;
13
14/// TCP protocol state.
15pub type TcpInfo = fidl_fuchsia_net_tcp_common::Info;
16
17/// TCP state machine state.
18pub type TcpState = fidl_fuchsia_net_tcp_common::State;
19
20/// Constant bounding the number of eventpairs returned by Netstack to clients
21/// of the fast protocol.
22///
23/// Set equal to `ZX_WAIT_MANY_MAXIMUM_ITEMS` - 1, where `ZX_WAIT_MANY_MAXIMUM_ITEMS`
24/// is defined in `//zircon/system/public/zircon/types.h` and bounds the number of eventpairs
25/// in a single call to `zx_object_wait_many`. The bias leaves room to allow clients to wait
26/// for errors on the zircon socket in the same call.
27pub const FAST_UDP_WAIT_MANY_MAXIMUM_ITEMS: u32 = 63;
28
29pub const SIGNAL_DATAGRAM_ERROR: u32 = USER_SIGNAL_2 as u32;
30
31pub const SIGNAL_DATAGRAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
32
33pub const SIGNAL_DATAGRAM_OUTGOING: u32 = USER_SIGNAL_1 as u32;
34
35pub const SIGNAL_DATAGRAM_SHUTDOWN_READ: u32 = USER_SIGNAL_4 as u32;
36
37pub const SIGNAL_DATAGRAM_SHUTDOWN_WRITE: u32 = USER_SIGNAL_5 as u32;
38
39pub const SIGNAL_STREAM_CONNECTED: u32 = USER_SIGNAL_3 as u32;
40
41pub const SIGNAL_STREAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
42
43pub const USER_SIGNAL_0: u32 = 16777216;
44
45pub const USER_SIGNAL_1: u32 = 33554432;
46
47pub const USER_SIGNAL_2: u32 = 67108864;
48
49pub const USER_SIGNAL_3: u32 = 134217728;
50
51pub const USER_SIGNAL_4: u32 = 268435456;
52
53pub const USER_SIGNAL_5: u32 = 536870912;
54
55bitflags! {
56    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
57    pub struct CmsgRequests: u32 {
58        /// Identifies whether the `IP_RECVTOS` control message is requested.
59        const IP_TOS = 1;
60        /// Identifies whether the `IP_RECVTTL` control message is requested.
61        const IP_TTL = 2;
62        /// Identifies whether the `IPV6_RECVTCLASS` control message is requested.
63        const IPV6_TCLASS = 4;
64        /// Identifies whether the `IPV6_RECVHOPLIMIT` control message is requested.
65        const IPV6_HOPLIMIT = 8;
66        /// Identifies whether the `IPV6_RECVPKTINFO` control message is requested.
67        const IPV6_PKTINFO = 16;
68        /// Identifies whether the `IP_RECVORIGDSTADDR` control message is requested.
69        const IP_RECVORIGDSTADDR = 32;
70        /// Identifies whether the `IP_PKTINFO` control message is requested.
71        const IP_PKTINFO = 64;
72    }
73}
74
75impl CmsgRequests {
76    #[inline(always)]
77    pub fn from_bits_allow_unknown(bits: u32) -> Self {
78        Self::from_bits_retain(bits)
79    }
80
81    #[inline(always)]
82    pub fn has_unknown_bits(&self) -> bool {
83        self.get_unknown_bits() != 0
84    }
85
86    #[inline(always)]
87    pub fn get_unknown_bits(&self) -> u32 {
88        self.bits() & !Self::all().bits()
89    }
90}
91
92bitflags! {
93    /// Bits representing the interface flags as returned by the SIOCGIFFLAGS ioctl
94    /// operation. These bitmasks are intended to track the C API definition. For
95    /// example, `InterfaceFlags.UP` corresponds to `IFF_UP`, etc.
96    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
97    pub struct InterfaceFlags: u16 {
98        const UP = 1;
99        const BROADCAST = 2;
100        const DEBUG = 4;
101        const LOOPBACK = 8;
102        const POINTTOPOINT = 16;
103        const NOTRAILERS = 32;
104        const RUNNING = 64;
105        const NOARP = 128;
106        const PROMISC = 256;
107        const ALLMULTI = 512;
108        const LEADER = 1024;
109        const FOLLOWER = 2048;
110        const MULTICAST = 4096;
111        const PORTSEL = 8192;
112        const AUTOMEDIA = 16384;
113        const DYNAMIC = 32768;
114    }
115}
116
117impl InterfaceFlags {}
118
119bitflags! {
120    /// Flags controlling RecvMsg behavior.
121    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
122    pub struct RecvMsgFlags: u16 {
123        /// Returns data from the receive queue without removing from it.
124        ///
125        /// Equivalent to `MSG_PEEK`.
126        const PEEK = 2;
127    }
128}
129
130impl RecvMsgFlags {}
131
132bitflags! {
133    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
134    pub struct SendMsgFlags: u16 {
135        const RESERVED = 32768;
136    }
137}
138
139impl SendMsgFlags {}
140
141bitflags! {
142    /// Socket shutdown mode.
143    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
144    pub struct ShutdownMode: u16 {
145        /// Shutdown socket read endpoint.
146        const READ = 1;
147        /// Shutdown socket write endpoint.
148        const WRITE = 2;
149    }
150}
151
152impl ShutdownMode {}
153
154/// Protocols supported by [`fuchsia.posix.socket/DatagramSocket`].
155///
156/// `DatagramSocketProtocol` enumerates the protocols supported by the network
157/// stack over datagram sockets.
158#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
159#[repr(u32)]
160pub enum DatagramSocketProtocol {
161    /// UDP (User Datagram Protocol).
162    ///
163    /// A UDP socket is equivalent to the POSIX API of `SOCK_DGRAM` with a
164    /// protocol of 0 or `IPPROTO_UDP`.
165    Udp = 1,
166    /// ICMP (Internet Control Message Protocol) echo.
167    ///
168    /// An ICMP echo socket is equivalent to the POSIX API of `SOCK_DGRAM` with
169    /// a protocol of `IPPROTO_ICMP` `IPPROTO_ICMPV6` (depending on provided
170    /// domain).
171    ///
172    /// Datagrams sent over an ICMP echo socket *must* have a valid ICMP or
173    /// ICMPv6 echo header.
174    IcmpEcho = 2,
175}
176
177impl DatagramSocketProtocol {
178    #[inline]
179    pub fn from_primitive(prim: u32) -> Option<Self> {
180        match prim {
181            1 => Some(Self::Udp),
182            2 => Some(Self::IcmpEcho),
183            _ => None,
184        }
185    }
186
187    #[inline]
188    pub const fn into_primitive(self) -> u32 {
189        self as u32
190    }
191}
192
193/// A socket's domain.
194///
195/// Determines the addressing domain for a socket.
196#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
197#[repr(i16)]
198pub enum Domain {
199    /// An IPv4 socket. Equivalent to `AF_INET`.
200    Ipv4 = 0,
201    /// An IPv6 socket. Equivalent to `AF_INET6`.
202    Ipv6 = 1,
203}
204
205impl Domain {
206    #[inline]
207    pub fn from_primitive(prim: i16) -> Option<Self> {
208        match prim {
209            0 => Some(Self::Ipv4),
210            1 => Some(Self::Ipv6),
211            _ => None,
212        }
213    }
214
215    #[inline]
216    pub const fn into_primitive(self) -> i16 {
217        self as i16
218    }
219}
220
221/// Protocols supported by [`fuchsia.posix.socket/StreamSocket`].
222///
223/// `StreamSocketProtocol` enumerates the protocols supported by the network
224/// stack over stream sockets.
225#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
226#[repr(u32)]
227pub enum StreamSocketProtocol {
228    /// TCP (Transmission Control Protocol).
229    ///
230    /// A TCP socket is equivalent to the POSIX API of `SOCK_STREAM` with a
231    /// protocol of 0 or `IPPROTO_TCP`.
232    Tcp = 0,
233}
234
235impl StreamSocketProtocol {
236    #[inline]
237    pub fn from_primitive(prim: u32) -> Option<Self> {
238        match prim {
239            0 => Some(Self::Tcp),
240            _ => None,
241        }
242    }
243
244    #[inline]
245    pub const fn into_primitive(self) -> u32 {
246        self as u32
247    }
248}
249
250/// TCP congestion control modes.
251#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
252#[repr(u32)]
253pub enum TcpCongestionControl {
254    Reno = 1,
255    Cubic = 2,
256}
257
258impl TcpCongestionControl {
259    #[inline]
260    pub fn from_primitive(prim: u32) -> Option<Self> {
261        match prim {
262            1 => Some(Self::Reno),
263            2 => Some(Self::Cubic),
264            _ => None,
265        }
266    }
267
268    #[inline]
269    pub const fn into_primitive(self) -> u32 {
270        self as u32
271    }
272}
273
274/// Packet timestamp reporting precision options.
275#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
276#[repr(u32)]
277pub enum TimestampOption {
278    /// Do not report timestamp.
279    Disabled = 0,
280    /// Report timestamp with nanosecond precision.
281    Nanosecond = 1,
282    /// Report timestamp with microsecond precision.
283    Microsecond = 2,
284}
285
286impl TimestampOption {
287    #[inline]
288    pub fn from_primitive(prim: u32) -> Option<Self> {
289        match prim {
290            0 => Some(Self::Disabled),
291            1 => Some(Self::Nanosecond),
292            2 => Some(Self::Microsecond),
293            _ => None,
294        }
295    }
296
297    #[inline]
298    pub const fn into_primitive(self) -> u32 {
299        self as u32
300    }
301}
302
303#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
304pub enum UdpMetadataEncodingProtocolVersion {
305    Zero,
306    #[doc(hidden)]
307    __SourceBreaking {
308        unknown_ordinal: u16,
309    },
310}
311
312/// Pattern that matches an unknown `UdpMetadataEncodingProtocolVersion` member.
313#[macro_export]
314macro_rules! UdpMetadataEncodingProtocolVersionUnknown {
315    () => {
316        _
317    };
318}
319
320impl UdpMetadataEncodingProtocolVersion {
321    #[inline]
322    pub fn from_primitive(prim: u16) -> Option<Self> {
323        match prim {
324            0 => Some(Self::Zero),
325            _ => None,
326        }
327    }
328
329    #[inline]
330    pub fn from_primitive_allow_unknown(prim: u16) -> Self {
331        match prim {
332            0 => Self::Zero,
333            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
334        }
335    }
336
337    #[inline]
338    pub fn unknown() -> Self {
339        Self::__SourceBreaking { unknown_ordinal: 0xffff }
340    }
341
342    #[inline]
343    pub const fn into_primitive(self) -> u16 {
344        match self {
345            Self::Zero => 0,
346            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
347        }
348    }
349
350    #[inline]
351    pub fn is_unknown(&self) -> bool {
352        match self {
353            Self::__SourceBreaking { unknown_ordinal: _ } => true,
354            _ => false,
355        }
356    }
357}
358
359#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
360pub struct BaseDatagramSocketGetInfoResponse {
361    pub domain: Domain,
362    pub proto: DatagramSocketProtocol,
363}
364
365impl fidl::Persistable for BaseDatagramSocketGetInfoResponse {}
366
367#[derive(Clone, Debug, PartialEq)]
368pub struct BaseNetworkSocketAddIpMembershipRequest {
369    pub membership: IpMulticastMembership,
370}
371
372impl fidl::Persistable for BaseNetworkSocketAddIpMembershipRequest {}
373
374#[derive(Clone, Debug, PartialEq)]
375pub struct BaseNetworkSocketAddIpv6MembershipRequest {
376    pub membership: Ipv6MulticastMembership,
377}
378
379impl fidl::Persistable for BaseNetworkSocketAddIpv6MembershipRequest {}
380
381#[derive(Clone, Debug, PartialEq)]
382pub struct BaseNetworkSocketBindRequest {
383    pub addr: fidl_fuchsia_net_common::SocketAddress,
384}
385
386impl fidl::Persistable for BaseNetworkSocketBindRequest {}
387
388#[derive(Clone, Debug, PartialEq)]
389pub struct BaseNetworkSocketConnectRequest {
390    pub addr: fidl_fuchsia_net_common::SocketAddress,
391}
392
393impl fidl::Persistable for BaseNetworkSocketConnectRequest {}
394
395#[derive(Clone, Debug, PartialEq)]
396pub struct BaseNetworkSocketDropIpMembershipRequest {
397    pub membership: IpMulticastMembership,
398}
399
400impl fidl::Persistable for BaseNetworkSocketDropIpMembershipRequest {}
401
402#[derive(Clone, Debug, PartialEq)]
403pub struct BaseNetworkSocketDropIpv6MembershipRequest {
404    pub membership: Ipv6MulticastMembership,
405}
406
407impl fidl::Persistable for BaseNetworkSocketDropIpv6MembershipRequest {}
408
409#[derive(Clone, Debug, PartialEq)]
410pub struct BaseNetworkSocketSetIpMulticastInterfaceRequest {
411    pub iface: u64,
412    pub address: fidl_fuchsia_net_common::Ipv4Address,
413}
414
415impl fidl::Persistable for BaseNetworkSocketSetIpMulticastInterfaceRequest {}
416
417#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
418pub struct BaseNetworkSocketSetIpMulticastLoopbackRequest {
419    pub value: bool,
420}
421
422impl fidl::Persistable for BaseNetworkSocketSetIpMulticastLoopbackRequest {}
423
424#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
425pub struct BaseNetworkSocketSetIpMulticastTtlRequest {
426    pub value: OptionalUint8,
427}
428
429impl fidl::Persistable for BaseNetworkSocketSetIpMulticastTtlRequest {}
430
431#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
432pub struct BaseNetworkSocketSetIpPacketInfoRequest {
433    pub value: bool,
434}
435
436impl fidl::Persistable for BaseNetworkSocketSetIpPacketInfoRequest {}
437
438#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
439pub struct BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {
440    pub value: bool,
441}
442
443impl fidl::Persistable for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {}
444
445#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
446pub struct BaseNetworkSocketSetIpReceiveTtlRequest {
447    pub value: bool,
448}
449
450impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTtlRequest {}
451
452#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
453pub struct BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
454    pub value: bool,
455}
456
457impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {}
458
459#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
460pub struct BaseNetworkSocketSetIpTransparentRequest {
461    pub value: bool,
462}
463
464impl fidl::Persistable for BaseNetworkSocketSetIpTransparentRequest {}
465
466#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
467pub struct BaseNetworkSocketSetIpTtlRequest {
468    pub value: OptionalUint8,
469}
470
471impl fidl::Persistable for BaseNetworkSocketSetIpTtlRequest {}
472
473#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
474#[repr(C)]
475pub struct BaseNetworkSocketSetIpTypeOfServiceRequest {
476    pub value: u8,
477}
478
479impl fidl::Persistable for BaseNetworkSocketSetIpTypeOfServiceRequest {}
480
481#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
482pub struct BaseNetworkSocketSetIpv6MulticastHopsRequest {
483    pub value: OptionalUint8,
484}
485
486impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastHopsRequest {}
487
488#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
489#[repr(C)]
490pub struct BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
491    pub value: u64,
492}
493
494impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {}
495
496#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
497pub struct BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
498    pub value: bool,
499}
500
501impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {}
502
503#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
504pub struct BaseNetworkSocketSetIpv6OnlyRequest {
505    pub value: bool,
506}
507
508impl fidl::Persistable for BaseNetworkSocketSetIpv6OnlyRequest {}
509
510#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
511pub struct BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
512    pub value: bool,
513}
514
515impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {}
516
517#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
518pub struct BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
519    pub value: bool,
520}
521
522impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {}
523
524#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
525pub struct BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
526    pub value: bool,
527}
528
529impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {}
530
531#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
532pub struct BaseNetworkSocketSetIpv6TrafficClassRequest {
533    pub value: OptionalUint8,
534}
535
536impl fidl::Persistable for BaseNetworkSocketSetIpv6TrafficClassRequest {}
537
538#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
539pub struct BaseNetworkSocketSetIpv6UnicastHopsRequest {
540    pub value: OptionalUint8,
541}
542
543impl fidl::Persistable for BaseNetworkSocketSetIpv6UnicastHopsRequest {}
544
545#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
546pub struct BaseNetworkSocketShutdownRequest {
547    pub mode: ShutdownMode,
548}
549
550impl fidl::Persistable for BaseNetworkSocketShutdownRequest {}
551
552#[derive(Clone, Debug, PartialEq)]
553pub struct BaseNetworkSocketGetIpMulticastInterfaceResponse {
554    pub value: fidl_fuchsia_net_common::Ipv4Address,
555}
556
557impl fidl::Persistable for BaseNetworkSocketGetIpMulticastInterfaceResponse {}
558
559#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
560pub struct BaseNetworkSocketGetIpMulticastLoopbackResponse {
561    pub value: bool,
562}
563
564impl fidl::Persistable for BaseNetworkSocketGetIpMulticastLoopbackResponse {}
565
566#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
567#[repr(C)]
568pub struct BaseNetworkSocketGetIpMulticastTtlResponse {
569    pub value: u8,
570}
571
572impl fidl::Persistable for BaseNetworkSocketGetIpMulticastTtlResponse {}
573
574#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
575pub struct BaseNetworkSocketGetIpPacketInfoResponse {
576    pub value: bool,
577}
578
579impl fidl::Persistable for BaseNetworkSocketGetIpPacketInfoResponse {}
580
581#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
582pub struct BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {
583    pub value: bool,
584}
585
586impl fidl::Persistable for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {}
587
588#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
589pub struct BaseNetworkSocketGetIpReceiveTtlResponse {
590    pub value: bool,
591}
592
593impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTtlResponse {}
594
595#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
596pub struct BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
597    pub value: bool,
598}
599
600impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {}
601
602#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
603pub struct BaseNetworkSocketGetIpTransparentResponse {
604    pub value: bool,
605}
606
607impl fidl::Persistable for BaseNetworkSocketGetIpTransparentResponse {}
608
609#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
610#[repr(C)]
611pub struct BaseNetworkSocketGetIpTtlResponse {
612    pub value: u8,
613}
614
615impl fidl::Persistable for BaseNetworkSocketGetIpTtlResponse {}
616
617#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
618#[repr(C)]
619pub struct BaseNetworkSocketGetIpTypeOfServiceResponse {
620    pub value: u8,
621}
622
623impl fidl::Persistable for BaseNetworkSocketGetIpTypeOfServiceResponse {}
624
625#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
626#[repr(C)]
627pub struct BaseNetworkSocketGetIpv6MulticastHopsResponse {
628    pub value: u8,
629}
630
631impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastHopsResponse {}
632
633#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
634#[repr(C)]
635pub struct BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
636    pub value: u64,
637}
638
639impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {}
640
641#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
642pub struct BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
643    pub value: bool,
644}
645
646impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {}
647
648#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
649pub struct BaseNetworkSocketGetIpv6OnlyResponse {
650    pub value: bool,
651}
652
653impl fidl::Persistable for BaseNetworkSocketGetIpv6OnlyResponse {}
654
655#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
656pub struct BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
657    pub value: bool,
658}
659
660impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {}
661
662#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
663pub struct BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
664    pub value: bool,
665}
666
667impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {}
668
669#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
670pub struct BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
671    pub value: bool,
672}
673
674impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {}
675
676#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
677#[repr(C)]
678pub struct BaseNetworkSocketGetIpv6TrafficClassResponse {
679    pub value: u8,
680}
681
682impl fidl::Persistable for BaseNetworkSocketGetIpv6TrafficClassResponse {}
683
684#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
685#[repr(C)]
686pub struct BaseNetworkSocketGetIpv6UnicastHopsResponse {
687    pub value: u8,
688}
689
690impl fidl::Persistable for BaseNetworkSocketGetIpv6UnicastHopsResponse {}
691
692#[derive(Clone, Debug, PartialEq)]
693pub struct BaseNetworkSocketGetOriginalDestinationResponse {
694    pub value: fidl_fuchsia_net_common::SocketAddress,
695}
696
697impl fidl::Persistable for BaseNetworkSocketGetOriginalDestinationResponse {}
698
699#[derive(Clone, Debug, PartialEq)]
700pub struct BaseNetworkSocketGetPeerNameResponse {
701    pub addr: fidl_fuchsia_net_common::SocketAddress,
702}
703
704impl fidl::Persistable for BaseNetworkSocketGetPeerNameResponse {}
705
706#[derive(Clone, Debug, PartialEq)]
707pub struct BaseNetworkSocketGetSockNameResponse {
708    pub addr: fidl_fuchsia_net_common::SocketAddress,
709}
710
711impl fidl::Persistable for BaseNetworkSocketGetSockNameResponse {}
712
713#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
714pub struct BaseSocketGetMarkRequest {
715    pub domain: fidl_fuchsia_net_common::MarkDomain,
716}
717
718impl fidl::Persistable for BaseSocketGetMarkRequest {}
719
720#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
721pub struct BaseSocketSetBindToDeviceRequest {
722    pub value: String,
723}
724
725impl fidl::Persistable for BaseSocketSetBindToDeviceRequest {}
726
727#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
728#[repr(C)]
729pub struct BaseSocketSetBindToInterfaceIndexRequest {
730    pub value: u64,
731}
732
733impl fidl::Persistable for BaseSocketSetBindToInterfaceIndexRequest {}
734
735#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
736pub struct BaseSocketSetBroadcastRequest {
737    pub value: bool,
738}
739
740impl fidl::Persistable for BaseSocketSetBroadcastRequest {}
741
742#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
743pub struct BaseSocketSetKeepAliveRequest {
744    pub value: bool,
745}
746
747impl fidl::Persistable for BaseSocketSetKeepAliveRequest {}
748
749#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
750pub struct BaseSocketSetLingerRequest {
751    pub linger: bool,
752    pub length_secs: u32,
753}
754
755impl fidl::Persistable for BaseSocketSetLingerRequest {}
756
757#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
758pub struct BaseSocketSetMarkRequest {
759    pub domain: fidl_fuchsia_net_common::MarkDomain,
760    pub mark: OptionalUint32,
761}
762
763impl fidl::Persistable for BaseSocketSetMarkRequest {}
764
765#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
766pub struct BaseSocketSetNoCheckRequest {
767    pub value: bool,
768}
769
770impl fidl::Persistable for BaseSocketSetNoCheckRequest {}
771
772#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
773pub struct BaseSocketSetOutOfBandInlineRequest {
774    pub value: bool,
775}
776
777impl fidl::Persistable for BaseSocketSetOutOfBandInlineRequest {}
778
779#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
780#[repr(C)]
781pub struct BaseSocketSetReceiveBufferRequest {
782    pub value_bytes: u64,
783}
784
785impl fidl::Persistable for BaseSocketSetReceiveBufferRequest {}
786
787#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
788pub struct BaseSocketSetReuseAddressRequest {
789    pub value: bool,
790}
791
792impl fidl::Persistable for BaseSocketSetReuseAddressRequest {}
793
794#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
795pub struct BaseSocketSetReusePortDeprecatedRequest {
796    pub value: bool,
797}
798
799impl fidl::Persistable for BaseSocketSetReusePortDeprecatedRequest {}
800
801#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
802#[repr(C)]
803pub struct BaseSocketSetSendBufferRequest {
804    pub value_bytes: u64,
805}
806
807impl fidl::Persistable for BaseSocketSetSendBufferRequest {}
808
809#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
810pub struct BaseSocketSetTimestampRequest {
811    pub value: TimestampOption,
812}
813
814impl fidl::Persistable for BaseSocketSetTimestampRequest {}
815
816#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
817pub struct BaseSocketGetAcceptConnResponse {
818    pub value: bool,
819}
820
821impl fidl::Persistable for BaseSocketGetAcceptConnResponse {}
822
823#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
824pub struct BaseSocketGetBindToDeviceResponse {
825    pub value: String,
826}
827
828impl fidl::Persistable for BaseSocketGetBindToDeviceResponse {}
829
830#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
831#[repr(C)]
832pub struct BaseSocketGetBindToInterfaceIndexResponse {
833    pub value: u64,
834}
835
836impl fidl::Persistable for BaseSocketGetBindToInterfaceIndexResponse {}
837
838#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
839pub struct BaseSocketGetBroadcastResponse {
840    pub value: bool,
841}
842
843impl fidl::Persistable for BaseSocketGetBroadcastResponse {}
844
845#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
846#[repr(C)]
847pub struct BaseSocketGetCookieResponse {
848    pub value: u64,
849}
850
851impl fidl::Persistable for BaseSocketGetCookieResponse {}
852
853#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
854pub struct BaseSocketGetKeepAliveResponse {
855    pub value: bool,
856}
857
858impl fidl::Persistable for BaseSocketGetKeepAliveResponse {}
859
860#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
861pub struct BaseSocketGetLingerResponse {
862    pub linger: bool,
863    pub length_secs: u32,
864}
865
866impl fidl::Persistable for BaseSocketGetLingerResponse {}
867
868#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
869pub struct BaseSocketGetMarkResponse {
870    pub mark: OptionalUint32,
871}
872
873impl fidl::Persistable for BaseSocketGetMarkResponse {}
874
875#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
876pub struct BaseSocketGetNoCheckResponse {
877    pub value: bool,
878}
879
880impl fidl::Persistable for BaseSocketGetNoCheckResponse {}
881
882#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
883pub struct BaseSocketGetOutOfBandInlineResponse {
884    pub value: bool,
885}
886
887impl fidl::Persistable for BaseSocketGetOutOfBandInlineResponse {}
888
889#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
890#[repr(C)]
891pub struct BaseSocketGetReceiveBufferResponse {
892    pub value_bytes: u64,
893}
894
895impl fidl::Persistable for BaseSocketGetReceiveBufferResponse {}
896
897#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
898pub struct BaseSocketGetReuseAddressResponse {
899    pub value: bool,
900}
901
902impl fidl::Persistable for BaseSocketGetReuseAddressResponse {}
903
904#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
905pub struct BaseSocketGetReusePortResponse {
906    pub value: bool,
907}
908
909impl fidl::Persistable for BaseSocketGetReusePortResponse {}
910
911#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
912#[repr(C)]
913pub struct BaseSocketGetSendBufferResponse {
914    pub value_bytes: u64,
915}
916
917impl fidl::Persistable for BaseSocketGetSendBufferResponse {}
918
919#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
920pub struct BaseSocketGetTimestampResponse {
921    pub value: TimestampOption,
922}
923
924impl fidl::Persistable for BaseSocketGetTimestampResponse {}
925
926#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
927pub struct Empty;
928
929impl fidl::Persistable for Empty {}
930
931/// IPv4 multicast membership options.
932#[derive(Clone, Debug, PartialEq)]
933pub struct IpMulticastMembership {
934    /// Interface index for membership.
935    pub iface: u64,
936    /// Local interface address requesting or relinquishing ownership.
937    pub local_addr: fidl_fuchsia_net_common::Ipv4Address,
938    /// Address of the multicast group the membership refers to.
939    pub mcast_addr: fidl_fuchsia_net_common::Ipv4Address,
940}
941
942impl fidl::Persistable for IpMulticastMembership {}
943
944#[derive(Clone, Debug, PartialEq)]
945pub struct Ipv4PktInfoRecvControlData {
946    /// The index of the interface on which the IP packet was received.
947    pub iface: u64,
948    /// The local address of the interface on which the packet was received.
949    pub local_addr: fidl_fuchsia_net_common::Ipv4Address,
950    /// The destination address specified in the received packet's IP
951    /// header.
952    pub header_destination_addr: fidl_fuchsia_net_common::Ipv4Address,
953}
954
955impl fidl::Persistable for Ipv4PktInfoRecvControlData {}
956
957/// IPv6 multicast membership options.
958#[derive(Clone, Debug, PartialEq)]
959pub struct Ipv6MulticastMembership {
960    /// Interface index for membership.
961    pub iface: u64,
962    /// Address of the multicast group the membership refers to.
963    pub mcast_addr: fidl_fuchsia_net_common::Ipv6Address,
964}
965
966impl fidl::Persistable for Ipv6MulticastMembership {}
967
968#[derive(Clone, Debug, PartialEq)]
969pub struct Ipv6PktInfoRecvControlData {
970    /// The index of the interface on which the IP packet was received.
971    pub iface: u64,
972    /// The destination address specified in the received packet's IP
973    /// header.
974    pub header_destination_addr: fidl_fuchsia_net_common::Ipv6Address,
975}
976
977impl fidl::Persistable for Ipv6PktInfoRecvControlData {}
978
979/// IPv6-specific disposition of sent data.
980///
981/// This is currently a struct instead of a table as it is meant to match
982/// `in6_pktinfo` which is not expected to grow.
983#[derive(Clone, Debug, PartialEq)]
984pub struct Ipv6PktInfoSendControlData {
985    /// The interface index from which the IPv6 packet should be sent.
986    ///
987    /// 0 indicates that the local interface is unspecified and the
988    /// stack may choose an appropriate interface.
989    pub iface: u64,
990    /// The source address from which the IPv6 packet should be sent.
991    ///
992    /// All zeroes indicates that the local address is unspecified and
993    /// the stack may choose an appropriate address (i.e. the local
994    /// address to which the socket is bound).
995    pub local_addr: fidl_fuchsia_net_common::Ipv6Address,
996}
997
998impl fidl::Persistable for Ipv6PktInfoSendControlData {}
999
1000#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1001pub struct ProviderDatagramSocketDeprecatedRequest {
1002    pub domain: Domain,
1003    pub proto: DatagramSocketProtocol,
1004}
1005
1006impl fidl::Persistable for ProviderDatagramSocketDeprecatedRequest {}
1007
1008#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1009pub struct ProviderDatagramSocketRequest {
1010    pub domain: Domain,
1011    pub proto: DatagramSocketProtocol,
1012}
1013
1014impl fidl::Persistable for ProviderDatagramSocketRequest {}
1015
1016#[derive(Clone, Debug, PartialEq)]
1017pub struct ProviderGetInterfaceAddressesResponse {
1018    pub interfaces: Vec<InterfaceAddresses>,
1019}
1020
1021impl fidl::Persistable for ProviderGetInterfaceAddressesResponse {}
1022
1023#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1024#[repr(C)]
1025pub struct ProviderInterfaceIndexToNameRequest {
1026    pub index: u64,
1027}
1028
1029impl fidl::Persistable for ProviderInterfaceIndexToNameRequest {}
1030
1031#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1032pub struct ProviderInterfaceNameToFlagsRequest {
1033    pub name: String,
1034}
1035
1036impl fidl::Persistable for ProviderInterfaceNameToFlagsRequest {}
1037
1038#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1039pub struct ProviderInterfaceNameToIndexRequest {
1040    pub name: String,
1041}
1042
1043impl fidl::Persistable for ProviderInterfaceNameToIndexRequest {}
1044
1045#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1046pub struct ProviderStreamSocketRequest {
1047    pub domain: Domain,
1048    pub proto: StreamSocketProtocol,
1049}
1050
1051impl fidl::Persistable for ProviderStreamSocketRequest {}
1052
1053#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1054pub struct ProviderInterfaceIndexToNameResponse {
1055    pub name: String,
1056}
1057
1058impl fidl::Persistable for ProviderInterfaceIndexToNameResponse {}
1059
1060#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1061pub struct ProviderInterfaceNameToFlagsResponse {
1062    pub flags: InterfaceFlags,
1063}
1064
1065impl fidl::Persistable for ProviderInterfaceNameToFlagsResponse {}
1066
1067#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1068#[repr(C)]
1069pub struct ProviderInterfaceNameToIndexResponse {
1070    pub index: u64,
1071}
1072
1073impl fidl::Persistable for ProviderInterfaceNameToIndexResponse {}
1074
1075#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1076pub struct StreamSocketAcceptRequest {
1077    pub want_addr: bool,
1078}
1079
1080impl fidl::Persistable for StreamSocketAcceptRequest {}
1081
1082#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1083#[repr(C)]
1084pub struct StreamSocketListenRequest {
1085    pub backlog: i16,
1086}
1087
1088impl fidl::Persistable for StreamSocketListenRequest {}
1089
1090#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1091pub struct StreamSocketSetTcpCongestionRequest {
1092    pub value: TcpCongestionControl,
1093}
1094
1095impl fidl::Persistable for StreamSocketSetTcpCongestionRequest {}
1096
1097#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1098pub struct StreamSocketSetTcpCorkRequest {
1099    pub value: bool,
1100}
1101
1102impl fidl::Persistable for StreamSocketSetTcpCorkRequest {}
1103
1104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1105#[repr(C)]
1106pub struct StreamSocketSetTcpDeferAcceptRequest {
1107    pub value_secs: u32,
1108}
1109
1110impl fidl::Persistable for StreamSocketSetTcpDeferAcceptRequest {}
1111
1112#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1113#[repr(C)]
1114pub struct StreamSocketSetTcpKeepAliveCountRequest {
1115    pub value: u32,
1116}
1117
1118impl fidl::Persistable for StreamSocketSetTcpKeepAliveCountRequest {}
1119
1120#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1121#[repr(C)]
1122pub struct StreamSocketSetTcpKeepAliveIdleRequest {
1123    pub value_secs: u32,
1124}
1125
1126impl fidl::Persistable for StreamSocketSetTcpKeepAliveIdleRequest {}
1127
1128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1129#[repr(C)]
1130pub struct StreamSocketSetTcpKeepAliveIntervalRequest {
1131    pub value_secs: u32,
1132}
1133
1134impl fidl::Persistable for StreamSocketSetTcpKeepAliveIntervalRequest {}
1135
1136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1137pub struct StreamSocketSetTcpLingerRequest {
1138    pub value_secs: OptionalUint32,
1139}
1140
1141impl fidl::Persistable for StreamSocketSetTcpLingerRequest {}
1142
1143#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1144#[repr(C)]
1145pub struct StreamSocketSetTcpMaxSegmentRequest {
1146    pub value_bytes: u32,
1147}
1148
1149impl fidl::Persistable for StreamSocketSetTcpMaxSegmentRequest {}
1150
1151#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1152pub struct StreamSocketSetTcpNoDelayRequest {
1153    pub value: bool,
1154}
1155
1156impl fidl::Persistable for StreamSocketSetTcpNoDelayRequest {}
1157
1158#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1159pub struct StreamSocketSetTcpQuickAckRequest {
1160    pub value: bool,
1161}
1162
1163impl fidl::Persistable for StreamSocketSetTcpQuickAckRequest {}
1164
1165#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1166#[repr(C)]
1167pub struct StreamSocketSetTcpSynCountRequest {
1168    pub value: u32,
1169}
1170
1171impl fidl::Persistable for StreamSocketSetTcpSynCountRequest {}
1172
1173#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1174#[repr(C)]
1175pub struct StreamSocketSetTcpUserTimeoutRequest {
1176    pub value_millis: u32,
1177}
1178
1179impl fidl::Persistable for StreamSocketSetTcpUserTimeoutRequest {}
1180
1181#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1182#[repr(C)]
1183pub struct StreamSocketSetTcpWindowClampRequest {
1184    pub value: u32,
1185}
1186
1187impl fidl::Persistable for StreamSocketSetTcpWindowClampRequest {}
1188
1189#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1190pub struct StreamSocketGetInfoResponse {
1191    pub domain: Domain,
1192    pub proto: StreamSocketProtocol,
1193}
1194
1195impl fidl::Persistable for StreamSocketGetInfoResponse {}
1196
1197#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1198pub struct StreamSocketGetTcpCongestionResponse {
1199    pub value: TcpCongestionControl,
1200}
1201
1202impl fidl::Persistable for StreamSocketGetTcpCongestionResponse {}
1203
1204#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1205pub struct StreamSocketGetTcpCorkResponse {
1206    pub value: bool,
1207}
1208
1209impl fidl::Persistable for StreamSocketGetTcpCorkResponse {}
1210
1211#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1212#[repr(C)]
1213pub struct StreamSocketGetTcpDeferAcceptResponse {
1214    pub value_secs: u32,
1215}
1216
1217impl fidl::Persistable for StreamSocketGetTcpDeferAcceptResponse {}
1218
1219#[derive(Clone, Debug, PartialEq)]
1220pub struct StreamSocketGetTcpInfoResponse {
1221    pub info: fidl_fuchsia_net_tcp_common::Info,
1222}
1223
1224impl fidl::Persistable for StreamSocketGetTcpInfoResponse {}
1225
1226#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1227#[repr(C)]
1228pub struct StreamSocketGetTcpKeepAliveCountResponse {
1229    pub value: u32,
1230}
1231
1232impl fidl::Persistable for StreamSocketGetTcpKeepAliveCountResponse {}
1233
1234#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1235#[repr(C)]
1236pub struct StreamSocketGetTcpKeepAliveIdleResponse {
1237    pub value_secs: u32,
1238}
1239
1240impl fidl::Persistable for StreamSocketGetTcpKeepAliveIdleResponse {}
1241
1242#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1243#[repr(C)]
1244pub struct StreamSocketGetTcpKeepAliveIntervalResponse {
1245    pub value_secs: u32,
1246}
1247
1248impl fidl::Persistable for StreamSocketGetTcpKeepAliveIntervalResponse {}
1249
1250#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1251pub struct StreamSocketGetTcpLingerResponse {
1252    pub value_secs: OptionalUint32,
1253}
1254
1255impl fidl::Persistable for StreamSocketGetTcpLingerResponse {}
1256
1257#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1258#[repr(C)]
1259pub struct StreamSocketGetTcpMaxSegmentResponse {
1260    pub value_bytes: u32,
1261}
1262
1263impl fidl::Persistable for StreamSocketGetTcpMaxSegmentResponse {}
1264
1265#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1266pub struct StreamSocketGetTcpNoDelayResponse {
1267    pub value: bool,
1268}
1269
1270impl fidl::Persistable for StreamSocketGetTcpNoDelayResponse {}
1271
1272#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1273pub struct StreamSocketGetTcpQuickAckResponse {
1274    pub value: bool,
1275}
1276
1277impl fidl::Persistable for StreamSocketGetTcpQuickAckResponse {}
1278
1279#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1280#[repr(C)]
1281pub struct StreamSocketGetTcpSynCountResponse {
1282    pub value: u32,
1283}
1284
1285impl fidl::Persistable for StreamSocketGetTcpSynCountResponse {}
1286
1287#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1288#[repr(C)]
1289pub struct StreamSocketGetTcpUserTimeoutResponse {
1290    pub value_millis: u32,
1291}
1292
1293impl fidl::Persistable for StreamSocketGetTcpUserTimeoutResponse {}
1294
1295#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1296#[repr(C)]
1297pub struct StreamSocketGetTcpWindowClampResponse {
1298    pub value: u32,
1299}
1300
1301impl fidl::Persistable for StreamSocketGetTcpWindowClampResponse {}
1302
1303#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1304pub struct SynchronousDatagramSocketRecvMsgRequest {
1305    pub want_addr: bool,
1306    pub data_len: u32,
1307    pub want_control: bool,
1308    pub flags: RecvMsgFlags,
1309}
1310
1311impl fidl::Persistable for SynchronousDatagramSocketRecvMsgRequest {}
1312
1313#[derive(Clone, Debug, PartialEq)]
1314pub struct SynchronousDatagramSocketSendMsgRequest {
1315    pub addr: Option<Box<fidl_fuchsia_net_common::SocketAddress>>,
1316    pub data: Vec<u8>,
1317    pub control: DatagramSocketSendControlData,
1318    pub flags: SendMsgFlags,
1319}
1320
1321impl fidl::Persistable for SynchronousDatagramSocketSendMsgRequest {}
1322
1323#[derive(Clone, Debug, PartialEq)]
1324pub struct SynchronousDatagramSocketRecvMsgResponse {
1325    pub addr: Option<Box<fidl_fuchsia_net_common::SocketAddress>>,
1326    pub data: Vec<u8>,
1327    pub control: DatagramSocketRecvControlData,
1328    pub truncated: u32,
1329}
1330
1331impl fidl::Persistable for SynchronousDatagramSocketRecvMsgResponse {}
1332
1333#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1334#[repr(C)]
1335pub struct SynchronousDatagramSocketSendMsgResponse {
1336    pub len: i64,
1337}
1338
1339impl fidl::Persistable for SynchronousDatagramSocketSendMsgResponse {}
1340
1341#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1342pub struct Timestamp {
1343    /// Time in nanoseconds since epoch (January 1 1970 GMT).
1344    pub nanoseconds: i64,
1345    /// Identifies whether/how the timestamp should be returned to the user.
1346    /// Ignored in the DatagramSocket protocol.
1347    pub requested: TimestampOption,
1348}
1349
1350impl fidl::Persistable for Timestamp {}
1351
1352#[derive(Clone, Debug, Default, PartialEq)]
1353pub struct DatagramSocketRecvControlData {
1354    /// Network socket ancillary data.
1355    pub network: Option<NetworkSocketRecvControlData>,
1356    #[doc(hidden)]
1357    pub __source_breaking: fidl::marker::SourceBreaking,
1358}
1359
1360impl fidl::Persistable for DatagramSocketRecvControlData {}
1361
1362#[derive(Clone, Debug, Default, PartialEq)]
1363pub struct DatagramSocketSendControlData {
1364    /// Network socket ancillary data.
1365    pub network: Option<NetworkSocketSendControlData>,
1366    #[doc(hidden)]
1367    pub __source_breaking: fidl::marker::SourceBreaking,
1368}
1369
1370impl fidl::Persistable for DatagramSocketSendControlData {}
1371
1372#[derive(Clone, Debug, Default, PartialEq)]
1373pub struct DatagramSocketSendMsgPreflightRequest {
1374    /// The destination address.
1375    ///
1376    /// If absent, interpreted as the method receiver's connected address and
1377    /// causes the connected address to be returned.
1378    ///
1379    /// Required if the method receiver is not connected.
1380    pub to: Option<fidl_fuchsia_net_common::SocketAddress>,
1381    /// Information controlling the local interface and/or address used when
1382    /// sending an IPv6 packet.
1383    ///
1384    /// If absent, indicates that the stack is free to choose an appropriate
1385    /// outgoing route.
1386    pub ipv6_pktinfo: Option<Ipv6PktInfoSendControlData>,
1387    #[doc(hidden)]
1388    pub __source_breaking: fidl::marker::SourceBreaking,
1389}
1390
1391impl fidl::Persistable for DatagramSocketSendMsgPreflightRequest {}
1392
1393/// Holds information about an interface and its addresses.
1394#[derive(Clone, Debug, Default, PartialEq)]
1395pub struct InterfaceAddresses {
1396    /// ID of the interface.
1397    pub id: Option<u64>,
1398    /// Name of the interface.
1399    pub name: Option<String>,
1400    /// All addresses currently assigned to the interface.
1401    pub addresses: Option<Vec<fidl_fuchsia_net_common::Subnet>>,
1402    /// Contains the interface flags, as returned by the SIOCGIFFLAGS ioctl
1403    /// operation.
1404    pub interface_flags: Option<InterfaceFlags>,
1405    #[doc(hidden)]
1406    pub __source_breaking: fidl::marker::SourceBreaking,
1407}
1408
1409impl fidl::Persistable for InterfaceAddresses {}
1410
1411#[derive(Clone, Debug, Default, PartialEq)]
1412pub struct IpRecvControlData {
1413    /// The Type of Service value found in a received packet's IPv4 header.
1414    ///
1415    /// Present if the `SOL_IP` -> `IP_RECVTOS` option is enabled.
1416    pub tos: Option<u8>,
1417    /// The Time to Live value found in a received packet's IPv4 header.
1418    ///
1419    /// Present if the `SOL_IP` -> `IP_RECVTTL` option is enabled.
1420    pub ttl: Option<u8>,
1421    /// The original destination address.
1422    ///
1423    /// Present if the `SOL_IP` -> `IP_RECVORIGDSTADDR` option is enabled.
1424    pub original_destination_address: Option<fidl_fuchsia_net_common::SocketAddress>,
1425    /// The packet information of a packet that was received.
1426    ///
1427    /// Present if the `SOL_IP` -> `IP_PKTINFO` option is enabled.
1428    pub pktinfo: Option<Ipv4PktInfoRecvControlData>,
1429    #[doc(hidden)]
1430    pub __source_breaking: fidl::marker::SourceBreaking,
1431}
1432
1433impl fidl::Persistable for IpRecvControlData {}
1434
1435#[derive(Clone, Debug, Default, PartialEq)]
1436pub struct IpSendControlData {
1437    /// The Time to Live value to set in the IPv4 header of an outgoing
1438    /// packet.
1439    pub ttl: Option<u8>,
1440    #[doc(hidden)]
1441    pub __source_breaking: fidl::marker::SourceBreaking,
1442}
1443
1444impl fidl::Persistable for IpSendControlData {}
1445
1446#[derive(Clone, Debug, Default, PartialEq)]
1447pub struct Ipv6RecvControlData {
1448    /// The Traffic Class of a packet that was received.
1449    ///
1450    /// Present if the `SOL_IPV6` -> `IPV6_RECVTCLASS` option is enabled.
1451    pub tclass: Option<u8>,
1452    /// The Hop Limit of a packet that was received.
1453    ///
1454    /// Present if the `SOL_IPV6` -> `IPV6_RECVHOPLIMIT` option is enabled.
1455    pub hoplimit: Option<u8>,
1456    /// The packet information of a packet that was received.
1457    ///
1458    /// Present if the `SOL_IPV6` -> `IPV6_RECVPKTINFO` option is enabled.
1459    pub pktinfo: Option<Ipv6PktInfoRecvControlData>,
1460    #[doc(hidden)]
1461    pub __source_breaking: fidl::marker::SourceBreaking,
1462}
1463
1464impl fidl::Persistable for Ipv6RecvControlData {}
1465
1466#[derive(Clone, Debug, Default, PartialEq)]
1467pub struct Ipv6SendControlData {
1468    /// The Hop Limit value to set in the IPv6 header of an outgoing
1469    /// packet.
1470    pub hoplimit: Option<u8>,
1471    /// Information controlling the local interface and/or address used when
1472    /// sending an IPv6 packet.
1473    pub pktinfo: Option<Ipv6PktInfoSendControlData>,
1474    #[doc(hidden)]
1475    pub __source_breaking: fidl::marker::SourceBreaking,
1476}
1477
1478impl fidl::Persistable for Ipv6SendControlData {}
1479
1480/// Network socket (L3) ancillary data that can be received.
1481#[derive(Clone, Debug, Default, PartialEq)]
1482pub struct NetworkSocketRecvControlData {
1483    /// Socket level ancillary data.
1484    pub socket: Option<SocketRecvControlData>,
1485    /// IPv4 level ancillary data.
1486    ///
1487    /// These match POSIX `SOL_IP` control messages.
1488    pub ip: Option<IpRecvControlData>,
1489    /// IPv6 level ancillary data.
1490    ///
1491    /// These match POSIX `SOL_IPV6` control messages.
1492    pub ipv6: Option<Ipv6RecvControlData>,
1493    #[doc(hidden)]
1494    pub __source_breaking: fidl::marker::SourceBreaking,
1495}
1496
1497impl fidl::Persistable for NetworkSocketRecvControlData {}
1498
1499/// Network socket (L3) ancillary data that can be sent.
1500#[derive(Clone, Debug, Default, PartialEq)]
1501pub struct NetworkSocketSendControlData {
1502    /// Socket level ancillary data.
1503    pub socket: Option<SocketSendControlData>,
1504    /// IPv4 level ancillary data.
1505    ///
1506    /// These match POSIX `SOL_IP` control messages.
1507    pub ip: Option<IpSendControlData>,
1508    /// IPv6 level ancillary data.
1509    ///
1510    /// These match POSIX `SOL_IPV6` control messages.
1511    pub ipv6: Option<Ipv6SendControlData>,
1512    #[doc(hidden)]
1513    pub __source_breaking: fidl::marker::SourceBreaking,
1514}
1515
1516impl fidl::Persistable for NetworkSocketSendControlData {}
1517
1518/// Metadata of a received datagram.
1519#[derive(Clone, Debug, Default, PartialEq)]
1520pub struct RecvMsgMeta {
1521    /// The from address of the datagram.
1522    pub from: Option<fidl_fuchsia_net_common::SocketAddress>,
1523    /// Ancillary control message data describing the datagram.
1524    pub control: Option<DatagramSocketRecvControlData>,
1525    /// The length of the payload, in bytes.
1526    pub payload_len: Option<u16>,
1527    #[doc(hidden)]
1528    pub __source_breaking: fidl::marker::SourceBreaking,
1529}
1530
1531impl fidl::Persistable for RecvMsgMeta {}
1532
1533/// Metadata of a sent datagram.
1534#[derive(Clone, Debug, Default, PartialEq)]
1535pub struct SendMsgMeta {
1536    /// The destination address, if specified.
1537    pub to: Option<fidl_fuchsia_net_common::SocketAddress>,
1538    /// Ancillary control message data used for sending the payload.
1539    pub control: Option<DatagramSocketSendControlData>,
1540    #[doc(hidden)]
1541    pub __source_breaking: fidl::marker::SourceBreaking,
1542}
1543
1544impl fidl::Persistable for SendMsgMeta {}
1545
1546/// Socket level ancillary data that can be received.
1547///
1548/// These match control messages with a `SOL_SOCKET` level.
1549#[derive(Clone, Debug, Default, PartialEq)]
1550pub struct SocketRecvControlData {
1551    /// Data about the time at which the packet was received.
1552    pub timestamp: Option<Timestamp>,
1553    #[doc(hidden)]
1554    pub __source_breaking: fidl::marker::SourceBreaking,
1555}
1556
1557impl fidl::Persistable for SocketRecvControlData {}
1558
1559/// Socket level ancillary data that can be sent.
1560///
1561/// These match the POSIX `SOL_SOCKET` control messages.
1562#[derive(Clone, Debug, Default, PartialEq)]
1563pub struct SocketSendControlData {
1564    #[doc(hidden)]
1565    pub __source_breaking: fidl::marker::SourceBreaking,
1566}
1567
1568impl fidl::Persistable for SocketSendControlData {}
1569
1570/// An optional uint32 value.
1571#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1572pub enum OptionalUint32 {
1573    Value(u32),
1574    Unset(Empty),
1575}
1576
1577impl OptionalUint32 {
1578    #[inline]
1579    pub fn ordinal(&self) -> u64 {
1580        match *self {
1581            Self::Value(_) => 1,
1582            Self::Unset(_) => 2,
1583        }
1584    }
1585}
1586
1587impl fidl::Persistable for OptionalUint32 {}
1588
1589/// An optional byte value.
1590#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1591pub enum OptionalUint8 {
1592    Value(u8),
1593    Unset(Empty),
1594}
1595
1596impl OptionalUint8 {
1597    #[inline]
1598    pub fn ordinal(&self) -> u64 {
1599        match *self {
1600            Self::Value(_) => 1,
1601            Self::Unset(_) => 2,
1602        }
1603    }
1604}
1605
1606impl fidl::Persistable for OptionalUint8 {}
1607
1608pub mod base_datagram_socket_ordinals {
1609    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1610    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1611    pub const QUERY: u64 = 0x2658edee9decfc06;
1612    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1613    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1614    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1615    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1616    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1617    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1618    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1619    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1620    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1621    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1622    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1623    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1624    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1625    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1626    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1627    pub const SET_LINGER: u64 = 0x45386351246e998e;
1628    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1629    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1630    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1631    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1632    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1633    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1634    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1635    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1636    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1637    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1638    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1639    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1640    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1641    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1642    pub const BIND: u64 = 0x4bc6400ae92125d;
1643    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1644    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1645    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1646    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1647    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1648    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1649    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1650    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1651    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1652    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1653    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1654    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1655    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1656    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1657    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1658    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1659    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1660    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1661    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1662    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1663    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1664    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1665    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1666    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1667    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1668    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1669    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1670    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1671    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1672    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1673    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1674    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1675    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1676    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1677    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1678    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1679    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1680    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1681    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1682    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1683    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1684    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1685    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1686    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1687    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1688    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1689    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1690    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1691    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
1692}
1693
1694pub mod base_network_socket_ordinals {
1695    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1696    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1697    pub const QUERY: u64 = 0x2658edee9decfc06;
1698    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1699    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1700    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1701    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1702    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1703    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1704    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1705    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1706    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1707    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1708    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1709    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1710    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1711    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1712    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1713    pub const SET_LINGER: u64 = 0x45386351246e998e;
1714    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1715    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1716    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1717    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1718    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1719    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1720    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1721    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1722    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1723    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1724    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1725    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1726    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1727    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1728    pub const BIND: u64 = 0x4bc6400ae92125d;
1729    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1730    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1731    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1732    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1733    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1734    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1735    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1736    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1737    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1738    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1739    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1740    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1741    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1742    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1743    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1744    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1745    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1746    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1747    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1748    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1749    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1750    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1751    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1752    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1753    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1754    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1755    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1756    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1757    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1758    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1759    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1760    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1761    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1762    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1763    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1764    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1765    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1766    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1767    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1768    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1769    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1770    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1771    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1772    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1773    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1774    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1775    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1776    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1777}
1778
1779pub mod base_socket_ordinals {
1780    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1781    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1782    pub const QUERY: u64 = 0x2658edee9decfc06;
1783    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1784    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1785    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1786    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1787    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1788    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1789    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1790    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1791    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1792    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1793    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1794    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1795    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1796    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1797    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1798    pub const SET_LINGER: u64 = 0x45386351246e998e;
1799    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1800    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1801    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1802    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1803    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1804    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1805    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1806    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1807    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1808    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1809    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1810    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1811    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1812    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1813}
1814
1815pub mod datagram_socket_ordinals {
1816    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1817    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1818    pub const QUERY: u64 = 0x2658edee9decfc06;
1819    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1820    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1821    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1822    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1823    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1824    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1825    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1826    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1827    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1828    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1829    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1830    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1831    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1832    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1833    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1834    pub const SET_LINGER: u64 = 0x45386351246e998e;
1835    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1836    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1837    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1838    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1839    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1840    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1841    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1842    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1843    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1844    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1845    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1846    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1847    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1848    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1849    pub const BIND: u64 = 0x4bc6400ae92125d;
1850    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1851    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1852    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1853    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1854    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1855    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1856    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1857    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1858    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1859    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1860    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1861    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1862    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1863    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1864    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1865    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1866    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1867    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1868    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1869    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1870    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1871    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1872    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1873    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1874    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1875    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1876    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1877    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1878    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1879    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1880    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1881    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1882    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1883    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1884    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1885    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1886    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1887    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1888    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1889    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1890    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1891    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1892    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1893    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1894    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1895    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1896    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1897    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1898    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
1899    pub const DESCRIBE: u64 = 0xbf1e2f0a86601f3;
1900    pub const SEND_MSG_PREFLIGHT: u64 = 0x5362e668e777248a;
1901    pub const RECV_MSG_POSTFLIGHT: u64 = 0x1a7cdeca5f3eb8e2;
1902}
1903
1904pub mod provider_ordinals {
1905    pub const STREAM_SOCKET_WITH_OPTIONS: u64 = 0x3969bf7eb78386e0;
1906    pub const STREAM_SOCKET: u64 = 0x27c3581da2155545;
1907    pub const DATAGRAM_SOCKET_DEPRECATED: u64 = 0x38876c87cf031cb1;
1908    pub const DATAGRAM_SOCKET: u64 = 0x4021b4fa1b6452f2;
1909    pub const DATAGRAM_SOCKET_WITH_OPTIONS: u64 = 0x4cd0cffbffa39eb1;
1910    pub const INTERFACE_INDEX_TO_NAME: u64 = 0x4d59a64fce98272f;
1911    pub const INTERFACE_NAME_TO_INDEX: u64 = 0x690cd8d2f2d650f8;
1912    pub const INTERFACE_NAME_TO_FLAGS: u64 = 0x25d0efcdb6671a0b;
1913    pub const GET_INTERFACE_ADDRESSES: u64 = 0x2e7b9aaf327c870;
1914}
1915
1916pub mod stream_socket_ordinals {
1917    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1918    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1919    pub const QUERY: u64 = 0x2658edee9decfc06;
1920    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1921    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1922    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1923    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1924    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1925    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1926    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1927    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1928    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1929    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1930    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1931    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1932    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1933    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1934    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1935    pub const SET_LINGER: u64 = 0x45386351246e998e;
1936    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1937    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1938    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1939    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1940    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1941    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1942    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1943    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1944    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1945    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1946    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1947    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1948    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1949    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1950    pub const BIND: u64 = 0x4bc6400ae92125d;
1951    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1952    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1953    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1954    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1955    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1956    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1957    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1958    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1959    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1960    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1961    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1962    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1963    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1964    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1965    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1966    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1967    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1968    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1969    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1970    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1971    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1972    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1973    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1974    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1975    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1976    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1977    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1978    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1979    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1980    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1981    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1982    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1983    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1984    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1985    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1986    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1987    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1988    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1989    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1990    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1991    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1992    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1993    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1994    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1995    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1996    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1997    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1998    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1999    pub const DESCRIBE: u64 = 0x29e22969a7dadc32;
2000    pub const LISTEN: u64 = 0x3d0a65ced3d10108;
2001    pub const ACCEPT: u64 = 0x5ab7ad620424c163;
2002    pub const GET_INFO: u64 = 0x87cfa55d19f878f;
2003    pub const SET_TCP_NO_DELAY: u64 = 0x5a59b778f7333ada;
2004    pub const GET_TCP_NO_DELAY: u64 = 0xac219a3218b0799;
2005    pub const SET_TCP_MAX_SEGMENT: u64 = 0xb3d30c498266d18;
2006    pub const GET_TCP_MAX_SEGMENT: u64 = 0x637404d1b4b9982c;
2007    pub const SET_TCP_CORK: u64 = 0x62e26891541143a0;
2008    pub const GET_TCP_CORK: u64 = 0x435bb232e0e74f32;
2009    pub const SET_TCP_KEEP_ALIVE_IDLE: u64 = 0x196d053d8363c42;
2010    pub const GET_TCP_KEEP_ALIVE_IDLE: u64 = 0x35ec58564879dac;
2011    pub const SET_TCP_KEEP_ALIVE_INTERVAL: u64 = 0x485ffbc2da1243f2;
2012    pub const GET_TCP_KEEP_ALIVE_INTERVAL: u64 = 0x264eaf46306b284;
2013    pub const SET_TCP_KEEP_ALIVE_COUNT: u64 = 0x2ab2e8c111708421;
2014    pub const GET_TCP_KEEP_ALIVE_COUNT: u64 = 0x2f176ae271fe7a09;
2015    pub const SET_TCP_SYN_COUNT: u64 = 0x4dcd6ab5573c1eb3;
2016    pub const GET_TCP_SYN_COUNT: u64 = 0x7d457cba8f5f3ee6;
2017    pub const SET_TCP_LINGER: u64 = 0xd5cc1e8654d36e4;
2018    pub const GET_TCP_LINGER: u64 = 0xad870d311cf30eb;
2019    pub const SET_TCP_DEFER_ACCEPT: u64 = 0x15092f181e57c404;
2020    pub const GET_TCP_DEFER_ACCEPT: u64 = 0x64589790842cb7c6;
2021    pub const SET_TCP_WINDOW_CLAMP: u64 = 0x4a26ce07d847f1c6;
2022    pub const GET_TCP_WINDOW_CLAMP: u64 = 0x2df6b636bf0a6a4e;
2023    pub const GET_TCP_INFO: u64 = 0x1ffb123d9f03ead2;
2024    pub const SET_TCP_QUICK_ACK: u64 = 0x6fa811be8fde7457;
2025    pub const GET_TCP_QUICK_ACK: u64 = 0x7356a949bef2df32;
2026    pub const SET_TCP_CONGESTION: u64 = 0x7924c6eabde7819e;
2027    pub const GET_TCP_CONGESTION: u64 = 0x11e16397e1b72a47;
2028    pub const SET_TCP_USER_TIMEOUT: u64 = 0x6b459e81c3741a60;
2029    pub const GET_TCP_USER_TIMEOUT: u64 = 0x24bbd5858ad8c380;
2030}
2031
2032pub mod synchronous_datagram_socket_ordinals {
2033    pub const CLONE: u64 = 0x20d8a7aba2168a79;
2034    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
2035    pub const QUERY: u64 = 0x2658edee9decfc06;
2036    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
2037    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
2038    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
2039    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
2040    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
2041    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
2042    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
2043    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
2044    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
2045    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
2046    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
2047    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
2048    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
2049    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
2050    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
2051    pub const SET_LINGER: u64 = 0x45386351246e998e;
2052    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
2053    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
2054    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
2055    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
2056    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
2057    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
2058    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
2059    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
2060    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
2061    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
2062    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
2063    pub const SET_MARK: u64 = 0x6ead6de09f653236;
2064    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
2065    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
2066    pub const BIND: u64 = 0x4bc6400ae92125d;
2067    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
2068    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
2069    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
2070    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
2071    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
2072    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
2073    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
2074    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
2075    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
2076    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
2077    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
2078    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
2079    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
2080    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
2081    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
2082    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
2083    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
2084    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
2085    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
2086    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
2087    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
2088    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
2089    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
2090    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
2091    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
2092    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
2093    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
2094    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
2095    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
2096    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
2097    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
2098    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
2099    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
2100    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
2101    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
2102    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
2103    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
2104    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
2105    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
2106    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
2107    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
2108    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
2109    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
2110    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
2111    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
2112    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
2113    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
2114    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
2115    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
2116    pub const DESCRIBE: u64 = 0x585f20b73631070d;
2117    pub const RECV_MSG: u64 = 0x28e494e48fb5dbf3;
2118    pub const SEND_MSG: u64 = 0x12dc2fceab6cefaa;
2119}
2120
2121mod internal {
2122    use super::*;
2123    unsafe impl fidl::encoding::TypeMarker for CmsgRequests {
2124        type Owned = Self;
2125
2126        #[inline(always)]
2127        fn inline_align(_context: fidl::encoding::Context) -> usize {
2128            4
2129        }
2130
2131        #[inline(always)]
2132        fn inline_size(_context: fidl::encoding::Context) -> usize {
2133            4
2134        }
2135    }
2136
2137    impl fidl::encoding::ValueTypeMarker for CmsgRequests {
2138        type Borrowed<'a> = Self;
2139        #[inline(always)]
2140        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2141            *value
2142        }
2143    }
2144
2145    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CmsgRequests {
2146        #[inline]
2147        unsafe fn encode(
2148            self,
2149            encoder: &mut fidl::encoding::Encoder<'_, D>,
2150            offset: usize,
2151            _depth: fidl::encoding::Depth,
2152        ) -> fidl::Result<()> {
2153            encoder.debug_check_bounds::<Self>(offset);
2154            encoder.write_num(self.bits(), offset);
2155            Ok(())
2156        }
2157    }
2158
2159    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CmsgRequests {
2160        #[inline(always)]
2161        fn new_empty() -> Self {
2162            Self::empty()
2163        }
2164
2165        #[inline]
2166        unsafe fn decode(
2167            &mut self,
2168            decoder: &mut fidl::encoding::Decoder<'_, D>,
2169            offset: usize,
2170            _depth: fidl::encoding::Depth,
2171        ) -> fidl::Result<()> {
2172            decoder.debug_check_bounds::<Self>(offset);
2173            let prim = decoder.read_num::<u32>(offset);
2174            *self = Self::from_bits_allow_unknown(prim);
2175            Ok(())
2176        }
2177    }
2178    unsafe impl fidl::encoding::TypeMarker for InterfaceFlags {
2179        type Owned = Self;
2180
2181        #[inline(always)]
2182        fn inline_align(_context: fidl::encoding::Context) -> usize {
2183            2
2184        }
2185
2186        #[inline(always)]
2187        fn inline_size(_context: fidl::encoding::Context) -> usize {
2188            2
2189        }
2190    }
2191
2192    impl fidl::encoding::ValueTypeMarker for InterfaceFlags {
2193        type Borrowed<'a> = Self;
2194        #[inline(always)]
2195        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2196            *value
2197        }
2198    }
2199
2200    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for InterfaceFlags {
2201        #[inline]
2202        unsafe fn encode(
2203            self,
2204            encoder: &mut fidl::encoding::Encoder<'_, D>,
2205            offset: usize,
2206            _depth: fidl::encoding::Depth,
2207        ) -> fidl::Result<()> {
2208            encoder.debug_check_bounds::<Self>(offset);
2209            if self.bits() & Self::all().bits() != self.bits() {
2210                return Err(fidl::Error::InvalidBitsValue);
2211            }
2212            encoder.write_num(self.bits(), offset);
2213            Ok(())
2214        }
2215    }
2216
2217    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceFlags {
2218        #[inline(always)]
2219        fn new_empty() -> Self {
2220            Self::empty()
2221        }
2222
2223        #[inline]
2224        unsafe fn decode(
2225            &mut self,
2226            decoder: &mut fidl::encoding::Decoder<'_, D>,
2227            offset: usize,
2228            _depth: fidl::encoding::Depth,
2229        ) -> fidl::Result<()> {
2230            decoder.debug_check_bounds::<Self>(offset);
2231            let prim = decoder.read_num::<u16>(offset);
2232            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2233            Ok(())
2234        }
2235    }
2236    unsafe impl fidl::encoding::TypeMarker for RecvMsgFlags {
2237        type Owned = Self;
2238
2239        #[inline(always)]
2240        fn inline_align(_context: fidl::encoding::Context) -> usize {
2241            2
2242        }
2243
2244        #[inline(always)]
2245        fn inline_size(_context: fidl::encoding::Context) -> usize {
2246            2
2247        }
2248    }
2249
2250    impl fidl::encoding::ValueTypeMarker for RecvMsgFlags {
2251        type Borrowed<'a> = Self;
2252        #[inline(always)]
2253        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2254            *value
2255        }
2256    }
2257
2258    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RecvMsgFlags {
2259        #[inline]
2260        unsafe fn encode(
2261            self,
2262            encoder: &mut fidl::encoding::Encoder<'_, D>,
2263            offset: usize,
2264            _depth: fidl::encoding::Depth,
2265        ) -> fidl::Result<()> {
2266            encoder.debug_check_bounds::<Self>(offset);
2267            if self.bits() & Self::all().bits() != self.bits() {
2268                return Err(fidl::Error::InvalidBitsValue);
2269            }
2270            encoder.write_num(self.bits(), offset);
2271            Ok(())
2272        }
2273    }
2274
2275    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgFlags {
2276        #[inline(always)]
2277        fn new_empty() -> Self {
2278            Self::empty()
2279        }
2280
2281        #[inline]
2282        unsafe fn decode(
2283            &mut self,
2284            decoder: &mut fidl::encoding::Decoder<'_, D>,
2285            offset: usize,
2286            _depth: fidl::encoding::Depth,
2287        ) -> fidl::Result<()> {
2288            decoder.debug_check_bounds::<Self>(offset);
2289            let prim = decoder.read_num::<u16>(offset);
2290            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2291            Ok(())
2292        }
2293    }
2294    unsafe impl fidl::encoding::TypeMarker for SendMsgFlags {
2295        type Owned = Self;
2296
2297        #[inline(always)]
2298        fn inline_align(_context: fidl::encoding::Context) -> usize {
2299            2
2300        }
2301
2302        #[inline(always)]
2303        fn inline_size(_context: fidl::encoding::Context) -> usize {
2304            2
2305        }
2306    }
2307
2308    impl fidl::encoding::ValueTypeMarker for SendMsgFlags {
2309        type Borrowed<'a> = Self;
2310        #[inline(always)]
2311        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2312            *value
2313        }
2314    }
2315
2316    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SendMsgFlags {
2317        #[inline]
2318        unsafe fn encode(
2319            self,
2320            encoder: &mut fidl::encoding::Encoder<'_, D>,
2321            offset: usize,
2322            _depth: fidl::encoding::Depth,
2323        ) -> fidl::Result<()> {
2324            encoder.debug_check_bounds::<Self>(offset);
2325            if self.bits() & Self::all().bits() != self.bits() {
2326                return Err(fidl::Error::InvalidBitsValue);
2327            }
2328            encoder.write_num(self.bits(), offset);
2329            Ok(())
2330        }
2331    }
2332
2333    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgFlags {
2334        #[inline(always)]
2335        fn new_empty() -> Self {
2336            Self::empty()
2337        }
2338
2339        #[inline]
2340        unsafe fn decode(
2341            &mut self,
2342            decoder: &mut fidl::encoding::Decoder<'_, D>,
2343            offset: usize,
2344            _depth: fidl::encoding::Depth,
2345        ) -> fidl::Result<()> {
2346            decoder.debug_check_bounds::<Self>(offset);
2347            let prim = decoder.read_num::<u16>(offset);
2348            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2349            Ok(())
2350        }
2351    }
2352    unsafe impl fidl::encoding::TypeMarker for ShutdownMode {
2353        type Owned = Self;
2354
2355        #[inline(always)]
2356        fn inline_align(_context: fidl::encoding::Context) -> usize {
2357            2
2358        }
2359
2360        #[inline(always)]
2361        fn inline_size(_context: fidl::encoding::Context) -> usize {
2362            2
2363        }
2364    }
2365
2366    impl fidl::encoding::ValueTypeMarker for ShutdownMode {
2367        type Borrowed<'a> = Self;
2368        #[inline(always)]
2369        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2370            *value
2371        }
2372    }
2373
2374    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShutdownMode {
2375        #[inline]
2376        unsafe fn encode(
2377            self,
2378            encoder: &mut fidl::encoding::Encoder<'_, D>,
2379            offset: usize,
2380            _depth: fidl::encoding::Depth,
2381        ) -> fidl::Result<()> {
2382            encoder.debug_check_bounds::<Self>(offset);
2383            if self.bits() & Self::all().bits() != self.bits() {
2384                return Err(fidl::Error::InvalidBitsValue);
2385            }
2386            encoder.write_num(self.bits(), offset);
2387            Ok(())
2388        }
2389    }
2390
2391    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShutdownMode {
2392        #[inline(always)]
2393        fn new_empty() -> Self {
2394            Self::empty()
2395        }
2396
2397        #[inline]
2398        unsafe fn decode(
2399            &mut self,
2400            decoder: &mut fidl::encoding::Decoder<'_, D>,
2401            offset: usize,
2402            _depth: fidl::encoding::Depth,
2403        ) -> fidl::Result<()> {
2404            decoder.debug_check_bounds::<Self>(offset);
2405            let prim = decoder.read_num::<u16>(offset);
2406            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2407            Ok(())
2408        }
2409    }
2410    unsafe impl fidl::encoding::TypeMarker for DatagramSocketProtocol {
2411        type Owned = Self;
2412
2413        #[inline(always)]
2414        fn inline_align(_context: fidl::encoding::Context) -> usize {
2415            std::mem::align_of::<u32>()
2416        }
2417
2418        #[inline(always)]
2419        fn inline_size(_context: fidl::encoding::Context) -> usize {
2420            std::mem::size_of::<u32>()
2421        }
2422
2423        #[inline(always)]
2424        fn encode_is_copy() -> bool {
2425            true
2426        }
2427
2428        #[inline(always)]
2429        fn decode_is_copy() -> bool {
2430            false
2431        }
2432    }
2433
2434    impl fidl::encoding::ValueTypeMarker for DatagramSocketProtocol {
2435        type Borrowed<'a> = Self;
2436        #[inline(always)]
2437        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2438            *value
2439        }
2440    }
2441
2442    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2443        for DatagramSocketProtocol
2444    {
2445        #[inline]
2446        unsafe fn encode(
2447            self,
2448            encoder: &mut fidl::encoding::Encoder<'_, D>,
2449            offset: usize,
2450            _depth: fidl::encoding::Depth,
2451        ) -> fidl::Result<()> {
2452            encoder.debug_check_bounds::<Self>(offset);
2453            encoder.write_num(self.into_primitive(), offset);
2454            Ok(())
2455        }
2456    }
2457
2458    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2459        for DatagramSocketProtocol
2460    {
2461        #[inline(always)]
2462        fn new_empty() -> Self {
2463            Self::Udp
2464        }
2465
2466        #[inline]
2467        unsafe fn decode(
2468            &mut self,
2469            decoder: &mut fidl::encoding::Decoder<'_, D>,
2470            offset: usize,
2471            _depth: fidl::encoding::Depth,
2472        ) -> fidl::Result<()> {
2473            decoder.debug_check_bounds::<Self>(offset);
2474            let prim = decoder.read_num::<u32>(offset);
2475
2476            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2477            Ok(())
2478        }
2479    }
2480    unsafe impl fidl::encoding::TypeMarker for Domain {
2481        type Owned = Self;
2482
2483        #[inline(always)]
2484        fn inline_align(_context: fidl::encoding::Context) -> usize {
2485            std::mem::align_of::<i16>()
2486        }
2487
2488        #[inline(always)]
2489        fn inline_size(_context: fidl::encoding::Context) -> usize {
2490            std::mem::size_of::<i16>()
2491        }
2492
2493        #[inline(always)]
2494        fn encode_is_copy() -> bool {
2495            true
2496        }
2497
2498        #[inline(always)]
2499        fn decode_is_copy() -> bool {
2500            false
2501        }
2502    }
2503
2504    impl fidl::encoding::ValueTypeMarker for Domain {
2505        type Borrowed<'a> = Self;
2506        #[inline(always)]
2507        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2508            *value
2509        }
2510    }
2511
2512    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Domain {
2513        #[inline]
2514        unsafe fn encode(
2515            self,
2516            encoder: &mut fidl::encoding::Encoder<'_, D>,
2517            offset: usize,
2518            _depth: fidl::encoding::Depth,
2519        ) -> fidl::Result<()> {
2520            encoder.debug_check_bounds::<Self>(offset);
2521            encoder.write_num(self.into_primitive(), offset);
2522            Ok(())
2523        }
2524    }
2525
2526    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Domain {
2527        #[inline(always)]
2528        fn new_empty() -> Self {
2529            Self::Ipv4
2530        }
2531
2532        #[inline]
2533        unsafe fn decode(
2534            &mut self,
2535            decoder: &mut fidl::encoding::Decoder<'_, D>,
2536            offset: usize,
2537            _depth: fidl::encoding::Depth,
2538        ) -> fidl::Result<()> {
2539            decoder.debug_check_bounds::<Self>(offset);
2540            let prim = decoder.read_num::<i16>(offset);
2541
2542            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2543            Ok(())
2544        }
2545    }
2546    unsafe impl fidl::encoding::TypeMarker for StreamSocketProtocol {
2547        type Owned = Self;
2548
2549        #[inline(always)]
2550        fn inline_align(_context: fidl::encoding::Context) -> usize {
2551            std::mem::align_of::<u32>()
2552        }
2553
2554        #[inline(always)]
2555        fn inline_size(_context: fidl::encoding::Context) -> usize {
2556            std::mem::size_of::<u32>()
2557        }
2558
2559        #[inline(always)]
2560        fn encode_is_copy() -> bool {
2561            true
2562        }
2563
2564        #[inline(always)]
2565        fn decode_is_copy() -> bool {
2566            false
2567        }
2568    }
2569
2570    impl fidl::encoding::ValueTypeMarker for StreamSocketProtocol {
2571        type Borrowed<'a> = Self;
2572        #[inline(always)]
2573        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2574            *value
2575        }
2576    }
2577
2578    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2579        for StreamSocketProtocol
2580    {
2581        #[inline]
2582        unsafe fn encode(
2583            self,
2584            encoder: &mut fidl::encoding::Encoder<'_, D>,
2585            offset: usize,
2586            _depth: fidl::encoding::Depth,
2587        ) -> fidl::Result<()> {
2588            encoder.debug_check_bounds::<Self>(offset);
2589            encoder.write_num(self.into_primitive(), offset);
2590            Ok(())
2591        }
2592    }
2593
2594    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamSocketProtocol {
2595        #[inline(always)]
2596        fn new_empty() -> Self {
2597            Self::Tcp
2598        }
2599
2600        #[inline]
2601        unsafe fn decode(
2602            &mut self,
2603            decoder: &mut fidl::encoding::Decoder<'_, D>,
2604            offset: usize,
2605            _depth: fidl::encoding::Depth,
2606        ) -> fidl::Result<()> {
2607            decoder.debug_check_bounds::<Self>(offset);
2608            let prim = decoder.read_num::<u32>(offset);
2609
2610            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2611            Ok(())
2612        }
2613    }
2614    unsafe impl fidl::encoding::TypeMarker for TcpCongestionControl {
2615        type Owned = Self;
2616
2617        #[inline(always)]
2618        fn inline_align(_context: fidl::encoding::Context) -> usize {
2619            std::mem::align_of::<u32>()
2620        }
2621
2622        #[inline(always)]
2623        fn inline_size(_context: fidl::encoding::Context) -> usize {
2624            std::mem::size_of::<u32>()
2625        }
2626
2627        #[inline(always)]
2628        fn encode_is_copy() -> bool {
2629            true
2630        }
2631
2632        #[inline(always)]
2633        fn decode_is_copy() -> bool {
2634            false
2635        }
2636    }
2637
2638    impl fidl::encoding::ValueTypeMarker for TcpCongestionControl {
2639        type Borrowed<'a> = Self;
2640        #[inline(always)]
2641        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2642            *value
2643        }
2644    }
2645
2646    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2647        for TcpCongestionControl
2648    {
2649        #[inline]
2650        unsafe fn encode(
2651            self,
2652            encoder: &mut fidl::encoding::Encoder<'_, D>,
2653            offset: usize,
2654            _depth: fidl::encoding::Depth,
2655        ) -> fidl::Result<()> {
2656            encoder.debug_check_bounds::<Self>(offset);
2657            encoder.write_num(self.into_primitive(), offset);
2658            Ok(())
2659        }
2660    }
2661
2662    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpCongestionControl {
2663        #[inline(always)]
2664        fn new_empty() -> Self {
2665            Self::Reno
2666        }
2667
2668        #[inline]
2669        unsafe fn decode(
2670            &mut self,
2671            decoder: &mut fidl::encoding::Decoder<'_, D>,
2672            offset: usize,
2673            _depth: fidl::encoding::Depth,
2674        ) -> fidl::Result<()> {
2675            decoder.debug_check_bounds::<Self>(offset);
2676            let prim = decoder.read_num::<u32>(offset);
2677
2678            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2679            Ok(())
2680        }
2681    }
2682    unsafe impl fidl::encoding::TypeMarker for TimestampOption {
2683        type Owned = Self;
2684
2685        #[inline(always)]
2686        fn inline_align(_context: fidl::encoding::Context) -> usize {
2687            std::mem::align_of::<u32>()
2688        }
2689
2690        #[inline(always)]
2691        fn inline_size(_context: fidl::encoding::Context) -> usize {
2692            std::mem::size_of::<u32>()
2693        }
2694
2695        #[inline(always)]
2696        fn encode_is_copy() -> bool {
2697            true
2698        }
2699
2700        #[inline(always)]
2701        fn decode_is_copy() -> bool {
2702            false
2703        }
2704    }
2705
2706    impl fidl::encoding::ValueTypeMarker for TimestampOption {
2707        type Borrowed<'a> = Self;
2708        #[inline(always)]
2709        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2710            *value
2711        }
2712    }
2713
2714    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2715        for TimestampOption
2716    {
2717        #[inline]
2718        unsafe fn encode(
2719            self,
2720            encoder: &mut fidl::encoding::Encoder<'_, D>,
2721            offset: usize,
2722            _depth: fidl::encoding::Depth,
2723        ) -> fidl::Result<()> {
2724            encoder.debug_check_bounds::<Self>(offset);
2725            encoder.write_num(self.into_primitive(), offset);
2726            Ok(())
2727        }
2728    }
2729
2730    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimestampOption {
2731        #[inline(always)]
2732        fn new_empty() -> Self {
2733            Self::Disabled
2734        }
2735
2736        #[inline]
2737        unsafe fn decode(
2738            &mut self,
2739            decoder: &mut fidl::encoding::Decoder<'_, D>,
2740            offset: usize,
2741            _depth: fidl::encoding::Depth,
2742        ) -> fidl::Result<()> {
2743            decoder.debug_check_bounds::<Self>(offset);
2744            let prim = decoder.read_num::<u32>(offset);
2745
2746            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2747            Ok(())
2748        }
2749    }
2750    unsafe impl fidl::encoding::TypeMarker for UdpMetadataEncodingProtocolVersion {
2751        type Owned = Self;
2752
2753        #[inline(always)]
2754        fn inline_align(_context: fidl::encoding::Context) -> usize {
2755            std::mem::align_of::<u16>()
2756        }
2757
2758        #[inline(always)]
2759        fn inline_size(_context: fidl::encoding::Context) -> usize {
2760            std::mem::size_of::<u16>()
2761        }
2762
2763        #[inline(always)]
2764        fn encode_is_copy() -> bool {
2765            false
2766        }
2767
2768        #[inline(always)]
2769        fn decode_is_copy() -> bool {
2770            false
2771        }
2772    }
2773
2774    impl fidl::encoding::ValueTypeMarker for UdpMetadataEncodingProtocolVersion {
2775        type Borrowed<'a> = Self;
2776        #[inline(always)]
2777        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2778            *value
2779        }
2780    }
2781
2782    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2783        for UdpMetadataEncodingProtocolVersion
2784    {
2785        #[inline]
2786        unsafe fn encode(
2787            self,
2788            encoder: &mut fidl::encoding::Encoder<'_, D>,
2789            offset: usize,
2790            _depth: fidl::encoding::Depth,
2791        ) -> fidl::Result<()> {
2792            encoder.debug_check_bounds::<Self>(offset);
2793            encoder.write_num(self.into_primitive(), offset);
2794            Ok(())
2795        }
2796    }
2797
2798    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2799        for UdpMetadataEncodingProtocolVersion
2800    {
2801        #[inline(always)]
2802        fn new_empty() -> Self {
2803            Self::unknown()
2804        }
2805
2806        #[inline]
2807        unsafe fn decode(
2808            &mut self,
2809            decoder: &mut fidl::encoding::Decoder<'_, D>,
2810            offset: usize,
2811            _depth: fidl::encoding::Depth,
2812        ) -> fidl::Result<()> {
2813            decoder.debug_check_bounds::<Self>(offset);
2814            let prim = decoder.read_num::<u16>(offset);
2815
2816            *self = Self::from_primitive_allow_unknown(prim);
2817            Ok(())
2818        }
2819    }
2820
2821    impl fidl::encoding::ValueTypeMarker for BaseDatagramSocketGetInfoResponse {
2822        type Borrowed<'a> = &'a Self;
2823        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2824            value
2825        }
2826    }
2827
2828    unsafe impl fidl::encoding::TypeMarker for BaseDatagramSocketGetInfoResponse {
2829        type Owned = Self;
2830
2831        #[inline(always)]
2832        fn inline_align(_context: fidl::encoding::Context) -> usize {
2833            4
2834        }
2835
2836        #[inline(always)]
2837        fn inline_size(_context: fidl::encoding::Context) -> usize {
2838            8
2839        }
2840    }
2841
2842    unsafe impl<D: fidl::encoding::ResourceDialect>
2843        fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D>
2844        for &BaseDatagramSocketGetInfoResponse
2845    {
2846        #[inline]
2847        unsafe fn encode(
2848            self,
2849            encoder: &mut fidl::encoding::Encoder<'_, D>,
2850            offset: usize,
2851            _depth: fidl::encoding::Depth,
2852        ) -> fidl::Result<()> {
2853            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2854            // Delegate to tuple encoding.
2855            fidl::encoding::Encode::<BaseDatagramSocketGetInfoResponse, D>::encode(
2856                (
2857                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
2858                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
2859                        &self.proto,
2860                    ),
2861                ),
2862                encoder,
2863                offset,
2864                _depth,
2865            )
2866        }
2867    }
2868    unsafe impl<
2869        D: fidl::encoding::ResourceDialect,
2870        T0: fidl::encoding::Encode<Domain, D>,
2871        T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
2872    > fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D> for (T0, T1)
2873    {
2874        #[inline]
2875        unsafe fn encode(
2876            self,
2877            encoder: &mut fidl::encoding::Encoder<'_, D>,
2878            offset: usize,
2879            depth: fidl::encoding::Depth,
2880        ) -> fidl::Result<()> {
2881            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2882            // Zero out padding regions. There's no need to apply masks
2883            // because the unmasked parts will be overwritten by fields.
2884            unsafe {
2885                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2886                (ptr as *mut u32).write_unaligned(0);
2887            }
2888            // Write the fields.
2889            self.0.encode(encoder, offset + 0, depth)?;
2890            self.1.encode(encoder, offset + 4, depth)?;
2891            Ok(())
2892        }
2893    }
2894
2895    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2896        for BaseDatagramSocketGetInfoResponse
2897    {
2898        #[inline(always)]
2899        fn new_empty() -> Self {
2900            Self {
2901                domain: fidl::new_empty!(Domain, D),
2902                proto: fidl::new_empty!(DatagramSocketProtocol, D),
2903            }
2904        }
2905
2906        #[inline]
2907        unsafe fn decode(
2908            &mut self,
2909            decoder: &mut fidl::encoding::Decoder<'_, D>,
2910            offset: usize,
2911            _depth: fidl::encoding::Depth,
2912        ) -> fidl::Result<()> {
2913            decoder.debug_check_bounds::<Self>(offset);
2914            // Verify that padding bytes are zero.
2915            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2916            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2917            let mask = 0xffff0000u32;
2918            let maskedval = padval & mask;
2919            if maskedval != 0 {
2920                return Err(fidl::Error::NonZeroPadding {
2921                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2922                });
2923            }
2924            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
2925            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
2926            Ok(())
2927        }
2928    }
2929
2930    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2931        type Borrowed<'a> = &'a Self;
2932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2933            value
2934        }
2935    }
2936
2937    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2938        type Owned = Self;
2939
2940        #[inline(always)]
2941        fn inline_align(_context: fidl::encoding::Context) -> usize {
2942            8
2943        }
2944
2945        #[inline(always)]
2946        fn inline_size(_context: fidl::encoding::Context) -> usize {
2947            16
2948        }
2949    }
2950
2951    unsafe impl<D: fidl::encoding::ResourceDialect>
2952        fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D>
2953        for &BaseNetworkSocketAddIpMembershipRequest
2954    {
2955        #[inline]
2956        unsafe fn encode(
2957            self,
2958            encoder: &mut fidl::encoding::Encoder<'_, D>,
2959            offset: usize,
2960            _depth: fidl::encoding::Depth,
2961        ) -> fidl::Result<()> {
2962            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2963            // Delegate to tuple encoding.
2964            fidl::encoding::Encode::<BaseNetworkSocketAddIpMembershipRequest, D>::encode(
2965                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
2966                    &self.membership,
2967                ),),
2968                encoder,
2969                offset,
2970                _depth,
2971            )
2972        }
2973    }
2974    unsafe impl<
2975        D: fidl::encoding::ResourceDialect,
2976        T0: fidl::encoding::Encode<IpMulticastMembership, D>,
2977    > fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D> for (T0,)
2978    {
2979        #[inline]
2980        unsafe fn encode(
2981            self,
2982            encoder: &mut fidl::encoding::Encoder<'_, D>,
2983            offset: usize,
2984            depth: fidl::encoding::Depth,
2985        ) -> fidl::Result<()> {
2986            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2987            // Zero out padding regions. There's no need to apply masks
2988            // because the unmasked parts will be overwritten by fields.
2989            // Write the fields.
2990            self.0.encode(encoder, offset + 0, depth)?;
2991            Ok(())
2992        }
2993    }
2994
2995    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2996        for BaseNetworkSocketAddIpMembershipRequest
2997    {
2998        #[inline(always)]
2999        fn new_empty() -> Self {
3000            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3001        }
3002
3003        #[inline]
3004        unsafe fn decode(
3005            &mut self,
3006            decoder: &mut fidl::encoding::Decoder<'_, D>,
3007            offset: usize,
3008            _depth: fidl::encoding::Depth,
3009        ) -> fidl::Result<()> {
3010            decoder.debug_check_bounds::<Self>(offset);
3011            // Verify that padding bytes are zero.
3012            fidl::decode!(
3013                IpMulticastMembership,
3014                D,
3015                &mut self.membership,
3016                decoder,
3017                offset + 0,
3018                _depth
3019            )?;
3020            Ok(())
3021        }
3022    }
3023
3024    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
3025        type Borrowed<'a> = &'a Self;
3026        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3027            value
3028        }
3029    }
3030
3031    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
3032        type Owned = Self;
3033
3034        #[inline(always)]
3035        fn inline_align(_context: fidl::encoding::Context) -> usize {
3036            8
3037        }
3038
3039        #[inline(always)]
3040        fn inline_size(_context: fidl::encoding::Context) -> usize {
3041            24
3042        }
3043    }
3044
3045    unsafe impl<D: fidl::encoding::ResourceDialect>
3046        fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D>
3047        for &BaseNetworkSocketAddIpv6MembershipRequest
3048    {
3049        #[inline]
3050        unsafe fn encode(
3051            self,
3052            encoder: &mut fidl::encoding::Encoder<'_, D>,
3053            offset: usize,
3054            _depth: fidl::encoding::Depth,
3055        ) -> fidl::Result<()> {
3056            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
3057            // Delegate to tuple encoding.
3058            fidl::encoding::Encode::<BaseNetworkSocketAddIpv6MembershipRequest, D>::encode(
3059                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3060                    &self.membership,
3061                ),),
3062                encoder,
3063                offset,
3064                _depth,
3065            )
3066        }
3067    }
3068    unsafe impl<
3069        D: fidl::encoding::ResourceDialect,
3070        T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3071    > fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D> for (T0,)
3072    {
3073        #[inline]
3074        unsafe fn encode(
3075            self,
3076            encoder: &mut fidl::encoding::Encoder<'_, D>,
3077            offset: usize,
3078            depth: fidl::encoding::Depth,
3079        ) -> fidl::Result<()> {
3080            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
3081            // Zero out padding regions. There's no need to apply masks
3082            // because the unmasked parts will be overwritten by fields.
3083            // Write the fields.
3084            self.0.encode(encoder, offset + 0, depth)?;
3085            Ok(())
3086        }
3087    }
3088
3089    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3090        for BaseNetworkSocketAddIpv6MembershipRequest
3091    {
3092        #[inline(always)]
3093        fn new_empty() -> Self {
3094            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3095        }
3096
3097        #[inline]
3098        unsafe fn decode(
3099            &mut self,
3100            decoder: &mut fidl::encoding::Decoder<'_, D>,
3101            offset: usize,
3102            _depth: fidl::encoding::Depth,
3103        ) -> fidl::Result<()> {
3104            decoder.debug_check_bounds::<Self>(offset);
3105            // Verify that padding bytes are zero.
3106            fidl::decode!(
3107                Ipv6MulticastMembership,
3108                D,
3109                &mut self.membership,
3110                decoder,
3111                offset + 0,
3112                _depth
3113            )?;
3114            Ok(())
3115        }
3116    }
3117
3118    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketBindRequest {
3119        type Borrowed<'a> = &'a Self;
3120        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3121            value
3122        }
3123    }
3124
3125    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketBindRequest {
3126        type Owned = Self;
3127
3128        #[inline(always)]
3129        fn inline_align(_context: fidl::encoding::Context) -> usize {
3130            8
3131        }
3132
3133        #[inline(always)]
3134        fn inline_size(_context: fidl::encoding::Context) -> usize {
3135            16
3136        }
3137    }
3138
3139    unsafe impl<D: fidl::encoding::ResourceDialect>
3140        fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for &BaseNetworkSocketBindRequest
3141    {
3142        #[inline]
3143        unsafe fn encode(
3144            self,
3145            encoder: &mut fidl::encoding::Encoder<'_, D>,
3146            offset: usize,
3147            _depth: fidl::encoding::Depth,
3148        ) -> fidl::Result<()> {
3149            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
3150            // Delegate to tuple encoding.
3151            fidl::encoding::Encode::<BaseNetworkSocketBindRequest, D>::encode(
3152                (
3153                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
3154                ),
3155                encoder, offset, _depth
3156            )
3157        }
3158    }
3159    unsafe impl<
3160        D: fidl::encoding::ResourceDialect,
3161        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
3162    > fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for (T0,)
3163    {
3164        #[inline]
3165        unsafe fn encode(
3166            self,
3167            encoder: &mut fidl::encoding::Encoder<'_, D>,
3168            offset: usize,
3169            depth: fidl::encoding::Depth,
3170        ) -> fidl::Result<()> {
3171            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
3172            // Zero out padding regions. There's no need to apply masks
3173            // because the unmasked parts will be overwritten by fields.
3174            // Write the fields.
3175            self.0.encode(encoder, offset + 0, depth)?;
3176            Ok(())
3177        }
3178    }
3179
3180    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3181        for BaseNetworkSocketBindRequest
3182    {
3183        #[inline(always)]
3184        fn new_empty() -> Self {
3185            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
3186        }
3187
3188        #[inline]
3189        unsafe fn decode(
3190            &mut self,
3191            decoder: &mut fidl::encoding::Decoder<'_, D>,
3192            offset: usize,
3193            _depth: fidl::encoding::Depth,
3194        ) -> fidl::Result<()> {
3195            decoder.debug_check_bounds::<Self>(offset);
3196            // Verify that padding bytes are zero.
3197            fidl::decode!(
3198                fidl_fuchsia_net_common::SocketAddress,
3199                D,
3200                &mut self.addr,
3201                decoder,
3202                offset + 0,
3203                _depth
3204            )?;
3205            Ok(())
3206        }
3207    }
3208
3209    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketConnectRequest {
3210        type Borrowed<'a> = &'a Self;
3211        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3212            value
3213        }
3214    }
3215
3216    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketConnectRequest {
3217        type Owned = Self;
3218
3219        #[inline(always)]
3220        fn inline_align(_context: fidl::encoding::Context) -> usize {
3221            8
3222        }
3223
3224        #[inline(always)]
3225        fn inline_size(_context: fidl::encoding::Context) -> usize {
3226            16
3227        }
3228    }
3229
3230    unsafe impl<D: fidl::encoding::ResourceDialect>
3231        fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D>
3232        for &BaseNetworkSocketConnectRequest
3233    {
3234        #[inline]
3235        unsafe fn encode(
3236            self,
3237            encoder: &mut fidl::encoding::Encoder<'_, D>,
3238            offset: usize,
3239            _depth: fidl::encoding::Depth,
3240        ) -> fidl::Result<()> {
3241            encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3242            // Delegate to tuple encoding.
3243            fidl::encoding::Encode::<BaseNetworkSocketConnectRequest, D>::encode(
3244                (
3245                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
3246                ),
3247                encoder, offset, _depth
3248            )
3249        }
3250    }
3251    unsafe impl<
3252        D: fidl::encoding::ResourceDialect,
3253        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
3254    > fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D> for (T0,)
3255    {
3256        #[inline]
3257        unsafe fn encode(
3258            self,
3259            encoder: &mut fidl::encoding::Encoder<'_, D>,
3260            offset: usize,
3261            depth: fidl::encoding::Depth,
3262        ) -> fidl::Result<()> {
3263            encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3264            // Zero out padding regions. There's no need to apply masks
3265            // because the unmasked parts will be overwritten by fields.
3266            // Write the fields.
3267            self.0.encode(encoder, offset + 0, depth)?;
3268            Ok(())
3269        }
3270    }
3271
3272    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3273        for BaseNetworkSocketConnectRequest
3274    {
3275        #[inline(always)]
3276        fn new_empty() -> Self {
3277            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
3278        }
3279
3280        #[inline]
3281        unsafe fn decode(
3282            &mut self,
3283            decoder: &mut fidl::encoding::Decoder<'_, D>,
3284            offset: usize,
3285            _depth: fidl::encoding::Depth,
3286        ) -> fidl::Result<()> {
3287            decoder.debug_check_bounds::<Self>(offset);
3288            // Verify that padding bytes are zero.
3289            fidl::decode!(
3290                fidl_fuchsia_net_common::SocketAddress,
3291                D,
3292                &mut self.addr,
3293                decoder,
3294                offset + 0,
3295                _depth
3296            )?;
3297            Ok(())
3298        }
3299    }
3300
3301    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3302        type Borrowed<'a> = &'a Self;
3303        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3304            value
3305        }
3306    }
3307
3308    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3309        type Owned = Self;
3310
3311        #[inline(always)]
3312        fn inline_align(_context: fidl::encoding::Context) -> usize {
3313            8
3314        }
3315
3316        #[inline(always)]
3317        fn inline_size(_context: fidl::encoding::Context) -> usize {
3318            16
3319        }
3320    }
3321
3322    unsafe impl<D: fidl::encoding::ResourceDialect>
3323        fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D>
3324        for &BaseNetworkSocketDropIpMembershipRequest
3325    {
3326        #[inline]
3327        unsafe fn encode(
3328            self,
3329            encoder: &mut fidl::encoding::Encoder<'_, D>,
3330            offset: usize,
3331            _depth: fidl::encoding::Depth,
3332        ) -> fidl::Result<()> {
3333            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3334            // Delegate to tuple encoding.
3335            fidl::encoding::Encode::<BaseNetworkSocketDropIpMembershipRequest, D>::encode(
3336                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3337                    &self.membership,
3338                ),),
3339                encoder,
3340                offset,
3341                _depth,
3342            )
3343        }
3344    }
3345    unsafe impl<
3346        D: fidl::encoding::ResourceDialect,
3347        T0: fidl::encoding::Encode<IpMulticastMembership, D>,
3348    > fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D> for (T0,)
3349    {
3350        #[inline]
3351        unsafe fn encode(
3352            self,
3353            encoder: &mut fidl::encoding::Encoder<'_, D>,
3354            offset: usize,
3355            depth: fidl::encoding::Depth,
3356        ) -> fidl::Result<()> {
3357            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3358            // Zero out padding regions. There's no need to apply masks
3359            // because the unmasked parts will be overwritten by fields.
3360            // Write the fields.
3361            self.0.encode(encoder, offset + 0, depth)?;
3362            Ok(())
3363        }
3364    }
3365
3366    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3367        for BaseNetworkSocketDropIpMembershipRequest
3368    {
3369        #[inline(always)]
3370        fn new_empty() -> Self {
3371            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3372        }
3373
3374        #[inline]
3375        unsafe fn decode(
3376            &mut self,
3377            decoder: &mut fidl::encoding::Decoder<'_, D>,
3378            offset: usize,
3379            _depth: fidl::encoding::Depth,
3380        ) -> fidl::Result<()> {
3381            decoder.debug_check_bounds::<Self>(offset);
3382            // Verify that padding bytes are zero.
3383            fidl::decode!(
3384                IpMulticastMembership,
3385                D,
3386                &mut self.membership,
3387                decoder,
3388                offset + 0,
3389                _depth
3390            )?;
3391            Ok(())
3392        }
3393    }
3394
3395    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3396        type Borrowed<'a> = &'a Self;
3397        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3398            value
3399        }
3400    }
3401
3402    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3403        type Owned = Self;
3404
3405        #[inline(always)]
3406        fn inline_align(_context: fidl::encoding::Context) -> usize {
3407            8
3408        }
3409
3410        #[inline(always)]
3411        fn inline_size(_context: fidl::encoding::Context) -> usize {
3412            24
3413        }
3414    }
3415
3416    unsafe impl<D: fidl::encoding::ResourceDialect>
3417        fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D>
3418        for &BaseNetworkSocketDropIpv6MembershipRequest
3419    {
3420        #[inline]
3421        unsafe fn encode(
3422            self,
3423            encoder: &mut fidl::encoding::Encoder<'_, D>,
3424            offset: usize,
3425            _depth: fidl::encoding::Depth,
3426        ) -> fidl::Result<()> {
3427            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3428            // Delegate to tuple encoding.
3429            fidl::encoding::Encode::<BaseNetworkSocketDropIpv6MembershipRequest, D>::encode(
3430                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3431                    &self.membership,
3432                ),),
3433                encoder,
3434                offset,
3435                _depth,
3436            )
3437        }
3438    }
3439    unsafe impl<
3440        D: fidl::encoding::ResourceDialect,
3441        T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3442    > fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D> for (T0,)
3443    {
3444        #[inline]
3445        unsafe fn encode(
3446            self,
3447            encoder: &mut fidl::encoding::Encoder<'_, D>,
3448            offset: usize,
3449            depth: fidl::encoding::Depth,
3450        ) -> fidl::Result<()> {
3451            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3452            // Zero out padding regions. There's no need to apply masks
3453            // because the unmasked parts will be overwritten by fields.
3454            // Write the fields.
3455            self.0.encode(encoder, offset + 0, depth)?;
3456            Ok(())
3457        }
3458    }
3459
3460    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3461        for BaseNetworkSocketDropIpv6MembershipRequest
3462    {
3463        #[inline(always)]
3464        fn new_empty() -> Self {
3465            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3466        }
3467
3468        #[inline]
3469        unsafe fn decode(
3470            &mut self,
3471            decoder: &mut fidl::encoding::Decoder<'_, D>,
3472            offset: usize,
3473            _depth: fidl::encoding::Depth,
3474        ) -> fidl::Result<()> {
3475            decoder.debug_check_bounds::<Self>(offset);
3476            // Verify that padding bytes are zero.
3477            fidl::decode!(
3478                Ipv6MulticastMembership,
3479                D,
3480                &mut self.membership,
3481                decoder,
3482                offset + 0,
3483                _depth
3484            )?;
3485            Ok(())
3486        }
3487    }
3488
3489    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3490        type Borrowed<'a> = &'a Self;
3491        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3492            value
3493        }
3494    }
3495
3496    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3497        type Owned = Self;
3498
3499        #[inline(always)]
3500        fn inline_align(_context: fidl::encoding::Context) -> usize {
3501            8
3502        }
3503
3504        #[inline(always)]
3505        fn inline_size(_context: fidl::encoding::Context) -> usize {
3506            16
3507        }
3508    }
3509
3510    unsafe impl<D: fidl::encoding::ResourceDialect>
3511        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>
3512        for &BaseNetworkSocketSetIpMulticastInterfaceRequest
3513    {
3514        #[inline]
3515        unsafe fn encode(
3516            self,
3517            encoder: &mut fidl::encoding::Encoder<'_, D>,
3518            offset: usize,
3519            _depth: fidl::encoding::Depth,
3520        ) -> fidl::Result<()> {
3521            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3522            // Delegate to tuple encoding.
3523            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>::encode(
3524                (
3525                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
3526                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
3527                ),
3528                encoder, offset, _depth
3529            )
3530        }
3531    }
3532    unsafe impl<
3533        D: fidl::encoding::ResourceDialect,
3534        T0: fidl::encoding::Encode<u64, D>,
3535        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
3536    > fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D> for (T0, T1)
3537    {
3538        #[inline]
3539        unsafe fn encode(
3540            self,
3541            encoder: &mut fidl::encoding::Encoder<'_, D>,
3542            offset: usize,
3543            depth: fidl::encoding::Depth,
3544        ) -> fidl::Result<()> {
3545            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3546            // Zero out padding regions. There's no need to apply masks
3547            // because the unmasked parts will be overwritten by fields.
3548            unsafe {
3549                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3550                (ptr as *mut u64).write_unaligned(0);
3551            }
3552            // Write the fields.
3553            self.0.encode(encoder, offset + 0, depth)?;
3554            self.1.encode(encoder, offset + 8, depth)?;
3555            Ok(())
3556        }
3557    }
3558
3559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3560        for BaseNetworkSocketSetIpMulticastInterfaceRequest
3561    {
3562        #[inline(always)]
3563        fn new_empty() -> Self {
3564            Self {
3565                iface: fidl::new_empty!(u64, D),
3566                address: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
3567            }
3568        }
3569
3570        #[inline]
3571        unsafe fn decode(
3572            &mut self,
3573            decoder: &mut fidl::encoding::Decoder<'_, D>,
3574            offset: usize,
3575            _depth: fidl::encoding::Depth,
3576        ) -> fidl::Result<()> {
3577            decoder.debug_check_bounds::<Self>(offset);
3578            // Verify that padding bytes are zero.
3579            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3580            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3581            let mask = 0xffffffff00000000u64;
3582            let maskedval = padval & mask;
3583            if maskedval != 0 {
3584                return Err(fidl::Error::NonZeroPadding {
3585                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3586                });
3587            }
3588            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
3589            fidl::decode!(
3590                fidl_fuchsia_net_common::Ipv4Address,
3591                D,
3592                &mut self.address,
3593                decoder,
3594                offset + 8,
3595                _depth
3596            )?;
3597            Ok(())
3598        }
3599    }
3600
3601    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3602        type Borrowed<'a> = &'a Self;
3603        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3604            value
3605        }
3606    }
3607
3608    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3609        type Owned = Self;
3610
3611        #[inline(always)]
3612        fn inline_align(_context: fidl::encoding::Context) -> usize {
3613            1
3614        }
3615
3616        #[inline(always)]
3617        fn inline_size(_context: fidl::encoding::Context) -> usize {
3618            1
3619        }
3620    }
3621
3622    unsafe impl<D: fidl::encoding::ResourceDialect>
3623        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>
3624        for &BaseNetworkSocketSetIpMulticastLoopbackRequest
3625    {
3626        #[inline]
3627        unsafe fn encode(
3628            self,
3629            encoder: &mut fidl::encoding::Encoder<'_, D>,
3630            offset: usize,
3631            _depth: fidl::encoding::Depth,
3632        ) -> fidl::Result<()> {
3633            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3634            // Delegate to tuple encoding.
3635            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>::encode(
3636                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3637                encoder,
3638                offset,
3639                _depth,
3640            )
3641        }
3642    }
3643    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3644        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D> for (T0,)
3645    {
3646        #[inline]
3647        unsafe fn encode(
3648            self,
3649            encoder: &mut fidl::encoding::Encoder<'_, D>,
3650            offset: usize,
3651            depth: fidl::encoding::Depth,
3652        ) -> fidl::Result<()> {
3653            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3654            // Zero out padding regions. There's no need to apply masks
3655            // because the unmasked parts will be overwritten by fields.
3656            // Write the fields.
3657            self.0.encode(encoder, offset + 0, depth)?;
3658            Ok(())
3659        }
3660    }
3661
3662    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3663        for BaseNetworkSocketSetIpMulticastLoopbackRequest
3664    {
3665        #[inline(always)]
3666        fn new_empty() -> Self {
3667            Self { value: fidl::new_empty!(bool, D) }
3668        }
3669
3670        #[inline]
3671        unsafe fn decode(
3672            &mut self,
3673            decoder: &mut fidl::encoding::Decoder<'_, D>,
3674            offset: usize,
3675            _depth: fidl::encoding::Depth,
3676        ) -> fidl::Result<()> {
3677            decoder.debug_check_bounds::<Self>(offset);
3678            // Verify that padding bytes are zero.
3679            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3680            Ok(())
3681        }
3682    }
3683
3684    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3685        type Borrowed<'a> = &'a Self;
3686        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3687            value
3688        }
3689    }
3690
3691    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3692        type Owned = Self;
3693
3694        #[inline(always)]
3695        fn inline_align(_context: fidl::encoding::Context) -> usize {
3696            8
3697        }
3698
3699        #[inline(always)]
3700        fn inline_size(_context: fidl::encoding::Context) -> usize {
3701            16
3702        }
3703    }
3704
3705    unsafe impl<D: fidl::encoding::ResourceDialect>
3706        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D>
3707        for &BaseNetworkSocketSetIpMulticastTtlRequest
3708    {
3709        #[inline]
3710        unsafe fn encode(
3711            self,
3712            encoder: &mut fidl::encoding::Encoder<'_, D>,
3713            offset: usize,
3714            _depth: fidl::encoding::Depth,
3715        ) -> fidl::Result<()> {
3716            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3717            // Delegate to tuple encoding.
3718            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastTtlRequest, D>::encode(
3719                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3720                encoder,
3721                offset,
3722                _depth,
3723            )
3724        }
3725    }
3726    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
3727        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D> for (T0,)
3728    {
3729        #[inline]
3730        unsafe fn encode(
3731            self,
3732            encoder: &mut fidl::encoding::Encoder<'_, D>,
3733            offset: usize,
3734            depth: fidl::encoding::Depth,
3735        ) -> fidl::Result<()> {
3736            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3737            // Zero out padding regions. There's no need to apply masks
3738            // because the unmasked parts will be overwritten by fields.
3739            // Write the fields.
3740            self.0.encode(encoder, offset + 0, depth)?;
3741            Ok(())
3742        }
3743    }
3744
3745    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3746        for BaseNetworkSocketSetIpMulticastTtlRequest
3747    {
3748        #[inline(always)]
3749        fn new_empty() -> Self {
3750            Self { value: fidl::new_empty!(OptionalUint8, D) }
3751        }
3752
3753        #[inline]
3754        unsafe fn decode(
3755            &mut self,
3756            decoder: &mut fidl::encoding::Decoder<'_, D>,
3757            offset: usize,
3758            _depth: fidl::encoding::Depth,
3759        ) -> fidl::Result<()> {
3760            decoder.debug_check_bounds::<Self>(offset);
3761            // Verify that padding bytes are zero.
3762            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
3763            Ok(())
3764        }
3765    }
3766
3767    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3768        type Borrowed<'a> = &'a Self;
3769        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3770            value
3771        }
3772    }
3773
3774    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3775        type Owned = Self;
3776
3777        #[inline(always)]
3778        fn inline_align(_context: fidl::encoding::Context) -> usize {
3779            1
3780        }
3781
3782        #[inline(always)]
3783        fn inline_size(_context: fidl::encoding::Context) -> usize {
3784            1
3785        }
3786    }
3787
3788    unsafe impl<D: fidl::encoding::ResourceDialect>
3789        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D>
3790        for &BaseNetworkSocketSetIpPacketInfoRequest
3791    {
3792        #[inline]
3793        unsafe fn encode(
3794            self,
3795            encoder: &mut fidl::encoding::Encoder<'_, D>,
3796            offset: usize,
3797            _depth: fidl::encoding::Depth,
3798        ) -> fidl::Result<()> {
3799            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3800            // Delegate to tuple encoding.
3801            fidl::encoding::Encode::<BaseNetworkSocketSetIpPacketInfoRequest, D>::encode(
3802                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3803                encoder,
3804                offset,
3805                _depth,
3806            )
3807        }
3808    }
3809    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3810        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D> for (T0,)
3811    {
3812        #[inline]
3813        unsafe fn encode(
3814            self,
3815            encoder: &mut fidl::encoding::Encoder<'_, D>,
3816            offset: usize,
3817            depth: fidl::encoding::Depth,
3818        ) -> fidl::Result<()> {
3819            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3820            // Zero out padding regions. There's no need to apply masks
3821            // because the unmasked parts will be overwritten by fields.
3822            // Write the fields.
3823            self.0.encode(encoder, offset + 0, depth)?;
3824            Ok(())
3825        }
3826    }
3827
3828    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3829        for BaseNetworkSocketSetIpPacketInfoRequest
3830    {
3831        #[inline(always)]
3832        fn new_empty() -> Self {
3833            Self { value: fidl::new_empty!(bool, D) }
3834        }
3835
3836        #[inline]
3837        unsafe fn decode(
3838            &mut self,
3839            decoder: &mut fidl::encoding::Decoder<'_, D>,
3840            offset: usize,
3841            _depth: fidl::encoding::Depth,
3842        ) -> fidl::Result<()> {
3843            decoder.debug_check_bounds::<Self>(offset);
3844            // Verify that padding bytes are zero.
3845            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3846            Ok(())
3847        }
3848    }
3849
3850    impl fidl::encoding::ValueTypeMarker
3851        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3852    {
3853        type Borrowed<'a> = &'a Self;
3854        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3855            value
3856        }
3857    }
3858
3859    unsafe impl fidl::encoding::TypeMarker
3860        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3861    {
3862        type Owned = Self;
3863
3864        #[inline(always)]
3865        fn inline_align(_context: fidl::encoding::Context) -> usize {
3866            1
3867        }
3868
3869        #[inline(always)]
3870        fn inline_size(_context: fidl::encoding::Context) -> usize {
3871            1
3872        }
3873    }
3874
3875    unsafe impl<D: fidl::encoding::ResourceDialect>
3876        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3877        for &BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3878    {
3879        #[inline]
3880        unsafe fn encode(
3881            self,
3882            encoder: &mut fidl::encoding::Encoder<'_, D>,
3883            offset: usize,
3884            _depth: fidl::encoding::Depth,
3885        ) -> fidl::Result<()> {
3886            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3887            // Delegate to tuple encoding.
3888            fidl::encoding::Encode::<
3889                BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest,
3890                D,
3891            >::encode(
3892                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3893                encoder,
3894                offset,
3895                _depth,
3896            )
3897        }
3898    }
3899    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3900        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3901        for (T0,)
3902    {
3903        #[inline]
3904        unsafe fn encode(
3905            self,
3906            encoder: &mut fidl::encoding::Encoder<'_, D>,
3907            offset: usize,
3908            depth: fidl::encoding::Depth,
3909        ) -> fidl::Result<()> {
3910            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3911            // Zero out padding regions. There's no need to apply masks
3912            // because the unmasked parts will be overwritten by fields.
3913            // Write the fields.
3914            self.0.encode(encoder, offset + 0, depth)?;
3915            Ok(())
3916        }
3917    }
3918
3919    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3920        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3921    {
3922        #[inline(always)]
3923        fn new_empty() -> Self {
3924            Self { value: fidl::new_empty!(bool, D) }
3925        }
3926
3927        #[inline]
3928        unsafe fn decode(
3929            &mut self,
3930            decoder: &mut fidl::encoding::Decoder<'_, D>,
3931            offset: usize,
3932            _depth: fidl::encoding::Depth,
3933        ) -> fidl::Result<()> {
3934            decoder.debug_check_bounds::<Self>(offset);
3935            // Verify that padding bytes are zero.
3936            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3937            Ok(())
3938        }
3939    }
3940
3941    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3942        type Borrowed<'a> = &'a Self;
3943        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3944            value
3945        }
3946    }
3947
3948    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3949        type Owned = Self;
3950
3951        #[inline(always)]
3952        fn inline_align(_context: fidl::encoding::Context) -> usize {
3953            1
3954        }
3955
3956        #[inline(always)]
3957        fn inline_size(_context: fidl::encoding::Context) -> usize {
3958            1
3959        }
3960    }
3961
3962    unsafe impl<D: fidl::encoding::ResourceDialect>
3963        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D>
3964        for &BaseNetworkSocketSetIpReceiveTtlRequest
3965    {
3966        #[inline]
3967        unsafe fn encode(
3968            self,
3969            encoder: &mut fidl::encoding::Encoder<'_, D>,
3970            offset: usize,
3971            _depth: fidl::encoding::Depth,
3972        ) -> fidl::Result<()> {
3973            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3974            // Delegate to tuple encoding.
3975            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTtlRequest, D>::encode(
3976                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3977                encoder,
3978                offset,
3979                _depth,
3980            )
3981        }
3982    }
3983    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3984        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D> for (T0,)
3985    {
3986        #[inline]
3987        unsafe fn encode(
3988            self,
3989            encoder: &mut fidl::encoding::Encoder<'_, D>,
3990            offset: usize,
3991            depth: fidl::encoding::Depth,
3992        ) -> fidl::Result<()> {
3993            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3994            // Zero out padding regions. There's no need to apply masks
3995            // because the unmasked parts will be overwritten by fields.
3996            // Write the fields.
3997            self.0.encode(encoder, offset + 0, depth)?;
3998            Ok(())
3999        }
4000    }
4001
4002    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4003        for BaseNetworkSocketSetIpReceiveTtlRequest
4004    {
4005        #[inline(always)]
4006        fn new_empty() -> Self {
4007            Self { value: fidl::new_empty!(bool, D) }
4008        }
4009
4010        #[inline]
4011        unsafe fn decode(
4012            &mut self,
4013            decoder: &mut fidl::encoding::Decoder<'_, D>,
4014            offset: usize,
4015            _depth: fidl::encoding::Depth,
4016        ) -> fidl::Result<()> {
4017            decoder.debug_check_bounds::<Self>(offset);
4018            // Verify that padding bytes are zero.
4019            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4020            Ok(())
4021        }
4022    }
4023
4024    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
4025        type Borrowed<'a> = &'a Self;
4026        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4027            value
4028        }
4029    }
4030
4031    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
4032        type Owned = Self;
4033
4034        #[inline(always)]
4035        fn inline_align(_context: fidl::encoding::Context) -> usize {
4036            1
4037        }
4038
4039        #[inline(always)]
4040        fn inline_size(_context: fidl::encoding::Context) -> usize {
4041            1
4042        }
4043    }
4044
4045    unsafe impl<D: fidl::encoding::ResourceDialect>
4046        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>
4047        for &BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
4048    {
4049        #[inline]
4050        unsafe fn encode(
4051            self,
4052            encoder: &mut fidl::encoding::Encoder<'_, D>,
4053            offset: usize,
4054            _depth: fidl::encoding::Depth,
4055        ) -> fidl::Result<()> {
4056            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
4057            // Delegate to tuple encoding.
4058            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>::encode(
4059                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4060                encoder,
4061                offset,
4062                _depth,
4063            )
4064        }
4065    }
4066    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4067        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D> for (T0,)
4068    {
4069        #[inline]
4070        unsafe fn encode(
4071            self,
4072            encoder: &mut fidl::encoding::Encoder<'_, D>,
4073            offset: usize,
4074            depth: fidl::encoding::Depth,
4075        ) -> fidl::Result<()> {
4076            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
4077            // Zero out padding regions. There's no need to apply masks
4078            // because the unmasked parts will be overwritten by fields.
4079            // Write the fields.
4080            self.0.encode(encoder, offset + 0, depth)?;
4081            Ok(())
4082        }
4083    }
4084
4085    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4086        for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
4087    {
4088        #[inline(always)]
4089        fn new_empty() -> Self {
4090            Self { value: fidl::new_empty!(bool, D) }
4091        }
4092
4093        #[inline]
4094        unsafe fn decode(
4095            &mut self,
4096            decoder: &mut fidl::encoding::Decoder<'_, D>,
4097            offset: usize,
4098            _depth: fidl::encoding::Depth,
4099        ) -> fidl::Result<()> {
4100            decoder.debug_check_bounds::<Self>(offset);
4101            // Verify that padding bytes are zero.
4102            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4103            Ok(())
4104        }
4105    }
4106
4107    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTransparentRequest {
4108        type Borrowed<'a> = &'a Self;
4109        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4110            value
4111        }
4112    }
4113
4114    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTransparentRequest {
4115        type Owned = Self;
4116
4117        #[inline(always)]
4118        fn inline_align(_context: fidl::encoding::Context) -> usize {
4119            1
4120        }
4121
4122        #[inline(always)]
4123        fn inline_size(_context: fidl::encoding::Context) -> usize {
4124            1
4125        }
4126    }
4127
4128    unsafe impl<D: fidl::encoding::ResourceDialect>
4129        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D>
4130        for &BaseNetworkSocketSetIpTransparentRequest
4131    {
4132        #[inline]
4133        unsafe fn encode(
4134            self,
4135            encoder: &mut fidl::encoding::Encoder<'_, D>,
4136            offset: usize,
4137            _depth: fidl::encoding::Depth,
4138        ) -> fidl::Result<()> {
4139            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
4140            // Delegate to tuple encoding.
4141            fidl::encoding::Encode::<BaseNetworkSocketSetIpTransparentRequest, D>::encode(
4142                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4143                encoder,
4144                offset,
4145                _depth,
4146            )
4147        }
4148    }
4149    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4150        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D> for (T0,)
4151    {
4152        #[inline]
4153        unsafe fn encode(
4154            self,
4155            encoder: &mut fidl::encoding::Encoder<'_, D>,
4156            offset: usize,
4157            depth: fidl::encoding::Depth,
4158        ) -> fidl::Result<()> {
4159            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
4160            // Zero out padding regions. There's no need to apply masks
4161            // because the unmasked parts will be overwritten by fields.
4162            // Write the fields.
4163            self.0.encode(encoder, offset + 0, depth)?;
4164            Ok(())
4165        }
4166    }
4167
4168    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4169        for BaseNetworkSocketSetIpTransparentRequest
4170    {
4171        #[inline(always)]
4172        fn new_empty() -> Self {
4173            Self { value: fidl::new_empty!(bool, D) }
4174        }
4175
4176        #[inline]
4177        unsafe fn decode(
4178            &mut self,
4179            decoder: &mut fidl::encoding::Decoder<'_, D>,
4180            offset: usize,
4181            _depth: fidl::encoding::Depth,
4182        ) -> fidl::Result<()> {
4183            decoder.debug_check_bounds::<Self>(offset);
4184            // Verify that padding bytes are zero.
4185            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4186            Ok(())
4187        }
4188    }
4189
4190    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTtlRequest {
4191        type Borrowed<'a> = &'a Self;
4192        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4193            value
4194        }
4195    }
4196
4197    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTtlRequest {
4198        type Owned = Self;
4199
4200        #[inline(always)]
4201        fn inline_align(_context: fidl::encoding::Context) -> usize {
4202            8
4203        }
4204
4205        #[inline(always)]
4206        fn inline_size(_context: fidl::encoding::Context) -> usize {
4207            16
4208        }
4209    }
4210
4211    unsafe impl<D: fidl::encoding::ResourceDialect>
4212        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D>
4213        for &BaseNetworkSocketSetIpTtlRequest
4214    {
4215        #[inline]
4216        unsafe fn encode(
4217            self,
4218            encoder: &mut fidl::encoding::Encoder<'_, D>,
4219            offset: usize,
4220            _depth: fidl::encoding::Depth,
4221        ) -> fidl::Result<()> {
4222            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4223            // Delegate to tuple encoding.
4224            fidl::encoding::Encode::<BaseNetworkSocketSetIpTtlRequest, D>::encode(
4225                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4226                encoder,
4227                offset,
4228                _depth,
4229            )
4230        }
4231    }
4232    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4233        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D> for (T0,)
4234    {
4235        #[inline]
4236        unsafe fn encode(
4237            self,
4238            encoder: &mut fidl::encoding::Encoder<'_, D>,
4239            offset: usize,
4240            depth: fidl::encoding::Depth,
4241        ) -> fidl::Result<()> {
4242            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4243            // Zero out padding regions. There's no need to apply masks
4244            // because the unmasked parts will be overwritten by fields.
4245            // Write the fields.
4246            self.0.encode(encoder, offset + 0, depth)?;
4247            Ok(())
4248        }
4249    }
4250
4251    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4252        for BaseNetworkSocketSetIpTtlRequest
4253    {
4254        #[inline(always)]
4255        fn new_empty() -> Self {
4256            Self { value: fidl::new_empty!(OptionalUint8, D) }
4257        }
4258
4259        #[inline]
4260        unsafe fn decode(
4261            &mut self,
4262            decoder: &mut fidl::encoding::Decoder<'_, D>,
4263            offset: usize,
4264            _depth: fidl::encoding::Depth,
4265        ) -> fidl::Result<()> {
4266            decoder.debug_check_bounds::<Self>(offset);
4267            // Verify that padding bytes are zero.
4268            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4269            Ok(())
4270        }
4271    }
4272
4273    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4274        type Borrowed<'a> = &'a Self;
4275        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4276            value
4277        }
4278    }
4279
4280    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4281        type Owned = Self;
4282
4283        #[inline(always)]
4284        fn inline_align(_context: fidl::encoding::Context) -> usize {
4285            1
4286        }
4287
4288        #[inline(always)]
4289        fn inline_size(_context: fidl::encoding::Context) -> usize {
4290            1
4291        }
4292        #[inline(always)]
4293        fn encode_is_copy() -> bool {
4294            true
4295        }
4296
4297        #[inline(always)]
4298        fn decode_is_copy() -> bool {
4299            true
4300        }
4301    }
4302
4303    unsafe impl<D: fidl::encoding::ResourceDialect>
4304        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D>
4305        for &BaseNetworkSocketSetIpTypeOfServiceRequest
4306    {
4307        #[inline]
4308        unsafe fn encode(
4309            self,
4310            encoder: &mut fidl::encoding::Encoder<'_, D>,
4311            offset: usize,
4312            _depth: fidl::encoding::Depth,
4313        ) -> fidl::Result<()> {
4314            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4315            unsafe {
4316                // Copy the object into the buffer.
4317                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4318                (buf_ptr as *mut BaseNetworkSocketSetIpTypeOfServiceRequest).write_unaligned(
4319                    (self as *const BaseNetworkSocketSetIpTypeOfServiceRequest).read(),
4320                );
4321                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4322                // done second because the memcpy will write garbage to these bytes.
4323            }
4324            Ok(())
4325        }
4326    }
4327    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
4328        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D> for (T0,)
4329    {
4330        #[inline]
4331        unsafe fn encode(
4332            self,
4333            encoder: &mut fidl::encoding::Encoder<'_, D>,
4334            offset: usize,
4335            depth: fidl::encoding::Depth,
4336        ) -> fidl::Result<()> {
4337            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4338            // Zero out padding regions. There's no need to apply masks
4339            // because the unmasked parts will be overwritten by fields.
4340            // Write the fields.
4341            self.0.encode(encoder, offset + 0, depth)?;
4342            Ok(())
4343        }
4344    }
4345
4346    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4347        for BaseNetworkSocketSetIpTypeOfServiceRequest
4348    {
4349        #[inline(always)]
4350        fn new_empty() -> Self {
4351            Self { value: fidl::new_empty!(u8, D) }
4352        }
4353
4354        #[inline]
4355        unsafe fn decode(
4356            &mut self,
4357            decoder: &mut fidl::encoding::Decoder<'_, D>,
4358            offset: usize,
4359            _depth: fidl::encoding::Depth,
4360        ) -> fidl::Result<()> {
4361            decoder.debug_check_bounds::<Self>(offset);
4362            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4363            // Verify that padding bytes are zero.
4364            // Copy from the buffer into the object.
4365            unsafe {
4366                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
4367            }
4368            Ok(())
4369        }
4370    }
4371
4372    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4373        type Borrowed<'a> = &'a Self;
4374        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4375            value
4376        }
4377    }
4378
4379    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4380        type Owned = Self;
4381
4382        #[inline(always)]
4383        fn inline_align(_context: fidl::encoding::Context) -> usize {
4384            8
4385        }
4386
4387        #[inline(always)]
4388        fn inline_size(_context: fidl::encoding::Context) -> usize {
4389            16
4390        }
4391    }
4392
4393    unsafe impl<D: fidl::encoding::ResourceDialect>
4394        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>
4395        for &BaseNetworkSocketSetIpv6MulticastHopsRequest
4396    {
4397        #[inline]
4398        unsafe fn encode(
4399            self,
4400            encoder: &mut fidl::encoding::Encoder<'_, D>,
4401            offset: usize,
4402            _depth: fidl::encoding::Depth,
4403        ) -> fidl::Result<()> {
4404            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4405            // Delegate to tuple encoding.
4406            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>::encode(
4407                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4408                encoder,
4409                offset,
4410                _depth,
4411            )
4412        }
4413    }
4414    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4415        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D> for (T0,)
4416    {
4417        #[inline]
4418        unsafe fn encode(
4419            self,
4420            encoder: &mut fidl::encoding::Encoder<'_, D>,
4421            offset: usize,
4422            depth: fidl::encoding::Depth,
4423        ) -> fidl::Result<()> {
4424            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4425            // Zero out padding regions. There's no need to apply masks
4426            // because the unmasked parts will be overwritten by fields.
4427            // Write the fields.
4428            self.0.encode(encoder, offset + 0, depth)?;
4429            Ok(())
4430        }
4431    }
4432
4433    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4434        for BaseNetworkSocketSetIpv6MulticastHopsRequest
4435    {
4436        #[inline(always)]
4437        fn new_empty() -> Self {
4438            Self { value: fidl::new_empty!(OptionalUint8, D) }
4439        }
4440
4441        #[inline]
4442        unsafe fn decode(
4443            &mut self,
4444            decoder: &mut fidl::encoding::Decoder<'_, D>,
4445            offset: usize,
4446            _depth: fidl::encoding::Depth,
4447        ) -> fidl::Result<()> {
4448            decoder.debug_check_bounds::<Self>(offset);
4449            // Verify that padding bytes are zero.
4450            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4451            Ok(())
4452        }
4453    }
4454
4455    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4456        type Borrowed<'a> = &'a Self;
4457        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4458            value
4459        }
4460    }
4461
4462    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4463        type Owned = Self;
4464
4465        #[inline(always)]
4466        fn inline_align(_context: fidl::encoding::Context) -> usize {
4467            8
4468        }
4469
4470        #[inline(always)]
4471        fn inline_size(_context: fidl::encoding::Context) -> usize {
4472            8
4473        }
4474        #[inline(always)]
4475        fn encode_is_copy() -> bool {
4476            true
4477        }
4478
4479        #[inline(always)]
4480        fn decode_is_copy() -> bool {
4481            true
4482        }
4483    }
4484
4485    unsafe impl<D: fidl::encoding::ResourceDialect>
4486        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D>
4487        for &BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4488    {
4489        #[inline]
4490        unsafe fn encode(
4491            self,
4492            encoder: &mut fidl::encoding::Encoder<'_, D>,
4493            offset: usize,
4494            _depth: fidl::encoding::Depth,
4495        ) -> fidl::Result<()> {
4496            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4497            unsafe {
4498                // Copy the object into the buffer.
4499                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4500                (buf_ptr as *mut BaseNetworkSocketSetIpv6MulticastInterfaceRequest)
4501                    .write_unaligned(
4502                        (self as *const BaseNetworkSocketSetIpv6MulticastInterfaceRequest).read(),
4503                    );
4504                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4505                // done second because the memcpy will write garbage to these bytes.
4506            }
4507            Ok(())
4508        }
4509    }
4510    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4511        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D> for (T0,)
4512    {
4513        #[inline]
4514        unsafe fn encode(
4515            self,
4516            encoder: &mut fidl::encoding::Encoder<'_, D>,
4517            offset: usize,
4518            depth: fidl::encoding::Depth,
4519        ) -> fidl::Result<()> {
4520            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4521            // Zero out padding regions. There's no need to apply masks
4522            // because the unmasked parts will be overwritten by fields.
4523            // Write the fields.
4524            self.0.encode(encoder, offset + 0, depth)?;
4525            Ok(())
4526        }
4527    }
4528
4529    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4530        for BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4531    {
4532        #[inline(always)]
4533        fn new_empty() -> Self {
4534            Self { value: fidl::new_empty!(u64, D) }
4535        }
4536
4537        #[inline]
4538        unsafe fn decode(
4539            &mut self,
4540            decoder: &mut fidl::encoding::Decoder<'_, D>,
4541            offset: usize,
4542            _depth: fidl::encoding::Depth,
4543        ) -> fidl::Result<()> {
4544            decoder.debug_check_bounds::<Self>(offset);
4545            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4546            // Verify that padding bytes are zero.
4547            // Copy from the buffer into the object.
4548            unsafe {
4549                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4550            }
4551            Ok(())
4552        }
4553    }
4554
4555    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4556        type Borrowed<'a> = &'a Self;
4557        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4558            value
4559        }
4560    }
4561
4562    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4563        type Owned = Self;
4564
4565        #[inline(always)]
4566        fn inline_align(_context: fidl::encoding::Context) -> usize {
4567            1
4568        }
4569
4570        #[inline(always)]
4571        fn inline_size(_context: fidl::encoding::Context) -> usize {
4572            1
4573        }
4574    }
4575
4576    unsafe impl<D: fidl::encoding::ResourceDialect>
4577        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>
4578        for &BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4579    {
4580        #[inline]
4581        unsafe fn encode(
4582            self,
4583            encoder: &mut fidl::encoding::Encoder<'_, D>,
4584            offset: usize,
4585            _depth: fidl::encoding::Depth,
4586        ) -> fidl::Result<()> {
4587            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4588            // Delegate to tuple encoding.
4589            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>::encode(
4590                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4591                encoder,
4592                offset,
4593                _depth,
4594            )
4595        }
4596    }
4597    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4598        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D> for (T0,)
4599    {
4600        #[inline]
4601        unsafe fn encode(
4602            self,
4603            encoder: &mut fidl::encoding::Encoder<'_, D>,
4604            offset: usize,
4605            depth: fidl::encoding::Depth,
4606        ) -> fidl::Result<()> {
4607            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4608            // Zero out padding regions. There's no need to apply masks
4609            // because the unmasked parts will be overwritten by fields.
4610            // Write the fields.
4611            self.0.encode(encoder, offset + 0, depth)?;
4612            Ok(())
4613        }
4614    }
4615
4616    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4617        for BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4618    {
4619        #[inline(always)]
4620        fn new_empty() -> Self {
4621            Self { value: fidl::new_empty!(bool, D) }
4622        }
4623
4624        #[inline]
4625        unsafe fn decode(
4626            &mut self,
4627            decoder: &mut fidl::encoding::Decoder<'_, D>,
4628            offset: usize,
4629            _depth: fidl::encoding::Depth,
4630        ) -> fidl::Result<()> {
4631            decoder.debug_check_bounds::<Self>(offset);
4632            // Verify that padding bytes are zero.
4633            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4634            Ok(())
4635        }
4636    }
4637
4638    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4639        type Borrowed<'a> = &'a Self;
4640        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4641            value
4642        }
4643    }
4644
4645    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4646        type Owned = Self;
4647
4648        #[inline(always)]
4649        fn inline_align(_context: fidl::encoding::Context) -> usize {
4650            1
4651        }
4652
4653        #[inline(always)]
4654        fn inline_size(_context: fidl::encoding::Context) -> usize {
4655            1
4656        }
4657    }
4658
4659    unsafe impl<D: fidl::encoding::ResourceDialect>
4660        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D>
4661        for &BaseNetworkSocketSetIpv6OnlyRequest
4662    {
4663        #[inline]
4664        unsafe fn encode(
4665            self,
4666            encoder: &mut fidl::encoding::Encoder<'_, D>,
4667            offset: usize,
4668            _depth: fidl::encoding::Depth,
4669        ) -> fidl::Result<()> {
4670            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4671            // Delegate to tuple encoding.
4672            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6OnlyRequest, D>::encode(
4673                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4674                encoder,
4675                offset,
4676                _depth,
4677            )
4678        }
4679    }
4680    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4681        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D> for (T0,)
4682    {
4683        #[inline]
4684        unsafe fn encode(
4685            self,
4686            encoder: &mut fidl::encoding::Encoder<'_, D>,
4687            offset: usize,
4688            depth: fidl::encoding::Depth,
4689        ) -> fidl::Result<()> {
4690            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4691            // Zero out padding regions. There's no need to apply masks
4692            // because the unmasked parts will be overwritten by fields.
4693            // Write the fields.
4694            self.0.encode(encoder, offset + 0, depth)?;
4695            Ok(())
4696        }
4697    }
4698
4699    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4700        for BaseNetworkSocketSetIpv6OnlyRequest
4701    {
4702        #[inline(always)]
4703        fn new_empty() -> Self {
4704            Self { value: fidl::new_empty!(bool, D) }
4705        }
4706
4707        #[inline]
4708        unsafe fn decode(
4709            &mut self,
4710            decoder: &mut fidl::encoding::Decoder<'_, D>,
4711            offset: usize,
4712            _depth: fidl::encoding::Depth,
4713        ) -> fidl::Result<()> {
4714            decoder.debug_check_bounds::<Self>(offset);
4715            // Verify that padding bytes are zero.
4716            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4717            Ok(())
4718        }
4719    }
4720
4721    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4722        type Borrowed<'a> = &'a Self;
4723        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4724            value
4725        }
4726    }
4727
4728    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4729        type Owned = Self;
4730
4731        #[inline(always)]
4732        fn inline_align(_context: fidl::encoding::Context) -> usize {
4733            1
4734        }
4735
4736        #[inline(always)]
4737        fn inline_size(_context: fidl::encoding::Context) -> usize {
4738            1
4739        }
4740    }
4741
4742    unsafe impl<D: fidl::encoding::ResourceDialect>
4743        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>
4744        for &BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4745    {
4746        #[inline]
4747        unsafe fn encode(
4748            self,
4749            encoder: &mut fidl::encoding::Encoder<'_, D>,
4750            offset: usize,
4751            _depth: fidl::encoding::Depth,
4752        ) -> fidl::Result<()> {
4753            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4754            // Delegate to tuple encoding.
4755            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>::encode(
4756                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4757                encoder,
4758                offset,
4759                _depth,
4760            )
4761        }
4762    }
4763    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4764        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D> for (T0,)
4765    {
4766        #[inline]
4767        unsafe fn encode(
4768            self,
4769            encoder: &mut fidl::encoding::Encoder<'_, D>,
4770            offset: usize,
4771            depth: fidl::encoding::Depth,
4772        ) -> fidl::Result<()> {
4773            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4774            // Zero out padding regions. There's no need to apply masks
4775            // because the unmasked parts will be overwritten by fields.
4776            // Write the fields.
4777            self.0.encode(encoder, offset + 0, depth)?;
4778            Ok(())
4779        }
4780    }
4781
4782    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4783        for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4784    {
4785        #[inline(always)]
4786        fn new_empty() -> Self {
4787            Self { value: fidl::new_empty!(bool, D) }
4788        }
4789
4790        #[inline]
4791        unsafe fn decode(
4792            &mut self,
4793            decoder: &mut fidl::encoding::Decoder<'_, D>,
4794            offset: usize,
4795            _depth: fidl::encoding::Depth,
4796        ) -> fidl::Result<()> {
4797            decoder.debug_check_bounds::<Self>(offset);
4798            // Verify that padding bytes are zero.
4799            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4800            Ok(())
4801        }
4802    }
4803
4804    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4805        type Borrowed<'a> = &'a Self;
4806        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4807            value
4808        }
4809    }
4810
4811    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4812        type Owned = Self;
4813
4814        #[inline(always)]
4815        fn inline_align(_context: fidl::encoding::Context) -> usize {
4816            1
4817        }
4818
4819        #[inline(always)]
4820        fn inline_size(_context: fidl::encoding::Context) -> usize {
4821            1
4822        }
4823    }
4824
4825    unsafe impl<D: fidl::encoding::ResourceDialect>
4826        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>
4827        for &BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4828    {
4829        #[inline]
4830        unsafe fn encode(
4831            self,
4832            encoder: &mut fidl::encoding::Encoder<'_, D>,
4833            offset: usize,
4834            _depth: fidl::encoding::Depth,
4835        ) -> fidl::Result<()> {
4836            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4837            // Delegate to tuple encoding.
4838            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>::encode(
4839                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4840                encoder,
4841                offset,
4842                _depth,
4843            )
4844        }
4845    }
4846    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4847        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D> for (T0,)
4848    {
4849        #[inline]
4850        unsafe fn encode(
4851            self,
4852            encoder: &mut fidl::encoding::Encoder<'_, D>,
4853            offset: usize,
4854            depth: fidl::encoding::Depth,
4855        ) -> fidl::Result<()> {
4856            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4857            // Zero out padding regions. There's no need to apply masks
4858            // because the unmasked parts will be overwritten by fields.
4859            // Write the fields.
4860            self.0.encode(encoder, offset + 0, depth)?;
4861            Ok(())
4862        }
4863    }
4864
4865    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4866        for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4867    {
4868        #[inline(always)]
4869        fn new_empty() -> Self {
4870            Self { value: fidl::new_empty!(bool, D) }
4871        }
4872
4873        #[inline]
4874        unsafe fn decode(
4875            &mut self,
4876            decoder: &mut fidl::encoding::Decoder<'_, D>,
4877            offset: usize,
4878            _depth: fidl::encoding::Depth,
4879        ) -> fidl::Result<()> {
4880            decoder.debug_check_bounds::<Self>(offset);
4881            // Verify that padding bytes are zero.
4882            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4883            Ok(())
4884        }
4885    }
4886
4887    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4888        type Borrowed<'a> = &'a Self;
4889        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4890            value
4891        }
4892    }
4893
4894    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4895        type Owned = Self;
4896
4897        #[inline(always)]
4898        fn inline_align(_context: fidl::encoding::Context) -> usize {
4899            1
4900        }
4901
4902        #[inline(always)]
4903        fn inline_size(_context: fidl::encoding::Context) -> usize {
4904            1
4905        }
4906    }
4907
4908    unsafe impl<D: fidl::encoding::ResourceDialect>
4909        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>
4910        for &BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4911    {
4912        #[inline]
4913        unsafe fn encode(
4914            self,
4915            encoder: &mut fidl::encoding::Encoder<'_, D>,
4916            offset: usize,
4917            _depth: fidl::encoding::Depth,
4918        ) -> fidl::Result<()> {
4919            encoder
4920                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4921            // Delegate to tuple encoding.
4922            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>::encode(
4923                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4924                encoder,
4925                offset,
4926                _depth,
4927            )
4928        }
4929    }
4930    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4931        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D> for (T0,)
4932    {
4933        #[inline]
4934        unsafe fn encode(
4935            self,
4936            encoder: &mut fidl::encoding::Encoder<'_, D>,
4937            offset: usize,
4938            depth: fidl::encoding::Depth,
4939        ) -> fidl::Result<()> {
4940            encoder
4941                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4942            // Zero out padding regions. There's no need to apply masks
4943            // because the unmasked parts will be overwritten by fields.
4944            // Write the fields.
4945            self.0.encode(encoder, offset + 0, depth)?;
4946            Ok(())
4947        }
4948    }
4949
4950    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4951        for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4952    {
4953        #[inline(always)]
4954        fn new_empty() -> Self {
4955            Self { value: fidl::new_empty!(bool, D) }
4956        }
4957
4958        #[inline]
4959        unsafe fn decode(
4960            &mut self,
4961            decoder: &mut fidl::encoding::Decoder<'_, D>,
4962            offset: usize,
4963            _depth: fidl::encoding::Depth,
4964        ) -> fidl::Result<()> {
4965            decoder.debug_check_bounds::<Self>(offset);
4966            // Verify that padding bytes are zero.
4967            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4968            Ok(())
4969        }
4970    }
4971
4972    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4973        type Borrowed<'a> = &'a Self;
4974        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4975            value
4976        }
4977    }
4978
4979    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4980        type Owned = Self;
4981
4982        #[inline(always)]
4983        fn inline_align(_context: fidl::encoding::Context) -> usize {
4984            8
4985        }
4986
4987        #[inline(always)]
4988        fn inline_size(_context: fidl::encoding::Context) -> usize {
4989            16
4990        }
4991    }
4992
4993    unsafe impl<D: fidl::encoding::ResourceDialect>
4994        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D>
4995        for &BaseNetworkSocketSetIpv6TrafficClassRequest
4996    {
4997        #[inline]
4998        unsafe fn encode(
4999            self,
5000            encoder: &mut fidl::encoding::Encoder<'_, D>,
5001            offset: usize,
5002            _depth: fidl::encoding::Depth,
5003        ) -> fidl::Result<()> {
5004            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
5005            // Delegate to tuple encoding.
5006            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6TrafficClassRequest, D>::encode(
5007                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5008                encoder,
5009                offset,
5010                _depth,
5011            )
5012        }
5013    }
5014    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
5015        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D> for (T0,)
5016    {
5017        #[inline]
5018        unsafe fn encode(
5019            self,
5020            encoder: &mut fidl::encoding::Encoder<'_, D>,
5021            offset: usize,
5022            depth: fidl::encoding::Depth,
5023        ) -> fidl::Result<()> {
5024            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
5025            // Zero out padding regions. There's no need to apply masks
5026            // because the unmasked parts will be overwritten by fields.
5027            // Write the fields.
5028            self.0.encode(encoder, offset + 0, depth)?;
5029            Ok(())
5030        }
5031    }
5032
5033    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5034        for BaseNetworkSocketSetIpv6TrafficClassRequest
5035    {
5036        #[inline(always)]
5037        fn new_empty() -> Self {
5038            Self { value: fidl::new_empty!(OptionalUint8, D) }
5039        }
5040
5041        #[inline]
5042        unsafe fn decode(
5043            &mut self,
5044            decoder: &mut fidl::encoding::Decoder<'_, D>,
5045            offset: usize,
5046            _depth: fidl::encoding::Depth,
5047        ) -> fidl::Result<()> {
5048            decoder.debug_check_bounds::<Self>(offset);
5049            // Verify that padding bytes are zero.
5050            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
5051            Ok(())
5052        }
5053    }
5054
5055    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
5056        type Borrowed<'a> = &'a Self;
5057        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5058            value
5059        }
5060    }
5061
5062    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
5063        type Owned = Self;
5064
5065        #[inline(always)]
5066        fn inline_align(_context: fidl::encoding::Context) -> usize {
5067            8
5068        }
5069
5070        #[inline(always)]
5071        fn inline_size(_context: fidl::encoding::Context) -> usize {
5072            16
5073        }
5074    }
5075
5076    unsafe impl<D: fidl::encoding::ResourceDialect>
5077        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>
5078        for &BaseNetworkSocketSetIpv6UnicastHopsRequest
5079    {
5080        #[inline]
5081        unsafe fn encode(
5082            self,
5083            encoder: &mut fidl::encoding::Encoder<'_, D>,
5084            offset: usize,
5085            _depth: fidl::encoding::Depth,
5086        ) -> fidl::Result<()> {
5087            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
5088            // Delegate to tuple encoding.
5089            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>::encode(
5090                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5091                encoder,
5092                offset,
5093                _depth,
5094            )
5095        }
5096    }
5097    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
5098        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D> for (T0,)
5099    {
5100        #[inline]
5101        unsafe fn encode(
5102            self,
5103            encoder: &mut fidl::encoding::Encoder<'_, D>,
5104            offset: usize,
5105            depth: fidl::encoding::Depth,
5106        ) -> fidl::Result<()> {
5107            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
5108            // Zero out padding regions. There's no need to apply masks
5109            // because the unmasked parts will be overwritten by fields.
5110            // Write the fields.
5111            self.0.encode(encoder, offset + 0, depth)?;
5112            Ok(())
5113        }
5114    }
5115
5116    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5117        for BaseNetworkSocketSetIpv6UnicastHopsRequest
5118    {
5119        #[inline(always)]
5120        fn new_empty() -> Self {
5121            Self { value: fidl::new_empty!(OptionalUint8, D) }
5122        }
5123
5124        #[inline]
5125        unsafe fn decode(
5126            &mut self,
5127            decoder: &mut fidl::encoding::Decoder<'_, D>,
5128            offset: usize,
5129            _depth: fidl::encoding::Depth,
5130        ) -> fidl::Result<()> {
5131            decoder.debug_check_bounds::<Self>(offset);
5132            // Verify that padding bytes are zero.
5133            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
5134            Ok(())
5135        }
5136    }
5137
5138    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketShutdownRequest {
5139        type Borrowed<'a> = &'a Self;
5140        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5141            value
5142        }
5143    }
5144
5145    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketShutdownRequest {
5146        type Owned = Self;
5147
5148        #[inline(always)]
5149        fn inline_align(_context: fidl::encoding::Context) -> usize {
5150            2
5151        }
5152
5153        #[inline(always)]
5154        fn inline_size(_context: fidl::encoding::Context) -> usize {
5155            2
5156        }
5157    }
5158
5159    unsafe impl<D: fidl::encoding::ResourceDialect>
5160        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D>
5161        for &BaseNetworkSocketShutdownRequest
5162    {
5163        #[inline]
5164        unsafe fn encode(
5165            self,
5166            encoder: &mut fidl::encoding::Encoder<'_, D>,
5167            offset: usize,
5168            _depth: fidl::encoding::Depth,
5169        ) -> fidl::Result<()> {
5170            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5171            // Delegate to tuple encoding.
5172            fidl::encoding::Encode::<BaseNetworkSocketShutdownRequest, D>::encode(
5173                (<ShutdownMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
5174                encoder,
5175                offset,
5176                _depth,
5177            )
5178        }
5179    }
5180    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ShutdownMode, D>>
5181        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D> for (T0,)
5182    {
5183        #[inline]
5184        unsafe fn encode(
5185            self,
5186            encoder: &mut fidl::encoding::Encoder<'_, D>,
5187            offset: usize,
5188            depth: fidl::encoding::Depth,
5189        ) -> fidl::Result<()> {
5190            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5191            // Zero out padding regions. There's no need to apply masks
5192            // because the unmasked parts will be overwritten by fields.
5193            // Write the fields.
5194            self.0.encode(encoder, offset + 0, depth)?;
5195            Ok(())
5196        }
5197    }
5198
5199    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5200        for BaseNetworkSocketShutdownRequest
5201    {
5202        #[inline(always)]
5203        fn new_empty() -> Self {
5204            Self { mode: fidl::new_empty!(ShutdownMode, D) }
5205        }
5206
5207        #[inline]
5208        unsafe fn decode(
5209            &mut self,
5210            decoder: &mut fidl::encoding::Decoder<'_, D>,
5211            offset: usize,
5212            _depth: fidl::encoding::Depth,
5213        ) -> fidl::Result<()> {
5214            decoder.debug_check_bounds::<Self>(offset);
5215            // Verify that padding bytes are zero.
5216            fidl::decode!(ShutdownMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
5217            Ok(())
5218        }
5219    }
5220
5221    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5222        type Borrowed<'a> = &'a Self;
5223        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5224            value
5225        }
5226    }
5227
5228    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5229        type Owned = Self;
5230
5231        #[inline(always)]
5232        fn inline_align(_context: fidl::encoding::Context) -> usize {
5233            1
5234        }
5235
5236        #[inline(always)]
5237        fn inline_size(_context: fidl::encoding::Context) -> usize {
5238            4
5239        }
5240    }
5241
5242    unsafe impl<D: fidl::encoding::ResourceDialect>
5243        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>
5244        for &BaseNetworkSocketGetIpMulticastInterfaceResponse
5245    {
5246        #[inline]
5247        unsafe fn encode(
5248            self,
5249            encoder: &mut fidl::encoding::Encoder<'_, D>,
5250            offset: usize,
5251            _depth: fidl::encoding::Depth,
5252        ) -> fidl::Result<()> {
5253            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5254            // Delegate to tuple encoding.
5255            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>::encode(
5256                (
5257                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5258                ),
5259                encoder, offset, _depth
5260            )
5261        }
5262    }
5263    unsafe impl<
5264        D: fidl::encoding::ResourceDialect,
5265        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
5266    > fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D> for (T0,)
5267    {
5268        #[inline]
5269        unsafe fn encode(
5270            self,
5271            encoder: &mut fidl::encoding::Encoder<'_, D>,
5272            offset: usize,
5273            depth: fidl::encoding::Depth,
5274        ) -> fidl::Result<()> {
5275            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5276            // Zero out padding regions. There's no need to apply masks
5277            // because the unmasked parts will be overwritten by fields.
5278            // Write the fields.
5279            self.0.encode(encoder, offset + 0, depth)?;
5280            Ok(())
5281        }
5282    }
5283
5284    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5285        for BaseNetworkSocketGetIpMulticastInterfaceResponse
5286    {
5287        #[inline(always)]
5288        fn new_empty() -> Self {
5289            Self { value: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D) }
5290        }
5291
5292        #[inline]
5293        unsafe fn decode(
5294            &mut self,
5295            decoder: &mut fidl::encoding::Decoder<'_, D>,
5296            offset: usize,
5297            _depth: fidl::encoding::Depth,
5298        ) -> fidl::Result<()> {
5299            decoder.debug_check_bounds::<Self>(offset);
5300            // Verify that padding bytes are zero.
5301            fidl::decode!(
5302                fidl_fuchsia_net_common::Ipv4Address,
5303                D,
5304                &mut self.value,
5305                decoder,
5306                offset + 0,
5307                _depth
5308            )?;
5309            Ok(())
5310        }
5311    }
5312
5313    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5314        type Borrowed<'a> = &'a Self;
5315        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5316            value
5317        }
5318    }
5319
5320    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5321        type Owned = Self;
5322
5323        #[inline(always)]
5324        fn inline_align(_context: fidl::encoding::Context) -> usize {
5325            1
5326        }
5327
5328        #[inline(always)]
5329        fn inline_size(_context: fidl::encoding::Context) -> usize {
5330            1
5331        }
5332    }
5333
5334    unsafe impl<D: fidl::encoding::ResourceDialect>
5335        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>
5336        for &BaseNetworkSocketGetIpMulticastLoopbackResponse
5337    {
5338        #[inline]
5339        unsafe fn encode(
5340            self,
5341            encoder: &mut fidl::encoding::Encoder<'_, D>,
5342            offset: usize,
5343            _depth: fidl::encoding::Depth,
5344        ) -> fidl::Result<()> {
5345            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5346            // Delegate to tuple encoding.
5347            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>::encode(
5348                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5349                encoder,
5350                offset,
5351                _depth,
5352            )
5353        }
5354    }
5355    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5356        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D> for (T0,)
5357    {
5358        #[inline]
5359        unsafe fn encode(
5360            self,
5361            encoder: &mut fidl::encoding::Encoder<'_, D>,
5362            offset: usize,
5363            depth: fidl::encoding::Depth,
5364        ) -> fidl::Result<()> {
5365            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5366            // Zero out padding regions. There's no need to apply masks
5367            // because the unmasked parts will be overwritten by fields.
5368            // Write the fields.
5369            self.0.encode(encoder, offset + 0, depth)?;
5370            Ok(())
5371        }
5372    }
5373
5374    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5375        for BaseNetworkSocketGetIpMulticastLoopbackResponse
5376    {
5377        #[inline(always)]
5378        fn new_empty() -> Self {
5379            Self { value: fidl::new_empty!(bool, D) }
5380        }
5381
5382        #[inline]
5383        unsafe fn decode(
5384            &mut self,
5385            decoder: &mut fidl::encoding::Decoder<'_, D>,
5386            offset: usize,
5387            _depth: fidl::encoding::Depth,
5388        ) -> fidl::Result<()> {
5389            decoder.debug_check_bounds::<Self>(offset);
5390            // Verify that padding bytes are zero.
5391            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5392            Ok(())
5393        }
5394    }
5395
5396    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5397        type Borrowed<'a> = &'a Self;
5398        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5399            value
5400        }
5401    }
5402
5403    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5404        type Owned = Self;
5405
5406        #[inline(always)]
5407        fn inline_align(_context: fidl::encoding::Context) -> usize {
5408            1
5409        }
5410
5411        #[inline(always)]
5412        fn inline_size(_context: fidl::encoding::Context) -> usize {
5413            1
5414        }
5415        #[inline(always)]
5416        fn encode_is_copy() -> bool {
5417            true
5418        }
5419
5420        #[inline(always)]
5421        fn decode_is_copy() -> bool {
5422            true
5423        }
5424    }
5425
5426    unsafe impl<D: fidl::encoding::ResourceDialect>
5427        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D>
5428        for &BaseNetworkSocketGetIpMulticastTtlResponse
5429    {
5430        #[inline]
5431        unsafe fn encode(
5432            self,
5433            encoder: &mut fidl::encoding::Encoder<'_, D>,
5434            offset: usize,
5435            _depth: fidl::encoding::Depth,
5436        ) -> fidl::Result<()> {
5437            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5438            unsafe {
5439                // Copy the object into the buffer.
5440                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5441                (buf_ptr as *mut BaseNetworkSocketGetIpMulticastTtlResponse).write_unaligned(
5442                    (self as *const BaseNetworkSocketGetIpMulticastTtlResponse).read(),
5443                );
5444                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5445                // done second because the memcpy will write garbage to these bytes.
5446            }
5447            Ok(())
5448        }
5449    }
5450    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5451        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D> for (T0,)
5452    {
5453        #[inline]
5454        unsafe fn encode(
5455            self,
5456            encoder: &mut fidl::encoding::Encoder<'_, D>,
5457            offset: usize,
5458            depth: fidl::encoding::Depth,
5459        ) -> fidl::Result<()> {
5460            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5461            // Zero out padding regions. There's no need to apply masks
5462            // because the unmasked parts will be overwritten by fields.
5463            // Write the fields.
5464            self.0.encode(encoder, offset + 0, depth)?;
5465            Ok(())
5466        }
5467    }
5468
5469    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5470        for BaseNetworkSocketGetIpMulticastTtlResponse
5471    {
5472        #[inline(always)]
5473        fn new_empty() -> Self {
5474            Self { value: fidl::new_empty!(u8, D) }
5475        }
5476
5477        #[inline]
5478        unsafe fn decode(
5479            &mut self,
5480            decoder: &mut fidl::encoding::Decoder<'_, D>,
5481            offset: usize,
5482            _depth: fidl::encoding::Depth,
5483        ) -> fidl::Result<()> {
5484            decoder.debug_check_bounds::<Self>(offset);
5485            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5486            // Verify that padding bytes are zero.
5487            // Copy from the buffer into the object.
5488            unsafe {
5489                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5490            }
5491            Ok(())
5492        }
5493    }
5494
5495    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5496        type Borrowed<'a> = &'a Self;
5497        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5498            value
5499        }
5500    }
5501
5502    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5503        type Owned = Self;
5504
5505        #[inline(always)]
5506        fn inline_align(_context: fidl::encoding::Context) -> usize {
5507            1
5508        }
5509
5510        #[inline(always)]
5511        fn inline_size(_context: fidl::encoding::Context) -> usize {
5512            1
5513        }
5514    }
5515
5516    unsafe impl<D: fidl::encoding::ResourceDialect>
5517        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D>
5518        for &BaseNetworkSocketGetIpPacketInfoResponse
5519    {
5520        #[inline]
5521        unsafe fn encode(
5522            self,
5523            encoder: &mut fidl::encoding::Encoder<'_, D>,
5524            offset: usize,
5525            _depth: fidl::encoding::Depth,
5526        ) -> fidl::Result<()> {
5527            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5528            // Delegate to tuple encoding.
5529            fidl::encoding::Encode::<BaseNetworkSocketGetIpPacketInfoResponse, D>::encode(
5530                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5531                encoder,
5532                offset,
5533                _depth,
5534            )
5535        }
5536    }
5537    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5538        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D> for (T0,)
5539    {
5540        #[inline]
5541        unsafe fn encode(
5542            self,
5543            encoder: &mut fidl::encoding::Encoder<'_, D>,
5544            offset: usize,
5545            depth: fidl::encoding::Depth,
5546        ) -> fidl::Result<()> {
5547            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5548            // Zero out padding regions. There's no need to apply masks
5549            // because the unmasked parts will be overwritten by fields.
5550            // Write the fields.
5551            self.0.encode(encoder, offset + 0, depth)?;
5552            Ok(())
5553        }
5554    }
5555
5556    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5557        for BaseNetworkSocketGetIpPacketInfoResponse
5558    {
5559        #[inline(always)]
5560        fn new_empty() -> Self {
5561            Self { value: fidl::new_empty!(bool, D) }
5562        }
5563
5564        #[inline]
5565        unsafe fn decode(
5566            &mut self,
5567            decoder: &mut fidl::encoding::Decoder<'_, D>,
5568            offset: usize,
5569            _depth: fidl::encoding::Depth,
5570        ) -> fidl::Result<()> {
5571            decoder.debug_check_bounds::<Self>(offset);
5572            // Verify that padding bytes are zero.
5573            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5574            Ok(())
5575        }
5576    }
5577
5578    impl fidl::encoding::ValueTypeMarker
5579        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5580    {
5581        type Borrowed<'a> = &'a Self;
5582        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5583            value
5584        }
5585    }
5586
5587    unsafe impl fidl::encoding::TypeMarker
5588        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5589    {
5590        type Owned = Self;
5591
5592        #[inline(always)]
5593        fn inline_align(_context: fidl::encoding::Context) -> usize {
5594            1
5595        }
5596
5597        #[inline(always)]
5598        fn inline_size(_context: fidl::encoding::Context) -> usize {
5599            1
5600        }
5601    }
5602
5603    unsafe impl<D: fidl::encoding::ResourceDialect>
5604        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5605        for &BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5606    {
5607        #[inline]
5608        unsafe fn encode(
5609            self,
5610            encoder: &mut fidl::encoding::Encoder<'_, D>,
5611            offset: usize,
5612            _depth: fidl::encoding::Depth,
5613        ) -> fidl::Result<()> {
5614            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5615            // Delegate to tuple encoding.
5616            fidl::encoding::Encode::<
5617                BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse,
5618                D,
5619            >::encode(
5620                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5621                encoder,
5622                offset,
5623                _depth,
5624            )
5625        }
5626    }
5627    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5628        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5629        for (T0,)
5630    {
5631        #[inline]
5632        unsafe fn encode(
5633            self,
5634            encoder: &mut fidl::encoding::Encoder<'_, D>,
5635            offset: usize,
5636            depth: fidl::encoding::Depth,
5637        ) -> fidl::Result<()> {
5638            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5639            // Zero out padding regions. There's no need to apply masks
5640            // because the unmasked parts will be overwritten by fields.
5641            // Write the fields.
5642            self.0.encode(encoder, offset + 0, depth)?;
5643            Ok(())
5644        }
5645    }
5646
5647    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5648        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5649    {
5650        #[inline(always)]
5651        fn new_empty() -> Self {
5652            Self { value: fidl::new_empty!(bool, D) }
5653        }
5654
5655        #[inline]
5656        unsafe fn decode(
5657            &mut self,
5658            decoder: &mut fidl::encoding::Decoder<'_, D>,
5659            offset: usize,
5660            _depth: fidl::encoding::Depth,
5661        ) -> fidl::Result<()> {
5662            decoder.debug_check_bounds::<Self>(offset);
5663            // Verify that padding bytes are zero.
5664            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5665            Ok(())
5666        }
5667    }
5668
5669    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5670        type Borrowed<'a> = &'a Self;
5671        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5672            value
5673        }
5674    }
5675
5676    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5677        type Owned = Self;
5678
5679        #[inline(always)]
5680        fn inline_align(_context: fidl::encoding::Context) -> usize {
5681            1
5682        }
5683
5684        #[inline(always)]
5685        fn inline_size(_context: fidl::encoding::Context) -> usize {
5686            1
5687        }
5688    }
5689
5690    unsafe impl<D: fidl::encoding::ResourceDialect>
5691        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D>
5692        for &BaseNetworkSocketGetIpReceiveTtlResponse
5693    {
5694        #[inline]
5695        unsafe fn encode(
5696            self,
5697            encoder: &mut fidl::encoding::Encoder<'_, D>,
5698            offset: usize,
5699            _depth: fidl::encoding::Depth,
5700        ) -> fidl::Result<()> {
5701            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5702            // Delegate to tuple encoding.
5703            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTtlResponse, D>::encode(
5704                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5705                encoder,
5706                offset,
5707                _depth,
5708            )
5709        }
5710    }
5711    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5712        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D> for (T0,)
5713    {
5714        #[inline]
5715        unsafe fn encode(
5716            self,
5717            encoder: &mut fidl::encoding::Encoder<'_, D>,
5718            offset: usize,
5719            depth: fidl::encoding::Depth,
5720        ) -> fidl::Result<()> {
5721            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5722            // Zero out padding regions. There's no need to apply masks
5723            // because the unmasked parts will be overwritten by fields.
5724            // Write the fields.
5725            self.0.encode(encoder, offset + 0, depth)?;
5726            Ok(())
5727        }
5728    }
5729
5730    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5731        for BaseNetworkSocketGetIpReceiveTtlResponse
5732    {
5733        #[inline(always)]
5734        fn new_empty() -> Self {
5735            Self { value: fidl::new_empty!(bool, D) }
5736        }
5737
5738        #[inline]
5739        unsafe fn decode(
5740            &mut self,
5741            decoder: &mut fidl::encoding::Decoder<'_, D>,
5742            offset: usize,
5743            _depth: fidl::encoding::Depth,
5744        ) -> fidl::Result<()> {
5745            decoder.debug_check_bounds::<Self>(offset);
5746            // Verify that padding bytes are zero.
5747            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5748            Ok(())
5749        }
5750    }
5751
5752    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5753        type Borrowed<'a> = &'a Self;
5754        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5755            value
5756        }
5757    }
5758
5759    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5760        type Owned = Self;
5761
5762        #[inline(always)]
5763        fn inline_align(_context: fidl::encoding::Context) -> usize {
5764            1
5765        }
5766
5767        #[inline(always)]
5768        fn inline_size(_context: fidl::encoding::Context) -> usize {
5769            1
5770        }
5771    }
5772
5773    unsafe impl<D: fidl::encoding::ResourceDialect>
5774        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>
5775        for &BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5776    {
5777        #[inline]
5778        unsafe fn encode(
5779            self,
5780            encoder: &mut fidl::encoding::Encoder<'_, D>,
5781            offset: usize,
5782            _depth: fidl::encoding::Depth,
5783        ) -> fidl::Result<()> {
5784            encoder
5785                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5786            // Delegate to tuple encoding.
5787            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>::encode(
5788                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5789                encoder,
5790                offset,
5791                _depth,
5792            )
5793        }
5794    }
5795    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5796        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D> for (T0,)
5797    {
5798        #[inline]
5799        unsafe fn encode(
5800            self,
5801            encoder: &mut fidl::encoding::Encoder<'_, D>,
5802            offset: usize,
5803            depth: fidl::encoding::Depth,
5804        ) -> fidl::Result<()> {
5805            encoder
5806                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5807            // Zero out padding regions. There's no need to apply masks
5808            // because the unmasked parts will be overwritten by fields.
5809            // Write the fields.
5810            self.0.encode(encoder, offset + 0, depth)?;
5811            Ok(())
5812        }
5813    }
5814
5815    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5816        for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5817    {
5818        #[inline(always)]
5819        fn new_empty() -> Self {
5820            Self { value: fidl::new_empty!(bool, D) }
5821        }
5822
5823        #[inline]
5824        unsafe fn decode(
5825            &mut self,
5826            decoder: &mut fidl::encoding::Decoder<'_, D>,
5827            offset: usize,
5828            _depth: fidl::encoding::Depth,
5829        ) -> fidl::Result<()> {
5830            decoder.debug_check_bounds::<Self>(offset);
5831            // Verify that padding bytes are zero.
5832            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5833            Ok(())
5834        }
5835    }
5836
5837    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5838        type Borrowed<'a> = &'a Self;
5839        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5840            value
5841        }
5842    }
5843
5844    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5845        type Owned = Self;
5846
5847        #[inline(always)]
5848        fn inline_align(_context: fidl::encoding::Context) -> usize {
5849            1
5850        }
5851
5852        #[inline(always)]
5853        fn inline_size(_context: fidl::encoding::Context) -> usize {
5854            1
5855        }
5856    }
5857
5858    unsafe impl<D: fidl::encoding::ResourceDialect>
5859        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D>
5860        for &BaseNetworkSocketGetIpTransparentResponse
5861    {
5862        #[inline]
5863        unsafe fn encode(
5864            self,
5865            encoder: &mut fidl::encoding::Encoder<'_, D>,
5866            offset: usize,
5867            _depth: fidl::encoding::Depth,
5868        ) -> fidl::Result<()> {
5869            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5870            // Delegate to tuple encoding.
5871            fidl::encoding::Encode::<BaseNetworkSocketGetIpTransparentResponse, D>::encode(
5872                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5873                encoder,
5874                offset,
5875                _depth,
5876            )
5877        }
5878    }
5879    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5880        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D> for (T0,)
5881    {
5882        #[inline]
5883        unsafe fn encode(
5884            self,
5885            encoder: &mut fidl::encoding::Encoder<'_, D>,
5886            offset: usize,
5887            depth: fidl::encoding::Depth,
5888        ) -> fidl::Result<()> {
5889            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5890            // Zero out padding regions. There's no need to apply masks
5891            // because the unmasked parts will be overwritten by fields.
5892            // Write the fields.
5893            self.0.encode(encoder, offset + 0, depth)?;
5894            Ok(())
5895        }
5896    }
5897
5898    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5899        for BaseNetworkSocketGetIpTransparentResponse
5900    {
5901        #[inline(always)]
5902        fn new_empty() -> Self {
5903            Self { value: fidl::new_empty!(bool, D) }
5904        }
5905
5906        #[inline]
5907        unsafe fn decode(
5908            &mut self,
5909            decoder: &mut fidl::encoding::Decoder<'_, D>,
5910            offset: usize,
5911            _depth: fidl::encoding::Depth,
5912        ) -> fidl::Result<()> {
5913            decoder.debug_check_bounds::<Self>(offset);
5914            // Verify that padding bytes are zero.
5915            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5916            Ok(())
5917        }
5918    }
5919
5920    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTtlResponse {
5921        type Borrowed<'a> = &'a Self;
5922        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5923            value
5924        }
5925    }
5926
5927    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTtlResponse {
5928        type Owned = Self;
5929
5930        #[inline(always)]
5931        fn inline_align(_context: fidl::encoding::Context) -> usize {
5932            1
5933        }
5934
5935        #[inline(always)]
5936        fn inline_size(_context: fidl::encoding::Context) -> usize {
5937            1
5938        }
5939        #[inline(always)]
5940        fn encode_is_copy() -> bool {
5941            true
5942        }
5943
5944        #[inline(always)]
5945        fn decode_is_copy() -> bool {
5946            true
5947        }
5948    }
5949
5950    unsafe impl<D: fidl::encoding::ResourceDialect>
5951        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D>
5952        for &BaseNetworkSocketGetIpTtlResponse
5953    {
5954        #[inline]
5955        unsafe fn encode(
5956            self,
5957            encoder: &mut fidl::encoding::Encoder<'_, D>,
5958            offset: usize,
5959            _depth: fidl::encoding::Depth,
5960        ) -> fidl::Result<()> {
5961            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5962            unsafe {
5963                // Copy the object into the buffer.
5964                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5965                (buf_ptr as *mut BaseNetworkSocketGetIpTtlResponse)
5966                    .write_unaligned((self as *const BaseNetworkSocketGetIpTtlResponse).read());
5967                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5968                // done second because the memcpy will write garbage to these bytes.
5969            }
5970            Ok(())
5971        }
5972    }
5973    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5974        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D> for (T0,)
5975    {
5976        #[inline]
5977        unsafe fn encode(
5978            self,
5979            encoder: &mut fidl::encoding::Encoder<'_, D>,
5980            offset: usize,
5981            depth: fidl::encoding::Depth,
5982        ) -> fidl::Result<()> {
5983            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5984            // Zero out padding regions. There's no need to apply masks
5985            // because the unmasked parts will be overwritten by fields.
5986            // Write the fields.
5987            self.0.encode(encoder, offset + 0, depth)?;
5988            Ok(())
5989        }
5990    }
5991
5992    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5993        for BaseNetworkSocketGetIpTtlResponse
5994    {
5995        #[inline(always)]
5996        fn new_empty() -> Self {
5997            Self { value: fidl::new_empty!(u8, D) }
5998        }
5999
6000        #[inline]
6001        unsafe fn decode(
6002            &mut self,
6003            decoder: &mut fidl::encoding::Decoder<'_, D>,
6004            offset: usize,
6005            _depth: fidl::encoding::Depth,
6006        ) -> fidl::Result<()> {
6007            decoder.debug_check_bounds::<Self>(offset);
6008            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6009            // Verify that padding bytes are zero.
6010            // Copy from the buffer into the object.
6011            unsafe {
6012                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6013            }
6014            Ok(())
6015        }
6016    }
6017
6018    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
6019        type Borrowed<'a> = &'a Self;
6020        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6021            value
6022        }
6023    }
6024
6025    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
6026        type Owned = Self;
6027
6028        #[inline(always)]
6029        fn inline_align(_context: fidl::encoding::Context) -> usize {
6030            1
6031        }
6032
6033        #[inline(always)]
6034        fn inline_size(_context: fidl::encoding::Context) -> usize {
6035            1
6036        }
6037        #[inline(always)]
6038        fn encode_is_copy() -> bool {
6039            true
6040        }
6041
6042        #[inline(always)]
6043        fn decode_is_copy() -> bool {
6044            true
6045        }
6046    }
6047
6048    unsafe impl<D: fidl::encoding::ResourceDialect>
6049        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D>
6050        for &BaseNetworkSocketGetIpTypeOfServiceResponse
6051    {
6052        #[inline]
6053        unsafe fn encode(
6054            self,
6055            encoder: &mut fidl::encoding::Encoder<'_, D>,
6056            offset: usize,
6057            _depth: fidl::encoding::Depth,
6058        ) -> fidl::Result<()> {
6059            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
6060            unsafe {
6061                // Copy the object into the buffer.
6062                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6063                (buf_ptr as *mut BaseNetworkSocketGetIpTypeOfServiceResponse).write_unaligned(
6064                    (self as *const BaseNetworkSocketGetIpTypeOfServiceResponse).read(),
6065                );
6066                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6067                // done second because the memcpy will write garbage to these bytes.
6068            }
6069            Ok(())
6070        }
6071    }
6072    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6073        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D> for (T0,)
6074    {
6075        #[inline]
6076        unsafe fn encode(
6077            self,
6078            encoder: &mut fidl::encoding::Encoder<'_, D>,
6079            offset: usize,
6080            depth: fidl::encoding::Depth,
6081        ) -> fidl::Result<()> {
6082            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
6083            // Zero out padding regions. There's no need to apply masks
6084            // because the unmasked parts will be overwritten by fields.
6085            // Write the fields.
6086            self.0.encode(encoder, offset + 0, depth)?;
6087            Ok(())
6088        }
6089    }
6090
6091    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6092        for BaseNetworkSocketGetIpTypeOfServiceResponse
6093    {
6094        #[inline(always)]
6095        fn new_empty() -> Self {
6096            Self { value: fidl::new_empty!(u8, D) }
6097        }
6098
6099        #[inline]
6100        unsafe fn decode(
6101            &mut self,
6102            decoder: &mut fidl::encoding::Decoder<'_, D>,
6103            offset: usize,
6104            _depth: fidl::encoding::Depth,
6105        ) -> fidl::Result<()> {
6106            decoder.debug_check_bounds::<Self>(offset);
6107            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6108            // Verify that padding bytes are zero.
6109            // Copy from the buffer into the object.
6110            unsafe {
6111                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6112            }
6113            Ok(())
6114        }
6115    }
6116
6117    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
6118        type Borrowed<'a> = &'a Self;
6119        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6120            value
6121        }
6122    }
6123
6124    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
6125        type Owned = Self;
6126
6127        #[inline(always)]
6128        fn inline_align(_context: fidl::encoding::Context) -> usize {
6129            1
6130        }
6131
6132        #[inline(always)]
6133        fn inline_size(_context: fidl::encoding::Context) -> usize {
6134            1
6135        }
6136        #[inline(always)]
6137        fn encode_is_copy() -> bool {
6138            true
6139        }
6140
6141        #[inline(always)]
6142        fn decode_is_copy() -> bool {
6143            true
6144        }
6145    }
6146
6147    unsafe impl<D: fidl::encoding::ResourceDialect>
6148        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D>
6149        for &BaseNetworkSocketGetIpv6MulticastHopsResponse
6150    {
6151        #[inline]
6152        unsafe fn encode(
6153            self,
6154            encoder: &mut fidl::encoding::Encoder<'_, D>,
6155            offset: usize,
6156            _depth: fidl::encoding::Depth,
6157        ) -> fidl::Result<()> {
6158            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6159            unsafe {
6160                // Copy the object into the buffer.
6161                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6162                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastHopsResponse).write_unaligned(
6163                    (self as *const BaseNetworkSocketGetIpv6MulticastHopsResponse).read(),
6164                );
6165                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6166                // done second because the memcpy will write garbage to these bytes.
6167            }
6168            Ok(())
6169        }
6170    }
6171    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6172        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D> for (T0,)
6173    {
6174        #[inline]
6175        unsafe fn encode(
6176            self,
6177            encoder: &mut fidl::encoding::Encoder<'_, D>,
6178            offset: usize,
6179            depth: fidl::encoding::Depth,
6180        ) -> fidl::Result<()> {
6181            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6182            // Zero out padding regions. There's no need to apply masks
6183            // because the unmasked parts will be overwritten by fields.
6184            // Write the fields.
6185            self.0.encode(encoder, offset + 0, depth)?;
6186            Ok(())
6187        }
6188    }
6189
6190    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6191        for BaseNetworkSocketGetIpv6MulticastHopsResponse
6192    {
6193        #[inline(always)]
6194        fn new_empty() -> Self {
6195            Self { value: fidl::new_empty!(u8, D) }
6196        }
6197
6198        #[inline]
6199        unsafe fn decode(
6200            &mut self,
6201            decoder: &mut fidl::encoding::Decoder<'_, D>,
6202            offset: usize,
6203            _depth: fidl::encoding::Depth,
6204        ) -> fidl::Result<()> {
6205            decoder.debug_check_bounds::<Self>(offset);
6206            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6207            // Verify that padding bytes are zero.
6208            // Copy from the buffer into the object.
6209            unsafe {
6210                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6211            }
6212            Ok(())
6213        }
6214    }
6215
6216    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6217        type Borrowed<'a> = &'a Self;
6218        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6219            value
6220        }
6221    }
6222
6223    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6224        type Owned = Self;
6225
6226        #[inline(always)]
6227        fn inline_align(_context: fidl::encoding::Context) -> usize {
6228            8
6229        }
6230
6231        #[inline(always)]
6232        fn inline_size(_context: fidl::encoding::Context) -> usize {
6233            8
6234        }
6235        #[inline(always)]
6236        fn encode_is_copy() -> bool {
6237            true
6238        }
6239
6240        #[inline(always)]
6241        fn decode_is_copy() -> bool {
6242            true
6243        }
6244    }
6245
6246    unsafe impl<D: fidl::encoding::ResourceDialect>
6247        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D>
6248        for &BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6249    {
6250        #[inline]
6251        unsafe fn encode(
6252            self,
6253            encoder: &mut fidl::encoding::Encoder<'_, D>,
6254            offset: usize,
6255            _depth: fidl::encoding::Depth,
6256        ) -> fidl::Result<()> {
6257            encoder
6258                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6259            unsafe {
6260                // Copy the object into the buffer.
6261                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6262                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastInterfaceResponse)
6263                    .write_unaligned(
6264                        (self as *const BaseNetworkSocketGetIpv6MulticastInterfaceResponse).read(),
6265                    );
6266                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6267                // done second because the memcpy will write garbage to these bytes.
6268            }
6269            Ok(())
6270        }
6271    }
6272    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6273        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D> for (T0,)
6274    {
6275        #[inline]
6276        unsafe fn encode(
6277            self,
6278            encoder: &mut fidl::encoding::Encoder<'_, D>,
6279            offset: usize,
6280            depth: fidl::encoding::Depth,
6281        ) -> fidl::Result<()> {
6282            encoder
6283                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6284            // Zero out padding regions. There's no need to apply masks
6285            // because the unmasked parts will be overwritten by fields.
6286            // Write the fields.
6287            self.0.encode(encoder, offset + 0, depth)?;
6288            Ok(())
6289        }
6290    }
6291
6292    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6293        for BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6294    {
6295        #[inline(always)]
6296        fn new_empty() -> Self {
6297            Self { value: fidl::new_empty!(u64, D) }
6298        }
6299
6300        #[inline]
6301        unsafe fn decode(
6302            &mut self,
6303            decoder: &mut fidl::encoding::Decoder<'_, D>,
6304            offset: usize,
6305            _depth: fidl::encoding::Depth,
6306        ) -> fidl::Result<()> {
6307            decoder.debug_check_bounds::<Self>(offset);
6308            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6309            // Verify that padding bytes are zero.
6310            // Copy from the buffer into the object.
6311            unsafe {
6312                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6313            }
6314            Ok(())
6315        }
6316    }
6317
6318    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6319        type Borrowed<'a> = &'a Self;
6320        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6321            value
6322        }
6323    }
6324
6325    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6326        type Owned = Self;
6327
6328        #[inline(always)]
6329        fn inline_align(_context: fidl::encoding::Context) -> usize {
6330            1
6331        }
6332
6333        #[inline(always)]
6334        fn inline_size(_context: fidl::encoding::Context) -> usize {
6335            1
6336        }
6337    }
6338
6339    unsafe impl<D: fidl::encoding::ResourceDialect>
6340        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>
6341        for &BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6342    {
6343        #[inline]
6344        unsafe fn encode(
6345            self,
6346            encoder: &mut fidl::encoding::Encoder<'_, D>,
6347            offset: usize,
6348            _depth: fidl::encoding::Depth,
6349        ) -> fidl::Result<()> {
6350            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6351            // Delegate to tuple encoding.
6352            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>::encode(
6353                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6354                encoder,
6355                offset,
6356                _depth,
6357            )
6358        }
6359    }
6360    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6361        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D> for (T0,)
6362    {
6363        #[inline]
6364        unsafe fn encode(
6365            self,
6366            encoder: &mut fidl::encoding::Encoder<'_, D>,
6367            offset: usize,
6368            depth: fidl::encoding::Depth,
6369        ) -> fidl::Result<()> {
6370            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6371            // Zero out padding regions. There's no need to apply masks
6372            // because the unmasked parts will be overwritten by fields.
6373            // Write the fields.
6374            self.0.encode(encoder, offset + 0, depth)?;
6375            Ok(())
6376        }
6377    }
6378
6379    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6380        for BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6381    {
6382        #[inline(always)]
6383        fn new_empty() -> Self {
6384            Self { value: fidl::new_empty!(bool, D) }
6385        }
6386
6387        #[inline]
6388        unsafe fn decode(
6389            &mut self,
6390            decoder: &mut fidl::encoding::Decoder<'_, D>,
6391            offset: usize,
6392            _depth: fidl::encoding::Depth,
6393        ) -> fidl::Result<()> {
6394            decoder.debug_check_bounds::<Self>(offset);
6395            // Verify that padding bytes are zero.
6396            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6397            Ok(())
6398        }
6399    }
6400
6401    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6402        type Borrowed<'a> = &'a Self;
6403        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6404            value
6405        }
6406    }
6407
6408    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6409        type Owned = Self;
6410
6411        #[inline(always)]
6412        fn inline_align(_context: fidl::encoding::Context) -> usize {
6413            1
6414        }
6415
6416        #[inline(always)]
6417        fn inline_size(_context: fidl::encoding::Context) -> usize {
6418            1
6419        }
6420    }
6421
6422    unsafe impl<D: fidl::encoding::ResourceDialect>
6423        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D>
6424        for &BaseNetworkSocketGetIpv6OnlyResponse
6425    {
6426        #[inline]
6427        unsafe fn encode(
6428            self,
6429            encoder: &mut fidl::encoding::Encoder<'_, D>,
6430            offset: usize,
6431            _depth: fidl::encoding::Depth,
6432        ) -> fidl::Result<()> {
6433            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6434            // Delegate to tuple encoding.
6435            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6OnlyResponse, D>::encode(
6436                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6437                encoder,
6438                offset,
6439                _depth,
6440            )
6441        }
6442    }
6443    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6444        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D> for (T0,)
6445    {
6446        #[inline]
6447        unsafe fn encode(
6448            self,
6449            encoder: &mut fidl::encoding::Encoder<'_, D>,
6450            offset: usize,
6451            depth: fidl::encoding::Depth,
6452        ) -> fidl::Result<()> {
6453            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6454            // Zero out padding regions. There's no need to apply masks
6455            // because the unmasked parts will be overwritten by fields.
6456            // Write the fields.
6457            self.0.encode(encoder, offset + 0, depth)?;
6458            Ok(())
6459        }
6460    }
6461
6462    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6463        for BaseNetworkSocketGetIpv6OnlyResponse
6464    {
6465        #[inline(always)]
6466        fn new_empty() -> Self {
6467            Self { value: fidl::new_empty!(bool, D) }
6468        }
6469
6470        #[inline]
6471        unsafe fn decode(
6472            &mut self,
6473            decoder: &mut fidl::encoding::Decoder<'_, D>,
6474            offset: usize,
6475            _depth: fidl::encoding::Depth,
6476        ) -> fidl::Result<()> {
6477            decoder.debug_check_bounds::<Self>(offset);
6478            // Verify that padding bytes are zero.
6479            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6480            Ok(())
6481        }
6482    }
6483
6484    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6485        type Borrowed<'a> = &'a Self;
6486        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6487            value
6488        }
6489    }
6490
6491    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6492        type Owned = Self;
6493
6494        #[inline(always)]
6495        fn inline_align(_context: fidl::encoding::Context) -> usize {
6496            1
6497        }
6498
6499        #[inline(always)]
6500        fn inline_size(_context: fidl::encoding::Context) -> usize {
6501            1
6502        }
6503    }
6504
6505    unsafe impl<D: fidl::encoding::ResourceDialect>
6506        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>
6507        for &BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6508    {
6509        #[inline]
6510        unsafe fn encode(
6511            self,
6512            encoder: &mut fidl::encoding::Encoder<'_, D>,
6513            offset: usize,
6514            _depth: fidl::encoding::Depth,
6515        ) -> fidl::Result<()> {
6516            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6517            // Delegate to tuple encoding.
6518            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>::encode(
6519                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6520                encoder,
6521                offset,
6522                _depth,
6523            )
6524        }
6525    }
6526    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6527        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D> for (T0,)
6528    {
6529        #[inline]
6530        unsafe fn encode(
6531            self,
6532            encoder: &mut fidl::encoding::Encoder<'_, D>,
6533            offset: usize,
6534            depth: fidl::encoding::Depth,
6535        ) -> fidl::Result<()> {
6536            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6537            // Zero out padding regions. There's no need to apply masks
6538            // because the unmasked parts will be overwritten by fields.
6539            // Write the fields.
6540            self.0.encode(encoder, offset + 0, depth)?;
6541            Ok(())
6542        }
6543    }
6544
6545    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6546        for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6547    {
6548        #[inline(always)]
6549        fn new_empty() -> Self {
6550            Self { value: fidl::new_empty!(bool, D) }
6551        }
6552
6553        #[inline]
6554        unsafe fn decode(
6555            &mut self,
6556            decoder: &mut fidl::encoding::Decoder<'_, D>,
6557            offset: usize,
6558            _depth: fidl::encoding::Depth,
6559        ) -> fidl::Result<()> {
6560            decoder.debug_check_bounds::<Self>(offset);
6561            // Verify that padding bytes are zero.
6562            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6563            Ok(())
6564        }
6565    }
6566
6567    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6568        type Borrowed<'a> = &'a Self;
6569        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6570            value
6571        }
6572    }
6573
6574    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6575        type Owned = Self;
6576
6577        #[inline(always)]
6578        fn inline_align(_context: fidl::encoding::Context) -> usize {
6579            1
6580        }
6581
6582        #[inline(always)]
6583        fn inline_size(_context: fidl::encoding::Context) -> usize {
6584            1
6585        }
6586    }
6587
6588    unsafe impl<D: fidl::encoding::ResourceDialect>
6589        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>
6590        for &BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6591    {
6592        #[inline]
6593        unsafe fn encode(
6594            self,
6595            encoder: &mut fidl::encoding::Encoder<'_, D>,
6596            offset: usize,
6597            _depth: fidl::encoding::Depth,
6598        ) -> fidl::Result<()> {
6599            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6600            // Delegate to tuple encoding.
6601            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>::encode(
6602                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6603                encoder,
6604                offset,
6605                _depth,
6606            )
6607        }
6608    }
6609    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6610        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D> for (T0,)
6611    {
6612        #[inline]
6613        unsafe fn encode(
6614            self,
6615            encoder: &mut fidl::encoding::Encoder<'_, D>,
6616            offset: usize,
6617            depth: fidl::encoding::Depth,
6618        ) -> fidl::Result<()> {
6619            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6620            // Zero out padding regions. There's no need to apply masks
6621            // because the unmasked parts will be overwritten by fields.
6622            // Write the fields.
6623            self.0.encode(encoder, offset + 0, depth)?;
6624            Ok(())
6625        }
6626    }
6627
6628    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6629        for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6630    {
6631        #[inline(always)]
6632        fn new_empty() -> Self {
6633            Self { value: fidl::new_empty!(bool, D) }
6634        }
6635
6636        #[inline]
6637        unsafe fn decode(
6638            &mut self,
6639            decoder: &mut fidl::encoding::Decoder<'_, D>,
6640            offset: usize,
6641            _depth: fidl::encoding::Depth,
6642        ) -> fidl::Result<()> {
6643            decoder.debug_check_bounds::<Self>(offset);
6644            // Verify that padding bytes are zero.
6645            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6646            Ok(())
6647        }
6648    }
6649
6650    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6651        type Borrowed<'a> = &'a Self;
6652        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6653            value
6654        }
6655    }
6656
6657    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6658        type Owned = Self;
6659
6660        #[inline(always)]
6661        fn inline_align(_context: fidl::encoding::Context) -> usize {
6662            1
6663        }
6664
6665        #[inline(always)]
6666        fn inline_size(_context: fidl::encoding::Context) -> usize {
6667            1
6668        }
6669    }
6670
6671    unsafe impl<D: fidl::encoding::ResourceDialect>
6672        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>
6673        for &BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6674    {
6675        #[inline]
6676        unsafe fn encode(
6677            self,
6678            encoder: &mut fidl::encoding::Encoder<'_, D>,
6679            offset: usize,
6680            _depth: fidl::encoding::Depth,
6681        ) -> fidl::Result<()> {
6682            encoder
6683                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6684            // Delegate to tuple encoding.
6685            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>::encode(
6686                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6687                encoder,
6688                offset,
6689                _depth,
6690            )
6691        }
6692    }
6693    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6694        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D> for (T0,)
6695    {
6696        #[inline]
6697        unsafe fn encode(
6698            self,
6699            encoder: &mut fidl::encoding::Encoder<'_, D>,
6700            offset: usize,
6701            depth: fidl::encoding::Depth,
6702        ) -> fidl::Result<()> {
6703            encoder
6704                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6705            // Zero out padding regions. There's no need to apply masks
6706            // because the unmasked parts will be overwritten by fields.
6707            // Write the fields.
6708            self.0.encode(encoder, offset + 0, depth)?;
6709            Ok(())
6710        }
6711    }
6712
6713    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6714        for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6715    {
6716        #[inline(always)]
6717        fn new_empty() -> Self {
6718            Self { value: fidl::new_empty!(bool, D) }
6719        }
6720
6721        #[inline]
6722        unsafe fn decode(
6723            &mut self,
6724            decoder: &mut fidl::encoding::Decoder<'_, D>,
6725            offset: usize,
6726            _depth: fidl::encoding::Depth,
6727        ) -> fidl::Result<()> {
6728            decoder.debug_check_bounds::<Self>(offset);
6729            // Verify that padding bytes are zero.
6730            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6731            Ok(())
6732        }
6733    }
6734
6735    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6736        type Borrowed<'a> = &'a Self;
6737        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6738            value
6739        }
6740    }
6741
6742    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6743        type Owned = Self;
6744
6745        #[inline(always)]
6746        fn inline_align(_context: fidl::encoding::Context) -> usize {
6747            1
6748        }
6749
6750        #[inline(always)]
6751        fn inline_size(_context: fidl::encoding::Context) -> usize {
6752            1
6753        }
6754        #[inline(always)]
6755        fn encode_is_copy() -> bool {
6756            true
6757        }
6758
6759        #[inline(always)]
6760        fn decode_is_copy() -> bool {
6761            true
6762        }
6763    }
6764
6765    unsafe impl<D: fidl::encoding::ResourceDialect>
6766        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D>
6767        for &BaseNetworkSocketGetIpv6TrafficClassResponse
6768    {
6769        #[inline]
6770        unsafe fn encode(
6771            self,
6772            encoder: &mut fidl::encoding::Encoder<'_, D>,
6773            offset: usize,
6774            _depth: fidl::encoding::Depth,
6775        ) -> fidl::Result<()> {
6776            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6777            unsafe {
6778                // Copy the object into the buffer.
6779                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6780                (buf_ptr as *mut BaseNetworkSocketGetIpv6TrafficClassResponse).write_unaligned(
6781                    (self as *const BaseNetworkSocketGetIpv6TrafficClassResponse).read(),
6782                );
6783                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6784                // done second because the memcpy will write garbage to these bytes.
6785            }
6786            Ok(())
6787        }
6788    }
6789    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6790        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D> for (T0,)
6791    {
6792        #[inline]
6793        unsafe fn encode(
6794            self,
6795            encoder: &mut fidl::encoding::Encoder<'_, D>,
6796            offset: usize,
6797            depth: fidl::encoding::Depth,
6798        ) -> fidl::Result<()> {
6799            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6800            // Zero out padding regions. There's no need to apply masks
6801            // because the unmasked parts will be overwritten by fields.
6802            // Write the fields.
6803            self.0.encode(encoder, offset + 0, depth)?;
6804            Ok(())
6805        }
6806    }
6807
6808    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6809        for BaseNetworkSocketGetIpv6TrafficClassResponse
6810    {
6811        #[inline(always)]
6812        fn new_empty() -> Self {
6813            Self { value: fidl::new_empty!(u8, D) }
6814        }
6815
6816        #[inline]
6817        unsafe fn decode(
6818            &mut self,
6819            decoder: &mut fidl::encoding::Decoder<'_, D>,
6820            offset: usize,
6821            _depth: fidl::encoding::Depth,
6822        ) -> fidl::Result<()> {
6823            decoder.debug_check_bounds::<Self>(offset);
6824            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6825            // Verify that padding bytes are zero.
6826            // Copy from the buffer into the object.
6827            unsafe {
6828                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6829            }
6830            Ok(())
6831        }
6832    }
6833
6834    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6835        type Borrowed<'a> = &'a Self;
6836        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6837            value
6838        }
6839    }
6840
6841    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6842        type Owned = Self;
6843
6844        #[inline(always)]
6845        fn inline_align(_context: fidl::encoding::Context) -> usize {
6846            1
6847        }
6848
6849        #[inline(always)]
6850        fn inline_size(_context: fidl::encoding::Context) -> usize {
6851            1
6852        }
6853        #[inline(always)]
6854        fn encode_is_copy() -> bool {
6855            true
6856        }
6857
6858        #[inline(always)]
6859        fn decode_is_copy() -> bool {
6860            true
6861        }
6862    }
6863
6864    unsafe impl<D: fidl::encoding::ResourceDialect>
6865        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D>
6866        for &BaseNetworkSocketGetIpv6UnicastHopsResponse
6867    {
6868        #[inline]
6869        unsafe fn encode(
6870            self,
6871            encoder: &mut fidl::encoding::Encoder<'_, D>,
6872            offset: usize,
6873            _depth: fidl::encoding::Depth,
6874        ) -> fidl::Result<()> {
6875            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6876            unsafe {
6877                // Copy the object into the buffer.
6878                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6879                (buf_ptr as *mut BaseNetworkSocketGetIpv6UnicastHopsResponse).write_unaligned(
6880                    (self as *const BaseNetworkSocketGetIpv6UnicastHopsResponse).read(),
6881                );
6882                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6883                // done second because the memcpy will write garbage to these bytes.
6884            }
6885            Ok(())
6886        }
6887    }
6888    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6889        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D> for (T0,)
6890    {
6891        #[inline]
6892        unsafe fn encode(
6893            self,
6894            encoder: &mut fidl::encoding::Encoder<'_, D>,
6895            offset: usize,
6896            depth: fidl::encoding::Depth,
6897        ) -> fidl::Result<()> {
6898            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6899            // Zero out padding regions. There's no need to apply masks
6900            // because the unmasked parts will be overwritten by fields.
6901            // Write the fields.
6902            self.0.encode(encoder, offset + 0, depth)?;
6903            Ok(())
6904        }
6905    }
6906
6907    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6908        for BaseNetworkSocketGetIpv6UnicastHopsResponse
6909    {
6910        #[inline(always)]
6911        fn new_empty() -> Self {
6912            Self { value: fidl::new_empty!(u8, D) }
6913        }
6914
6915        #[inline]
6916        unsafe fn decode(
6917            &mut self,
6918            decoder: &mut fidl::encoding::Decoder<'_, D>,
6919            offset: usize,
6920            _depth: fidl::encoding::Depth,
6921        ) -> fidl::Result<()> {
6922            decoder.debug_check_bounds::<Self>(offset);
6923            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6924            // Verify that padding bytes are zero.
6925            // Copy from the buffer into the object.
6926            unsafe {
6927                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6928            }
6929            Ok(())
6930        }
6931    }
6932
6933    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6934        type Borrowed<'a> = &'a Self;
6935        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6936            value
6937        }
6938    }
6939
6940    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6941        type Owned = Self;
6942
6943        #[inline(always)]
6944        fn inline_align(_context: fidl::encoding::Context) -> usize {
6945            8
6946        }
6947
6948        #[inline(always)]
6949        fn inline_size(_context: fidl::encoding::Context) -> usize {
6950            16
6951        }
6952    }
6953
6954    unsafe impl<D: fidl::encoding::ResourceDialect>
6955        fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D>
6956        for &BaseNetworkSocketGetOriginalDestinationResponse
6957    {
6958        #[inline]
6959        unsafe fn encode(
6960            self,
6961            encoder: &mut fidl::encoding::Encoder<'_, D>,
6962            offset: usize,
6963            _depth: fidl::encoding::Depth,
6964        ) -> fidl::Result<()> {
6965            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6966            // Delegate to tuple encoding.
6967            fidl::encoding::Encode::<BaseNetworkSocketGetOriginalDestinationResponse, D>::encode(
6968                (
6969                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6970                ),
6971                encoder, offset, _depth
6972            )
6973        }
6974    }
6975    unsafe impl<
6976        D: fidl::encoding::ResourceDialect,
6977        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
6978    > fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D> for (T0,)
6979    {
6980        #[inline]
6981        unsafe fn encode(
6982            self,
6983            encoder: &mut fidl::encoding::Encoder<'_, D>,
6984            offset: usize,
6985            depth: fidl::encoding::Depth,
6986        ) -> fidl::Result<()> {
6987            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6988            // Zero out padding regions. There's no need to apply masks
6989            // because the unmasked parts will be overwritten by fields.
6990            // Write the fields.
6991            self.0.encode(encoder, offset + 0, depth)?;
6992            Ok(())
6993        }
6994    }
6995
6996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6997        for BaseNetworkSocketGetOriginalDestinationResponse
6998    {
6999        #[inline(always)]
7000        fn new_empty() -> Self {
7001            Self { value: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
7002        }
7003
7004        #[inline]
7005        unsafe fn decode(
7006            &mut self,
7007            decoder: &mut fidl::encoding::Decoder<'_, D>,
7008            offset: usize,
7009            _depth: fidl::encoding::Depth,
7010        ) -> fidl::Result<()> {
7011            decoder.debug_check_bounds::<Self>(offset);
7012            // Verify that padding bytes are zero.
7013            fidl::decode!(
7014                fidl_fuchsia_net_common::SocketAddress,
7015                D,
7016                &mut self.value,
7017                decoder,
7018                offset + 0,
7019                _depth
7020            )?;
7021            Ok(())
7022        }
7023    }
7024
7025    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetPeerNameResponse {
7026        type Borrowed<'a> = &'a Self;
7027        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7028            value
7029        }
7030    }
7031
7032    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetPeerNameResponse {
7033        type Owned = Self;
7034
7035        #[inline(always)]
7036        fn inline_align(_context: fidl::encoding::Context) -> usize {
7037            8
7038        }
7039
7040        #[inline(always)]
7041        fn inline_size(_context: fidl::encoding::Context) -> usize {
7042            16
7043        }
7044    }
7045
7046    unsafe impl<D: fidl::encoding::ResourceDialect>
7047        fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D>
7048        for &BaseNetworkSocketGetPeerNameResponse
7049    {
7050        #[inline]
7051        unsafe fn encode(
7052            self,
7053            encoder: &mut fidl::encoding::Encoder<'_, D>,
7054            offset: usize,
7055            _depth: fidl::encoding::Depth,
7056        ) -> fidl::Result<()> {
7057            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
7058            // Delegate to tuple encoding.
7059            fidl::encoding::Encode::<BaseNetworkSocketGetPeerNameResponse, D>::encode(
7060                (
7061                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
7062                ),
7063                encoder, offset, _depth
7064            )
7065        }
7066    }
7067    unsafe impl<
7068        D: fidl::encoding::ResourceDialect,
7069        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
7070    > fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D> for (T0,)
7071    {
7072        #[inline]
7073        unsafe fn encode(
7074            self,
7075            encoder: &mut fidl::encoding::Encoder<'_, D>,
7076            offset: usize,
7077            depth: fidl::encoding::Depth,
7078        ) -> fidl::Result<()> {
7079            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
7080            // Zero out padding regions. There's no need to apply masks
7081            // because the unmasked parts will be overwritten by fields.
7082            // Write the fields.
7083            self.0.encode(encoder, offset + 0, depth)?;
7084            Ok(())
7085        }
7086    }
7087
7088    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7089        for BaseNetworkSocketGetPeerNameResponse
7090    {
7091        #[inline(always)]
7092        fn new_empty() -> Self {
7093            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
7094        }
7095
7096        #[inline]
7097        unsafe fn decode(
7098            &mut self,
7099            decoder: &mut fidl::encoding::Decoder<'_, D>,
7100            offset: usize,
7101            _depth: fidl::encoding::Depth,
7102        ) -> fidl::Result<()> {
7103            decoder.debug_check_bounds::<Self>(offset);
7104            // Verify that padding bytes are zero.
7105            fidl::decode!(
7106                fidl_fuchsia_net_common::SocketAddress,
7107                D,
7108                &mut self.addr,
7109                decoder,
7110                offset + 0,
7111                _depth
7112            )?;
7113            Ok(())
7114        }
7115    }
7116
7117    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetSockNameResponse {
7118        type Borrowed<'a> = &'a Self;
7119        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7120            value
7121        }
7122    }
7123
7124    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetSockNameResponse {
7125        type Owned = Self;
7126
7127        #[inline(always)]
7128        fn inline_align(_context: fidl::encoding::Context) -> usize {
7129            8
7130        }
7131
7132        #[inline(always)]
7133        fn inline_size(_context: fidl::encoding::Context) -> usize {
7134            16
7135        }
7136    }
7137
7138    unsafe impl<D: fidl::encoding::ResourceDialect>
7139        fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D>
7140        for &BaseNetworkSocketGetSockNameResponse
7141    {
7142        #[inline]
7143        unsafe fn encode(
7144            self,
7145            encoder: &mut fidl::encoding::Encoder<'_, D>,
7146            offset: usize,
7147            _depth: fidl::encoding::Depth,
7148        ) -> fidl::Result<()> {
7149            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
7150            // Delegate to tuple encoding.
7151            fidl::encoding::Encode::<BaseNetworkSocketGetSockNameResponse, D>::encode(
7152                (
7153                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
7154                ),
7155                encoder, offset, _depth
7156            )
7157        }
7158    }
7159    unsafe impl<
7160        D: fidl::encoding::ResourceDialect,
7161        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
7162    > fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, 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::<BaseNetworkSocketGetSockNameResponse>(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 BaseNetworkSocketGetSockNameResponse
7182    {
7183        #[inline(always)]
7184        fn new_empty() -> Self {
7185            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, 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            // Verify that padding bytes are zero.
7197            fidl::decode!(
7198                fidl_fuchsia_net_common::SocketAddress,
7199                D,
7200                &mut self.addr,
7201                decoder,
7202                offset + 0,
7203                _depth
7204            )?;
7205            Ok(())
7206        }
7207    }
7208
7209    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkRequest {
7210        type Borrowed<'a> = &'a Self;
7211        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7212            value
7213        }
7214    }
7215
7216    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkRequest {
7217        type Owned = Self;
7218
7219        #[inline(always)]
7220        fn inline_align(_context: fidl::encoding::Context) -> usize {
7221            1
7222        }
7223
7224        #[inline(always)]
7225        fn inline_size(_context: fidl::encoding::Context) -> usize {
7226            1
7227        }
7228    }
7229
7230    unsafe impl<D: fidl::encoding::ResourceDialect>
7231        fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for &BaseSocketGetMarkRequest
7232    {
7233        #[inline]
7234        unsafe fn encode(
7235            self,
7236            encoder: &mut fidl::encoding::Encoder<'_, D>,
7237            offset: usize,
7238            _depth: fidl::encoding::Depth,
7239        ) -> fidl::Result<()> {
7240            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7241            // Delegate to tuple encoding.
7242            fidl::encoding::Encode::<BaseSocketGetMarkRequest, D>::encode(
7243                (<fidl_fuchsia_net_common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(
7244                    &self.domain,
7245                ),),
7246                encoder,
7247                offset,
7248                _depth,
7249            )
7250        }
7251    }
7252    unsafe impl<
7253        D: fidl::encoding::ResourceDialect,
7254        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::MarkDomain, D>,
7255    > fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for (T0,)
7256    {
7257        #[inline]
7258        unsafe fn encode(
7259            self,
7260            encoder: &mut fidl::encoding::Encoder<'_, D>,
7261            offset: usize,
7262            depth: fidl::encoding::Depth,
7263        ) -> fidl::Result<()> {
7264            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7265            // Zero out padding regions. There's no need to apply masks
7266            // because the unmasked parts will be overwritten by fields.
7267            // Write the fields.
7268            self.0.encode(encoder, offset + 0, depth)?;
7269            Ok(())
7270        }
7271    }
7272
7273    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7274        for BaseSocketGetMarkRequest
7275    {
7276        #[inline(always)]
7277        fn new_empty() -> Self {
7278            Self { domain: fidl::new_empty!(fidl_fuchsia_net_common::MarkDomain, D) }
7279        }
7280
7281        #[inline]
7282        unsafe fn decode(
7283            &mut self,
7284            decoder: &mut fidl::encoding::Decoder<'_, D>,
7285            offset: usize,
7286            _depth: fidl::encoding::Depth,
7287        ) -> fidl::Result<()> {
7288            decoder.debug_check_bounds::<Self>(offset);
7289            // Verify that padding bytes are zero.
7290            fidl::decode!(
7291                fidl_fuchsia_net_common::MarkDomain,
7292                D,
7293                &mut self.domain,
7294                decoder,
7295                offset + 0,
7296                _depth
7297            )?;
7298            Ok(())
7299        }
7300    }
7301
7302    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToDeviceRequest {
7303        type Borrowed<'a> = &'a Self;
7304        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7305            value
7306        }
7307    }
7308
7309    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToDeviceRequest {
7310        type Owned = Self;
7311
7312        #[inline(always)]
7313        fn inline_align(_context: fidl::encoding::Context) -> usize {
7314            8
7315        }
7316
7317        #[inline(always)]
7318        fn inline_size(_context: fidl::encoding::Context) -> usize {
7319            16
7320        }
7321    }
7322
7323    unsafe impl<D: fidl::encoding::ResourceDialect>
7324        fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D>
7325        for &BaseSocketSetBindToDeviceRequest
7326    {
7327        #[inline]
7328        unsafe fn encode(
7329            self,
7330            encoder: &mut fidl::encoding::Encoder<'_, D>,
7331            offset: usize,
7332            _depth: fidl::encoding::Depth,
7333        ) -> fidl::Result<()> {
7334            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7335            // Delegate to tuple encoding.
7336            fidl::encoding::Encode::<BaseSocketSetBindToDeviceRequest, D>::encode(
7337                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
7338                    &self.value,
7339                ),),
7340                encoder,
7341                offset,
7342                _depth,
7343            )
7344        }
7345    }
7346    unsafe impl<
7347        D: fidl::encoding::ResourceDialect,
7348        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
7349    > fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D> for (T0,)
7350    {
7351        #[inline]
7352        unsafe fn encode(
7353            self,
7354            encoder: &mut fidl::encoding::Encoder<'_, D>,
7355            offset: usize,
7356            depth: fidl::encoding::Depth,
7357        ) -> fidl::Result<()> {
7358            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7359            // Zero out padding regions. There's no need to apply masks
7360            // because the unmasked parts will be overwritten by fields.
7361            // Write the fields.
7362            self.0.encode(encoder, offset + 0, depth)?;
7363            Ok(())
7364        }
7365    }
7366
7367    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7368        for BaseSocketSetBindToDeviceRequest
7369    {
7370        #[inline(always)]
7371        fn new_empty() -> Self {
7372            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
7373        }
7374
7375        #[inline]
7376        unsafe fn decode(
7377            &mut self,
7378            decoder: &mut fidl::encoding::Decoder<'_, D>,
7379            offset: usize,
7380            _depth: fidl::encoding::Depth,
7381        ) -> fidl::Result<()> {
7382            decoder.debug_check_bounds::<Self>(offset);
7383            // Verify that padding bytes are zero.
7384            fidl::decode!(
7385                fidl::encoding::BoundedString<15>,
7386                D,
7387                &mut self.value,
7388                decoder,
7389                offset + 0,
7390                _depth
7391            )?;
7392            Ok(())
7393        }
7394    }
7395
7396    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7397        type Borrowed<'a> = &'a Self;
7398        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7399            value
7400        }
7401    }
7402
7403    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7404        type Owned = Self;
7405
7406        #[inline(always)]
7407        fn inline_align(_context: fidl::encoding::Context) -> usize {
7408            8
7409        }
7410
7411        #[inline(always)]
7412        fn inline_size(_context: fidl::encoding::Context) -> usize {
7413            8
7414        }
7415        #[inline(always)]
7416        fn encode_is_copy() -> bool {
7417            true
7418        }
7419
7420        #[inline(always)]
7421        fn decode_is_copy() -> bool {
7422            true
7423        }
7424    }
7425
7426    unsafe impl<D: fidl::encoding::ResourceDialect>
7427        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D>
7428        for &BaseSocketSetBindToInterfaceIndexRequest
7429    {
7430        #[inline]
7431        unsafe fn encode(
7432            self,
7433            encoder: &mut fidl::encoding::Encoder<'_, D>,
7434            offset: usize,
7435            _depth: fidl::encoding::Depth,
7436        ) -> fidl::Result<()> {
7437            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7438            unsafe {
7439                // Copy the object into the buffer.
7440                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7441                (buf_ptr as *mut BaseSocketSetBindToInterfaceIndexRequest).write_unaligned(
7442                    (self as *const BaseSocketSetBindToInterfaceIndexRequest).read(),
7443                );
7444                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7445                // done second because the memcpy will write garbage to these bytes.
7446            }
7447            Ok(())
7448        }
7449    }
7450    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7451        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D> for (T0,)
7452    {
7453        #[inline]
7454        unsafe fn encode(
7455            self,
7456            encoder: &mut fidl::encoding::Encoder<'_, D>,
7457            offset: usize,
7458            depth: fidl::encoding::Depth,
7459        ) -> fidl::Result<()> {
7460            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7461            // Zero out padding regions. There's no need to apply masks
7462            // because the unmasked parts will be overwritten by fields.
7463            // Write the fields.
7464            self.0.encode(encoder, offset + 0, depth)?;
7465            Ok(())
7466        }
7467    }
7468
7469    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7470        for BaseSocketSetBindToInterfaceIndexRequest
7471    {
7472        #[inline(always)]
7473        fn new_empty() -> Self {
7474            Self { value: fidl::new_empty!(u64, D) }
7475        }
7476
7477        #[inline]
7478        unsafe fn decode(
7479            &mut self,
7480            decoder: &mut fidl::encoding::Decoder<'_, D>,
7481            offset: usize,
7482            _depth: fidl::encoding::Depth,
7483        ) -> fidl::Result<()> {
7484            decoder.debug_check_bounds::<Self>(offset);
7485            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7486            // Verify that padding bytes are zero.
7487            // Copy from the buffer into the object.
7488            unsafe {
7489                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7490            }
7491            Ok(())
7492        }
7493    }
7494
7495    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBroadcastRequest {
7496        type Borrowed<'a> = &'a Self;
7497        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7498            value
7499        }
7500    }
7501
7502    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBroadcastRequest {
7503        type Owned = Self;
7504
7505        #[inline(always)]
7506        fn inline_align(_context: fidl::encoding::Context) -> usize {
7507            1
7508        }
7509
7510        #[inline(always)]
7511        fn inline_size(_context: fidl::encoding::Context) -> usize {
7512            1
7513        }
7514    }
7515
7516    unsafe impl<D: fidl::encoding::ResourceDialect>
7517        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D>
7518        for &BaseSocketSetBroadcastRequest
7519    {
7520        #[inline]
7521        unsafe fn encode(
7522            self,
7523            encoder: &mut fidl::encoding::Encoder<'_, D>,
7524            offset: usize,
7525            _depth: fidl::encoding::Depth,
7526        ) -> fidl::Result<()> {
7527            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7528            // Delegate to tuple encoding.
7529            fidl::encoding::Encode::<BaseSocketSetBroadcastRequest, D>::encode(
7530                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7531                encoder,
7532                offset,
7533                _depth,
7534            )
7535        }
7536    }
7537    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7538        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D> for (T0,)
7539    {
7540        #[inline]
7541        unsafe fn encode(
7542            self,
7543            encoder: &mut fidl::encoding::Encoder<'_, D>,
7544            offset: usize,
7545            depth: fidl::encoding::Depth,
7546        ) -> fidl::Result<()> {
7547            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7548            // Zero out padding regions. There's no need to apply masks
7549            // because the unmasked parts will be overwritten by fields.
7550            // Write the fields.
7551            self.0.encode(encoder, offset + 0, depth)?;
7552            Ok(())
7553        }
7554    }
7555
7556    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7557        for BaseSocketSetBroadcastRequest
7558    {
7559        #[inline(always)]
7560        fn new_empty() -> Self {
7561            Self { value: fidl::new_empty!(bool, D) }
7562        }
7563
7564        #[inline]
7565        unsafe fn decode(
7566            &mut self,
7567            decoder: &mut fidl::encoding::Decoder<'_, D>,
7568            offset: usize,
7569            _depth: fidl::encoding::Depth,
7570        ) -> fidl::Result<()> {
7571            decoder.debug_check_bounds::<Self>(offset);
7572            // Verify that padding bytes are zero.
7573            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7574            Ok(())
7575        }
7576    }
7577
7578    impl fidl::encoding::ValueTypeMarker for BaseSocketSetKeepAliveRequest {
7579        type Borrowed<'a> = &'a Self;
7580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7581            value
7582        }
7583    }
7584
7585    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetKeepAliveRequest {
7586        type Owned = Self;
7587
7588        #[inline(always)]
7589        fn inline_align(_context: fidl::encoding::Context) -> usize {
7590            1
7591        }
7592
7593        #[inline(always)]
7594        fn inline_size(_context: fidl::encoding::Context) -> usize {
7595            1
7596        }
7597    }
7598
7599    unsafe impl<D: fidl::encoding::ResourceDialect>
7600        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D>
7601        for &BaseSocketSetKeepAliveRequest
7602    {
7603        #[inline]
7604        unsafe fn encode(
7605            self,
7606            encoder: &mut fidl::encoding::Encoder<'_, D>,
7607            offset: usize,
7608            _depth: fidl::encoding::Depth,
7609        ) -> fidl::Result<()> {
7610            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7611            // Delegate to tuple encoding.
7612            fidl::encoding::Encode::<BaseSocketSetKeepAliveRequest, D>::encode(
7613                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7614                encoder,
7615                offset,
7616                _depth,
7617            )
7618        }
7619    }
7620    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7621        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D> for (T0,)
7622    {
7623        #[inline]
7624        unsafe fn encode(
7625            self,
7626            encoder: &mut fidl::encoding::Encoder<'_, D>,
7627            offset: usize,
7628            depth: fidl::encoding::Depth,
7629        ) -> fidl::Result<()> {
7630            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7631            // Zero out padding regions. There's no need to apply masks
7632            // because the unmasked parts will be overwritten by fields.
7633            // Write the fields.
7634            self.0.encode(encoder, offset + 0, depth)?;
7635            Ok(())
7636        }
7637    }
7638
7639    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7640        for BaseSocketSetKeepAliveRequest
7641    {
7642        #[inline(always)]
7643        fn new_empty() -> Self {
7644            Self { value: fidl::new_empty!(bool, D) }
7645        }
7646
7647        #[inline]
7648        unsafe fn decode(
7649            &mut self,
7650            decoder: &mut fidl::encoding::Decoder<'_, D>,
7651            offset: usize,
7652            _depth: fidl::encoding::Depth,
7653        ) -> fidl::Result<()> {
7654            decoder.debug_check_bounds::<Self>(offset);
7655            // Verify that padding bytes are zero.
7656            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7657            Ok(())
7658        }
7659    }
7660
7661    impl fidl::encoding::ValueTypeMarker for BaseSocketSetLingerRequest {
7662        type Borrowed<'a> = &'a Self;
7663        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7664            value
7665        }
7666    }
7667
7668    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetLingerRequest {
7669        type Owned = Self;
7670
7671        #[inline(always)]
7672        fn inline_align(_context: fidl::encoding::Context) -> usize {
7673            4
7674        }
7675
7676        #[inline(always)]
7677        fn inline_size(_context: fidl::encoding::Context) -> usize {
7678            8
7679        }
7680    }
7681
7682    unsafe impl<D: fidl::encoding::ResourceDialect>
7683        fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for &BaseSocketSetLingerRequest
7684    {
7685        #[inline]
7686        unsafe fn encode(
7687            self,
7688            encoder: &mut fidl::encoding::Encoder<'_, D>,
7689            offset: usize,
7690            _depth: fidl::encoding::Depth,
7691        ) -> fidl::Result<()> {
7692            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7693            // Delegate to tuple encoding.
7694            fidl::encoding::Encode::<BaseSocketSetLingerRequest, D>::encode(
7695                (
7696                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
7697                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
7698                ),
7699                encoder,
7700                offset,
7701                _depth,
7702            )
7703        }
7704    }
7705    unsafe impl<
7706        D: fidl::encoding::ResourceDialect,
7707        T0: fidl::encoding::Encode<bool, D>,
7708        T1: fidl::encoding::Encode<u32, D>,
7709    > fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for (T0, T1)
7710    {
7711        #[inline]
7712        unsafe fn encode(
7713            self,
7714            encoder: &mut fidl::encoding::Encoder<'_, D>,
7715            offset: usize,
7716            depth: fidl::encoding::Depth,
7717        ) -> fidl::Result<()> {
7718            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7719            // Zero out padding regions. There's no need to apply masks
7720            // because the unmasked parts will be overwritten by fields.
7721            unsafe {
7722                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7723                (ptr as *mut u32).write_unaligned(0);
7724            }
7725            // Write the fields.
7726            self.0.encode(encoder, offset + 0, depth)?;
7727            self.1.encode(encoder, offset + 4, depth)?;
7728            Ok(())
7729        }
7730    }
7731
7732    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7733        for BaseSocketSetLingerRequest
7734    {
7735        #[inline(always)]
7736        fn new_empty() -> Self {
7737            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
7738        }
7739
7740        #[inline]
7741        unsafe fn decode(
7742            &mut self,
7743            decoder: &mut fidl::encoding::Decoder<'_, D>,
7744            offset: usize,
7745            _depth: fidl::encoding::Depth,
7746        ) -> fidl::Result<()> {
7747            decoder.debug_check_bounds::<Self>(offset);
7748            // Verify that padding bytes are zero.
7749            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7750            let padval = unsafe { (ptr as *const u32).read_unaligned() };
7751            let mask = 0xffffff00u32;
7752            let maskedval = padval & mask;
7753            if maskedval != 0 {
7754                return Err(fidl::Error::NonZeroPadding {
7755                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7756                });
7757            }
7758            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
7759            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
7760            Ok(())
7761        }
7762    }
7763
7764    impl fidl::encoding::ValueTypeMarker for BaseSocketSetMarkRequest {
7765        type Borrowed<'a> = &'a Self;
7766        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7767            value
7768        }
7769    }
7770
7771    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetMarkRequest {
7772        type Owned = Self;
7773
7774        #[inline(always)]
7775        fn inline_align(_context: fidl::encoding::Context) -> usize {
7776            8
7777        }
7778
7779        #[inline(always)]
7780        fn inline_size(_context: fidl::encoding::Context) -> usize {
7781            24
7782        }
7783    }
7784
7785    unsafe impl<D: fidl::encoding::ResourceDialect>
7786        fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for &BaseSocketSetMarkRequest
7787    {
7788        #[inline]
7789        unsafe fn encode(
7790            self,
7791            encoder: &mut fidl::encoding::Encoder<'_, D>,
7792            offset: usize,
7793            _depth: fidl::encoding::Depth,
7794        ) -> fidl::Result<()> {
7795            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7796            // Delegate to tuple encoding.
7797            fidl::encoding::Encode::<BaseSocketSetMarkRequest, D>::encode(
7798                (
7799                    <fidl_fuchsia_net_common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
7800                    <OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),
7801                ),
7802                encoder, offset, _depth
7803            )
7804        }
7805    }
7806    unsafe impl<
7807        D: fidl::encoding::ResourceDialect,
7808        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::MarkDomain, D>,
7809        T1: fidl::encoding::Encode<OptionalUint32, D>,
7810    > fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for (T0, T1)
7811    {
7812        #[inline]
7813        unsafe fn encode(
7814            self,
7815            encoder: &mut fidl::encoding::Encoder<'_, D>,
7816            offset: usize,
7817            depth: fidl::encoding::Depth,
7818        ) -> fidl::Result<()> {
7819            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7820            // Zero out padding regions. There's no need to apply masks
7821            // because the unmasked parts will be overwritten by fields.
7822            unsafe {
7823                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7824                (ptr as *mut u64).write_unaligned(0);
7825            }
7826            // Write the fields.
7827            self.0.encode(encoder, offset + 0, depth)?;
7828            self.1.encode(encoder, offset + 8, depth)?;
7829            Ok(())
7830        }
7831    }
7832
7833    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7834        for BaseSocketSetMarkRequest
7835    {
7836        #[inline(always)]
7837        fn new_empty() -> Self {
7838            Self {
7839                domain: fidl::new_empty!(fidl_fuchsia_net_common::MarkDomain, D),
7840                mark: fidl::new_empty!(OptionalUint32, D),
7841            }
7842        }
7843
7844        #[inline]
7845        unsafe fn decode(
7846            &mut self,
7847            decoder: &mut fidl::encoding::Decoder<'_, D>,
7848            offset: usize,
7849            _depth: fidl::encoding::Depth,
7850        ) -> fidl::Result<()> {
7851            decoder.debug_check_bounds::<Self>(offset);
7852            // Verify that padding bytes are zero.
7853            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7854            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7855            let mask = 0xffffffffffffff00u64;
7856            let maskedval = padval & mask;
7857            if maskedval != 0 {
7858                return Err(fidl::Error::NonZeroPadding {
7859                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7860                });
7861            }
7862            fidl::decode!(
7863                fidl_fuchsia_net_common::MarkDomain,
7864                D,
7865                &mut self.domain,
7866                decoder,
7867                offset + 0,
7868                _depth
7869            )?;
7870            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 8, _depth)?;
7871            Ok(())
7872        }
7873    }
7874
7875    impl fidl::encoding::ValueTypeMarker for BaseSocketSetNoCheckRequest {
7876        type Borrowed<'a> = &'a Self;
7877        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7878            value
7879        }
7880    }
7881
7882    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetNoCheckRequest {
7883        type Owned = Self;
7884
7885        #[inline(always)]
7886        fn inline_align(_context: fidl::encoding::Context) -> usize {
7887            1
7888        }
7889
7890        #[inline(always)]
7891        fn inline_size(_context: fidl::encoding::Context) -> usize {
7892            1
7893        }
7894    }
7895
7896    unsafe impl<D: fidl::encoding::ResourceDialect>
7897        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for &BaseSocketSetNoCheckRequest
7898    {
7899        #[inline]
7900        unsafe fn encode(
7901            self,
7902            encoder: &mut fidl::encoding::Encoder<'_, D>,
7903            offset: usize,
7904            _depth: fidl::encoding::Depth,
7905        ) -> fidl::Result<()> {
7906            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7907            // Delegate to tuple encoding.
7908            fidl::encoding::Encode::<BaseSocketSetNoCheckRequest, D>::encode(
7909                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7910                encoder,
7911                offset,
7912                _depth,
7913            )
7914        }
7915    }
7916    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7917        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for (T0,)
7918    {
7919        #[inline]
7920        unsafe fn encode(
7921            self,
7922            encoder: &mut fidl::encoding::Encoder<'_, D>,
7923            offset: usize,
7924            depth: fidl::encoding::Depth,
7925        ) -> fidl::Result<()> {
7926            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7927            // Zero out padding regions. There's no need to apply masks
7928            // because the unmasked parts will be overwritten by fields.
7929            // Write the fields.
7930            self.0.encode(encoder, offset + 0, depth)?;
7931            Ok(())
7932        }
7933    }
7934
7935    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7936        for BaseSocketSetNoCheckRequest
7937    {
7938        #[inline(always)]
7939        fn new_empty() -> Self {
7940            Self { value: fidl::new_empty!(bool, D) }
7941        }
7942
7943        #[inline]
7944        unsafe fn decode(
7945            &mut self,
7946            decoder: &mut fidl::encoding::Decoder<'_, D>,
7947            offset: usize,
7948            _depth: fidl::encoding::Depth,
7949        ) -> fidl::Result<()> {
7950            decoder.debug_check_bounds::<Self>(offset);
7951            // Verify that padding bytes are zero.
7952            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7953            Ok(())
7954        }
7955    }
7956
7957    impl fidl::encoding::ValueTypeMarker for BaseSocketSetOutOfBandInlineRequest {
7958        type Borrowed<'a> = &'a Self;
7959        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7960            value
7961        }
7962    }
7963
7964    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetOutOfBandInlineRequest {
7965        type Owned = Self;
7966
7967        #[inline(always)]
7968        fn inline_align(_context: fidl::encoding::Context) -> usize {
7969            1
7970        }
7971
7972        #[inline(always)]
7973        fn inline_size(_context: fidl::encoding::Context) -> usize {
7974            1
7975        }
7976    }
7977
7978    unsafe impl<D: fidl::encoding::ResourceDialect>
7979        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D>
7980        for &BaseSocketSetOutOfBandInlineRequest
7981    {
7982        #[inline]
7983        unsafe fn encode(
7984            self,
7985            encoder: &mut fidl::encoding::Encoder<'_, D>,
7986            offset: usize,
7987            _depth: fidl::encoding::Depth,
7988        ) -> fidl::Result<()> {
7989            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
7990            // Delegate to tuple encoding.
7991            fidl::encoding::Encode::<BaseSocketSetOutOfBandInlineRequest, D>::encode(
7992                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7993                encoder,
7994                offset,
7995                _depth,
7996            )
7997        }
7998    }
7999    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8000        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D> for (T0,)
8001    {
8002        #[inline]
8003        unsafe fn encode(
8004            self,
8005            encoder: &mut fidl::encoding::Encoder<'_, D>,
8006            offset: usize,
8007            depth: fidl::encoding::Depth,
8008        ) -> fidl::Result<()> {
8009            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
8010            // Zero out padding regions. There's no need to apply masks
8011            // because the unmasked parts will be overwritten by fields.
8012            // Write the fields.
8013            self.0.encode(encoder, offset + 0, depth)?;
8014            Ok(())
8015        }
8016    }
8017
8018    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8019        for BaseSocketSetOutOfBandInlineRequest
8020    {
8021        #[inline(always)]
8022        fn new_empty() -> Self {
8023            Self { value: fidl::new_empty!(bool, D) }
8024        }
8025
8026        #[inline]
8027        unsafe fn decode(
8028            &mut self,
8029            decoder: &mut fidl::encoding::Decoder<'_, D>,
8030            offset: usize,
8031            _depth: fidl::encoding::Depth,
8032        ) -> fidl::Result<()> {
8033            decoder.debug_check_bounds::<Self>(offset);
8034            // Verify that padding bytes are zero.
8035            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8036            Ok(())
8037        }
8038    }
8039
8040    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReceiveBufferRequest {
8041        type Borrowed<'a> = &'a Self;
8042        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8043            value
8044        }
8045    }
8046
8047    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReceiveBufferRequest {
8048        type Owned = Self;
8049
8050        #[inline(always)]
8051        fn inline_align(_context: fidl::encoding::Context) -> usize {
8052            8
8053        }
8054
8055        #[inline(always)]
8056        fn inline_size(_context: fidl::encoding::Context) -> usize {
8057            8
8058        }
8059        #[inline(always)]
8060        fn encode_is_copy() -> bool {
8061            true
8062        }
8063
8064        #[inline(always)]
8065        fn decode_is_copy() -> bool {
8066            true
8067        }
8068    }
8069
8070    unsafe impl<D: fidl::encoding::ResourceDialect>
8071        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D>
8072        for &BaseSocketSetReceiveBufferRequest
8073    {
8074        #[inline]
8075        unsafe fn encode(
8076            self,
8077            encoder: &mut fidl::encoding::Encoder<'_, D>,
8078            offset: usize,
8079            _depth: fidl::encoding::Depth,
8080        ) -> fidl::Result<()> {
8081            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
8082            unsafe {
8083                // Copy the object into the buffer.
8084                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8085                (buf_ptr as *mut BaseSocketSetReceiveBufferRequest)
8086                    .write_unaligned((self as *const BaseSocketSetReceiveBufferRequest).read());
8087                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8088                // done second because the memcpy will write garbage to these bytes.
8089            }
8090            Ok(())
8091        }
8092    }
8093    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8094        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D> for (T0,)
8095    {
8096        #[inline]
8097        unsafe fn encode(
8098            self,
8099            encoder: &mut fidl::encoding::Encoder<'_, D>,
8100            offset: usize,
8101            depth: fidl::encoding::Depth,
8102        ) -> fidl::Result<()> {
8103            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
8104            // Zero out padding regions. There's no need to apply masks
8105            // because the unmasked parts will be overwritten by fields.
8106            // Write the fields.
8107            self.0.encode(encoder, offset + 0, depth)?;
8108            Ok(())
8109        }
8110    }
8111
8112    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8113        for BaseSocketSetReceiveBufferRequest
8114    {
8115        #[inline(always)]
8116        fn new_empty() -> Self {
8117            Self { value_bytes: fidl::new_empty!(u64, D) }
8118        }
8119
8120        #[inline]
8121        unsafe fn decode(
8122            &mut self,
8123            decoder: &mut fidl::encoding::Decoder<'_, D>,
8124            offset: usize,
8125            _depth: fidl::encoding::Depth,
8126        ) -> fidl::Result<()> {
8127            decoder.debug_check_bounds::<Self>(offset);
8128            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8129            // Verify that padding bytes are zero.
8130            // Copy from the buffer into the object.
8131            unsafe {
8132                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8133            }
8134            Ok(())
8135        }
8136    }
8137
8138    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReuseAddressRequest {
8139        type Borrowed<'a> = &'a Self;
8140        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8141            value
8142        }
8143    }
8144
8145    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReuseAddressRequest {
8146        type Owned = Self;
8147
8148        #[inline(always)]
8149        fn inline_align(_context: fidl::encoding::Context) -> usize {
8150            1
8151        }
8152
8153        #[inline(always)]
8154        fn inline_size(_context: fidl::encoding::Context) -> usize {
8155            1
8156        }
8157    }
8158
8159    unsafe impl<D: fidl::encoding::ResourceDialect>
8160        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D>
8161        for &BaseSocketSetReuseAddressRequest
8162    {
8163        #[inline]
8164        unsafe fn encode(
8165            self,
8166            encoder: &mut fidl::encoding::Encoder<'_, D>,
8167            offset: usize,
8168            _depth: fidl::encoding::Depth,
8169        ) -> fidl::Result<()> {
8170            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8171            // Delegate to tuple encoding.
8172            fidl::encoding::Encode::<BaseSocketSetReuseAddressRequest, D>::encode(
8173                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8174                encoder,
8175                offset,
8176                _depth,
8177            )
8178        }
8179    }
8180    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8181        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D> for (T0,)
8182    {
8183        #[inline]
8184        unsafe fn encode(
8185            self,
8186            encoder: &mut fidl::encoding::Encoder<'_, D>,
8187            offset: usize,
8188            depth: fidl::encoding::Depth,
8189        ) -> fidl::Result<()> {
8190            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8191            // Zero out padding regions. There's no need to apply masks
8192            // because the unmasked parts will be overwritten by fields.
8193            // Write the fields.
8194            self.0.encode(encoder, offset + 0, depth)?;
8195            Ok(())
8196        }
8197    }
8198
8199    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8200        for BaseSocketSetReuseAddressRequest
8201    {
8202        #[inline(always)]
8203        fn new_empty() -> Self {
8204            Self { value: fidl::new_empty!(bool, D) }
8205        }
8206
8207        #[inline]
8208        unsafe fn decode(
8209            &mut self,
8210            decoder: &mut fidl::encoding::Decoder<'_, D>,
8211            offset: usize,
8212            _depth: fidl::encoding::Depth,
8213        ) -> fidl::Result<()> {
8214            decoder.debug_check_bounds::<Self>(offset);
8215            // Verify that padding bytes are zero.
8216            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8217            Ok(())
8218        }
8219    }
8220
8221    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReusePortDeprecatedRequest {
8222        type Borrowed<'a> = &'a Self;
8223        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8224            value
8225        }
8226    }
8227
8228    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReusePortDeprecatedRequest {
8229        type Owned = Self;
8230
8231        #[inline(always)]
8232        fn inline_align(_context: fidl::encoding::Context) -> usize {
8233            1
8234        }
8235
8236        #[inline(always)]
8237        fn inline_size(_context: fidl::encoding::Context) -> usize {
8238            1
8239        }
8240    }
8241
8242    unsafe impl<D: fidl::encoding::ResourceDialect>
8243        fidl::encoding::Encode<BaseSocketSetReusePortDeprecatedRequest, D>
8244        for &BaseSocketSetReusePortDeprecatedRequest
8245    {
8246        #[inline]
8247        unsafe fn encode(
8248            self,
8249            encoder: &mut fidl::encoding::Encoder<'_, D>,
8250            offset: usize,
8251            _depth: fidl::encoding::Depth,
8252        ) -> fidl::Result<()> {
8253            encoder.debug_check_bounds::<BaseSocketSetReusePortDeprecatedRequest>(offset);
8254            // Delegate to tuple encoding.
8255            fidl::encoding::Encode::<BaseSocketSetReusePortDeprecatedRequest, D>::encode(
8256                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8257                encoder,
8258                offset,
8259                _depth,
8260            )
8261        }
8262    }
8263    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8264        fidl::encoding::Encode<BaseSocketSetReusePortDeprecatedRequest, D> for (T0,)
8265    {
8266        #[inline]
8267        unsafe fn encode(
8268            self,
8269            encoder: &mut fidl::encoding::Encoder<'_, D>,
8270            offset: usize,
8271            depth: fidl::encoding::Depth,
8272        ) -> fidl::Result<()> {
8273            encoder.debug_check_bounds::<BaseSocketSetReusePortDeprecatedRequest>(offset);
8274            // Zero out padding regions. There's no need to apply masks
8275            // because the unmasked parts will be overwritten by fields.
8276            // Write the fields.
8277            self.0.encode(encoder, offset + 0, depth)?;
8278            Ok(())
8279        }
8280    }
8281
8282    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8283        for BaseSocketSetReusePortDeprecatedRequest
8284    {
8285        #[inline(always)]
8286        fn new_empty() -> Self {
8287            Self { value: fidl::new_empty!(bool, D) }
8288        }
8289
8290        #[inline]
8291        unsafe fn decode(
8292            &mut self,
8293            decoder: &mut fidl::encoding::Decoder<'_, D>,
8294            offset: usize,
8295            _depth: fidl::encoding::Depth,
8296        ) -> fidl::Result<()> {
8297            decoder.debug_check_bounds::<Self>(offset);
8298            // Verify that padding bytes are zero.
8299            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8300            Ok(())
8301        }
8302    }
8303
8304    impl fidl::encoding::ValueTypeMarker for BaseSocketSetSendBufferRequest {
8305        type Borrowed<'a> = &'a Self;
8306        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8307            value
8308        }
8309    }
8310
8311    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetSendBufferRequest {
8312        type Owned = Self;
8313
8314        #[inline(always)]
8315        fn inline_align(_context: fidl::encoding::Context) -> usize {
8316            8
8317        }
8318
8319        #[inline(always)]
8320        fn inline_size(_context: fidl::encoding::Context) -> usize {
8321            8
8322        }
8323        #[inline(always)]
8324        fn encode_is_copy() -> bool {
8325            true
8326        }
8327
8328        #[inline(always)]
8329        fn decode_is_copy() -> bool {
8330            true
8331        }
8332    }
8333
8334    unsafe impl<D: fidl::encoding::ResourceDialect>
8335        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D>
8336        for &BaseSocketSetSendBufferRequest
8337    {
8338        #[inline]
8339        unsafe fn encode(
8340            self,
8341            encoder: &mut fidl::encoding::Encoder<'_, D>,
8342            offset: usize,
8343            _depth: fidl::encoding::Depth,
8344        ) -> fidl::Result<()> {
8345            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8346            unsafe {
8347                // Copy the object into the buffer.
8348                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8349                (buf_ptr as *mut BaseSocketSetSendBufferRequest)
8350                    .write_unaligned((self as *const BaseSocketSetSendBufferRequest).read());
8351                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8352                // done second because the memcpy will write garbage to these bytes.
8353            }
8354            Ok(())
8355        }
8356    }
8357    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8358        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D> for (T0,)
8359    {
8360        #[inline]
8361        unsafe fn encode(
8362            self,
8363            encoder: &mut fidl::encoding::Encoder<'_, D>,
8364            offset: usize,
8365            depth: fidl::encoding::Depth,
8366        ) -> fidl::Result<()> {
8367            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8368            // Zero out padding regions. There's no need to apply masks
8369            // because the unmasked parts will be overwritten by fields.
8370            // Write the fields.
8371            self.0.encode(encoder, offset + 0, depth)?;
8372            Ok(())
8373        }
8374    }
8375
8376    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8377        for BaseSocketSetSendBufferRequest
8378    {
8379        #[inline(always)]
8380        fn new_empty() -> Self {
8381            Self { value_bytes: fidl::new_empty!(u64, D) }
8382        }
8383
8384        #[inline]
8385        unsafe fn decode(
8386            &mut self,
8387            decoder: &mut fidl::encoding::Decoder<'_, D>,
8388            offset: usize,
8389            _depth: fidl::encoding::Depth,
8390        ) -> fidl::Result<()> {
8391            decoder.debug_check_bounds::<Self>(offset);
8392            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8393            // Verify that padding bytes are zero.
8394            // Copy from the buffer into the object.
8395            unsafe {
8396                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8397            }
8398            Ok(())
8399        }
8400    }
8401
8402    impl fidl::encoding::ValueTypeMarker for BaseSocketSetTimestampRequest {
8403        type Borrowed<'a> = &'a Self;
8404        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8405            value
8406        }
8407    }
8408
8409    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetTimestampRequest {
8410        type Owned = Self;
8411
8412        #[inline(always)]
8413        fn inline_align(_context: fidl::encoding::Context) -> usize {
8414            4
8415        }
8416
8417        #[inline(always)]
8418        fn inline_size(_context: fidl::encoding::Context) -> usize {
8419            4
8420        }
8421    }
8422
8423    unsafe impl<D: fidl::encoding::ResourceDialect>
8424        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D>
8425        for &BaseSocketSetTimestampRequest
8426    {
8427        #[inline]
8428        unsafe fn encode(
8429            self,
8430            encoder: &mut fidl::encoding::Encoder<'_, D>,
8431            offset: usize,
8432            _depth: fidl::encoding::Depth,
8433        ) -> fidl::Result<()> {
8434            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8435            // Delegate to tuple encoding.
8436            fidl::encoding::Encode::<BaseSocketSetTimestampRequest, D>::encode(
8437                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8438                encoder,
8439                offset,
8440                _depth,
8441            )
8442        }
8443    }
8444    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
8445        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D> for (T0,)
8446    {
8447        #[inline]
8448        unsafe fn encode(
8449            self,
8450            encoder: &mut fidl::encoding::Encoder<'_, D>,
8451            offset: usize,
8452            depth: fidl::encoding::Depth,
8453        ) -> fidl::Result<()> {
8454            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8455            // Zero out padding regions. There's no need to apply masks
8456            // because the unmasked parts will be overwritten by fields.
8457            // Write the fields.
8458            self.0.encode(encoder, offset + 0, depth)?;
8459            Ok(())
8460        }
8461    }
8462
8463    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8464        for BaseSocketSetTimestampRequest
8465    {
8466        #[inline(always)]
8467        fn new_empty() -> Self {
8468            Self { value: fidl::new_empty!(TimestampOption, D) }
8469        }
8470
8471        #[inline]
8472        unsafe fn decode(
8473            &mut self,
8474            decoder: &mut fidl::encoding::Decoder<'_, D>,
8475            offset: usize,
8476            _depth: fidl::encoding::Depth,
8477        ) -> fidl::Result<()> {
8478            decoder.debug_check_bounds::<Self>(offset);
8479            // Verify that padding bytes are zero.
8480            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
8481            Ok(())
8482        }
8483    }
8484
8485    impl fidl::encoding::ValueTypeMarker for BaseSocketGetAcceptConnResponse {
8486        type Borrowed<'a> = &'a Self;
8487        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8488            value
8489        }
8490    }
8491
8492    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetAcceptConnResponse {
8493        type Owned = Self;
8494
8495        #[inline(always)]
8496        fn inline_align(_context: fidl::encoding::Context) -> usize {
8497            1
8498        }
8499
8500        #[inline(always)]
8501        fn inline_size(_context: fidl::encoding::Context) -> usize {
8502            1
8503        }
8504    }
8505
8506    unsafe impl<D: fidl::encoding::ResourceDialect>
8507        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D>
8508        for &BaseSocketGetAcceptConnResponse
8509    {
8510        #[inline]
8511        unsafe fn encode(
8512            self,
8513            encoder: &mut fidl::encoding::Encoder<'_, D>,
8514            offset: usize,
8515            _depth: fidl::encoding::Depth,
8516        ) -> fidl::Result<()> {
8517            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8518            // Delegate to tuple encoding.
8519            fidl::encoding::Encode::<BaseSocketGetAcceptConnResponse, D>::encode(
8520                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8521                encoder,
8522                offset,
8523                _depth,
8524            )
8525        }
8526    }
8527    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8528        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D> for (T0,)
8529    {
8530        #[inline]
8531        unsafe fn encode(
8532            self,
8533            encoder: &mut fidl::encoding::Encoder<'_, D>,
8534            offset: usize,
8535            depth: fidl::encoding::Depth,
8536        ) -> fidl::Result<()> {
8537            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8538            // Zero out padding regions. There's no need to apply masks
8539            // because the unmasked parts will be overwritten by fields.
8540            // Write the fields.
8541            self.0.encode(encoder, offset + 0, depth)?;
8542            Ok(())
8543        }
8544    }
8545
8546    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8547        for BaseSocketGetAcceptConnResponse
8548    {
8549        #[inline(always)]
8550        fn new_empty() -> Self {
8551            Self { value: fidl::new_empty!(bool, D) }
8552        }
8553
8554        #[inline]
8555        unsafe fn decode(
8556            &mut self,
8557            decoder: &mut fidl::encoding::Decoder<'_, D>,
8558            offset: usize,
8559            _depth: fidl::encoding::Depth,
8560        ) -> fidl::Result<()> {
8561            decoder.debug_check_bounds::<Self>(offset);
8562            // Verify that padding bytes are zero.
8563            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8564            Ok(())
8565        }
8566    }
8567
8568    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToDeviceResponse {
8569        type Borrowed<'a> = &'a Self;
8570        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8571            value
8572        }
8573    }
8574
8575    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToDeviceResponse {
8576        type Owned = Self;
8577
8578        #[inline(always)]
8579        fn inline_align(_context: fidl::encoding::Context) -> usize {
8580            8
8581        }
8582
8583        #[inline(always)]
8584        fn inline_size(_context: fidl::encoding::Context) -> usize {
8585            16
8586        }
8587    }
8588
8589    unsafe impl<D: fidl::encoding::ResourceDialect>
8590        fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D>
8591        for &BaseSocketGetBindToDeviceResponse
8592    {
8593        #[inline]
8594        unsafe fn encode(
8595            self,
8596            encoder: &mut fidl::encoding::Encoder<'_, D>,
8597            offset: usize,
8598            _depth: fidl::encoding::Depth,
8599        ) -> fidl::Result<()> {
8600            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8601            // Delegate to tuple encoding.
8602            fidl::encoding::Encode::<BaseSocketGetBindToDeviceResponse, D>::encode(
8603                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
8604                    &self.value,
8605                ),),
8606                encoder,
8607                offset,
8608                _depth,
8609            )
8610        }
8611    }
8612    unsafe impl<
8613        D: fidl::encoding::ResourceDialect,
8614        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
8615    > fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D> for (T0,)
8616    {
8617        #[inline]
8618        unsafe fn encode(
8619            self,
8620            encoder: &mut fidl::encoding::Encoder<'_, D>,
8621            offset: usize,
8622            depth: fidl::encoding::Depth,
8623        ) -> fidl::Result<()> {
8624            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8625            // Zero out padding regions. There's no need to apply masks
8626            // because the unmasked parts will be overwritten by fields.
8627            // Write the fields.
8628            self.0.encode(encoder, offset + 0, depth)?;
8629            Ok(())
8630        }
8631    }
8632
8633    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8634        for BaseSocketGetBindToDeviceResponse
8635    {
8636        #[inline(always)]
8637        fn new_empty() -> Self {
8638            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
8639        }
8640
8641        #[inline]
8642        unsafe fn decode(
8643            &mut self,
8644            decoder: &mut fidl::encoding::Decoder<'_, D>,
8645            offset: usize,
8646            _depth: fidl::encoding::Depth,
8647        ) -> fidl::Result<()> {
8648            decoder.debug_check_bounds::<Self>(offset);
8649            // Verify that padding bytes are zero.
8650            fidl::decode!(
8651                fidl::encoding::BoundedString<15>,
8652                D,
8653                &mut self.value,
8654                decoder,
8655                offset + 0,
8656                _depth
8657            )?;
8658            Ok(())
8659        }
8660    }
8661
8662    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8663        type Borrowed<'a> = &'a Self;
8664        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8665            value
8666        }
8667    }
8668
8669    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8670        type Owned = Self;
8671
8672        #[inline(always)]
8673        fn inline_align(_context: fidl::encoding::Context) -> usize {
8674            8
8675        }
8676
8677        #[inline(always)]
8678        fn inline_size(_context: fidl::encoding::Context) -> usize {
8679            8
8680        }
8681        #[inline(always)]
8682        fn encode_is_copy() -> bool {
8683            true
8684        }
8685
8686        #[inline(always)]
8687        fn decode_is_copy() -> bool {
8688            true
8689        }
8690    }
8691
8692    unsafe impl<D: fidl::encoding::ResourceDialect>
8693        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D>
8694        for &BaseSocketGetBindToInterfaceIndexResponse
8695    {
8696        #[inline]
8697        unsafe fn encode(
8698            self,
8699            encoder: &mut fidl::encoding::Encoder<'_, D>,
8700            offset: usize,
8701            _depth: fidl::encoding::Depth,
8702        ) -> fidl::Result<()> {
8703            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8704            unsafe {
8705                // Copy the object into the buffer.
8706                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8707                (buf_ptr as *mut BaseSocketGetBindToInterfaceIndexResponse).write_unaligned(
8708                    (self as *const BaseSocketGetBindToInterfaceIndexResponse).read(),
8709                );
8710                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8711                // done second because the memcpy will write garbage to these bytes.
8712            }
8713            Ok(())
8714        }
8715    }
8716    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8717        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D> for (T0,)
8718    {
8719        #[inline]
8720        unsafe fn encode(
8721            self,
8722            encoder: &mut fidl::encoding::Encoder<'_, D>,
8723            offset: usize,
8724            depth: fidl::encoding::Depth,
8725        ) -> fidl::Result<()> {
8726            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8727            // Zero out padding regions. There's no need to apply masks
8728            // because the unmasked parts will be overwritten by fields.
8729            // Write the fields.
8730            self.0.encode(encoder, offset + 0, depth)?;
8731            Ok(())
8732        }
8733    }
8734
8735    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8736        for BaseSocketGetBindToInterfaceIndexResponse
8737    {
8738        #[inline(always)]
8739        fn new_empty() -> Self {
8740            Self { value: fidl::new_empty!(u64, D) }
8741        }
8742
8743        #[inline]
8744        unsafe fn decode(
8745            &mut self,
8746            decoder: &mut fidl::encoding::Decoder<'_, D>,
8747            offset: usize,
8748            _depth: fidl::encoding::Depth,
8749        ) -> fidl::Result<()> {
8750            decoder.debug_check_bounds::<Self>(offset);
8751            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8752            // Verify that padding bytes are zero.
8753            // Copy from the buffer into the object.
8754            unsafe {
8755                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8756            }
8757            Ok(())
8758        }
8759    }
8760
8761    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBroadcastResponse {
8762        type Borrowed<'a> = &'a Self;
8763        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8764            value
8765        }
8766    }
8767
8768    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBroadcastResponse {
8769        type Owned = Self;
8770
8771        #[inline(always)]
8772        fn inline_align(_context: fidl::encoding::Context) -> usize {
8773            1
8774        }
8775
8776        #[inline(always)]
8777        fn inline_size(_context: fidl::encoding::Context) -> usize {
8778            1
8779        }
8780    }
8781
8782    unsafe impl<D: fidl::encoding::ResourceDialect>
8783        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D>
8784        for &BaseSocketGetBroadcastResponse
8785    {
8786        #[inline]
8787        unsafe fn encode(
8788            self,
8789            encoder: &mut fidl::encoding::Encoder<'_, D>,
8790            offset: usize,
8791            _depth: fidl::encoding::Depth,
8792        ) -> fidl::Result<()> {
8793            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8794            // Delegate to tuple encoding.
8795            fidl::encoding::Encode::<BaseSocketGetBroadcastResponse, D>::encode(
8796                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8797                encoder,
8798                offset,
8799                _depth,
8800            )
8801        }
8802    }
8803    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8804        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D> for (T0,)
8805    {
8806        #[inline]
8807        unsafe fn encode(
8808            self,
8809            encoder: &mut fidl::encoding::Encoder<'_, D>,
8810            offset: usize,
8811            depth: fidl::encoding::Depth,
8812        ) -> fidl::Result<()> {
8813            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8814            // Zero out padding regions. There's no need to apply masks
8815            // because the unmasked parts will be overwritten by fields.
8816            // Write the fields.
8817            self.0.encode(encoder, offset + 0, depth)?;
8818            Ok(())
8819        }
8820    }
8821
8822    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8823        for BaseSocketGetBroadcastResponse
8824    {
8825        #[inline(always)]
8826        fn new_empty() -> Self {
8827            Self { value: fidl::new_empty!(bool, D) }
8828        }
8829
8830        #[inline]
8831        unsafe fn decode(
8832            &mut self,
8833            decoder: &mut fidl::encoding::Decoder<'_, D>,
8834            offset: usize,
8835            _depth: fidl::encoding::Depth,
8836        ) -> fidl::Result<()> {
8837            decoder.debug_check_bounds::<Self>(offset);
8838            // Verify that padding bytes are zero.
8839            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8840            Ok(())
8841        }
8842    }
8843
8844    impl fidl::encoding::ValueTypeMarker for BaseSocketGetCookieResponse {
8845        type Borrowed<'a> = &'a Self;
8846        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8847            value
8848        }
8849    }
8850
8851    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetCookieResponse {
8852        type Owned = Self;
8853
8854        #[inline(always)]
8855        fn inline_align(_context: fidl::encoding::Context) -> usize {
8856            8
8857        }
8858
8859        #[inline(always)]
8860        fn inline_size(_context: fidl::encoding::Context) -> usize {
8861            8
8862        }
8863        #[inline(always)]
8864        fn encode_is_copy() -> bool {
8865            true
8866        }
8867
8868        #[inline(always)]
8869        fn decode_is_copy() -> bool {
8870            true
8871        }
8872    }
8873
8874    unsafe impl<D: fidl::encoding::ResourceDialect>
8875        fidl::encoding::Encode<BaseSocketGetCookieResponse, D> for &BaseSocketGetCookieResponse
8876    {
8877        #[inline]
8878        unsafe fn encode(
8879            self,
8880            encoder: &mut fidl::encoding::Encoder<'_, D>,
8881            offset: usize,
8882            _depth: fidl::encoding::Depth,
8883        ) -> fidl::Result<()> {
8884            encoder.debug_check_bounds::<BaseSocketGetCookieResponse>(offset);
8885            unsafe {
8886                // Copy the object into the buffer.
8887                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8888                (buf_ptr as *mut BaseSocketGetCookieResponse)
8889                    .write_unaligned((self as *const BaseSocketGetCookieResponse).read());
8890                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8891                // done second because the memcpy will write garbage to these bytes.
8892            }
8893            Ok(())
8894        }
8895    }
8896    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8897        fidl::encoding::Encode<BaseSocketGetCookieResponse, D> for (T0,)
8898    {
8899        #[inline]
8900        unsafe fn encode(
8901            self,
8902            encoder: &mut fidl::encoding::Encoder<'_, D>,
8903            offset: usize,
8904            depth: fidl::encoding::Depth,
8905        ) -> fidl::Result<()> {
8906            encoder.debug_check_bounds::<BaseSocketGetCookieResponse>(offset);
8907            // Zero out padding regions. There's no need to apply masks
8908            // because the unmasked parts will be overwritten by fields.
8909            // Write the fields.
8910            self.0.encode(encoder, offset + 0, depth)?;
8911            Ok(())
8912        }
8913    }
8914
8915    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8916        for BaseSocketGetCookieResponse
8917    {
8918        #[inline(always)]
8919        fn new_empty() -> Self {
8920            Self { value: fidl::new_empty!(u64, D) }
8921        }
8922
8923        #[inline]
8924        unsafe fn decode(
8925            &mut self,
8926            decoder: &mut fidl::encoding::Decoder<'_, D>,
8927            offset: usize,
8928            _depth: fidl::encoding::Depth,
8929        ) -> fidl::Result<()> {
8930            decoder.debug_check_bounds::<Self>(offset);
8931            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8932            // Verify that padding bytes are zero.
8933            // Copy from the buffer into the object.
8934            unsafe {
8935                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8936            }
8937            Ok(())
8938        }
8939    }
8940
8941    impl fidl::encoding::ValueTypeMarker for BaseSocketGetKeepAliveResponse {
8942        type Borrowed<'a> = &'a Self;
8943        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8944            value
8945        }
8946    }
8947
8948    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetKeepAliveResponse {
8949        type Owned = Self;
8950
8951        #[inline(always)]
8952        fn inline_align(_context: fidl::encoding::Context) -> usize {
8953            1
8954        }
8955
8956        #[inline(always)]
8957        fn inline_size(_context: fidl::encoding::Context) -> usize {
8958            1
8959        }
8960    }
8961
8962    unsafe impl<D: fidl::encoding::ResourceDialect>
8963        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D>
8964        for &BaseSocketGetKeepAliveResponse
8965    {
8966        #[inline]
8967        unsafe fn encode(
8968            self,
8969            encoder: &mut fidl::encoding::Encoder<'_, D>,
8970            offset: usize,
8971            _depth: fidl::encoding::Depth,
8972        ) -> fidl::Result<()> {
8973            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8974            // Delegate to tuple encoding.
8975            fidl::encoding::Encode::<BaseSocketGetKeepAliveResponse, D>::encode(
8976                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8977                encoder,
8978                offset,
8979                _depth,
8980            )
8981        }
8982    }
8983    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8984        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D> for (T0,)
8985    {
8986        #[inline]
8987        unsafe fn encode(
8988            self,
8989            encoder: &mut fidl::encoding::Encoder<'_, D>,
8990            offset: usize,
8991            depth: fidl::encoding::Depth,
8992        ) -> fidl::Result<()> {
8993            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8994            // Zero out padding regions. There's no need to apply masks
8995            // because the unmasked parts will be overwritten by fields.
8996            // Write the fields.
8997            self.0.encode(encoder, offset + 0, depth)?;
8998            Ok(())
8999        }
9000    }
9001
9002    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9003        for BaseSocketGetKeepAliveResponse
9004    {
9005        #[inline(always)]
9006        fn new_empty() -> Self {
9007            Self { value: fidl::new_empty!(bool, D) }
9008        }
9009
9010        #[inline]
9011        unsafe fn decode(
9012            &mut self,
9013            decoder: &mut fidl::encoding::Decoder<'_, D>,
9014            offset: usize,
9015            _depth: fidl::encoding::Depth,
9016        ) -> fidl::Result<()> {
9017            decoder.debug_check_bounds::<Self>(offset);
9018            // Verify that padding bytes are zero.
9019            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9020            Ok(())
9021        }
9022    }
9023
9024    impl fidl::encoding::ValueTypeMarker for BaseSocketGetLingerResponse {
9025        type Borrowed<'a> = &'a Self;
9026        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9027            value
9028        }
9029    }
9030
9031    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetLingerResponse {
9032        type Owned = Self;
9033
9034        #[inline(always)]
9035        fn inline_align(_context: fidl::encoding::Context) -> usize {
9036            4
9037        }
9038
9039        #[inline(always)]
9040        fn inline_size(_context: fidl::encoding::Context) -> usize {
9041            8
9042        }
9043    }
9044
9045    unsafe impl<D: fidl::encoding::ResourceDialect>
9046        fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for &BaseSocketGetLingerResponse
9047    {
9048        #[inline]
9049        unsafe fn encode(
9050            self,
9051            encoder: &mut fidl::encoding::Encoder<'_, D>,
9052            offset: usize,
9053            _depth: fidl::encoding::Depth,
9054        ) -> fidl::Result<()> {
9055            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
9056            // Delegate to tuple encoding.
9057            fidl::encoding::Encode::<BaseSocketGetLingerResponse, D>::encode(
9058                (
9059                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
9060                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
9061                ),
9062                encoder,
9063                offset,
9064                _depth,
9065            )
9066        }
9067    }
9068    unsafe impl<
9069        D: fidl::encoding::ResourceDialect,
9070        T0: fidl::encoding::Encode<bool, D>,
9071        T1: fidl::encoding::Encode<u32, D>,
9072    > fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for (T0, T1)
9073    {
9074        #[inline]
9075        unsafe fn encode(
9076            self,
9077            encoder: &mut fidl::encoding::Encoder<'_, D>,
9078            offset: usize,
9079            depth: fidl::encoding::Depth,
9080        ) -> fidl::Result<()> {
9081            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
9082            // Zero out padding regions. There's no need to apply masks
9083            // because the unmasked parts will be overwritten by fields.
9084            unsafe {
9085                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9086                (ptr as *mut u32).write_unaligned(0);
9087            }
9088            // Write the fields.
9089            self.0.encode(encoder, offset + 0, depth)?;
9090            self.1.encode(encoder, offset + 4, depth)?;
9091            Ok(())
9092        }
9093    }
9094
9095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9096        for BaseSocketGetLingerResponse
9097    {
9098        #[inline(always)]
9099        fn new_empty() -> Self {
9100            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
9101        }
9102
9103        #[inline]
9104        unsafe fn decode(
9105            &mut self,
9106            decoder: &mut fidl::encoding::Decoder<'_, D>,
9107            offset: usize,
9108            _depth: fidl::encoding::Depth,
9109        ) -> fidl::Result<()> {
9110            decoder.debug_check_bounds::<Self>(offset);
9111            // Verify that padding bytes are zero.
9112            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9113            let padval = unsafe { (ptr as *const u32).read_unaligned() };
9114            let mask = 0xffffff00u32;
9115            let maskedval = padval & mask;
9116            if maskedval != 0 {
9117                return Err(fidl::Error::NonZeroPadding {
9118                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9119                });
9120            }
9121            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
9122            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
9123            Ok(())
9124        }
9125    }
9126
9127    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkResponse {
9128        type Borrowed<'a> = &'a Self;
9129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9130            value
9131        }
9132    }
9133
9134    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkResponse {
9135        type Owned = Self;
9136
9137        #[inline(always)]
9138        fn inline_align(_context: fidl::encoding::Context) -> usize {
9139            8
9140        }
9141
9142        #[inline(always)]
9143        fn inline_size(_context: fidl::encoding::Context) -> usize {
9144            16
9145        }
9146    }
9147
9148    unsafe impl<D: fidl::encoding::ResourceDialect>
9149        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for &BaseSocketGetMarkResponse
9150    {
9151        #[inline]
9152        unsafe fn encode(
9153            self,
9154            encoder: &mut fidl::encoding::Encoder<'_, D>,
9155            offset: usize,
9156            _depth: fidl::encoding::Depth,
9157        ) -> fidl::Result<()> {
9158            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
9159            // Delegate to tuple encoding.
9160            fidl::encoding::Encode::<BaseSocketGetMarkResponse, D>::encode(
9161                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),),
9162                encoder,
9163                offset,
9164                _depth,
9165            )
9166        }
9167    }
9168    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
9169        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for (T0,)
9170    {
9171        #[inline]
9172        unsafe fn encode(
9173            self,
9174            encoder: &mut fidl::encoding::Encoder<'_, D>,
9175            offset: usize,
9176            depth: fidl::encoding::Depth,
9177        ) -> fidl::Result<()> {
9178            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
9179            // Zero out padding regions. There's no need to apply masks
9180            // because the unmasked parts will be overwritten by fields.
9181            // Write the fields.
9182            self.0.encode(encoder, offset + 0, depth)?;
9183            Ok(())
9184        }
9185    }
9186
9187    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9188        for BaseSocketGetMarkResponse
9189    {
9190        #[inline(always)]
9191        fn new_empty() -> Self {
9192            Self { mark: fidl::new_empty!(OptionalUint32, D) }
9193        }
9194
9195        #[inline]
9196        unsafe fn decode(
9197            &mut self,
9198            decoder: &mut fidl::encoding::Decoder<'_, D>,
9199            offset: usize,
9200            _depth: fidl::encoding::Depth,
9201        ) -> fidl::Result<()> {
9202            decoder.debug_check_bounds::<Self>(offset);
9203            // Verify that padding bytes are zero.
9204            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 0, _depth)?;
9205            Ok(())
9206        }
9207    }
9208
9209    impl fidl::encoding::ValueTypeMarker for BaseSocketGetNoCheckResponse {
9210        type Borrowed<'a> = &'a Self;
9211        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9212            value
9213        }
9214    }
9215
9216    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetNoCheckResponse {
9217        type Owned = Self;
9218
9219        #[inline(always)]
9220        fn inline_align(_context: fidl::encoding::Context) -> usize {
9221            1
9222        }
9223
9224        #[inline(always)]
9225        fn inline_size(_context: fidl::encoding::Context) -> usize {
9226            1
9227        }
9228    }
9229
9230    unsafe impl<D: fidl::encoding::ResourceDialect>
9231        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for &BaseSocketGetNoCheckResponse
9232    {
9233        #[inline]
9234        unsafe fn encode(
9235            self,
9236            encoder: &mut fidl::encoding::Encoder<'_, D>,
9237            offset: usize,
9238            _depth: fidl::encoding::Depth,
9239        ) -> fidl::Result<()> {
9240            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
9241            // Delegate to tuple encoding.
9242            fidl::encoding::Encode::<BaseSocketGetNoCheckResponse, D>::encode(
9243                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9244                encoder,
9245                offset,
9246                _depth,
9247            )
9248        }
9249    }
9250    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9251        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for (T0,)
9252    {
9253        #[inline]
9254        unsafe fn encode(
9255            self,
9256            encoder: &mut fidl::encoding::Encoder<'_, D>,
9257            offset: usize,
9258            depth: fidl::encoding::Depth,
9259        ) -> fidl::Result<()> {
9260            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
9261            // Zero out padding regions. There's no need to apply masks
9262            // because the unmasked parts will be overwritten by fields.
9263            // Write the fields.
9264            self.0.encode(encoder, offset + 0, depth)?;
9265            Ok(())
9266        }
9267    }
9268
9269    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9270        for BaseSocketGetNoCheckResponse
9271    {
9272        #[inline(always)]
9273        fn new_empty() -> Self {
9274            Self { value: fidl::new_empty!(bool, D) }
9275        }
9276
9277        #[inline]
9278        unsafe fn decode(
9279            &mut self,
9280            decoder: &mut fidl::encoding::Decoder<'_, D>,
9281            offset: usize,
9282            _depth: fidl::encoding::Depth,
9283        ) -> fidl::Result<()> {
9284            decoder.debug_check_bounds::<Self>(offset);
9285            // Verify that padding bytes are zero.
9286            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9287            Ok(())
9288        }
9289    }
9290
9291    impl fidl::encoding::ValueTypeMarker for BaseSocketGetOutOfBandInlineResponse {
9292        type Borrowed<'a> = &'a Self;
9293        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9294            value
9295        }
9296    }
9297
9298    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetOutOfBandInlineResponse {
9299        type Owned = Self;
9300
9301        #[inline(always)]
9302        fn inline_align(_context: fidl::encoding::Context) -> usize {
9303            1
9304        }
9305
9306        #[inline(always)]
9307        fn inline_size(_context: fidl::encoding::Context) -> usize {
9308            1
9309        }
9310    }
9311
9312    unsafe impl<D: fidl::encoding::ResourceDialect>
9313        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D>
9314        for &BaseSocketGetOutOfBandInlineResponse
9315    {
9316        #[inline]
9317        unsafe fn encode(
9318            self,
9319            encoder: &mut fidl::encoding::Encoder<'_, D>,
9320            offset: usize,
9321            _depth: fidl::encoding::Depth,
9322        ) -> fidl::Result<()> {
9323            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9324            // Delegate to tuple encoding.
9325            fidl::encoding::Encode::<BaseSocketGetOutOfBandInlineResponse, D>::encode(
9326                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9327                encoder,
9328                offset,
9329                _depth,
9330            )
9331        }
9332    }
9333    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9334        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D> for (T0,)
9335    {
9336        #[inline]
9337        unsafe fn encode(
9338            self,
9339            encoder: &mut fidl::encoding::Encoder<'_, D>,
9340            offset: usize,
9341            depth: fidl::encoding::Depth,
9342        ) -> fidl::Result<()> {
9343            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9344            // Zero out padding regions. There's no need to apply masks
9345            // because the unmasked parts will be overwritten by fields.
9346            // Write the fields.
9347            self.0.encode(encoder, offset + 0, depth)?;
9348            Ok(())
9349        }
9350    }
9351
9352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9353        for BaseSocketGetOutOfBandInlineResponse
9354    {
9355        #[inline(always)]
9356        fn new_empty() -> Self {
9357            Self { value: fidl::new_empty!(bool, D) }
9358        }
9359
9360        #[inline]
9361        unsafe fn decode(
9362            &mut self,
9363            decoder: &mut fidl::encoding::Decoder<'_, D>,
9364            offset: usize,
9365            _depth: fidl::encoding::Depth,
9366        ) -> fidl::Result<()> {
9367            decoder.debug_check_bounds::<Self>(offset);
9368            // Verify that padding bytes are zero.
9369            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9370            Ok(())
9371        }
9372    }
9373
9374    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReceiveBufferResponse {
9375        type Borrowed<'a> = &'a Self;
9376        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9377            value
9378        }
9379    }
9380
9381    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReceiveBufferResponse {
9382        type Owned = Self;
9383
9384        #[inline(always)]
9385        fn inline_align(_context: fidl::encoding::Context) -> usize {
9386            8
9387        }
9388
9389        #[inline(always)]
9390        fn inline_size(_context: fidl::encoding::Context) -> usize {
9391            8
9392        }
9393        #[inline(always)]
9394        fn encode_is_copy() -> bool {
9395            true
9396        }
9397
9398        #[inline(always)]
9399        fn decode_is_copy() -> bool {
9400            true
9401        }
9402    }
9403
9404    unsafe impl<D: fidl::encoding::ResourceDialect>
9405        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D>
9406        for &BaseSocketGetReceiveBufferResponse
9407    {
9408        #[inline]
9409        unsafe fn encode(
9410            self,
9411            encoder: &mut fidl::encoding::Encoder<'_, D>,
9412            offset: usize,
9413            _depth: fidl::encoding::Depth,
9414        ) -> fidl::Result<()> {
9415            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9416            unsafe {
9417                // Copy the object into the buffer.
9418                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9419                (buf_ptr as *mut BaseSocketGetReceiveBufferResponse)
9420                    .write_unaligned((self as *const BaseSocketGetReceiveBufferResponse).read());
9421                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9422                // done second because the memcpy will write garbage to these bytes.
9423            }
9424            Ok(())
9425        }
9426    }
9427    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9428        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D> for (T0,)
9429    {
9430        #[inline]
9431        unsafe fn encode(
9432            self,
9433            encoder: &mut fidl::encoding::Encoder<'_, D>,
9434            offset: usize,
9435            depth: fidl::encoding::Depth,
9436        ) -> fidl::Result<()> {
9437            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9438            // Zero out padding regions. There's no need to apply masks
9439            // because the unmasked parts will be overwritten by fields.
9440            // Write the fields.
9441            self.0.encode(encoder, offset + 0, depth)?;
9442            Ok(())
9443        }
9444    }
9445
9446    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9447        for BaseSocketGetReceiveBufferResponse
9448    {
9449        #[inline(always)]
9450        fn new_empty() -> Self {
9451            Self { value_bytes: fidl::new_empty!(u64, D) }
9452        }
9453
9454        #[inline]
9455        unsafe fn decode(
9456            &mut self,
9457            decoder: &mut fidl::encoding::Decoder<'_, D>,
9458            offset: usize,
9459            _depth: fidl::encoding::Depth,
9460        ) -> fidl::Result<()> {
9461            decoder.debug_check_bounds::<Self>(offset);
9462            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9463            // Verify that padding bytes are zero.
9464            // Copy from the buffer into the object.
9465            unsafe {
9466                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9467            }
9468            Ok(())
9469        }
9470    }
9471
9472    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReuseAddressResponse {
9473        type Borrowed<'a> = &'a Self;
9474        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9475            value
9476        }
9477    }
9478
9479    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReuseAddressResponse {
9480        type Owned = Self;
9481
9482        #[inline(always)]
9483        fn inline_align(_context: fidl::encoding::Context) -> usize {
9484            1
9485        }
9486
9487        #[inline(always)]
9488        fn inline_size(_context: fidl::encoding::Context) -> usize {
9489            1
9490        }
9491    }
9492
9493    unsafe impl<D: fidl::encoding::ResourceDialect>
9494        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D>
9495        for &BaseSocketGetReuseAddressResponse
9496    {
9497        #[inline]
9498        unsafe fn encode(
9499            self,
9500            encoder: &mut fidl::encoding::Encoder<'_, D>,
9501            offset: usize,
9502            _depth: fidl::encoding::Depth,
9503        ) -> fidl::Result<()> {
9504            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9505            // Delegate to tuple encoding.
9506            fidl::encoding::Encode::<BaseSocketGetReuseAddressResponse, D>::encode(
9507                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9508                encoder,
9509                offset,
9510                _depth,
9511            )
9512        }
9513    }
9514    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9515        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D> for (T0,)
9516    {
9517        #[inline]
9518        unsafe fn encode(
9519            self,
9520            encoder: &mut fidl::encoding::Encoder<'_, D>,
9521            offset: usize,
9522            depth: fidl::encoding::Depth,
9523        ) -> fidl::Result<()> {
9524            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9525            // Zero out padding regions. There's no need to apply masks
9526            // because the unmasked parts will be overwritten by fields.
9527            // Write the fields.
9528            self.0.encode(encoder, offset + 0, depth)?;
9529            Ok(())
9530        }
9531    }
9532
9533    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9534        for BaseSocketGetReuseAddressResponse
9535    {
9536        #[inline(always)]
9537        fn new_empty() -> Self {
9538            Self { value: fidl::new_empty!(bool, D) }
9539        }
9540
9541        #[inline]
9542        unsafe fn decode(
9543            &mut self,
9544            decoder: &mut fidl::encoding::Decoder<'_, D>,
9545            offset: usize,
9546            _depth: fidl::encoding::Depth,
9547        ) -> fidl::Result<()> {
9548            decoder.debug_check_bounds::<Self>(offset);
9549            // Verify that padding bytes are zero.
9550            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9551            Ok(())
9552        }
9553    }
9554
9555    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReusePortResponse {
9556        type Borrowed<'a> = &'a Self;
9557        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9558            value
9559        }
9560    }
9561
9562    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReusePortResponse {
9563        type Owned = Self;
9564
9565        #[inline(always)]
9566        fn inline_align(_context: fidl::encoding::Context) -> usize {
9567            1
9568        }
9569
9570        #[inline(always)]
9571        fn inline_size(_context: fidl::encoding::Context) -> usize {
9572            1
9573        }
9574    }
9575
9576    unsafe impl<D: fidl::encoding::ResourceDialect>
9577        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D>
9578        for &BaseSocketGetReusePortResponse
9579    {
9580        #[inline]
9581        unsafe fn encode(
9582            self,
9583            encoder: &mut fidl::encoding::Encoder<'_, D>,
9584            offset: usize,
9585            _depth: fidl::encoding::Depth,
9586        ) -> fidl::Result<()> {
9587            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9588            // Delegate to tuple encoding.
9589            fidl::encoding::Encode::<BaseSocketGetReusePortResponse, D>::encode(
9590                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9591                encoder,
9592                offset,
9593                _depth,
9594            )
9595        }
9596    }
9597    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9598        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D> for (T0,)
9599    {
9600        #[inline]
9601        unsafe fn encode(
9602            self,
9603            encoder: &mut fidl::encoding::Encoder<'_, D>,
9604            offset: usize,
9605            depth: fidl::encoding::Depth,
9606        ) -> fidl::Result<()> {
9607            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9608            // Zero out padding regions. There's no need to apply masks
9609            // because the unmasked parts will be overwritten by fields.
9610            // Write the fields.
9611            self.0.encode(encoder, offset + 0, depth)?;
9612            Ok(())
9613        }
9614    }
9615
9616    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9617        for BaseSocketGetReusePortResponse
9618    {
9619        #[inline(always)]
9620        fn new_empty() -> Self {
9621            Self { value: fidl::new_empty!(bool, D) }
9622        }
9623
9624        #[inline]
9625        unsafe fn decode(
9626            &mut self,
9627            decoder: &mut fidl::encoding::Decoder<'_, D>,
9628            offset: usize,
9629            _depth: fidl::encoding::Depth,
9630        ) -> fidl::Result<()> {
9631            decoder.debug_check_bounds::<Self>(offset);
9632            // Verify that padding bytes are zero.
9633            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9634            Ok(())
9635        }
9636    }
9637
9638    impl fidl::encoding::ValueTypeMarker for BaseSocketGetSendBufferResponse {
9639        type Borrowed<'a> = &'a Self;
9640        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9641            value
9642        }
9643    }
9644
9645    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetSendBufferResponse {
9646        type Owned = Self;
9647
9648        #[inline(always)]
9649        fn inline_align(_context: fidl::encoding::Context) -> usize {
9650            8
9651        }
9652
9653        #[inline(always)]
9654        fn inline_size(_context: fidl::encoding::Context) -> usize {
9655            8
9656        }
9657        #[inline(always)]
9658        fn encode_is_copy() -> bool {
9659            true
9660        }
9661
9662        #[inline(always)]
9663        fn decode_is_copy() -> bool {
9664            true
9665        }
9666    }
9667
9668    unsafe impl<D: fidl::encoding::ResourceDialect>
9669        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D>
9670        for &BaseSocketGetSendBufferResponse
9671    {
9672        #[inline]
9673        unsafe fn encode(
9674            self,
9675            encoder: &mut fidl::encoding::Encoder<'_, D>,
9676            offset: usize,
9677            _depth: fidl::encoding::Depth,
9678        ) -> fidl::Result<()> {
9679            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9680            unsafe {
9681                // Copy the object into the buffer.
9682                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9683                (buf_ptr as *mut BaseSocketGetSendBufferResponse)
9684                    .write_unaligned((self as *const BaseSocketGetSendBufferResponse).read());
9685                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9686                // done second because the memcpy will write garbage to these bytes.
9687            }
9688            Ok(())
9689        }
9690    }
9691    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9692        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D> for (T0,)
9693    {
9694        #[inline]
9695        unsafe fn encode(
9696            self,
9697            encoder: &mut fidl::encoding::Encoder<'_, D>,
9698            offset: usize,
9699            depth: fidl::encoding::Depth,
9700        ) -> fidl::Result<()> {
9701            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9702            // Zero out padding regions. There's no need to apply masks
9703            // because the unmasked parts will be overwritten by fields.
9704            // Write the fields.
9705            self.0.encode(encoder, offset + 0, depth)?;
9706            Ok(())
9707        }
9708    }
9709
9710    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9711        for BaseSocketGetSendBufferResponse
9712    {
9713        #[inline(always)]
9714        fn new_empty() -> Self {
9715            Self { value_bytes: fidl::new_empty!(u64, D) }
9716        }
9717
9718        #[inline]
9719        unsafe fn decode(
9720            &mut self,
9721            decoder: &mut fidl::encoding::Decoder<'_, D>,
9722            offset: usize,
9723            _depth: fidl::encoding::Depth,
9724        ) -> fidl::Result<()> {
9725            decoder.debug_check_bounds::<Self>(offset);
9726            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9727            // Verify that padding bytes are zero.
9728            // Copy from the buffer into the object.
9729            unsafe {
9730                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9731            }
9732            Ok(())
9733        }
9734    }
9735
9736    impl fidl::encoding::ValueTypeMarker for BaseSocketGetTimestampResponse {
9737        type Borrowed<'a> = &'a Self;
9738        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9739            value
9740        }
9741    }
9742
9743    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetTimestampResponse {
9744        type Owned = Self;
9745
9746        #[inline(always)]
9747        fn inline_align(_context: fidl::encoding::Context) -> usize {
9748            4
9749        }
9750
9751        #[inline(always)]
9752        fn inline_size(_context: fidl::encoding::Context) -> usize {
9753            4
9754        }
9755    }
9756
9757    unsafe impl<D: fidl::encoding::ResourceDialect>
9758        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D>
9759        for &BaseSocketGetTimestampResponse
9760    {
9761        #[inline]
9762        unsafe fn encode(
9763            self,
9764            encoder: &mut fidl::encoding::Encoder<'_, D>,
9765            offset: usize,
9766            _depth: fidl::encoding::Depth,
9767        ) -> fidl::Result<()> {
9768            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9769            // Delegate to tuple encoding.
9770            fidl::encoding::Encode::<BaseSocketGetTimestampResponse, D>::encode(
9771                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9772                encoder,
9773                offset,
9774                _depth,
9775            )
9776        }
9777    }
9778    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
9779        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D> for (T0,)
9780    {
9781        #[inline]
9782        unsafe fn encode(
9783            self,
9784            encoder: &mut fidl::encoding::Encoder<'_, D>,
9785            offset: usize,
9786            depth: fidl::encoding::Depth,
9787        ) -> fidl::Result<()> {
9788            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9789            // Zero out padding regions. There's no need to apply masks
9790            // because the unmasked parts will be overwritten by fields.
9791            // Write the fields.
9792            self.0.encode(encoder, offset + 0, depth)?;
9793            Ok(())
9794        }
9795    }
9796
9797    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9798        for BaseSocketGetTimestampResponse
9799    {
9800        #[inline(always)]
9801        fn new_empty() -> Self {
9802            Self { value: fidl::new_empty!(TimestampOption, D) }
9803        }
9804
9805        #[inline]
9806        unsafe fn decode(
9807            &mut self,
9808            decoder: &mut fidl::encoding::Decoder<'_, D>,
9809            offset: usize,
9810            _depth: fidl::encoding::Depth,
9811        ) -> fidl::Result<()> {
9812            decoder.debug_check_bounds::<Self>(offset);
9813            // Verify that padding bytes are zero.
9814            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
9815            Ok(())
9816        }
9817    }
9818
9819    impl fidl::encoding::ValueTypeMarker for Empty {
9820        type Borrowed<'a> = &'a Self;
9821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9822            value
9823        }
9824    }
9825
9826    unsafe impl fidl::encoding::TypeMarker for Empty {
9827        type Owned = Self;
9828
9829        #[inline(always)]
9830        fn inline_align(_context: fidl::encoding::Context) -> usize {
9831            1
9832        }
9833
9834        #[inline(always)]
9835        fn inline_size(_context: fidl::encoding::Context) -> usize {
9836            1
9837        }
9838    }
9839
9840    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
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::<Empty>(offset);
9849            encoder.write_num(0u8, offset);
9850            Ok(())
9851        }
9852    }
9853
9854    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
9855        #[inline(always)]
9856        fn new_empty() -> Self {
9857            Self
9858        }
9859
9860        #[inline]
9861        unsafe fn decode(
9862            &mut self,
9863            decoder: &mut fidl::encoding::Decoder<'_, D>,
9864            offset: usize,
9865            _depth: fidl::encoding::Depth,
9866        ) -> fidl::Result<()> {
9867            decoder.debug_check_bounds::<Self>(offset);
9868            match decoder.read_num::<u8>(offset) {
9869                0 => Ok(()),
9870                _ => Err(fidl::Error::Invalid),
9871            }
9872        }
9873    }
9874
9875    impl fidl::encoding::ValueTypeMarker for IpMulticastMembership {
9876        type Borrowed<'a> = &'a Self;
9877        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9878            value
9879        }
9880    }
9881
9882    unsafe impl fidl::encoding::TypeMarker for IpMulticastMembership {
9883        type Owned = Self;
9884
9885        #[inline(always)]
9886        fn inline_align(_context: fidl::encoding::Context) -> usize {
9887            8
9888        }
9889
9890        #[inline(always)]
9891        fn inline_size(_context: fidl::encoding::Context) -> usize {
9892            16
9893        }
9894    }
9895
9896    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpMulticastMembership, D>
9897        for &IpMulticastMembership
9898    {
9899        #[inline]
9900        unsafe fn encode(
9901            self,
9902            encoder: &mut fidl::encoding::Encoder<'_, D>,
9903            offset: usize,
9904            _depth: fidl::encoding::Depth,
9905        ) -> fidl::Result<()> {
9906            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9907            // Delegate to tuple encoding.
9908            fidl::encoding::Encode::<IpMulticastMembership, D>::encode(
9909                (
9910                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9911                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
9912                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
9913                ),
9914                encoder, offset, _depth
9915            )
9916        }
9917    }
9918    unsafe impl<
9919        D: fidl::encoding::ResourceDialect,
9920        T0: fidl::encoding::Encode<u64, D>,
9921        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
9922        T2: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
9923    > fidl::encoding::Encode<IpMulticastMembership, D> for (T0, T1, T2)
9924    {
9925        #[inline]
9926        unsafe fn encode(
9927            self,
9928            encoder: &mut fidl::encoding::Encoder<'_, D>,
9929            offset: usize,
9930            depth: fidl::encoding::Depth,
9931        ) -> fidl::Result<()> {
9932            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9933            // Zero out padding regions. There's no need to apply masks
9934            // because the unmasked parts will be overwritten by fields.
9935            // Write the fields.
9936            self.0.encode(encoder, offset + 0, depth)?;
9937            self.1.encode(encoder, offset + 8, depth)?;
9938            self.2.encode(encoder, offset + 12, depth)?;
9939            Ok(())
9940        }
9941    }
9942
9943    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpMulticastMembership {
9944        #[inline(always)]
9945        fn new_empty() -> Self {
9946            Self {
9947                iface: fidl::new_empty!(u64, D),
9948                local_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
9949                mcast_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
9950            }
9951        }
9952
9953        #[inline]
9954        unsafe fn decode(
9955            &mut self,
9956            decoder: &mut fidl::encoding::Decoder<'_, D>,
9957            offset: usize,
9958            _depth: fidl::encoding::Depth,
9959        ) -> fidl::Result<()> {
9960            decoder.debug_check_bounds::<Self>(offset);
9961            // Verify that padding bytes are zero.
9962            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9963            fidl::decode!(
9964                fidl_fuchsia_net_common::Ipv4Address,
9965                D,
9966                &mut self.local_addr,
9967                decoder,
9968                offset + 8,
9969                _depth
9970            )?;
9971            fidl::decode!(
9972                fidl_fuchsia_net_common::Ipv4Address,
9973                D,
9974                &mut self.mcast_addr,
9975                decoder,
9976                offset + 12,
9977                _depth
9978            )?;
9979            Ok(())
9980        }
9981    }
9982
9983    impl fidl::encoding::ValueTypeMarker for Ipv4PktInfoRecvControlData {
9984        type Borrowed<'a> = &'a Self;
9985        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9986            value
9987        }
9988    }
9989
9990    unsafe impl fidl::encoding::TypeMarker for Ipv4PktInfoRecvControlData {
9991        type Owned = Self;
9992
9993        #[inline(always)]
9994        fn inline_align(_context: fidl::encoding::Context) -> usize {
9995            8
9996        }
9997
9998        #[inline(always)]
9999        fn inline_size(_context: fidl::encoding::Context) -> usize {
10000            16
10001        }
10002    }
10003
10004    unsafe impl<D: fidl::encoding::ResourceDialect>
10005        fidl::encoding::Encode<Ipv4PktInfoRecvControlData, D> for &Ipv4PktInfoRecvControlData
10006    {
10007        #[inline]
10008        unsafe fn encode(
10009            self,
10010            encoder: &mut fidl::encoding::Encoder<'_, D>,
10011            offset: usize,
10012            _depth: fidl::encoding::Depth,
10013        ) -> fidl::Result<()> {
10014            encoder.debug_check_bounds::<Ipv4PktInfoRecvControlData>(offset);
10015            // Delegate to tuple encoding.
10016            fidl::encoding::Encode::<Ipv4PktInfoRecvControlData, D>::encode(
10017                (
10018                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10019                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
10020                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.header_destination_addr),
10021                ),
10022                encoder, offset, _depth
10023            )
10024        }
10025    }
10026    unsafe impl<
10027        D: fidl::encoding::ResourceDialect,
10028        T0: fidl::encoding::Encode<u64, D>,
10029        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
10030        T2: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
10031    > fidl::encoding::Encode<Ipv4PktInfoRecvControlData, D> for (T0, T1, T2)
10032    {
10033        #[inline]
10034        unsafe fn encode(
10035            self,
10036            encoder: &mut fidl::encoding::Encoder<'_, D>,
10037            offset: usize,
10038            depth: fidl::encoding::Depth,
10039        ) -> fidl::Result<()> {
10040            encoder.debug_check_bounds::<Ipv4PktInfoRecvControlData>(offset);
10041            // Zero out padding regions. There's no need to apply masks
10042            // because the unmasked parts will be overwritten by fields.
10043            // Write the fields.
10044            self.0.encode(encoder, offset + 0, depth)?;
10045            self.1.encode(encoder, offset + 8, depth)?;
10046            self.2.encode(encoder, offset + 12, depth)?;
10047            Ok(())
10048        }
10049    }
10050
10051    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10052        for Ipv4PktInfoRecvControlData
10053    {
10054        #[inline(always)]
10055        fn new_empty() -> Self {
10056            Self {
10057                iface: fidl::new_empty!(u64, D),
10058                local_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
10059                header_destination_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
10060            }
10061        }
10062
10063        #[inline]
10064        unsafe fn decode(
10065            &mut self,
10066            decoder: &mut fidl::encoding::Decoder<'_, D>,
10067            offset: usize,
10068            _depth: fidl::encoding::Depth,
10069        ) -> fidl::Result<()> {
10070            decoder.debug_check_bounds::<Self>(offset);
10071            // Verify that padding bytes are zero.
10072            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10073            fidl::decode!(
10074                fidl_fuchsia_net_common::Ipv4Address,
10075                D,
10076                &mut self.local_addr,
10077                decoder,
10078                offset + 8,
10079                _depth
10080            )?;
10081            fidl::decode!(
10082                fidl_fuchsia_net_common::Ipv4Address,
10083                D,
10084                &mut self.header_destination_addr,
10085                decoder,
10086                offset + 12,
10087                _depth
10088            )?;
10089            Ok(())
10090        }
10091    }
10092
10093    impl fidl::encoding::ValueTypeMarker for Ipv6MulticastMembership {
10094        type Borrowed<'a> = &'a Self;
10095        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10096            value
10097        }
10098    }
10099
10100    unsafe impl fidl::encoding::TypeMarker for Ipv6MulticastMembership {
10101        type Owned = Self;
10102
10103        #[inline(always)]
10104        fn inline_align(_context: fidl::encoding::Context) -> usize {
10105            8
10106        }
10107
10108        #[inline(always)]
10109        fn inline_size(_context: fidl::encoding::Context) -> usize {
10110            24
10111        }
10112    }
10113
10114    unsafe impl<D: fidl::encoding::ResourceDialect>
10115        fidl::encoding::Encode<Ipv6MulticastMembership, D> for &Ipv6MulticastMembership
10116    {
10117        #[inline]
10118        unsafe fn encode(
10119            self,
10120            encoder: &mut fidl::encoding::Encoder<'_, D>,
10121            offset: usize,
10122            _depth: fidl::encoding::Depth,
10123        ) -> fidl::Result<()> {
10124            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
10125            // Delegate to tuple encoding.
10126            fidl::encoding::Encode::<Ipv6MulticastMembership, D>::encode(
10127                (
10128                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10129                    <fidl_fuchsia_net_common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
10130                ),
10131                encoder, offset, _depth
10132            )
10133        }
10134    }
10135    unsafe impl<
10136        D: fidl::encoding::ResourceDialect,
10137        T0: fidl::encoding::Encode<u64, D>,
10138        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv6Address, D>,
10139    > fidl::encoding::Encode<Ipv6MulticastMembership, D> for (T0, T1)
10140    {
10141        #[inline]
10142        unsafe fn encode(
10143            self,
10144            encoder: &mut fidl::encoding::Encoder<'_, D>,
10145            offset: usize,
10146            depth: fidl::encoding::Depth,
10147        ) -> fidl::Result<()> {
10148            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
10149            // Zero out padding regions. There's no need to apply masks
10150            // because the unmasked parts will be overwritten by fields.
10151            // Write the fields.
10152            self.0.encode(encoder, offset + 0, depth)?;
10153            self.1.encode(encoder, offset + 8, depth)?;
10154            Ok(())
10155        }
10156    }
10157
10158    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10159        for Ipv6MulticastMembership
10160    {
10161        #[inline(always)]
10162        fn new_empty() -> Self {
10163            Self {
10164                iface: fidl::new_empty!(u64, D),
10165                mcast_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv6Address, D),
10166            }
10167        }
10168
10169        #[inline]
10170        unsafe fn decode(
10171            &mut self,
10172            decoder: &mut fidl::encoding::Decoder<'_, D>,
10173            offset: usize,
10174            _depth: fidl::encoding::Depth,
10175        ) -> fidl::Result<()> {
10176            decoder.debug_check_bounds::<Self>(offset);
10177            // Verify that padding bytes are zero.
10178            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10179            fidl::decode!(
10180                fidl_fuchsia_net_common::Ipv6Address,
10181                D,
10182                &mut self.mcast_addr,
10183                decoder,
10184                offset + 8,
10185                _depth
10186            )?;
10187            Ok(())
10188        }
10189    }
10190
10191    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoRecvControlData {
10192        type Borrowed<'a> = &'a Self;
10193        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10194            value
10195        }
10196    }
10197
10198    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoRecvControlData {
10199        type Owned = Self;
10200
10201        #[inline(always)]
10202        fn inline_align(_context: fidl::encoding::Context) -> usize {
10203            8
10204        }
10205
10206        #[inline(always)]
10207        fn inline_size(_context: fidl::encoding::Context) -> usize {
10208            24
10209        }
10210    }
10211
10212    unsafe impl<D: fidl::encoding::ResourceDialect>
10213        fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for &Ipv6PktInfoRecvControlData
10214    {
10215        #[inline]
10216        unsafe fn encode(
10217            self,
10218            encoder: &mut fidl::encoding::Encoder<'_, D>,
10219            offset: usize,
10220            _depth: fidl::encoding::Depth,
10221        ) -> fidl::Result<()> {
10222            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
10223            // Delegate to tuple encoding.
10224            fidl::encoding::Encode::<Ipv6PktInfoRecvControlData, D>::encode(
10225                (
10226                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10227                    <fidl_fuchsia_net_common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.header_destination_addr),
10228                ),
10229                encoder, offset, _depth
10230            )
10231        }
10232    }
10233    unsafe impl<
10234        D: fidl::encoding::ResourceDialect,
10235        T0: fidl::encoding::Encode<u64, D>,
10236        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv6Address, D>,
10237    > fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for (T0, T1)
10238    {
10239        #[inline]
10240        unsafe fn encode(
10241            self,
10242            encoder: &mut fidl::encoding::Encoder<'_, D>,
10243            offset: usize,
10244            depth: fidl::encoding::Depth,
10245        ) -> fidl::Result<()> {
10246            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
10247            // Zero out padding regions. There's no need to apply masks
10248            // because the unmasked parts will be overwritten by fields.
10249            // Write the fields.
10250            self.0.encode(encoder, offset + 0, depth)?;
10251            self.1.encode(encoder, offset + 8, depth)?;
10252            Ok(())
10253        }
10254    }
10255
10256    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10257        for Ipv6PktInfoRecvControlData
10258    {
10259        #[inline(always)]
10260        fn new_empty() -> Self {
10261            Self {
10262                iface: fidl::new_empty!(u64, D),
10263                header_destination_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv6Address, D),
10264            }
10265        }
10266
10267        #[inline]
10268        unsafe fn decode(
10269            &mut self,
10270            decoder: &mut fidl::encoding::Decoder<'_, D>,
10271            offset: usize,
10272            _depth: fidl::encoding::Depth,
10273        ) -> fidl::Result<()> {
10274            decoder.debug_check_bounds::<Self>(offset);
10275            // Verify that padding bytes are zero.
10276            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10277            fidl::decode!(
10278                fidl_fuchsia_net_common::Ipv6Address,
10279                D,
10280                &mut self.header_destination_addr,
10281                decoder,
10282                offset + 8,
10283                _depth
10284            )?;
10285            Ok(())
10286        }
10287    }
10288
10289    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoSendControlData {
10290        type Borrowed<'a> = &'a Self;
10291        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10292            value
10293        }
10294    }
10295
10296    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoSendControlData {
10297        type Owned = Self;
10298
10299        #[inline(always)]
10300        fn inline_align(_context: fidl::encoding::Context) -> usize {
10301            8
10302        }
10303
10304        #[inline(always)]
10305        fn inline_size(_context: fidl::encoding::Context) -> usize {
10306            24
10307        }
10308    }
10309
10310    unsafe impl<D: fidl::encoding::ResourceDialect>
10311        fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for &Ipv6PktInfoSendControlData
10312    {
10313        #[inline]
10314        unsafe fn encode(
10315            self,
10316            encoder: &mut fidl::encoding::Encoder<'_, D>,
10317            offset: usize,
10318            _depth: fidl::encoding::Depth,
10319        ) -> fidl::Result<()> {
10320            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
10321            // Delegate to tuple encoding.
10322            fidl::encoding::Encode::<Ipv6PktInfoSendControlData, D>::encode(
10323                (
10324                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10325                    <fidl_fuchsia_net_common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
10326                ),
10327                encoder, offset, _depth
10328            )
10329        }
10330    }
10331    unsafe impl<
10332        D: fidl::encoding::ResourceDialect,
10333        T0: fidl::encoding::Encode<u64, D>,
10334        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv6Address, D>,
10335    > fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for (T0, T1)
10336    {
10337        #[inline]
10338        unsafe fn encode(
10339            self,
10340            encoder: &mut fidl::encoding::Encoder<'_, D>,
10341            offset: usize,
10342            depth: fidl::encoding::Depth,
10343        ) -> fidl::Result<()> {
10344            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
10345            // Zero out padding regions. There's no need to apply masks
10346            // because the unmasked parts will be overwritten by fields.
10347            // Write the fields.
10348            self.0.encode(encoder, offset + 0, depth)?;
10349            self.1.encode(encoder, offset + 8, depth)?;
10350            Ok(())
10351        }
10352    }
10353
10354    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10355        for Ipv6PktInfoSendControlData
10356    {
10357        #[inline(always)]
10358        fn new_empty() -> Self {
10359            Self {
10360                iface: fidl::new_empty!(u64, D),
10361                local_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv6Address, D),
10362            }
10363        }
10364
10365        #[inline]
10366        unsafe fn decode(
10367            &mut self,
10368            decoder: &mut fidl::encoding::Decoder<'_, D>,
10369            offset: usize,
10370            _depth: fidl::encoding::Depth,
10371        ) -> fidl::Result<()> {
10372            decoder.debug_check_bounds::<Self>(offset);
10373            // Verify that padding bytes are zero.
10374            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10375            fidl::decode!(
10376                fidl_fuchsia_net_common::Ipv6Address,
10377                D,
10378                &mut self.local_addr,
10379                decoder,
10380                offset + 8,
10381                _depth
10382            )?;
10383            Ok(())
10384        }
10385    }
10386
10387    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketDeprecatedRequest {
10388        type Borrowed<'a> = &'a Self;
10389        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10390            value
10391        }
10392    }
10393
10394    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketDeprecatedRequest {
10395        type Owned = Self;
10396
10397        #[inline(always)]
10398        fn inline_align(_context: fidl::encoding::Context) -> usize {
10399            4
10400        }
10401
10402        #[inline(always)]
10403        fn inline_size(_context: fidl::encoding::Context) -> usize {
10404            8
10405        }
10406    }
10407
10408    unsafe impl<D: fidl::encoding::ResourceDialect>
10409        fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D>
10410        for &ProviderDatagramSocketDeprecatedRequest
10411    {
10412        #[inline]
10413        unsafe fn encode(
10414            self,
10415            encoder: &mut fidl::encoding::Encoder<'_, D>,
10416            offset: usize,
10417            _depth: fidl::encoding::Depth,
10418        ) -> fidl::Result<()> {
10419            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10420            // Delegate to tuple encoding.
10421            fidl::encoding::Encode::<ProviderDatagramSocketDeprecatedRequest, D>::encode(
10422                (
10423                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10424                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10425                        &self.proto,
10426                    ),
10427                ),
10428                encoder,
10429                offset,
10430                _depth,
10431            )
10432        }
10433    }
10434    unsafe impl<
10435        D: fidl::encoding::ResourceDialect,
10436        T0: fidl::encoding::Encode<Domain, D>,
10437        T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10438    > fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D> for (T0, T1)
10439    {
10440        #[inline]
10441        unsafe fn encode(
10442            self,
10443            encoder: &mut fidl::encoding::Encoder<'_, D>,
10444            offset: usize,
10445            depth: fidl::encoding::Depth,
10446        ) -> fidl::Result<()> {
10447            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10448            // Zero out padding regions. There's no need to apply masks
10449            // because the unmasked parts will be overwritten by fields.
10450            unsafe {
10451                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10452                (ptr as *mut u32).write_unaligned(0);
10453            }
10454            // Write the fields.
10455            self.0.encode(encoder, offset + 0, depth)?;
10456            self.1.encode(encoder, offset + 4, depth)?;
10457            Ok(())
10458        }
10459    }
10460
10461    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10462        for ProviderDatagramSocketDeprecatedRequest
10463    {
10464        #[inline(always)]
10465        fn new_empty() -> Self {
10466            Self {
10467                domain: fidl::new_empty!(Domain, D),
10468                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10469            }
10470        }
10471
10472        #[inline]
10473        unsafe fn decode(
10474            &mut self,
10475            decoder: &mut fidl::encoding::Decoder<'_, D>,
10476            offset: usize,
10477            _depth: fidl::encoding::Depth,
10478        ) -> fidl::Result<()> {
10479            decoder.debug_check_bounds::<Self>(offset);
10480            // Verify that padding bytes are zero.
10481            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10482            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10483            let mask = 0xffff0000u32;
10484            let maskedval = padval & mask;
10485            if maskedval != 0 {
10486                return Err(fidl::Error::NonZeroPadding {
10487                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10488                });
10489            }
10490            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10491            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10492            Ok(())
10493        }
10494    }
10495
10496    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketRequest {
10497        type Borrowed<'a> = &'a Self;
10498        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10499            value
10500        }
10501    }
10502
10503    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketRequest {
10504        type Owned = Self;
10505
10506        #[inline(always)]
10507        fn inline_align(_context: fidl::encoding::Context) -> usize {
10508            4
10509        }
10510
10511        #[inline(always)]
10512        fn inline_size(_context: fidl::encoding::Context) -> usize {
10513            8
10514        }
10515    }
10516
10517    unsafe impl<D: fidl::encoding::ResourceDialect>
10518        fidl::encoding::Encode<ProviderDatagramSocketRequest, D>
10519        for &ProviderDatagramSocketRequest
10520    {
10521        #[inline]
10522        unsafe fn encode(
10523            self,
10524            encoder: &mut fidl::encoding::Encoder<'_, D>,
10525            offset: usize,
10526            _depth: fidl::encoding::Depth,
10527        ) -> fidl::Result<()> {
10528            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10529            // Delegate to tuple encoding.
10530            fidl::encoding::Encode::<ProviderDatagramSocketRequest, D>::encode(
10531                (
10532                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10533                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10534                        &self.proto,
10535                    ),
10536                ),
10537                encoder,
10538                offset,
10539                _depth,
10540            )
10541        }
10542    }
10543    unsafe impl<
10544        D: fidl::encoding::ResourceDialect,
10545        T0: fidl::encoding::Encode<Domain, D>,
10546        T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10547    > fidl::encoding::Encode<ProviderDatagramSocketRequest, D> for (T0, T1)
10548    {
10549        #[inline]
10550        unsafe fn encode(
10551            self,
10552            encoder: &mut fidl::encoding::Encoder<'_, D>,
10553            offset: usize,
10554            depth: fidl::encoding::Depth,
10555        ) -> fidl::Result<()> {
10556            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10557            // Zero out padding regions. There's no need to apply masks
10558            // because the unmasked parts will be overwritten by fields.
10559            unsafe {
10560                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10561                (ptr as *mut u32).write_unaligned(0);
10562            }
10563            // Write the fields.
10564            self.0.encode(encoder, offset + 0, depth)?;
10565            self.1.encode(encoder, offset + 4, depth)?;
10566            Ok(())
10567        }
10568    }
10569
10570    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10571        for ProviderDatagramSocketRequest
10572    {
10573        #[inline(always)]
10574        fn new_empty() -> Self {
10575            Self {
10576                domain: fidl::new_empty!(Domain, D),
10577                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10578            }
10579        }
10580
10581        #[inline]
10582        unsafe fn decode(
10583            &mut self,
10584            decoder: &mut fidl::encoding::Decoder<'_, D>,
10585            offset: usize,
10586            _depth: fidl::encoding::Depth,
10587        ) -> fidl::Result<()> {
10588            decoder.debug_check_bounds::<Self>(offset);
10589            // Verify that padding bytes are zero.
10590            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10591            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10592            let mask = 0xffff0000u32;
10593            let maskedval = padval & mask;
10594            if maskedval != 0 {
10595                return Err(fidl::Error::NonZeroPadding {
10596                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10597                });
10598            }
10599            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10600            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10601            Ok(())
10602        }
10603    }
10604
10605    impl fidl::encoding::ValueTypeMarker for ProviderGetInterfaceAddressesResponse {
10606        type Borrowed<'a> = &'a Self;
10607        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10608            value
10609        }
10610    }
10611
10612    unsafe impl fidl::encoding::TypeMarker for ProviderGetInterfaceAddressesResponse {
10613        type Owned = Self;
10614
10615        #[inline(always)]
10616        fn inline_align(_context: fidl::encoding::Context) -> usize {
10617            8
10618        }
10619
10620        #[inline(always)]
10621        fn inline_size(_context: fidl::encoding::Context) -> usize {
10622            16
10623        }
10624    }
10625
10626    unsafe impl<D: fidl::encoding::ResourceDialect>
10627        fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D>
10628        for &ProviderGetInterfaceAddressesResponse
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::<ProviderGetInterfaceAddressesResponse>(offset);
10638            // Delegate to tuple encoding.
10639            fidl::encoding::Encode::<ProviderGetInterfaceAddressesResponse, D>::encode(
10640                (
10641                    <fidl::encoding::UnboundedVector<InterfaceAddresses> as fidl::encoding::ValueTypeMarker>::borrow(&self.interfaces),
10642                ),
10643                encoder, offset, _depth
10644            )
10645        }
10646    }
10647    unsafe impl<
10648        D: fidl::encoding::ResourceDialect,
10649        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<InterfaceAddresses>, D>,
10650    > fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D> for (T0,)
10651    {
10652        #[inline]
10653        unsafe fn encode(
10654            self,
10655            encoder: &mut fidl::encoding::Encoder<'_, D>,
10656            offset: usize,
10657            depth: fidl::encoding::Depth,
10658        ) -> fidl::Result<()> {
10659            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10660            // Zero out padding regions. There's no need to apply masks
10661            // because the unmasked parts will be overwritten by fields.
10662            // Write the fields.
10663            self.0.encode(encoder, offset + 0, depth)?;
10664            Ok(())
10665        }
10666    }
10667
10668    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10669        for ProviderGetInterfaceAddressesResponse
10670    {
10671        #[inline(always)]
10672        fn new_empty() -> Self {
10673            Self {
10674                interfaces: fidl::new_empty!(
10675                    fidl::encoding::UnboundedVector<InterfaceAddresses>,
10676                    D
10677                ),
10678            }
10679        }
10680
10681        #[inline]
10682        unsafe fn decode(
10683            &mut self,
10684            decoder: &mut fidl::encoding::Decoder<'_, D>,
10685            offset: usize,
10686            _depth: fidl::encoding::Depth,
10687        ) -> fidl::Result<()> {
10688            decoder.debug_check_bounds::<Self>(offset);
10689            // Verify that padding bytes are zero.
10690            fidl::decode!(
10691                fidl::encoding::UnboundedVector<InterfaceAddresses>,
10692                D,
10693                &mut self.interfaces,
10694                decoder,
10695                offset + 0,
10696                _depth
10697            )?;
10698            Ok(())
10699        }
10700    }
10701
10702    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameRequest {
10703        type Borrowed<'a> = &'a Self;
10704        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10705            value
10706        }
10707    }
10708
10709    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameRequest {
10710        type Owned = Self;
10711
10712        #[inline(always)]
10713        fn inline_align(_context: fidl::encoding::Context) -> usize {
10714            8
10715        }
10716
10717        #[inline(always)]
10718        fn inline_size(_context: fidl::encoding::Context) -> usize {
10719            8
10720        }
10721        #[inline(always)]
10722        fn encode_is_copy() -> bool {
10723            true
10724        }
10725
10726        #[inline(always)]
10727        fn decode_is_copy() -> bool {
10728            true
10729        }
10730    }
10731
10732    unsafe impl<D: fidl::encoding::ResourceDialect>
10733        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D>
10734        for &ProviderInterfaceIndexToNameRequest
10735    {
10736        #[inline]
10737        unsafe fn encode(
10738            self,
10739            encoder: &mut fidl::encoding::Encoder<'_, D>,
10740            offset: usize,
10741            _depth: fidl::encoding::Depth,
10742        ) -> fidl::Result<()> {
10743            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10744            unsafe {
10745                // Copy the object into the buffer.
10746                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10747                (buf_ptr as *mut ProviderInterfaceIndexToNameRequest)
10748                    .write_unaligned((self as *const ProviderInterfaceIndexToNameRequest).read());
10749                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10750                // done second because the memcpy will write garbage to these bytes.
10751            }
10752            Ok(())
10753        }
10754    }
10755    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
10756        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D> for (T0,)
10757    {
10758        #[inline]
10759        unsafe fn encode(
10760            self,
10761            encoder: &mut fidl::encoding::Encoder<'_, D>,
10762            offset: usize,
10763            depth: fidl::encoding::Depth,
10764        ) -> fidl::Result<()> {
10765            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10766            // Zero out padding regions. There's no need to apply masks
10767            // because the unmasked parts will be overwritten by fields.
10768            // Write the fields.
10769            self.0.encode(encoder, offset + 0, depth)?;
10770            Ok(())
10771        }
10772    }
10773
10774    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10775        for ProviderInterfaceIndexToNameRequest
10776    {
10777        #[inline(always)]
10778        fn new_empty() -> Self {
10779            Self { index: fidl::new_empty!(u64, D) }
10780        }
10781
10782        #[inline]
10783        unsafe fn decode(
10784            &mut self,
10785            decoder: &mut fidl::encoding::Decoder<'_, D>,
10786            offset: usize,
10787            _depth: fidl::encoding::Depth,
10788        ) -> fidl::Result<()> {
10789            decoder.debug_check_bounds::<Self>(offset);
10790            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10791            // Verify that padding bytes are zero.
10792            // Copy from the buffer into the object.
10793            unsafe {
10794                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10795            }
10796            Ok(())
10797        }
10798    }
10799
10800    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsRequest {
10801        type Borrowed<'a> = &'a Self;
10802        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10803            value
10804        }
10805    }
10806
10807    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsRequest {
10808        type Owned = Self;
10809
10810        #[inline(always)]
10811        fn inline_align(_context: fidl::encoding::Context) -> usize {
10812            8
10813        }
10814
10815        #[inline(always)]
10816        fn inline_size(_context: fidl::encoding::Context) -> usize {
10817            16
10818        }
10819    }
10820
10821    unsafe impl<D: fidl::encoding::ResourceDialect>
10822        fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D>
10823        for &ProviderInterfaceNameToFlagsRequest
10824    {
10825        #[inline]
10826        unsafe fn encode(
10827            self,
10828            encoder: &mut fidl::encoding::Encoder<'_, D>,
10829            offset: usize,
10830            _depth: fidl::encoding::Depth,
10831        ) -> fidl::Result<()> {
10832            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10833            // Delegate to tuple encoding.
10834            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsRequest, D>::encode(
10835                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10836                    &self.name,
10837                ),),
10838                encoder,
10839                offset,
10840                _depth,
10841            )
10842        }
10843    }
10844    unsafe impl<
10845        D: fidl::encoding::ResourceDialect,
10846        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10847    > fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D> for (T0,)
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::<ProviderInterfaceNameToFlagsRequest>(offset);
10857            // Zero out padding regions. There's no need to apply masks
10858            // because the unmasked parts will be overwritten by fields.
10859            // Write the fields.
10860            self.0.encode(encoder, offset + 0, depth)?;
10861            Ok(())
10862        }
10863    }
10864
10865    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10866        for ProviderInterfaceNameToFlagsRequest
10867    {
10868        #[inline(always)]
10869        fn new_empty() -> Self {
10870            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10871        }
10872
10873        #[inline]
10874        unsafe fn decode(
10875            &mut self,
10876            decoder: &mut fidl::encoding::Decoder<'_, D>,
10877            offset: usize,
10878            _depth: fidl::encoding::Depth,
10879        ) -> fidl::Result<()> {
10880            decoder.debug_check_bounds::<Self>(offset);
10881            // Verify that padding bytes are zero.
10882            fidl::decode!(
10883                fidl::encoding::BoundedString<15>,
10884                D,
10885                &mut self.name,
10886                decoder,
10887                offset + 0,
10888                _depth
10889            )?;
10890            Ok(())
10891        }
10892    }
10893
10894    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexRequest {
10895        type Borrowed<'a> = &'a Self;
10896        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10897            value
10898        }
10899    }
10900
10901    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexRequest {
10902        type Owned = Self;
10903
10904        #[inline(always)]
10905        fn inline_align(_context: fidl::encoding::Context) -> usize {
10906            8
10907        }
10908
10909        #[inline(always)]
10910        fn inline_size(_context: fidl::encoding::Context) -> usize {
10911            16
10912        }
10913    }
10914
10915    unsafe impl<D: fidl::encoding::ResourceDialect>
10916        fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D>
10917        for &ProviderInterfaceNameToIndexRequest
10918    {
10919        #[inline]
10920        unsafe fn encode(
10921            self,
10922            encoder: &mut fidl::encoding::Encoder<'_, D>,
10923            offset: usize,
10924            _depth: fidl::encoding::Depth,
10925        ) -> fidl::Result<()> {
10926            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10927            // Delegate to tuple encoding.
10928            fidl::encoding::Encode::<ProviderInterfaceNameToIndexRequest, D>::encode(
10929                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10930                    &self.name,
10931                ),),
10932                encoder,
10933                offset,
10934                _depth,
10935            )
10936        }
10937    }
10938    unsafe impl<
10939        D: fidl::encoding::ResourceDialect,
10940        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10941    > fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D> for (T0,)
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::<ProviderInterfaceNameToIndexRequest>(offset);
10951            // Zero out padding regions. There's no need to apply masks
10952            // because the unmasked parts will be overwritten by fields.
10953            // Write the fields.
10954            self.0.encode(encoder, offset + 0, depth)?;
10955            Ok(())
10956        }
10957    }
10958
10959    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10960        for ProviderInterfaceNameToIndexRequest
10961    {
10962        #[inline(always)]
10963        fn new_empty() -> Self {
10964            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10965        }
10966
10967        #[inline]
10968        unsafe fn decode(
10969            &mut self,
10970            decoder: &mut fidl::encoding::Decoder<'_, D>,
10971            offset: usize,
10972            _depth: fidl::encoding::Depth,
10973        ) -> fidl::Result<()> {
10974            decoder.debug_check_bounds::<Self>(offset);
10975            // Verify that padding bytes are zero.
10976            fidl::decode!(
10977                fidl::encoding::BoundedString<15>,
10978                D,
10979                &mut self.name,
10980                decoder,
10981                offset + 0,
10982                _depth
10983            )?;
10984            Ok(())
10985        }
10986    }
10987
10988    impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketRequest {
10989        type Borrowed<'a> = &'a Self;
10990        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10991            value
10992        }
10993    }
10994
10995    unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketRequest {
10996        type Owned = Self;
10997
10998        #[inline(always)]
10999        fn inline_align(_context: fidl::encoding::Context) -> usize {
11000            4
11001        }
11002
11003        #[inline(always)]
11004        fn inline_size(_context: fidl::encoding::Context) -> usize {
11005            8
11006        }
11007    }
11008
11009    unsafe impl<D: fidl::encoding::ResourceDialect>
11010        fidl::encoding::Encode<ProviderStreamSocketRequest, D> for &ProviderStreamSocketRequest
11011    {
11012        #[inline]
11013        unsafe fn encode(
11014            self,
11015            encoder: &mut fidl::encoding::Encoder<'_, D>,
11016            offset: usize,
11017            _depth: fidl::encoding::Depth,
11018        ) -> fidl::Result<()> {
11019            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
11020            // Delegate to tuple encoding.
11021            fidl::encoding::Encode::<ProviderStreamSocketRequest, D>::encode(
11022                (
11023                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
11024                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
11025                ),
11026                encoder,
11027                offset,
11028                _depth,
11029            )
11030        }
11031    }
11032    unsafe impl<
11033        D: fidl::encoding::ResourceDialect,
11034        T0: fidl::encoding::Encode<Domain, D>,
11035        T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
11036    > fidl::encoding::Encode<ProviderStreamSocketRequest, D> for (T0, T1)
11037    {
11038        #[inline]
11039        unsafe fn encode(
11040            self,
11041            encoder: &mut fidl::encoding::Encoder<'_, D>,
11042            offset: usize,
11043            depth: fidl::encoding::Depth,
11044        ) -> fidl::Result<()> {
11045            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
11046            // Zero out padding regions. There's no need to apply masks
11047            // because the unmasked parts will be overwritten by fields.
11048            unsafe {
11049                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11050                (ptr as *mut u32).write_unaligned(0);
11051            }
11052            // Write the fields.
11053            self.0.encode(encoder, offset + 0, depth)?;
11054            self.1.encode(encoder, offset + 4, depth)?;
11055            Ok(())
11056        }
11057    }
11058
11059    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11060        for ProviderStreamSocketRequest
11061    {
11062        #[inline(always)]
11063        fn new_empty() -> Self {
11064            Self {
11065                domain: fidl::new_empty!(Domain, D),
11066                proto: fidl::new_empty!(StreamSocketProtocol, D),
11067            }
11068        }
11069
11070        #[inline]
11071        unsafe fn decode(
11072            &mut self,
11073            decoder: &mut fidl::encoding::Decoder<'_, D>,
11074            offset: usize,
11075            _depth: fidl::encoding::Depth,
11076        ) -> fidl::Result<()> {
11077            decoder.debug_check_bounds::<Self>(offset);
11078            // Verify that padding bytes are zero.
11079            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11080            let padval = unsafe { (ptr as *const u32).read_unaligned() };
11081            let mask = 0xffff0000u32;
11082            let maskedval = padval & mask;
11083            if maskedval != 0 {
11084                return Err(fidl::Error::NonZeroPadding {
11085                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11086                });
11087            }
11088            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
11089            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
11090            Ok(())
11091        }
11092    }
11093
11094    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameResponse {
11095        type Borrowed<'a> = &'a Self;
11096        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11097            value
11098        }
11099    }
11100
11101    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameResponse {
11102        type Owned = Self;
11103
11104        #[inline(always)]
11105        fn inline_align(_context: fidl::encoding::Context) -> usize {
11106            8
11107        }
11108
11109        #[inline(always)]
11110        fn inline_size(_context: fidl::encoding::Context) -> usize {
11111            16
11112        }
11113    }
11114
11115    unsafe impl<D: fidl::encoding::ResourceDialect>
11116        fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D>
11117        for &ProviderInterfaceIndexToNameResponse
11118    {
11119        #[inline]
11120        unsafe fn encode(
11121            self,
11122            encoder: &mut fidl::encoding::Encoder<'_, D>,
11123            offset: usize,
11124            _depth: fidl::encoding::Depth,
11125        ) -> fidl::Result<()> {
11126            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
11127            // Delegate to tuple encoding.
11128            fidl::encoding::Encode::<ProviderInterfaceIndexToNameResponse, D>::encode(
11129                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
11130                    &self.name,
11131                ),),
11132                encoder,
11133                offset,
11134                _depth,
11135            )
11136        }
11137    }
11138    unsafe impl<
11139        D: fidl::encoding::ResourceDialect,
11140        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
11141    > fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, 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::<ProviderInterfaceIndexToNameResponse>(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 ProviderInterfaceIndexToNameResponse
11161    {
11162        #[inline(always)]
11163        fn new_empty() -> Self {
11164            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, 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!(
11177                fidl::encoding::BoundedString<15>,
11178                D,
11179                &mut self.name,
11180                decoder,
11181                offset + 0,
11182                _depth
11183            )?;
11184            Ok(())
11185        }
11186    }
11187
11188    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsResponse {
11189        type Borrowed<'a> = &'a Self;
11190        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11191            value
11192        }
11193    }
11194
11195    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsResponse {
11196        type Owned = Self;
11197
11198        #[inline(always)]
11199        fn inline_align(_context: fidl::encoding::Context) -> usize {
11200            2
11201        }
11202
11203        #[inline(always)]
11204        fn inline_size(_context: fidl::encoding::Context) -> usize {
11205            2
11206        }
11207    }
11208
11209    unsafe impl<D: fidl::encoding::ResourceDialect>
11210        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D>
11211        for &ProviderInterfaceNameToFlagsResponse
11212    {
11213        #[inline]
11214        unsafe fn encode(
11215            self,
11216            encoder: &mut fidl::encoding::Encoder<'_, D>,
11217            offset: usize,
11218            _depth: fidl::encoding::Depth,
11219        ) -> fidl::Result<()> {
11220            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11221            // Delegate to tuple encoding.
11222            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsResponse, D>::encode(
11223                (<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
11224                encoder,
11225                offset,
11226                _depth,
11227            )
11228        }
11229    }
11230    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<InterfaceFlags, D>>
11231        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D> for (T0,)
11232    {
11233        #[inline]
11234        unsafe fn encode(
11235            self,
11236            encoder: &mut fidl::encoding::Encoder<'_, D>,
11237            offset: usize,
11238            depth: fidl::encoding::Depth,
11239        ) -> fidl::Result<()> {
11240            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11241            // Zero out padding regions. There's no need to apply masks
11242            // because the unmasked parts will be overwritten by fields.
11243            // Write the fields.
11244            self.0.encode(encoder, offset + 0, depth)?;
11245            Ok(())
11246        }
11247    }
11248
11249    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11250        for ProviderInterfaceNameToFlagsResponse
11251    {
11252        #[inline(always)]
11253        fn new_empty() -> Self {
11254            Self { flags: fidl::new_empty!(InterfaceFlags, D) }
11255        }
11256
11257        #[inline]
11258        unsafe fn decode(
11259            &mut self,
11260            decoder: &mut fidl::encoding::Decoder<'_, D>,
11261            offset: usize,
11262            _depth: fidl::encoding::Depth,
11263        ) -> fidl::Result<()> {
11264            decoder.debug_check_bounds::<Self>(offset);
11265            // Verify that padding bytes are zero.
11266            fidl::decode!(InterfaceFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
11267            Ok(())
11268        }
11269    }
11270
11271    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexResponse {
11272        type Borrowed<'a> = &'a Self;
11273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11274            value
11275        }
11276    }
11277
11278    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexResponse {
11279        type Owned = Self;
11280
11281        #[inline(always)]
11282        fn inline_align(_context: fidl::encoding::Context) -> usize {
11283            8
11284        }
11285
11286        #[inline(always)]
11287        fn inline_size(_context: fidl::encoding::Context) -> usize {
11288            8
11289        }
11290        #[inline(always)]
11291        fn encode_is_copy() -> bool {
11292            true
11293        }
11294
11295        #[inline(always)]
11296        fn decode_is_copy() -> bool {
11297            true
11298        }
11299    }
11300
11301    unsafe impl<D: fidl::encoding::ResourceDialect>
11302        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D>
11303        for &ProviderInterfaceNameToIndexResponse
11304    {
11305        #[inline]
11306        unsafe fn encode(
11307            self,
11308            encoder: &mut fidl::encoding::Encoder<'_, D>,
11309            offset: usize,
11310            _depth: fidl::encoding::Depth,
11311        ) -> fidl::Result<()> {
11312            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11313            unsafe {
11314                // Copy the object into the buffer.
11315                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11316                (buf_ptr as *mut ProviderInterfaceNameToIndexResponse)
11317                    .write_unaligned((self as *const ProviderInterfaceNameToIndexResponse).read());
11318                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11319                // done second because the memcpy will write garbage to these bytes.
11320            }
11321            Ok(())
11322        }
11323    }
11324    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11325        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D> for (T0,)
11326    {
11327        #[inline]
11328        unsafe fn encode(
11329            self,
11330            encoder: &mut fidl::encoding::Encoder<'_, D>,
11331            offset: usize,
11332            depth: fidl::encoding::Depth,
11333        ) -> fidl::Result<()> {
11334            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11335            // Zero out padding regions. There's no need to apply masks
11336            // because the unmasked parts will be overwritten by fields.
11337            // Write the fields.
11338            self.0.encode(encoder, offset + 0, depth)?;
11339            Ok(())
11340        }
11341    }
11342
11343    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11344        for ProviderInterfaceNameToIndexResponse
11345    {
11346        #[inline(always)]
11347        fn new_empty() -> Self {
11348            Self { index: fidl::new_empty!(u64, D) }
11349        }
11350
11351        #[inline]
11352        unsafe fn decode(
11353            &mut self,
11354            decoder: &mut fidl::encoding::Decoder<'_, D>,
11355            offset: usize,
11356            _depth: fidl::encoding::Depth,
11357        ) -> fidl::Result<()> {
11358            decoder.debug_check_bounds::<Self>(offset);
11359            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11360            // Verify that padding bytes are zero.
11361            // Copy from the buffer into the object.
11362            unsafe {
11363                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11364            }
11365            Ok(())
11366        }
11367    }
11368
11369    impl fidl::encoding::ValueTypeMarker for StreamSocketAcceptRequest {
11370        type Borrowed<'a> = &'a Self;
11371        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11372            value
11373        }
11374    }
11375
11376    unsafe impl fidl::encoding::TypeMarker for StreamSocketAcceptRequest {
11377        type Owned = Self;
11378
11379        #[inline(always)]
11380        fn inline_align(_context: fidl::encoding::Context) -> usize {
11381            1
11382        }
11383
11384        #[inline(always)]
11385        fn inline_size(_context: fidl::encoding::Context) -> usize {
11386            1
11387        }
11388    }
11389
11390    unsafe impl<D: fidl::encoding::ResourceDialect>
11391        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for &StreamSocketAcceptRequest
11392    {
11393        #[inline]
11394        unsafe fn encode(
11395            self,
11396            encoder: &mut fidl::encoding::Encoder<'_, D>,
11397            offset: usize,
11398            _depth: fidl::encoding::Depth,
11399        ) -> fidl::Result<()> {
11400            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11401            // Delegate to tuple encoding.
11402            fidl::encoding::Encode::<StreamSocketAcceptRequest, D>::encode(
11403                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),),
11404                encoder,
11405                offset,
11406                _depth,
11407            )
11408        }
11409    }
11410    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11411        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for (T0,)
11412    {
11413        #[inline]
11414        unsafe fn encode(
11415            self,
11416            encoder: &mut fidl::encoding::Encoder<'_, D>,
11417            offset: usize,
11418            depth: fidl::encoding::Depth,
11419        ) -> fidl::Result<()> {
11420            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11421            // Zero out padding regions. There's no need to apply masks
11422            // because the unmasked parts will be overwritten by fields.
11423            // Write the fields.
11424            self.0.encode(encoder, offset + 0, depth)?;
11425            Ok(())
11426        }
11427    }
11428
11429    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11430        for StreamSocketAcceptRequest
11431    {
11432        #[inline(always)]
11433        fn new_empty() -> Self {
11434            Self { want_addr: fidl::new_empty!(bool, D) }
11435        }
11436
11437        #[inline]
11438        unsafe fn decode(
11439            &mut self,
11440            decoder: &mut fidl::encoding::Decoder<'_, D>,
11441            offset: usize,
11442            _depth: fidl::encoding::Depth,
11443        ) -> fidl::Result<()> {
11444            decoder.debug_check_bounds::<Self>(offset);
11445            // Verify that padding bytes are zero.
11446            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
11447            Ok(())
11448        }
11449    }
11450
11451    impl fidl::encoding::ValueTypeMarker for StreamSocketListenRequest {
11452        type Borrowed<'a> = &'a Self;
11453        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11454            value
11455        }
11456    }
11457
11458    unsafe impl fidl::encoding::TypeMarker for StreamSocketListenRequest {
11459        type Owned = Self;
11460
11461        #[inline(always)]
11462        fn inline_align(_context: fidl::encoding::Context) -> usize {
11463            2
11464        }
11465
11466        #[inline(always)]
11467        fn inline_size(_context: fidl::encoding::Context) -> usize {
11468            2
11469        }
11470        #[inline(always)]
11471        fn encode_is_copy() -> bool {
11472            true
11473        }
11474
11475        #[inline(always)]
11476        fn decode_is_copy() -> bool {
11477            true
11478        }
11479    }
11480
11481    unsafe impl<D: fidl::encoding::ResourceDialect>
11482        fidl::encoding::Encode<StreamSocketListenRequest, D> for &StreamSocketListenRequest
11483    {
11484        #[inline]
11485        unsafe fn encode(
11486            self,
11487            encoder: &mut fidl::encoding::Encoder<'_, D>,
11488            offset: usize,
11489            _depth: fidl::encoding::Depth,
11490        ) -> fidl::Result<()> {
11491            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11492            unsafe {
11493                // Copy the object into the buffer.
11494                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11495                (buf_ptr as *mut StreamSocketListenRequest)
11496                    .write_unaligned((self as *const StreamSocketListenRequest).read());
11497                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11498                // done second because the memcpy will write garbage to these bytes.
11499            }
11500            Ok(())
11501        }
11502    }
11503    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i16, D>>
11504        fidl::encoding::Encode<StreamSocketListenRequest, D> for (T0,)
11505    {
11506        #[inline]
11507        unsafe fn encode(
11508            self,
11509            encoder: &mut fidl::encoding::Encoder<'_, D>,
11510            offset: usize,
11511            depth: fidl::encoding::Depth,
11512        ) -> fidl::Result<()> {
11513            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11514            // Zero out padding regions. There's no need to apply masks
11515            // because the unmasked parts will be overwritten by fields.
11516            // Write the fields.
11517            self.0.encode(encoder, offset + 0, depth)?;
11518            Ok(())
11519        }
11520    }
11521
11522    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11523        for StreamSocketListenRequest
11524    {
11525        #[inline(always)]
11526        fn new_empty() -> Self {
11527            Self { backlog: fidl::new_empty!(i16, D) }
11528        }
11529
11530        #[inline]
11531        unsafe fn decode(
11532            &mut self,
11533            decoder: &mut fidl::encoding::Decoder<'_, D>,
11534            offset: usize,
11535            _depth: fidl::encoding::Depth,
11536        ) -> fidl::Result<()> {
11537            decoder.debug_check_bounds::<Self>(offset);
11538            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11539            // Verify that padding bytes are zero.
11540            // Copy from the buffer into the object.
11541            unsafe {
11542                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
11543            }
11544            Ok(())
11545        }
11546    }
11547
11548    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCongestionRequest {
11549        type Borrowed<'a> = &'a Self;
11550        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11551            value
11552        }
11553    }
11554
11555    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCongestionRequest {
11556        type Owned = Self;
11557
11558        #[inline(always)]
11559        fn inline_align(_context: fidl::encoding::Context) -> usize {
11560            4
11561        }
11562
11563        #[inline(always)]
11564        fn inline_size(_context: fidl::encoding::Context) -> usize {
11565            4
11566        }
11567    }
11568
11569    unsafe impl<D: fidl::encoding::ResourceDialect>
11570        fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D>
11571        for &StreamSocketSetTcpCongestionRequest
11572    {
11573        #[inline]
11574        unsafe fn encode(
11575            self,
11576            encoder: &mut fidl::encoding::Encoder<'_, D>,
11577            offset: usize,
11578            _depth: fidl::encoding::Depth,
11579        ) -> fidl::Result<()> {
11580            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11581            // Delegate to tuple encoding.
11582            fidl::encoding::Encode::<StreamSocketSetTcpCongestionRequest, D>::encode(
11583                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11584                encoder,
11585                offset,
11586                _depth,
11587            )
11588        }
11589    }
11590    unsafe impl<
11591        D: fidl::encoding::ResourceDialect,
11592        T0: fidl::encoding::Encode<TcpCongestionControl, D>,
11593    > fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D> for (T0,)
11594    {
11595        #[inline]
11596        unsafe fn encode(
11597            self,
11598            encoder: &mut fidl::encoding::Encoder<'_, D>,
11599            offset: usize,
11600            depth: fidl::encoding::Depth,
11601        ) -> fidl::Result<()> {
11602            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11603            // Zero out padding regions. There's no need to apply masks
11604            // because the unmasked parts will be overwritten by fields.
11605            // Write the fields.
11606            self.0.encode(encoder, offset + 0, depth)?;
11607            Ok(())
11608        }
11609    }
11610
11611    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11612        for StreamSocketSetTcpCongestionRequest
11613    {
11614        #[inline(always)]
11615        fn new_empty() -> Self {
11616            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
11617        }
11618
11619        #[inline]
11620        unsafe fn decode(
11621            &mut self,
11622            decoder: &mut fidl::encoding::Decoder<'_, D>,
11623            offset: usize,
11624            _depth: fidl::encoding::Depth,
11625        ) -> fidl::Result<()> {
11626            decoder.debug_check_bounds::<Self>(offset);
11627            // Verify that padding bytes are zero.
11628            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
11629            Ok(())
11630        }
11631    }
11632
11633    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCorkRequest {
11634        type Borrowed<'a> = &'a Self;
11635        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11636            value
11637        }
11638    }
11639
11640    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCorkRequest {
11641        type Owned = Self;
11642
11643        #[inline(always)]
11644        fn inline_align(_context: fidl::encoding::Context) -> usize {
11645            1
11646        }
11647
11648        #[inline(always)]
11649        fn inline_size(_context: fidl::encoding::Context) -> usize {
11650            1
11651        }
11652    }
11653
11654    unsafe impl<D: fidl::encoding::ResourceDialect>
11655        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D>
11656        for &StreamSocketSetTcpCorkRequest
11657    {
11658        #[inline]
11659        unsafe fn encode(
11660            self,
11661            encoder: &mut fidl::encoding::Encoder<'_, D>,
11662            offset: usize,
11663            _depth: fidl::encoding::Depth,
11664        ) -> fidl::Result<()> {
11665            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11666            // Delegate to tuple encoding.
11667            fidl::encoding::Encode::<StreamSocketSetTcpCorkRequest, D>::encode(
11668                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11669                encoder,
11670                offset,
11671                _depth,
11672            )
11673        }
11674    }
11675    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11676        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D> for (T0,)
11677    {
11678        #[inline]
11679        unsafe fn encode(
11680            self,
11681            encoder: &mut fidl::encoding::Encoder<'_, D>,
11682            offset: usize,
11683            depth: fidl::encoding::Depth,
11684        ) -> fidl::Result<()> {
11685            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11686            // Zero out padding regions. There's no need to apply masks
11687            // because the unmasked parts will be overwritten by fields.
11688            // Write the fields.
11689            self.0.encode(encoder, offset + 0, depth)?;
11690            Ok(())
11691        }
11692    }
11693
11694    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11695        for StreamSocketSetTcpCorkRequest
11696    {
11697        #[inline(always)]
11698        fn new_empty() -> Self {
11699            Self { value: fidl::new_empty!(bool, D) }
11700        }
11701
11702        #[inline]
11703        unsafe fn decode(
11704            &mut self,
11705            decoder: &mut fidl::encoding::Decoder<'_, D>,
11706            offset: usize,
11707            _depth: fidl::encoding::Depth,
11708        ) -> fidl::Result<()> {
11709            decoder.debug_check_bounds::<Self>(offset);
11710            // Verify that padding bytes are zero.
11711            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
11712            Ok(())
11713        }
11714    }
11715
11716    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11717        type Borrowed<'a> = &'a Self;
11718        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11719            value
11720        }
11721    }
11722
11723    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11724        type Owned = Self;
11725
11726        #[inline(always)]
11727        fn inline_align(_context: fidl::encoding::Context) -> usize {
11728            4
11729        }
11730
11731        #[inline(always)]
11732        fn inline_size(_context: fidl::encoding::Context) -> usize {
11733            4
11734        }
11735        #[inline(always)]
11736        fn encode_is_copy() -> bool {
11737            true
11738        }
11739
11740        #[inline(always)]
11741        fn decode_is_copy() -> bool {
11742            true
11743        }
11744    }
11745
11746    unsafe impl<D: fidl::encoding::ResourceDialect>
11747        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D>
11748        for &StreamSocketSetTcpDeferAcceptRequest
11749    {
11750        #[inline]
11751        unsafe fn encode(
11752            self,
11753            encoder: &mut fidl::encoding::Encoder<'_, D>,
11754            offset: usize,
11755            _depth: fidl::encoding::Depth,
11756        ) -> fidl::Result<()> {
11757            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11758            unsafe {
11759                // Copy the object into the buffer.
11760                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11761                (buf_ptr as *mut StreamSocketSetTcpDeferAcceptRequest)
11762                    .write_unaligned((self as *const StreamSocketSetTcpDeferAcceptRequest).read());
11763                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11764                // done second because the memcpy will write garbage to these bytes.
11765            }
11766            Ok(())
11767        }
11768    }
11769    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11770        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D> for (T0,)
11771    {
11772        #[inline]
11773        unsafe fn encode(
11774            self,
11775            encoder: &mut fidl::encoding::Encoder<'_, D>,
11776            offset: usize,
11777            depth: fidl::encoding::Depth,
11778        ) -> fidl::Result<()> {
11779            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11780            // Zero out padding regions. There's no need to apply masks
11781            // because the unmasked parts will be overwritten by fields.
11782            // Write the fields.
11783            self.0.encode(encoder, offset + 0, depth)?;
11784            Ok(())
11785        }
11786    }
11787
11788    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11789        for StreamSocketSetTcpDeferAcceptRequest
11790    {
11791        #[inline(always)]
11792        fn new_empty() -> Self {
11793            Self { value_secs: fidl::new_empty!(u32, D) }
11794        }
11795
11796        #[inline]
11797        unsafe fn decode(
11798            &mut self,
11799            decoder: &mut fidl::encoding::Decoder<'_, D>,
11800            offset: usize,
11801            _depth: fidl::encoding::Depth,
11802        ) -> fidl::Result<()> {
11803            decoder.debug_check_bounds::<Self>(offset);
11804            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11805            // Verify that padding bytes are zero.
11806            // Copy from the buffer into the object.
11807            unsafe {
11808                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11809            }
11810            Ok(())
11811        }
11812    }
11813
11814    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11815        type Borrowed<'a> = &'a Self;
11816        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11817            value
11818        }
11819    }
11820
11821    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11822        type Owned = Self;
11823
11824        #[inline(always)]
11825        fn inline_align(_context: fidl::encoding::Context) -> usize {
11826            4
11827        }
11828
11829        #[inline(always)]
11830        fn inline_size(_context: fidl::encoding::Context) -> usize {
11831            4
11832        }
11833        #[inline(always)]
11834        fn encode_is_copy() -> bool {
11835            true
11836        }
11837
11838        #[inline(always)]
11839        fn decode_is_copy() -> bool {
11840            true
11841        }
11842    }
11843
11844    unsafe impl<D: fidl::encoding::ResourceDialect>
11845        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D>
11846        for &StreamSocketSetTcpKeepAliveCountRequest
11847    {
11848        #[inline]
11849        unsafe fn encode(
11850            self,
11851            encoder: &mut fidl::encoding::Encoder<'_, D>,
11852            offset: usize,
11853            _depth: fidl::encoding::Depth,
11854        ) -> fidl::Result<()> {
11855            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11856            unsafe {
11857                // Copy the object into the buffer.
11858                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11859                (buf_ptr as *mut StreamSocketSetTcpKeepAliveCountRequest).write_unaligned(
11860                    (self as *const StreamSocketSetTcpKeepAliveCountRequest).read(),
11861                );
11862                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11863                // done second because the memcpy will write garbage to these bytes.
11864            }
11865            Ok(())
11866        }
11867    }
11868    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11869        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D> for (T0,)
11870    {
11871        #[inline]
11872        unsafe fn encode(
11873            self,
11874            encoder: &mut fidl::encoding::Encoder<'_, D>,
11875            offset: usize,
11876            depth: fidl::encoding::Depth,
11877        ) -> fidl::Result<()> {
11878            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11879            // Zero out padding regions. There's no need to apply masks
11880            // because the unmasked parts will be overwritten by fields.
11881            // Write the fields.
11882            self.0.encode(encoder, offset + 0, depth)?;
11883            Ok(())
11884        }
11885    }
11886
11887    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11888        for StreamSocketSetTcpKeepAliveCountRequest
11889    {
11890        #[inline(always)]
11891        fn new_empty() -> Self {
11892            Self { value: fidl::new_empty!(u32, D) }
11893        }
11894
11895        #[inline]
11896        unsafe fn decode(
11897            &mut self,
11898            decoder: &mut fidl::encoding::Decoder<'_, D>,
11899            offset: usize,
11900            _depth: fidl::encoding::Depth,
11901        ) -> fidl::Result<()> {
11902            decoder.debug_check_bounds::<Self>(offset);
11903            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11904            // Verify that padding bytes are zero.
11905            // Copy from the buffer into the object.
11906            unsafe {
11907                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11908            }
11909            Ok(())
11910        }
11911    }
11912
11913    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11914        type Borrowed<'a> = &'a Self;
11915        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11916            value
11917        }
11918    }
11919
11920    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11921        type Owned = Self;
11922
11923        #[inline(always)]
11924        fn inline_align(_context: fidl::encoding::Context) -> usize {
11925            4
11926        }
11927
11928        #[inline(always)]
11929        fn inline_size(_context: fidl::encoding::Context) -> usize {
11930            4
11931        }
11932        #[inline(always)]
11933        fn encode_is_copy() -> bool {
11934            true
11935        }
11936
11937        #[inline(always)]
11938        fn decode_is_copy() -> bool {
11939            true
11940        }
11941    }
11942
11943    unsafe impl<D: fidl::encoding::ResourceDialect>
11944        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D>
11945        for &StreamSocketSetTcpKeepAliveIdleRequest
11946    {
11947        #[inline]
11948        unsafe fn encode(
11949            self,
11950            encoder: &mut fidl::encoding::Encoder<'_, D>,
11951            offset: usize,
11952            _depth: fidl::encoding::Depth,
11953        ) -> fidl::Result<()> {
11954            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11955            unsafe {
11956                // Copy the object into the buffer.
11957                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11958                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIdleRequest).write_unaligned(
11959                    (self as *const StreamSocketSetTcpKeepAliveIdleRequest).read(),
11960                );
11961                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11962                // done second because the memcpy will write garbage to these bytes.
11963            }
11964            Ok(())
11965        }
11966    }
11967    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11968        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D> for (T0,)
11969    {
11970        #[inline]
11971        unsafe fn encode(
11972            self,
11973            encoder: &mut fidl::encoding::Encoder<'_, D>,
11974            offset: usize,
11975            depth: fidl::encoding::Depth,
11976        ) -> fidl::Result<()> {
11977            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11978            // Zero out padding regions. There's no need to apply masks
11979            // because the unmasked parts will be overwritten by fields.
11980            // Write the fields.
11981            self.0.encode(encoder, offset + 0, depth)?;
11982            Ok(())
11983        }
11984    }
11985
11986    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11987        for StreamSocketSetTcpKeepAliveIdleRequest
11988    {
11989        #[inline(always)]
11990        fn new_empty() -> Self {
11991            Self { value_secs: fidl::new_empty!(u32, D) }
11992        }
11993
11994        #[inline]
11995        unsafe fn decode(
11996            &mut self,
11997            decoder: &mut fidl::encoding::Decoder<'_, D>,
11998            offset: usize,
11999            _depth: fidl::encoding::Depth,
12000        ) -> fidl::Result<()> {
12001            decoder.debug_check_bounds::<Self>(offset);
12002            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12003            // Verify that padding bytes are zero.
12004            // Copy from the buffer into the object.
12005            unsafe {
12006                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12007            }
12008            Ok(())
12009        }
12010    }
12011
12012    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
12013        type Borrowed<'a> = &'a Self;
12014        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12015            value
12016        }
12017    }
12018
12019    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
12020        type Owned = Self;
12021
12022        #[inline(always)]
12023        fn inline_align(_context: fidl::encoding::Context) -> usize {
12024            4
12025        }
12026
12027        #[inline(always)]
12028        fn inline_size(_context: fidl::encoding::Context) -> usize {
12029            4
12030        }
12031        #[inline(always)]
12032        fn encode_is_copy() -> bool {
12033            true
12034        }
12035
12036        #[inline(always)]
12037        fn decode_is_copy() -> bool {
12038            true
12039        }
12040    }
12041
12042    unsafe impl<D: fidl::encoding::ResourceDialect>
12043        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D>
12044        for &StreamSocketSetTcpKeepAliveIntervalRequest
12045    {
12046        #[inline]
12047        unsafe fn encode(
12048            self,
12049            encoder: &mut fidl::encoding::Encoder<'_, D>,
12050            offset: usize,
12051            _depth: fidl::encoding::Depth,
12052        ) -> fidl::Result<()> {
12053            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
12054            unsafe {
12055                // Copy the object into the buffer.
12056                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12057                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIntervalRequest).write_unaligned(
12058                    (self as *const StreamSocketSetTcpKeepAliveIntervalRequest).read(),
12059                );
12060                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12061                // done second because the memcpy will write garbage to these bytes.
12062            }
12063            Ok(())
12064        }
12065    }
12066    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12067        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D> for (T0,)
12068    {
12069        #[inline]
12070        unsafe fn encode(
12071            self,
12072            encoder: &mut fidl::encoding::Encoder<'_, D>,
12073            offset: usize,
12074            depth: fidl::encoding::Depth,
12075        ) -> fidl::Result<()> {
12076            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
12077            // Zero out padding regions. There's no need to apply masks
12078            // because the unmasked parts will be overwritten by fields.
12079            // Write the fields.
12080            self.0.encode(encoder, offset + 0, depth)?;
12081            Ok(())
12082        }
12083    }
12084
12085    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12086        for StreamSocketSetTcpKeepAliveIntervalRequest
12087    {
12088        #[inline(always)]
12089        fn new_empty() -> Self {
12090            Self { value_secs: fidl::new_empty!(u32, D) }
12091        }
12092
12093        #[inline]
12094        unsafe fn decode(
12095            &mut self,
12096            decoder: &mut fidl::encoding::Decoder<'_, D>,
12097            offset: usize,
12098            _depth: fidl::encoding::Depth,
12099        ) -> fidl::Result<()> {
12100            decoder.debug_check_bounds::<Self>(offset);
12101            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12102            // Verify that padding bytes are zero.
12103            // Copy from the buffer into the object.
12104            unsafe {
12105                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12106            }
12107            Ok(())
12108        }
12109    }
12110
12111    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpLingerRequest {
12112        type Borrowed<'a> = &'a Self;
12113        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12114            value
12115        }
12116    }
12117
12118    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpLingerRequest {
12119        type Owned = Self;
12120
12121        #[inline(always)]
12122        fn inline_align(_context: fidl::encoding::Context) -> usize {
12123            8
12124        }
12125
12126        #[inline(always)]
12127        fn inline_size(_context: fidl::encoding::Context) -> usize {
12128            16
12129        }
12130    }
12131
12132    unsafe impl<D: fidl::encoding::ResourceDialect>
12133        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D>
12134        for &StreamSocketSetTcpLingerRequest
12135    {
12136        #[inline]
12137        unsafe fn encode(
12138            self,
12139            encoder: &mut fidl::encoding::Encoder<'_, D>,
12140            offset: usize,
12141            _depth: fidl::encoding::Depth,
12142        ) -> fidl::Result<()> {
12143            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12144            // Delegate to tuple encoding.
12145            fidl::encoding::Encode::<StreamSocketSetTcpLingerRequest, D>::encode(
12146                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
12147                encoder,
12148                offset,
12149                _depth,
12150            )
12151        }
12152    }
12153    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
12154        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D> for (T0,)
12155    {
12156        #[inline]
12157        unsafe fn encode(
12158            self,
12159            encoder: &mut fidl::encoding::Encoder<'_, D>,
12160            offset: usize,
12161            depth: fidl::encoding::Depth,
12162        ) -> fidl::Result<()> {
12163            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12164            // Zero out padding regions. There's no need to apply masks
12165            // because the unmasked parts will be overwritten by fields.
12166            // Write the fields.
12167            self.0.encode(encoder, offset + 0, depth)?;
12168            Ok(())
12169        }
12170    }
12171
12172    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12173        for StreamSocketSetTcpLingerRequest
12174    {
12175        #[inline(always)]
12176        fn new_empty() -> Self {
12177            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
12178        }
12179
12180        #[inline]
12181        unsafe fn decode(
12182            &mut self,
12183            decoder: &mut fidl::encoding::Decoder<'_, D>,
12184            offset: usize,
12185            _depth: fidl::encoding::Depth,
12186        ) -> fidl::Result<()> {
12187            decoder.debug_check_bounds::<Self>(offset);
12188            // Verify that padding bytes are zero.
12189            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
12190            Ok(())
12191        }
12192    }
12193
12194    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12195        type Borrowed<'a> = &'a Self;
12196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12197            value
12198        }
12199    }
12200
12201    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12202        type Owned = Self;
12203
12204        #[inline(always)]
12205        fn inline_align(_context: fidl::encoding::Context) -> usize {
12206            4
12207        }
12208
12209        #[inline(always)]
12210        fn inline_size(_context: fidl::encoding::Context) -> usize {
12211            4
12212        }
12213        #[inline(always)]
12214        fn encode_is_copy() -> bool {
12215            true
12216        }
12217
12218        #[inline(always)]
12219        fn decode_is_copy() -> bool {
12220            true
12221        }
12222    }
12223
12224    unsafe impl<D: fidl::encoding::ResourceDialect>
12225        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D>
12226        for &StreamSocketSetTcpMaxSegmentRequest
12227    {
12228        #[inline]
12229        unsafe fn encode(
12230            self,
12231            encoder: &mut fidl::encoding::Encoder<'_, D>,
12232            offset: usize,
12233            _depth: fidl::encoding::Depth,
12234        ) -> fidl::Result<()> {
12235            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12236            unsafe {
12237                // Copy the object into the buffer.
12238                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12239                (buf_ptr as *mut StreamSocketSetTcpMaxSegmentRequest)
12240                    .write_unaligned((self as *const StreamSocketSetTcpMaxSegmentRequest).read());
12241                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12242                // done second because the memcpy will write garbage to these bytes.
12243            }
12244            Ok(())
12245        }
12246    }
12247    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12248        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D> for (T0,)
12249    {
12250        #[inline]
12251        unsafe fn encode(
12252            self,
12253            encoder: &mut fidl::encoding::Encoder<'_, D>,
12254            offset: usize,
12255            depth: fidl::encoding::Depth,
12256        ) -> fidl::Result<()> {
12257            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12258            // Zero out padding regions. There's no need to apply masks
12259            // because the unmasked parts will be overwritten by fields.
12260            // Write the fields.
12261            self.0.encode(encoder, offset + 0, depth)?;
12262            Ok(())
12263        }
12264    }
12265
12266    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12267        for StreamSocketSetTcpMaxSegmentRequest
12268    {
12269        #[inline(always)]
12270        fn new_empty() -> Self {
12271            Self { value_bytes: fidl::new_empty!(u32, D) }
12272        }
12273
12274        #[inline]
12275        unsafe fn decode(
12276            &mut self,
12277            decoder: &mut fidl::encoding::Decoder<'_, D>,
12278            offset: usize,
12279            _depth: fidl::encoding::Depth,
12280        ) -> fidl::Result<()> {
12281            decoder.debug_check_bounds::<Self>(offset);
12282            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12283            // Verify that padding bytes are zero.
12284            // Copy from the buffer into the object.
12285            unsafe {
12286                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12287            }
12288            Ok(())
12289        }
12290    }
12291
12292    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpNoDelayRequest {
12293        type Borrowed<'a> = &'a Self;
12294        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12295            value
12296        }
12297    }
12298
12299    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpNoDelayRequest {
12300        type Owned = Self;
12301
12302        #[inline(always)]
12303        fn inline_align(_context: fidl::encoding::Context) -> usize {
12304            1
12305        }
12306
12307        #[inline(always)]
12308        fn inline_size(_context: fidl::encoding::Context) -> usize {
12309            1
12310        }
12311    }
12312
12313    unsafe impl<D: fidl::encoding::ResourceDialect>
12314        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D>
12315        for &StreamSocketSetTcpNoDelayRequest
12316    {
12317        #[inline]
12318        unsafe fn encode(
12319            self,
12320            encoder: &mut fidl::encoding::Encoder<'_, D>,
12321            offset: usize,
12322            _depth: fidl::encoding::Depth,
12323        ) -> fidl::Result<()> {
12324            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12325            // Delegate to tuple encoding.
12326            fidl::encoding::Encode::<StreamSocketSetTcpNoDelayRequest, D>::encode(
12327                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12328                encoder,
12329                offset,
12330                _depth,
12331            )
12332        }
12333    }
12334    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12335        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D> for (T0,)
12336    {
12337        #[inline]
12338        unsafe fn encode(
12339            self,
12340            encoder: &mut fidl::encoding::Encoder<'_, D>,
12341            offset: usize,
12342            depth: fidl::encoding::Depth,
12343        ) -> fidl::Result<()> {
12344            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12345            // Zero out padding regions. There's no need to apply masks
12346            // because the unmasked parts will be overwritten by fields.
12347            // Write the fields.
12348            self.0.encode(encoder, offset + 0, depth)?;
12349            Ok(())
12350        }
12351    }
12352
12353    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12354        for StreamSocketSetTcpNoDelayRequest
12355    {
12356        #[inline(always)]
12357        fn new_empty() -> Self {
12358            Self { value: fidl::new_empty!(bool, D) }
12359        }
12360
12361        #[inline]
12362        unsafe fn decode(
12363            &mut self,
12364            decoder: &mut fidl::encoding::Decoder<'_, D>,
12365            offset: usize,
12366            _depth: fidl::encoding::Depth,
12367        ) -> fidl::Result<()> {
12368            decoder.debug_check_bounds::<Self>(offset);
12369            // Verify that padding bytes are zero.
12370            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12371            Ok(())
12372        }
12373    }
12374
12375    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpQuickAckRequest {
12376        type Borrowed<'a> = &'a Self;
12377        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12378            value
12379        }
12380    }
12381
12382    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpQuickAckRequest {
12383        type Owned = Self;
12384
12385        #[inline(always)]
12386        fn inline_align(_context: fidl::encoding::Context) -> usize {
12387            1
12388        }
12389
12390        #[inline(always)]
12391        fn inline_size(_context: fidl::encoding::Context) -> usize {
12392            1
12393        }
12394    }
12395
12396    unsafe impl<D: fidl::encoding::ResourceDialect>
12397        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D>
12398        for &StreamSocketSetTcpQuickAckRequest
12399    {
12400        #[inline]
12401        unsafe fn encode(
12402            self,
12403            encoder: &mut fidl::encoding::Encoder<'_, D>,
12404            offset: usize,
12405            _depth: fidl::encoding::Depth,
12406        ) -> fidl::Result<()> {
12407            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12408            // Delegate to tuple encoding.
12409            fidl::encoding::Encode::<StreamSocketSetTcpQuickAckRequest, D>::encode(
12410                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12411                encoder,
12412                offset,
12413                _depth,
12414            )
12415        }
12416    }
12417    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12418        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D> for (T0,)
12419    {
12420        #[inline]
12421        unsafe fn encode(
12422            self,
12423            encoder: &mut fidl::encoding::Encoder<'_, D>,
12424            offset: usize,
12425            depth: fidl::encoding::Depth,
12426        ) -> fidl::Result<()> {
12427            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12428            // Zero out padding regions. There's no need to apply masks
12429            // because the unmasked parts will be overwritten by fields.
12430            // Write the fields.
12431            self.0.encode(encoder, offset + 0, depth)?;
12432            Ok(())
12433        }
12434    }
12435
12436    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12437        for StreamSocketSetTcpQuickAckRequest
12438    {
12439        #[inline(always)]
12440        fn new_empty() -> Self {
12441            Self { value: fidl::new_empty!(bool, D) }
12442        }
12443
12444        #[inline]
12445        unsafe fn decode(
12446            &mut self,
12447            decoder: &mut fidl::encoding::Decoder<'_, D>,
12448            offset: usize,
12449            _depth: fidl::encoding::Depth,
12450        ) -> fidl::Result<()> {
12451            decoder.debug_check_bounds::<Self>(offset);
12452            // Verify that padding bytes are zero.
12453            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12454            Ok(())
12455        }
12456    }
12457
12458    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpSynCountRequest {
12459        type Borrowed<'a> = &'a Self;
12460        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12461            value
12462        }
12463    }
12464
12465    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpSynCountRequest {
12466        type Owned = Self;
12467
12468        #[inline(always)]
12469        fn inline_align(_context: fidl::encoding::Context) -> usize {
12470            4
12471        }
12472
12473        #[inline(always)]
12474        fn inline_size(_context: fidl::encoding::Context) -> usize {
12475            4
12476        }
12477        #[inline(always)]
12478        fn encode_is_copy() -> bool {
12479            true
12480        }
12481
12482        #[inline(always)]
12483        fn decode_is_copy() -> bool {
12484            true
12485        }
12486    }
12487
12488    unsafe impl<D: fidl::encoding::ResourceDialect>
12489        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D>
12490        for &StreamSocketSetTcpSynCountRequest
12491    {
12492        #[inline]
12493        unsafe fn encode(
12494            self,
12495            encoder: &mut fidl::encoding::Encoder<'_, D>,
12496            offset: usize,
12497            _depth: fidl::encoding::Depth,
12498        ) -> fidl::Result<()> {
12499            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12500            unsafe {
12501                // Copy the object into the buffer.
12502                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12503                (buf_ptr as *mut StreamSocketSetTcpSynCountRequest)
12504                    .write_unaligned((self as *const StreamSocketSetTcpSynCountRequest).read());
12505                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12506                // done second because the memcpy will write garbage to these bytes.
12507            }
12508            Ok(())
12509        }
12510    }
12511    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12512        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D> for (T0,)
12513    {
12514        #[inline]
12515        unsafe fn encode(
12516            self,
12517            encoder: &mut fidl::encoding::Encoder<'_, D>,
12518            offset: usize,
12519            depth: fidl::encoding::Depth,
12520        ) -> fidl::Result<()> {
12521            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12522            // Zero out padding regions. There's no need to apply masks
12523            // because the unmasked parts will be overwritten by fields.
12524            // Write the fields.
12525            self.0.encode(encoder, offset + 0, depth)?;
12526            Ok(())
12527        }
12528    }
12529
12530    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12531        for StreamSocketSetTcpSynCountRequest
12532    {
12533        #[inline(always)]
12534        fn new_empty() -> Self {
12535            Self { value: fidl::new_empty!(u32, D) }
12536        }
12537
12538        #[inline]
12539        unsafe fn decode(
12540            &mut self,
12541            decoder: &mut fidl::encoding::Decoder<'_, D>,
12542            offset: usize,
12543            _depth: fidl::encoding::Depth,
12544        ) -> fidl::Result<()> {
12545            decoder.debug_check_bounds::<Self>(offset);
12546            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12547            // Verify that padding bytes are zero.
12548            // Copy from the buffer into the object.
12549            unsafe {
12550                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12551            }
12552            Ok(())
12553        }
12554    }
12555
12556    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12557        type Borrowed<'a> = &'a Self;
12558        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12559            value
12560        }
12561    }
12562
12563    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12564        type Owned = Self;
12565
12566        #[inline(always)]
12567        fn inline_align(_context: fidl::encoding::Context) -> usize {
12568            4
12569        }
12570
12571        #[inline(always)]
12572        fn inline_size(_context: fidl::encoding::Context) -> usize {
12573            4
12574        }
12575        #[inline(always)]
12576        fn encode_is_copy() -> bool {
12577            true
12578        }
12579
12580        #[inline(always)]
12581        fn decode_is_copy() -> bool {
12582            true
12583        }
12584    }
12585
12586    unsafe impl<D: fidl::encoding::ResourceDialect>
12587        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D>
12588        for &StreamSocketSetTcpUserTimeoutRequest
12589    {
12590        #[inline]
12591        unsafe fn encode(
12592            self,
12593            encoder: &mut fidl::encoding::Encoder<'_, D>,
12594            offset: usize,
12595            _depth: fidl::encoding::Depth,
12596        ) -> fidl::Result<()> {
12597            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12598            unsafe {
12599                // Copy the object into the buffer.
12600                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12601                (buf_ptr as *mut StreamSocketSetTcpUserTimeoutRequest)
12602                    .write_unaligned((self as *const StreamSocketSetTcpUserTimeoutRequest).read());
12603                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12604                // done second because the memcpy will write garbage to these bytes.
12605            }
12606            Ok(())
12607        }
12608    }
12609    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12610        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D> for (T0,)
12611    {
12612        #[inline]
12613        unsafe fn encode(
12614            self,
12615            encoder: &mut fidl::encoding::Encoder<'_, D>,
12616            offset: usize,
12617            depth: fidl::encoding::Depth,
12618        ) -> fidl::Result<()> {
12619            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12620            // Zero out padding regions. There's no need to apply masks
12621            // because the unmasked parts will be overwritten by fields.
12622            // Write the fields.
12623            self.0.encode(encoder, offset + 0, depth)?;
12624            Ok(())
12625        }
12626    }
12627
12628    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12629        for StreamSocketSetTcpUserTimeoutRequest
12630    {
12631        #[inline(always)]
12632        fn new_empty() -> Self {
12633            Self { value_millis: fidl::new_empty!(u32, D) }
12634        }
12635
12636        #[inline]
12637        unsafe fn decode(
12638            &mut self,
12639            decoder: &mut fidl::encoding::Decoder<'_, D>,
12640            offset: usize,
12641            _depth: fidl::encoding::Depth,
12642        ) -> fidl::Result<()> {
12643            decoder.debug_check_bounds::<Self>(offset);
12644            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12645            // Verify that padding bytes are zero.
12646            // Copy from the buffer into the object.
12647            unsafe {
12648                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12649            }
12650            Ok(())
12651        }
12652    }
12653
12654    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpWindowClampRequest {
12655        type Borrowed<'a> = &'a Self;
12656        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12657            value
12658        }
12659    }
12660
12661    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpWindowClampRequest {
12662        type Owned = Self;
12663
12664        #[inline(always)]
12665        fn inline_align(_context: fidl::encoding::Context) -> usize {
12666            4
12667        }
12668
12669        #[inline(always)]
12670        fn inline_size(_context: fidl::encoding::Context) -> usize {
12671            4
12672        }
12673        #[inline(always)]
12674        fn encode_is_copy() -> bool {
12675            true
12676        }
12677
12678        #[inline(always)]
12679        fn decode_is_copy() -> bool {
12680            true
12681        }
12682    }
12683
12684    unsafe impl<D: fidl::encoding::ResourceDialect>
12685        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D>
12686        for &StreamSocketSetTcpWindowClampRequest
12687    {
12688        #[inline]
12689        unsafe fn encode(
12690            self,
12691            encoder: &mut fidl::encoding::Encoder<'_, D>,
12692            offset: usize,
12693            _depth: fidl::encoding::Depth,
12694        ) -> fidl::Result<()> {
12695            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12696            unsafe {
12697                // Copy the object into the buffer.
12698                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12699                (buf_ptr as *mut StreamSocketSetTcpWindowClampRequest)
12700                    .write_unaligned((self as *const StreamSocketSetTcpWindowClampRequest).read());
12701                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12702                // done second because the memcpy will write garbage to these bytes.
12703            }
12704            Ok(())
12705        }
12706    }
12707    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12708        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D> for (T0,)
12709    {
12710        #[inline]
12711        unsafe fn encode(
12712            self,
12713            encoder: &mut fidl::encoding::Encoder<'_, D>,
12714            offset: usize,
12715            depth: fidl::encoding::Depth,
12716        ) -> fidl::Result<()> {
12717            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12718            // Zero out padding regions. There's no need to apply masks
12719            // because the unmasked parts will be overwritten by fields.
12720            // Write the fields.
12721            self.0.encode(encoder, offset + 0, depth)?;
12722            Ok(())
12723        }
12724    }
12725
12726    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12727        for StreamSocketSetTcpWindowClampRequest
12728    {
12729        #[inline(always)]
12730        fn new_empty() -> Self {
12731            Self { value: fidl::new_empty!(u32, D) }
12732        }
12733
12734        #[inline]
12735        unsafe fn decode(
12736            &mut self,
12737            decoder: &mut fidl::encoding::Decoder<'_, D>,
12738            offset: usize,
12739            _depth: fidl::encoding::Depth,
12740        ) -> fidl::Result<()> {
12741            decoder.debug_check_bounds::<Self>(offset);
12742            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12743            // Verify that padding bytes are zero.
12744            // Copy from the buffer into the object.
12745            unsafe {
12746                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12747            }
12748            Ok(())
12749        }
12750    }
12751
12752    impl fidl::encoding::ValueTypeMarker for StreamSocketGetInfoResponse {
12753        type Borrowed<'a> = &'a Self;
12754        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12755            value
12756        }
12757    }
12758
12759    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetInfoResponse {
12760        type Owned = Self;
12761
12762        #[inline(always)]
12763        fn inline_align(_context: fidl::encoding::Context) -> usize {
12764            4
12765        }
12766
12767        #[inline(always)]
12768        fn inline_size(_context: fidl::encoding::Context) -> usize {
12769            8
12770        }
12771    }
12772
12773    unsafe impl<D: fidl::encoding::ResourceDialect>
12774        fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for &StreamSocketGetInfoResponse
12775    {
12776        #[inline]
12777        unsafe fn encode(
12778            self,
12779            encoder: &mut fidl::encoding::Encoder<'_, D>,
12780            offset: usize,
12781            _depth: fidl::encoding::Depth,
12782        ) -> fidl::Result<()> {
12783            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12784            // Delegate to tuple encoding.
12785            fidl::encoding::Encode::<StreamSocketGetInfoResponse, D>::encode(
12786                (
12787                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
12788                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
12789                ),
12790                encoder,
12791                offset,
12792                _depth,
12793            )
12794        }
12795    }
12796    unsafe impl<
12797        D: fidl::encoding::ResourceDialect,
12798        T0: fidl::encoding::Encode<Domain, D>,
12799        T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
12800    > fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for (T0, T1)
12801    {
12802        #[inline]
12803        unsafe fn encode(
12804            self,
12805            encoder: &mut fidl::encoding::Encoder<'_, D>,
12806            offset: usize,
12807            depth: fidl::encoding::Depth,
12808        ) -> fidl::Result<()> {
12809            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12810            // Zero out padding regions. There's no need to apply masks
12811            // because the unmasked parts will be overwritten by fields.
12812            unsafe {
12813                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12814                (ptr as *mut u32).write_unaligned(0);
12815            }
12816            // Write the fields.
12817            self.0.encode(encoder, offset + 0, depth)?;
12818            self.1.encode(encoder, offset + 4, depth)?;
12819            Ok(())
12820        }
12821    }
12822
12823    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12824        for StreamSocketGetInfoResponse
12825    {
12826        #[inline(always)]
12827        fn new_empty() -> Self {
12828            Self {
12829                domain: fidl::new_empty!(Domain, D),
12830                proto: fidl::new_empty!(StreamSocketProtocol, D),
12831            }
12832        }
12833
12834        #[inline]
12835        unsafe fn decode(
12836            &mut self,
12837            decoder: &mut fidl::encoding::Decoder<'_, D>,
12838            offset: usize,
12839            _depth: fidl::encoding::Depth,
12840        ) -> fidl::Result<()> {
12841            decoder.debug_check_bounds::<Self>(offset);
12842            // Verify that padding bytes are zero.
12843            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12844            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12845            let mask = 0xffff0000u32;
12846            let maskedval = padval & mask;
12847            if maskedval != 0 {
12848                return Err(fidl::Error::NonZeroPadding {
12849                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12850                });
12851            }
12852            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
12853            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
12854            Ok(())
12855        }
12856    }
12857
12858    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCongestionResponse {
12859        type Borrowed<'a> = &'a Self;
12860        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12861            value
12862        }
12863    }
12864
12865    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCongestionResponse {
12866        type Owned = Self;
12867
12868        #[inline(always)]
12869        fn inline_align(_context: fidl::encoding::Context) -> usize {
12870            4
12871        }
12872
12873        #[inline(always)]
12874        fn inline_size(_context: fidl::encoding::Context) -> usize {
12875            4
12876        }
12877    }
12878
12879    unsafe impl<D: fidl::encoding::ResourceDialect>
12880        fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D>
12881        for &StreamSocketGetTcpCongestionResponse
12882    {
12883        #[inline]
12884        unsafe fn encode(
12885            self,
12886            encoder: &mut fidl::encoding::Encoder<'_, D>,
12887            offset: usize,
12888            _depth: fidl::encoding::Depth,
12889        ) -> fidl::Result<()> {
12890            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12891            // Delegate to tuple encoding.
12892            fidl::encoding::Encode::<StreamSocketGetTcpCongestionResponse, D>::encode(
12893                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12894                encoder,
12895                offset,
12896                _depth,
12897            )
12898        }
12899    }
12900    unsafe impl<
12901        D: fidl::encoding::ResourceDialect,
12902        T0: fidl::encoding::Encode<TcpCongestionControl, D>,
12903    > fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D> for (T0,)
12904    {
12905        #[inline]
12906        unsafe fn encode(
12907            self,
12908            encoder: &mut fidl::encoding::Encoder<'_, D>,
12909            offset: usize,
12910            depth: fidl::encoding::Depth,
12911        ) -> fidl::Result<()> {
12912            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12913            // Zero out padding regions. There's no need to apply masks
12914            // because the unmasked parts will be overwritten by fields.
12915            // Write the fields.
12916            self.0.encode(encoder, offset + 0, depth)?;
12917            Ok(())
12918        }
12919    }
12920
12921    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12922        for StreamSocketGetTcpCongestionResponse
12923    {
12924        #[inline(always)]
12925        fn new_empty() -> Self {
12926            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
12927        }
12928
12929        #[inline]
12930        unsafe fn decode(
12931            &mut self,
12932            decoder: &mut fidl::encoding::Decoder<'_, D>,
12933            offset: usize,
12934            _depth: fidl::encoding::Depth,
12935        ) -> fidl::Result<()> {
12936            decoder.debug_check_bounds::<Self>(offset);
12937            // Verify that padding bytes are zero.
12938            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
12939            Ok(())
12940        }
12941    }
12942
12943    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCorkResponse {
12944        type Borrowed<'a> = &'a Self;
12945        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12946            value
12947        }
12948    }
12949
12950    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCorkResponse {
12951        type Owned = Self;
12952
12953        #[inline(always)]
12954        fn inline_align(_context: fidl::encoding::Context) -> usize {
12955            1
12956        }
12957
12958        #[inline(always)]
12959        fn inline_size(_context: fidl::encoding::Context) -> usize {
12960            1
12961        }
12962    }
12963
12964    unsafe impl<D: fidl::encoding::ResourceDialect>
12965        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D>
12966        for &StreamSocketGetTcpCorkResponse
12967    {
12968        #[inline]
12969        unsafe fn encode(
12970            self,
12971            encoder: &mut fidl::encoding::Encoder<'_, D>,
12972            offset: usize,
12973            _depth: fidl::encoding::Depth,
12974        ) -> fidl::Result<()> {
12975            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12976            // Delegate to tuple encoding.
12977            fidl::encoding::Encode::<StreamSocketGetTcpCorkResponse, D>::encode(
12978                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12979                encoder,
12980                offset,
12981                _depth,
12982            )
12983        }
12984    }
12985    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12986        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D> for (T0,)
12987    {
12988        #[inline]
12989        unsafe fn encode(
12990            self,
12991            encoder: &mut fidl::encoding::Encoder<'_, D>,
12992            offset: usize,
12993            depth: fidl::encoding::Depth,
12994        ) -> fidl::Result<()> {
12995            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12996            // Zero out padding regions. There's no need to apply masks
12997            // because the unmasked parts will be overwritten by fields.
12998            // Write the fields.
12999            self.0.encode(encoder, offset + 0, depth)?;
13000            Ok(())
13001        }
13002    }
13003
13004    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13005        for StreamSocketGetTcpCorkResponse
13006    {
13007        #[inline(always)]
13008        fn new_empty() -> Self {
13009            Self { value: fidl::new_empty!(bool, D) }
13010        }
13011
13012        #[inline]
13013        unsafe fn decode(
13014            &mut self,
13015            decoder: &mut fidl::encoding::Decoder<'_, D>,
13016            offset: usize,
13017            _depth: fidl::encoding::Depth,
13018        ) -> fidl::Result<()> {
13019            decoder.debug_check_bounds::<Self>(offset);
13020            // Verify that padding bytes are zero.
13021            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13022            Ok(())
13023        }
13024    }
13025
13026    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpDeferAcceptResponse {
13027        type Borrowed<'a> = &'a Self;
13028        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13029            value
13030        }
13031    }
13032
13033    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpDeferAcceptResponse {
13034        type Owned = Self;
13035
13036        #[inline(always)]
13037        fn inline_align(_context: fidl::encoding::Context) -> usize {
13038            4
13039        }
13040
13041        #[inline(always)]
13042        fn inline_size(_context: fidl::encoding::Context) -> usize {
13043            4
13044        }
13045        #[inline(always)]
13046        fn encode_is_copy() -> bool {
13047            true
13048        }
13049
13050        #[inline(always)]
13051        fn decode_is_copy() -> bool {
13052            true
13053        }
13054    }
13055
13056    unsafe impl<D: fidl::encoding::ResourceDialect>
13057        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D>
13058        for &StreamSocketGetTcpDeferAcceptResponse
13059    {
13060        #[inline]
13061        unsafe fn encode(
13062            self,
13063            encoder: &mut fidl::encoding::Encoder<'_, D>,
13064            offset: usize,
13065            _depth: fidl::encoding::Depth,
13066        ) -> fidl::Result<()> {
13067            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
13068            unsafe {
13069                // Copy the object into the buffer.
13070                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13071                (buf_ptr as *mut StreamSocketGetTcpDeferAcceptResponse)
13072                    .write_unaligned((self as *const StreamSocketGetTcpDeferAcceptResponse).read());
13073                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13074                // done second because the memcpy will write garbage to these bytes.
13075            }
13076            Ok(())
13077        }
13078    }
13079    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13080        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D> for (T0,)
13081    {
13082        #[inline]
13083        unsafe fn encode(
13084            self,
13085            encoder: &mut fidl::encoding::Encoder<'_, D>,
13086            offset: usize,
13087            depth: fidl::encoding::Depth,
13088        ) -> fidl::Result<()> {
13089            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
13090            // Zero out padding regions. There's no need to apply masks
13091            // because the unmasked parts will be overwritten by fields.
13092            // Write the fields.
13093            self.0.encode(encoder, offset + 0, depth)?;
13094            Ok(())
13095        }
13096    }
13097
13098    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13099        for StreamSocketGetTcpDeferAcceptResponse
13100    {
13101        #[inline(always)]
13102        fn new_empty() -> Self {
13103            Self { value_secs: fidl::new_empty!(u32, D) }
13104        }
13105
13106        #[inline]
13107        unsafe fn decode(
13108            &mut self,
13109            decoder: &mut fidl::encoding::Decoder<'_, D>,
13110            offset: usize,
13111            _depth: fidl::encoding::Depth,
13112        ) -> fidl::Result<()> {
13113            decoder.debug_check_bounds::<Self>(offset);
13114            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13115            // Verify that padding bytes are zero.
13116            // Copy from the buffer into the object.
13117            unsafe {
13118                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13119            }
13120            Ok(())
13121        }
13122    }
13123
13124    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpInfoResponse {
13125        type Borrowed<'a> = &'a Self;
13126        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13127            value
13128        }
13129    }
13130
13131    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpInfoResponse {
13132        type Owned = Self;
13133
13134        #[inline(always)]
13135        fn inline_align(_context: fidl::encoding::Context) -> usize {
13136            8
13137        }
13138
13139        #[inline(always)]
13140        fn inline_size(_context: fidl::encoding::Context) -> usize {
13141            16
13142        }
13143    }
13144
13145    unsafe impl<D: fidl::encoding::ResourceDialect>
13146        fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D>
13147        for &StreamSocketGetTcpInfoResponse
13148    {
13149        #[inline]
13150        unsafe fn encode(
13151            self,
13152            encoder: &mut fidl::encoding::Encoder<'_, D>,
13153            offset: usize,
13154            _depth: fidl::encoding::Depth,
13155        ) -> fidl::Result<()> {
13156            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13157            // Delegate to tuple encoding.
13158            fidl::encoding::Encode::<StreamSocketGetTcpInfoResponse, D>::encode(
13159                (<fidl_fuchsia_net_tcp_common::Info as fidl::encoding::ValueTypeMarker>::borrow(
13160                    &self.info,
13161                ),),
13162                encoder,
13163                offset,
13164                _depth,
13165            )
13166        }
13167    }
13168    unsafe impl<
13169        D: fidl::encoding::ResourceDialect,
13170        T0: fidl::encoding::Encode<fidl_fuchsia_net_tcp_common::Info, D>,
13171    > fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D> for (T0,)
13172    {
13173        #[inline]
13174        unsafe fn encode(
13175            self,
13176            encoder: &mut fidl::encoding::Encoder<'_, D>,
13177            offset: usize,
13178            depth: fidl::encoding::Depth,
13179        ) -> fidl::Result<()> {
13180            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13181            // Zero out padding regions. There's no need to apply masks
13182            // because the unmasked parts will be overwritten by fields.
13183            // Write the fields.
13184            self.0.encode(encoder, offset + 0, depth)?;
13185            Ok(())
13186        }
13187    }
13188
13189    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13190        for StreamSocketGetTcpInfoResponse
13191    {
13192        #[inline(always)]
13193        fn new_empty() -> Self {
13194            Self { info: fidl::new_empty!(fidl_fuchsia_net_tcp_common::Info, D) }
13195        }
13196
13197        #[inline]
13198        unsafe fn decode(
13199            &mut self,
13200            decoder: &mut fidl::encoding::Decoder<'_, D>,
13201            offset: usize,
13202            _depth: fidl::encoding::Depth,
13203        ) -> fidl::Result<()> {
13204            decoder.debug_check_bounds::<Self>(offset);
13205            // Verify that padding bytes are zero.
13206            fidl::decode!(
13207                fidl_fuchsia_net_tcp_common::Info,
13208                D,
13209                &mut self.info,
13210                decoder,
13211                offset + 0,
13212                _depth
13213            )?;
13214            Ok(())
13215        }
13216    }
13217
13218    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13219        type Borrowed<'a> = &'a Self;
13220        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13221            value
13222        }
13223    }
13224
13225    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13226        type Owned = Self;
13227
13228        #[inline(always)]
13229        fn inline_align(_context: fidl::encoding::Context) -> usize {
13230            4
13231        }
13232
13233        #[inline(always)]
13234        fn inline_size(_context: fidl::encoding::Context) -> usize {
13235            4
13236        }
13237        #[inline(always)]
13238        fn encode_is_copy() -> bool {
13239            true
13240        }
13241
13242        #[inline(always)]
13243        fn decode_is_copy() -> bool {
13244            true
13245        }
13246    }
13247
13248    unsafe impl<D: fidl::encoding::ResourceDialect>
13249        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D>
13250        for &StreamSocketGetTcpKeepAliveCountResponse
13251    {
13252        #[inline]
13253        unsafe fn encode(
13254            self,
13255            encoder: &mut fidl::encoding::Encoder<'_, D>,
13256            offset: usize,
13257            _depth: fidl::encoding::Depth,
13258        ) -> fidl::Result<()> {
13259            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13260            unsafe {
13261                // Copy the object into the buffer.
13262                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13263                (buf_ptr as *mut StreamSocketGetTcpKeepAliveCountResponse).write_unaligned(
13264                    (self as *const StreamSocketGetTcpKeepAliveCountResponse).read(),
13265                );
13266                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13267                // done second because the memcpy will write garbage to these bytes.
13268            }
13269            Ok(())
13270        }
13271    }
13272    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13273        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D> for (T0,)
13274    {
13275        #[inline]
13276        unsafe fn encode(
13277            self,
13278            encoder: &mut fidl::encoding::Encoder<'_, D>,
13279            offset: usize,
13280            depth: fidl::encoding::Depth,
13281        ) -> fidl::Result<()> {
13282            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13283            // Zero out padding regions. There's no need to apply masks
13284            // because the unmasked parts will be overwritten by fields.
13285            // Write the fields.
13286            self.0.encode(encoder, offset + 0, depth)?;
13287            Ok(())
13288        }
13289    }
13290
13291    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13292        for StreamSocketGetTcpKeepAliveCountResponse
13293    {
13294        #[inline(always)]
13295        fn new_empty() -> Self {
13296            Self { value: fidl::new_empty!(u32, D) }
13297        }
13298
13299        #[inline]
13300        unsafe fn decode(
13301            &mut self,
13302            decoder: &mut fidl::encoding::Decoder<'_, D>,
13303            offset: usize,
13304            _depth: fidl::encoding::Depth,
13305        ) -> fidl::Result<()> {
13306            decoder.debug_check_bounds::<Self>(offset);
13307            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13308            // Verify that padding bytes are zero.
13309            // Copy from the buffer into the object.
13310            unsafe {
13311                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13312            }
13313            Ok(())
13314        }
13315    }
13316
13317    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
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 StreamSocketGetTcpKeepAliveIdleResponse {
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<StreamSocketGetTcpKeepAliveIdleResponse, D>
13349        for &StreamSocketGetTcpKeepAliveIdleResponse
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::<StreamSocketGetTcpKeepAliveIdleResponse>(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 StreamSocketGetTcpKeepAliveIdleResponse).write_unaligned(
13363                    (self as *const StreamSocketGetTcpKeepAliveIdleResponse).read(),
13364                );
13365                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13366                // done second because the memcpy will write garbage to these bytes.
13367            }
13368            Ok(())
13369        }
13370    }
13371    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13372        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D> for (T0,)
13373    {
13374        #[inline]
13375        unsafe fn encode(
13376            self,
13377            encoder: &mut fidl::encoding::Encoder<'_, D>,
13378            offset: usize,
13379            depth: fidl::encoding::Depth,
13380        ) -> fidl::Result<()> {
13381            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13382            // Zero out padding regions. There's no need to apply masks
13383            // because the unmasked parts will be overwritten by fields.
13384            // Write the fields.
13385            self.0.encode(encoder, offset + 0, depth)?;
13386            Ok(())
13387        }
13388    }
13389
13390    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13391        for StreamSocketGetTcpKeepAliveIdleResponse
13392    {
13393        #[inline(always)]
13394        fn new_empty() -> Self {
13395            Self { value_secs: fidl::new_empty!(u32, D) }
13396        }
13397
13398        #[inline]
13399        unsafe fn decode(
13400            &mut self,
13401            decoder: &mut fidl::encoding::Decoder<'_, D>,
13402            offset: usize,
13403            _depth: fidl::encoding::Depth,
13404        ) -> fidl::Result<()> {
13405            decoder.debug_check_bounds::<Self>(offset);
13406            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13407            // Verify that padding bytes are zero.
13408            // Copy from the buffer into the object.
13409            unsafe {
13410                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13411            }
13412            Ok(())
13413        }
13414    }
13415
13416    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13417        type Borrowed<'a> = &'a Self;
13418        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13419            value
13420        }
13421    }
13422
13423    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13424        type Owned = Self;
13425
13426        #[inline(always)]
13427        fn inline_align(_context: fidl::encoding::Context) -> usize {
13428            4
13429        }
13430
13431        #[inline(always)]
13432        fn inline_size(_context: fidl::encoding::Context) -> usize {
13433            4
13434        }
13435        #[inline(always)]
13436        fn encode_is_copy() -> bool {
13437            true
13438        }
13439
13440        #[inline(always)]
13441        fn decode_is_copy() -> bool {
13442            true
13443        }
13444    }
13445
13446    unsafe impl<D: fidl::encoding::ResourceDialect>
13447        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D>
13448        for &StreamSocketGetTcpKeepAliveIntervalResponse
13449    {
13450        #[inline]
13451        unsafe fn encode(
13452            self,
13453            encoder: &mut fidl::encoding::Encoder<'_, D>,
13454            offset: usize,
13455            _depth: fidl::encoding::Depth,
13456        ) -> fidl::Result<()> {
13457            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13458            unsafe {
13459                // Copy the object into the buffer.
13460                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13461                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIntervalResponse).write_unaligned(
13462                    (self as *const StreamSocketGetTcpKeepAliveIntervalResponse).read(),
13463                );
13464                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13465                // done second because the memcpy will write garbage to these bytes.
13466            }
13467            Ok(())
13468        }
13469    }
13470    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13471        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D> for (T0,)
13472    {
13473        #[inline]
13474        unsafe fn encode(
13475            self,
13476            encoder: &mut fidl::encoding::Encoder<'_, D>,
13477            offset: usize,
13478            depth: fidl::encoding::Depth,
13479        ) -> fidl::Result<()> {
13480            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13481            // Zero out padding regions. There's no need to apply masks
13482            // because the unmasked parts will be overwritten by fields.
13483            // Write the fields.
13484            self.0.encode(encoder, offset + 0, depth)?;
13485            Ok(())
13486        }
13487    }
13488
13489    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13490        for StreamSocketGetTcpKeepAliveIntervalResponse
13491    {
13492        #[inline(always)]
13493        fn new_empty() -> Self {
13494            Self { value_secs: fidl::new_empty!(u32, D) }
13495        }
13496
13497        #[inline]
13498        unsafe fn decode(
13499            &mut self,
13500            decoder: &mut fidl::encoding::Decoder<'_, D>,
13501            offset: usize,
13502            _depth: fidl::encoding::Depth,
13503        ) -> fidl::Result<()> {
13504            decoder.debug_check_bounds::<Self>(offset);
13505            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13506            // Verify that padding bytes are zero.
13507            // Copy from the buffer into the object.
13508            unsafe {
13509                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13510            }
13511            Ok(())
13512        }
13513    }
13514
13515    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpLingerResponse {
13516        type Borrowed<'a> = &'a Self;
13517        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13518            value
13519        }
13520    }
13521
13522    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpLingerResponse {
13523        type Owned = Self;
13524
13525        #[inline(always)]
13526        fn inline_align(_context: fidl::encoding::Context) -> usize {
13527            8
13528        }
13529
13530        #[inline(always)]
13531        fn inline_size(_context: fidl::encoding::Context) -> usize {
13532            16
13533        }
13534    }
13535
13536    unsafe impl<D: fidl::encoding::ResourceDialect>
13537        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D>
13538        for &StreamSocketGetTcpLingerResponse
13539    {
13540        #[inline]
13541        unsafe fn encode(
13542            self,
13543            encoder: &mut fidl::encoding::Encoder<'_, D>,
13544            offset: usize,
13545            _depth: fidl::encoding::Depth,
13546        ) -> fidl::Result<()> {
13547            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13548            // Delegate to tuple encoding.
13549            fidl::encoding::Encode::<StreamSocketGetTcpLingerResponse, D>::encode(
13550                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
13551                encoder,
13552                offset,
13553                _depth,
13554            )
13555        }
13556    }
13557    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
13558        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D> for (T0,)
13559    {
13560        #[inline]
13561        unsafe fn encode(
13562            self,
13563            encoder: &mut fidl::encoding::Encoder<'_, D>,
13564            offset: usize,
13565            depth: fidl::encoding::Depth,
13566        ) -> fidl::Result<()> {
13567            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13568            // Zero out padding regions. There's no need to apply masks
13569            // because the unmasked parts will be overwritten by fields.
13570            // Write the fields.
13571            self.0.encode(encoder, offset + 0, depth)?;
13572            Ok(())
13573        }
13574    }
13575
13576    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13577        for StreamSocketGetTcpLingerResponse
13578    {
13579        #[inline(always)]
13580        fn new_empty() -> Self {
13581            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
13582        }
13583
13584        #[inline]
13585        unsafe fn decode(
13586            &mut self,
13587            decoder: &mut fidl::encoding::Decoder<'_, D>,
13588            offset: usize,
13589            _depth: fidl::encoding::Depth,
13590        ) -> fidl::Result<()> {
13591            decoder.debug_check_bounds::<Self>(offset);
13592            // Verify that padding bytes are zero.
13593            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
13594            Ok(())
13595        }
13596    }
13597
13598    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13599        type Borrowed<'a> = &'a Self;
13600        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13601            value
13602        }
13603    }
13604
13605    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13606        type Owned = Self;
13607
13608        #[inline(always)]
13609        fn inline_align(_context: fidl::encoding::Context) -> usize {
13610            4
13611        }
13612
13613        #[inline(always)]
13614        fn inline_size(_context: fidl::encoding::Context) -> usize {
13615            4
13616        }
13617        #[inline(always)]
13618        fn encode_is_copy() -> bool {
13619            true
13620        }
13621
13622        #[inline(always)]
13623        fn decode_is_copy() -> bool {
13624            true
13625        }
13626    }
13627
13628    unsafe impl<D: fidl::encoding::ResourceDialect>
13629        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D>
13630        for &StreamSocketGetTcpMaxSegmentResponse
13631    {
13632        #[inline]
13633        unsafe fn encode(
13634            self,
13635            encoder: &mut fidl::encoding::Encoder<'_, D>,
13636            offset: usize,
13637            _depth: fidl::encoding::Depth,
13638        ) -> fidl::Result<()> {
13639            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13640            unsafe {
13641                // Copy the object into the buffer.
13642                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13643                (buf_ptr as *mut StreamSocketGetTcpMaxSegmentResponse)
13644                    .write_unaligned((self as *const StreamSocketGetTcpMaxSegmentResponse).read());
13645                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13646                // done second because the memcpy will write garbage to these bytes.
13647            }
13648            Ok(())
13649        }
13650    }
13651    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13652        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D> for (T0,)
13653    {
13654        #[inline]
13655        unsafe fn encode(
13656            self,
13657            encoder: &mut fidl::encoding::Encoder<'_, D>,
13658            offset: usize,
13659            depth: fidl::encoding::Depth,
13660        ) -> fidl::Result<()> {
13661            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13662            // Zero out padding regions. There's no need to apply masks
13663            // because the unmasked parts will be overwritten by fields.
13664            // Write the fields.
13665            self.0.encode(encoder, offset + 0, depth)?;
13666            Ok(())
13667        }
13668    }
13669
13670    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13671        for StreamSocketGetTcpMaxSegmentResponse
13672    {
13673        #[inline(always)]
13674        fn new_empty() -> Self {
13675            Self { value_bytes: fidl::new_empty!(u32, D) }
13676        }
13677
13678        #[inline]
13679        unsafe fn decode(
13680            &mut self,
13681            decoder: &mut fidl::encoding::Decoder<'_, D>,
13682            offset: usize,
13683            _depth: fidl::encoding::Depth,
13684        ) -> fidl::Result<()> {
13685            decoder.debug_check_bounds::<Self>(offset);
13686            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13687            // Verify that padding bytes are zero.
13688            // Copy from the buffer into the object.
13689            unsafe {
13690                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13691            }
13692            Ok(())
13693        }
13694    }
13695
13696    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpNoDelayResponse {
13697        type Borrowed<'a> = &'a Self;
13698        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13699            value
13700        }
13701    }
13702
13703    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpNoDelayResponse {
13704        type Owned = Self;
13705
13706        #[inline(always)]
13707        fn inline_align(_context: fidl::encoding::Context) -> usize {
13708            1
13709        }
13710
13711        #[inline(always)]
13712        fn inline_size(_context: fidl::encoding::Context) -> usize {
13713            1
13714        }
13715    }
13716
13717    unsafe impl<D: fidl::encoding::ResourceDialect>
13718        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D>
13719        for &StreamSocketGetTcpNoDelayResponse
13720    {
13721        #[inline]
13722        unsafe fn encode(
13723            self,
13724            encoder: &mut fidl::encoding::Encoder<'_, D>,
13725            offset: usize,
13726            _depth: fidl::encoding::Depth,
13727        ) -> fidl::Result<()> {
13728            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13729            // Delegate to tuple encoding.
13730            fidl::encoding::Encode::<StreamSocketGetTcpNoDelayResponse, D>::encode(
13731                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13732                encoder,
13733                offset,
13734                _depth,
13735            )
13736        }
13737    }
13738    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13739        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D> for (T0,)
13740    {
13741        #[inline]
13742        unsafe fn encode(
13743            self,
13744            encoder: &mut fidl::encoding::Encoder<'_, D>,
13745            offset: usize,
13746            depth: fidl::encoding::Depth,
13747        ) -> fidl::Result<()> {
13748            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13749            // Zero out padding regions. There's no need to apply masks
13750            // because the unmasked parts will be overwritten by fields.
13751            // Write the fields.
13752            self.0.encode(encoder, offset + 0, depth)?;
13753            Ok(())
13754        }
13755    }
13756
13757    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13758        for StreamSocketGetTcpNoDelayResponse
13759    {
13760        #[inline(always)]
13761        fn new_empty() -> Self {
13762            Self { value: fidl::new_empty!(bool, D) }
13763        }
13764
13765        #[inline]
13766        unsafe fn decode(
13767            &mut self,
13768            decoder: &mut fidl::encoding::Decoder<'_, D>,
13769            offset: usize,
13770            _depth: fidl::encoding::Depth,
13771        ) -> fidl::Result<()> {
13772            decoder.debug_check_bounds::<Self>(offset);
13773            // Verify that padding bytes are zero.
13774            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13775            Ok(())
13776        }
13777    }
13778
13779    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpQuickAckResponse {
13780        type Borrowed<'a> = &'a Self;
13781        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13782            value
13783        }
13784    }
13785
13786    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpQuickAckResponse {
13787        type Owned = Self;
13788
13789        #[inline(always)]
13790        fn inline_align(_context: fidl::encoding::Context) -> usize {
13791            1
13792        }
13793
13794        #[inline(always)]
13795        fn inline_size(_context: fidl::encoding::Context) -> usize {
13796            1
13797        }
13798    }
13799
13800    unsafe impl<D: fidl::encoding::ResourceDialect>
13801        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D>
13802        for &StreamSocketGetTcpQuickAckResponse
13803    {
13804        #[inline]
13805        unsafe fn encode(
13806            self,
13807            encoder: &mut fidl::encoding::Encoder<'_, D>,
13808            offset: usize,
13809            _depth: fidl::encoding::Depth,
13810        ) -> fidl::Result<()> {
13811            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13812            // Delegate to tuple encoding.
13813            fidl::encoding::Encode::<StreamSocketGetTcpQuickAckResponse, D>::encode(
13814                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13815                encoder,
13816                offset,
13817                _depth,
13818            )
13819        }
13820    }
13821    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13822        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D> for (T0,)
13823    {
13824        #[inline]
13825        unsafe fn encode(
13826            self,
13827            encoder: &mut fidl::encoding::Encoder<'_, D>,
13828            offset: usize,
13829            depth: fidl::encoding::Depth,
13830        ) -> fidl::Result<()> {
13831            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13832            // Zero out padding regions. There's no need to apply masks
13833            // because the unmasked parts will be overwritten by fields.
13834            // Write the fields.
13835            self.0.encode(encoder, offset + 0, depth)?;
13836            Ok(())
13837        }
13838    }
13839
13840    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13841        for StreamSocketGetTcpQuickAckResponse
13842    {
13843        #[inline(always)]
13844        fn new_empty() -> Self {
13845            Self { value: fidl::new_empty!(bool, D) }
13846        }
13847
13848        #[inline]
13849        unsafe fn decode(
13850            &mut self,
13851            decoder: &mut fidl::encoding::Decoder<'_, D>,
13852            offset: usize,
13853            _depth: fidl::encoding::Depth,
13854        ) -> fidl::Result<()> {
13855            decoder.debug_check_bounds::<Self>(offset);
13856            // Verify that padding bytes are zero.
13857            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13858            Ok(())
13859        }
13860    }
13861
13862    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpSynCountResponse {
13863        type Borrowed<'a> = &'a Self;
13864        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13865            value
13866        }
13867    }
13868
13869    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpSynCountResponse {
13870        type Owned = Self;
13871
13872        #[inline(always)]
13873        fn inline_align(_context: fidl::encoding::Context) -> usize {
13874            4
13875        }
13876
13877        #[inline(always)]
13878        fn inline_size(_context: fidl::encoding::Context) -> usize {
13879            4
13880        }
13881        #[inline(always)]
13882        fn encode_is_copy() -> bool {
13883            true
13884        }
13885
13886        #[inline(always)]
13887        fn decode_is_copy() -> bool {
13888            true
13889        }
13890    }
13891
13892    unsafe impl<D: fidl::encoding::ResourceDialect>
13893        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D>
13894        for &StreamSocketGetTcpSynCountResponse
13895    {
13896        #[inline]
13897        unsafe fn encode(
13898            self,
13899            encoder: &mut fidl::encoding::Encoder<'_, D>,
13900            offset: usize,
13901            _depth: fidl::encoding::Depth,
13902        ) -> fidl::Result<()> {
13903            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13904            unsafe {
13905                // Copy the object into the buffer.
13906                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13907                (buf_ptr as *mut StreamSocketGetTcpSynCountResponse)
13908                    .write_unaligned((self as *const StreamSocketGetTcpSynCountResponse).read());
13909                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13910                // done second because the memcpy will write garbage to these bytes.
13911            }
13912            Ok(())
13913        }
13914    }
13915    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13916        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D> for (T0,)
13917    {
13918        #[inline]
13919        unsafe fn encode(
13920            self,
13921            encoder: &mut fidl::encoding::Encoder<'_, D>,
13922            offset: usize,
13923            depth: fidl::encoding::Depth,
13924        ) -> fidl::Result<()> {
13925            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13926            // Zero out padding regions. There's no need to apply masks
13927            // because the unmasked parts will be overwritten by fields.
13928            // Write the fields.
13929            self.0.encode(encoder, offset + 0, depth)?;
13930            Ok(())
13931        }
13932    }
13933
13934    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13935        for StreamSocketGetTcpSynCountResponse
13936    {
13937        #[inline(always)]
13938        fn new_empty() -> Self {
13939            Self { value: fidl::new_empty!(u32, D) }
13940        }
13941
13942        #[inline]
13943        unsafe fn decode(
13944            &mut self,
13945            decoder: &mut fidl::encoding::Decoder<'_, D>,
13946            offset: usize,
13947            _depth: fidl::encoding::Depth,
13948        ) -> fidl::Result<()> {
13949            decoder.debug_check_bounds::<Self>(offset);
13950            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13951            // Verify that padding bytes are zero.
13952            // Copy from the buffer into the object.
13953            unsafe {
13954                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13955            }
13956            Ok(())
13957        }
13958    }
13959
13960    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13961        type Borrowed<'a> = &'a Self;
13962        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13963            value
13964        }
13965    }
13966
13967    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13968        type Owned = Self;
13969
13970        #[inline(always)]
13971        fn inline_align(_context: fidl::encoding::Context) -> usize {
13972            4
13973        }
13974
13975        #[inline(always)]
13976        fn inline_size(_context: fidl::encoding::Context) -> usize {
13977            4
13978        }
13979        #[inline(always)]
13980        fn encode_is_copy() -> bool {
13981            true
13982        }
13983
13984        #[inline(always)]
13985        fn decode_is_copy() -> bool {
13986            true
13987        }
13988    }
13989
13990    unsafe impl<D: fidl::encoding::ResourceDialect>
13991        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D>
13992        for &StreamSocketGetTcpUserTimeoutResponse
13993    {
13994        #[inline]
13995        unsafe fn encode(
13996            self,
13997            encoder: &mut fidl::encoding::Encoder<'_, D>,
13998            offset: usize,
13999            _depth: fidl::encoding::Depth,
14000        ) -> fidl::Result<()> {
14001            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
14002            unsafe {
14003                // Copy the object into the buffer.
14004                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14005                (buf_ptr as *mut StreamSocketGetTcpUserTimeoutResponse)
14006                    .write_unaligned((self as *const StreamSocketGetTcpUserTimeoutResponse).read());
14007                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14008                // done second because the memcpy will write garbage to these bytes.
14009            }
14010            Ok(())
14011        }
14012    }
14013    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14014        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D> for (T0,)
14015    {
14016        #[inline]
14017        unsafe fn encode(
14018            self,
14019            encoder: &mut fidl::encoding::Encoder<'_, D>,
14020            offset: usize,
14021            depth: fidl::encoding::Depth,
14022        ) -> fidl::Result<()> {
14023            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
14024            // Zero out padding regions. There's no need to apply masks
14025            // because the unmasked parts will be overwritten by fields.
14026            // Write the fields.
14027            self.0.encode(encoder, offset + 0, depth)?;
14028            Ok(())
14029        }
14030    }
14031
14032    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14033        for StreamSocketGetTcpUserTimeoutResponse
14034    {
14035        #[inline(always)]
14036        fn new_empty() -> Self {
14037            Self { value_millis: fidl::new_empty!(u32, D) }
14038        }
14039
14040        #[inline]
14041        unsafe fn decode(
14042            &mut self,
14043            decoder: &mut fidl::encoding::Decoder<'_, D>,
14044            offset: usize,
14045            _depth: fidl::encoding::Depth,
14046        ) -> fidl::Result<()> {
14047            decoder.debug_check_bounds::<Self>(offset);
14048            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14049            // Verify that padding bytes are zero.
14050            // Copy from the buffer into the object.
14051            unsafe {
14052                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14053            }
14054            Ok(())
14055        }
14056    }
14057
14058    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpWindowClampResponse {
14059        type Borrowed<'a> = &'a Self;
14060        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14061            value
14062        }
14063    }
14064
14065    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpWindowClampResponse {
14066        type Owned = Self;
14067
14068        #[inline(always)]
14069        fn inline_align(_context: fidl::encoding::Context) -> usize {
14070            4
14071        }
14072
14073        #[inline(always)]
14074        fn inline_size(_context: fidl::encoding::Context) -> usize {
14075            4
14076        }
14077        #[inline(always)]
14078        fn encode_is_copy() -> bool {
14079            true
14080        }
14081
14082        #[inline(always)]
14083        fn decode_is_copy() -> bool {
14084            true
14085        }
14086    }
14087
14088    unsafe impl<D: fidl::encoding::ResourceDialect>
14089        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D>
14090        for &StreamSocketGetTcpWindowClampResponse
14091    {
14092        #[inline]
14093        unsafe fn encode(
14094            self,
14095            encoder: &mut fidl::encoding::Encoder<'_, D>,
14096            offset: usize,
14097            _depth: fidl::encoding::Depth,
14098        ) -> fidl::Result<()> {
14099            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
14100            unsafe {
14101                // Copy the object into the buffer.
14102                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14103                (buf_ptr as *mut StreamSocketGetTcpWindowClampResponse)
14104                    .write_unaligned((self as *const StreamSocketGetTcpWindowClampResponse).read());
14105                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14106                // done second because the memcpy will write garbage to these bytes.
14107            }
14108            Ok(())
14109        }
14110    }
14111    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14112        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D> for (T0,)
14113    {
14114        #[inline]
14115        unsafe fn encode(
14116            self,
14117            encoder: &mut fidl::encoding::Encoder<'_, D>,
14118            offset: usize,
14119            depth: fidl::encoding::Depth,
14120        ) -> fidl::Result<()> {
14121            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
14122            // Zero out padding regions. There's no need to apply masks
14123            // because the unmasked parts will be overwritten by fields.
14124            // Write the fields.
14125            self.0.encode(encoder, offset + 0, depth)?;
14126            Ok(())
14127        }
14128    }
14129
14130    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14131        for StreamSocketGetTcpWindowClampResponse
14132    {
14133        #[inline(always)]
14134        fn new_empty() -> Self {
14135            Self { value: fidl::new_empty!(u32, D) }
14136        }
14137
14138        #[inline]
14139        unsafe fn decode(
14140            &mut self,
14141            decoder: &mut fidl::encoding::Decoder<'_, D>,
14142            offset: usize,
14143            _depth: fidl::encoding::Depth,
14144        ) -> fidl::Result<()> {
14145            decoder.debug_check_bounds::<Self>(offset);
14146            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14147            // Verify that padding bytes are zero.
14148            // Copy from the buffer into the object.
14149            unsafe {
14150                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14151            }
14152            Ok(())
14153        }
14154    }
14155
14156    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14157        type Borrowed<'a> = &'a Self;
14158        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14159            value
14160        }
14161    }
14162
14163    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14164        type Owned = Self;
14165
14166        #[inline(always)]
14167        fn inline_align(_context: fidl::encoding::Context) -> usize {
14168            4
14169        }
14170
14171        #[inline(always)]
14172        fn inline_size(_context: fidl::encoding::Context) -> usize {
14173            12
14174        }
14175    }
14176
14177    unsafe impl<D: fidl::encoding::ResourceDialect>
14178        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D>
14179        for &SynchronousDatagramSocketRecvMsgRequest
14180    {
14181        #[inline]
14182        unsafe fn encode(
14183            self,
14184            encoder: &mut fidl::encoding::Encoder<'_, D>,
14185            offset: usize,
14186            _depth: fidl::encoding::Depth,
14187        ) -> fidl::Result<()> {
14188            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14189            // Delegate to tuple encoding.
14190            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgRequest, D>::encode(
14191                (
14192                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),
14193                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_len),
14194                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_control),
14195                    <RecvMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14196                ),
14197                encoder,
14198                offset,
14199                _depth,
14200            )
14201        }
14202    }
14203    unsafe impl<
14204        D: fidl::encoding::ResourceDialect,
14205        T0: fidl::encoding::Encode<bool, D>,
14206        T1: fidl::encoding::Encode<u32, D>,
14207        T2: fidl::encoding::Encode<bool, D>,
14208        T3: fidl::encoding::Encode<RecvMsgFlags, D>,
14209    > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D> for (T0, T1, T2, T3)
14210    {
14211        #[inline]
14212        unsafe fn encode(
14213            self,
14214            encoder: &mut fidl::encoding::Encoder<'_, D>,
14215            offset: usize,
14216            depth: fidl::encoding::Depth,
14217        ) -> fidl::Result<()> {
14218            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14219            // Zero out padding regions. There's no need to apply masks
14220            // because the unmasked parts will be overwritten by fields.
14221            unsafe {
14222                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14223                (ptr as *mut u32).write_unaligned(0);
14224            }
14225            unsafe {
14226                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14227                (ptr as *mut u32).write_unaligned(0);
14228            }
14229            // Write the fields.
14230            self.0.encode(encoder, offset + 0, depth)?;
14231            self.1.encode(encoder, offset + 4, depth)?;
14232            self.2.encode(encoder, offset + 8, depth)?;
14233            self.3.encode(encoder, offset + 10, depth)?;
14234            Ok(())
14235        }
14236    }
14237
14238    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14239        for SynchronousDatagramSocketRecvMsgRequest
14240    {
14241        #[inline(always)]
14242        fn new_empty() -> Self {
14243            Self {
14244                want_addr: fidl::new_empty!(bool, D),
14245                data_len: fidl::new_empty!(u32, D),
14246                want_control: fidl::new_empty!(bool, D),
14247                flags: fidl::new_empty!(RecvMsgFlags, D),
14248            }
14249        }
14250
14251        #[inline]
14252        unsafe fn decode(
14253            &mut self,
14254            decoder: &mut fidl::encoding::Decoder<'_, D>,
14255            offset: usize,
14256            _depth: fidl::encoding::Depth,
14257        ) -> fidl::Result<()> {
14258            decoder.debug_check_bounds::<Self>(offset);
14259            // Verify that padding bytes are zero.
14260            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14261            let padval = unsafe { (ptr as *const u32).read_unaligned() };
14262            let mask = 0xffffff00u32;
14263            let maskedval = padval & mask;
14264            if maskedval != 0 {
14265                return Err(fidl::Error::NonZeroPadding {
14266                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14267                });
14268            }
14269            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14270            let padval = unsafe { (ptr as *const u32).read_unaligned() };
14271            let mask = 0xff00u32;
14272            let maskedval = padval & mask;
14273            if maskedval != 0 {
14274                return Err(fidl::Error::NonZeroPadding {
14275                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14276                });
14277            }
14278            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
14279            fidl::decode!(u32, D, &mut self.data_len, decoder, offset + 4, _depth)?;
14280            fidl::decode!(bool, D, &mut self.want_control, decoder, offset + 8, _depth)?;
14281            fidl::decode!(RecvMsgFlags, D, &mut self.flags, decoder, offset + 10, _depth)?;
14282            Ok(())
14283        }
14284    }
14285
14286    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgRequest {
14287        type Borrowed<'a> = &'a Self;
14288        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14289            value
14290        }
14291    }
14292
14293    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgRequest {
14294        type Owned = Self;
14295
14296        #[inline(always)]
14297        fn inline_align(_context: fidl::encoding::Context) -> usize {
14298            8
14299        }
14300
14301        #[inline(always)]
14302        fn inline_size(_context: fidl::encoding::Context) -> usize {
14303            56
14304        }
14305    }
14306
14307    unsafe impl<D: fidl::encoding::ResourceDialect>
14308        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D>
14309        for &SynchronousDatagramSocketSendMsgRequest
14310    {
14311        #[inline]
14312        unsafe fn encode(
14313            self,
14314            encoder: &mut fidl::encoding::Encoder<'_, D>,
14315            offset: usize,
14316            _depth: fidl::encoding::Depth,
14317        ) -> fidl::Result<()> {
14318            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14319            // Delegate to tuple encoding.
14320            fidl::encoding::Encode::<SynchronousDatagramSocketSendMsgRequest, D>::encode(
14321                (
14322                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14323                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14324                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14325                    <SendMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14326                ),
14327                encoder, offset, _depth
14328            )
14329        }
14330    }
14331    unsafe impl<
14332        D: fidl::encoding::ResourceDialect,
14333        T0: fidl::encoding::Encode<
14334                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14335                D,
14336            >,
14337        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14338        T2: fidl::encoding::Encode<DatagramSocketSendControlData, D>,
14339        T3: fidl::encoding::Encode<SendMsgFlags, D>,
14340    > fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D> for (T0, T1, T2, T3)
14341    {
14342        #[inline]
14343        unsafe fn encode(
14344            self,
14345            encoder: &mut fidl::encoding::Encoder<'_, D>,
14346            offset: usize,
14347            depth: fidl::encoding::Depth,
14348        ) -> fidl::Result<()> {
14349            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14350            // Zero out padding regions. There's no need to apply masks
14351            // because the unmasked parts will be overwritten by fields.
14352            unsafe {
14353                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14354                (ptr as *mut u64).write_unaligned(0);
14355            }
14356            // Write the fields.
14357            self.0.encode(encoder, offset + 0, depth)?;
14358            self.1.encode(encoder, offset + 16, depth)?;
14359            self.2.encode(encoder, offset + 32, depth)?;
14360            self.3.encode(encoder, offset + 48, depth)?;
14361            Ok(())
14362        }
14363    }
14364
14365    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14366        for SynchronousDatagramSocketSendMsgRequest
14367    {
14368        #[inline(always)]
14369        fn new_empty() -> Self {
14370            Self {
14371                addr: fidl::new_empty!(
14372                    fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14373                    D
14374                ),
14375                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14376                control: fidl::new_empty!(DatagramSocketSendControlData, D),
14377                flags: fidl::new_empty!(SendMsgFlags, D),
14378            }
14379        }
14380
14381        #[inline]
14382        unsafe fn decode(
14383            &mut self,
14384            decoder: &mut fidl::encoding::Decoder<'_, D>,
14385            offset: usize,
14386            _depth: fidl::encoding::Depth,
14387        ) -> fidl::Result<()> {
14388            decoder.debug_check_bounds::<Self>(offset);
14389            // Verify that padding bytes are zero.
14390            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14391            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14392            let mask = 0xffffffffffff0000u64;
14393            let maskedval = padval & mask;
14394            if maskedval != 0 {
14395                return Err(fidl::Error::NonZeroPadding {
14396                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14397                });
14398            }
14399            fidl::decode!(
14400                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14401                D,
14402                &mut self.addr,
14403                decoder,
14404                offset + 0,
14405                _depth
14406            )?;
14407            fidl::decode!(
14408                fidl::encoding::UnboundedVector<u8>,
14409                D,
14410                &mut self.data,
14411                decoder,
14412                offset + 16,
14413                _depth
14414            )?;
14415            fidl::decode!(
14416                DatagramSocketSendControlData,
14417                D,
14418                &mut self.control,
14419                decoder,
14420                offset + 32,
14421                _depth
14422            )?;
14423            fidl::decode!(SendMsgFlags, D, &mut self.flags, decoder, offset + 48, _depth)?;
14424            Ok(())
14425        }
14426    }
14427
14428    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14429        type Borrowed<'a> = &'a Self;
14430        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14431            value
14432        }
14433    }
14434
14435    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14436        type Owned = Self;
14437
14438        #[inline(always)]
14439        fn inline_align(_context: fidl::encoding::Context) -> usize {
14440            8
14441        }
14442
14443        #[inline(always)]
14444        fn inline_size(_context: fidl::encoding::Context) -> usize {
14445            56
14446        }
14447    }
14448
14449    unsafe impl<D: fidl::encoding::ResourceDialect>
14450        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D>
14451        for &SynchronousDatagramSocketRecvMsgResponse
14452    {
14453        #[inline]
14454        unsafe fn encode(
14455            self,
14456            encoder: &mut fidl::encoding::Encoder<'_, D>,
14457            offset: usize,
14458            _depth: fidl::encoding::Depth,
14459        ) -> fidl::Result<()> {
14460            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14461            // Delegate to tuple encoding.
14462            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgResponse, D>::encode(
14463                (
14464                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14465                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14466                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14467                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.truncated),
14468                ),
14469                encoder, offset, _depth
14470            )
14471        }
14472    }
14473    unsafe impl<
14474        D: fidl::encoding::ResourceDialect,
14475        T0: fidl::encoding::Encode<
14476                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14477                D,
14478            >,
14479        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14480        T2: fidl::encoding::Encode<DatagramSocketRecvControlData, D>,
14481        T3: fidl::encoding::Encode<u32, D>,
14482    > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D> for (T0, T1, T2, T3)
14483    {
14484        #[inline]
14485        unsafe fn encode(
14486            self,
14487            encoder: &mut fidl::encoding::Encoder<'_, D>,
14488            offset: usize,
14489            depth: fidl::encoding::Depth,
14490        ) -> fidl::Result<()> {
14491            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14492            // Zero out padding regions. There's no need to apply masks
14493            // because the unmasked parts will be overwritten by fields.
14494            unsafe {
14495                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14496                (ptr as *mut u64).write_unaligned(0);
14497            }
14498            // Write the fields.
14499            self.0.encode(encoder, offset + 0, depth)?;
14500            self.1.encode(encoder, offset + 16, depth)?;
14501            self.2.encode(encoder, offset + 32, depth)?;
14502            self.3.encode(encoder, offset + 48, depth)?;
14503            Ok(())
14504        }
14505    }
14506
14507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14508        for SynchronousDatagramSocketRecvMsgResponse
14509    {
14510        #[inline(always)]
14511        fn new_empty() -> Self {
14512            Self {
14513                addr: fidl::new_empty!(
14514                    fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14515                    D
14516                ),
14517                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14518                control: fidl::new_empty!(DatagramSocketRecvControlData, D),
14519                truncated: fidl::new_empty!(u32, D),
14520            }
14521        }
14522
14523        #[inline]
14524        unsafe fn decode(
14525            &mut self,
14526            decoder: &mut fidl::encoding::Decoder<'_, D>,
14527            offset: usize,
14528            _depth: fidl::encoding::Depth,
14529        ) -> fidl::Result<()> {
14530            decoder.debug_check_bounds::<Self>(offset);
14531            // Verify that padding bytes are zero.
14532            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14533            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14534            let mask = 0xffffffff00000000u64;
14535            let maskedval = padval & mask;
14536            if maskedval != 0 {
14537                return Err(fidl::Error::NonZeroPadding {
14538                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14539                });
14540            }
14541            fidl::decode!(
14542                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14543                D,
14544                &mut self.addr,
14545                decoder,
14546                offset + 0,
14547                _depth
14548            )?;
14549            fidl::decode!(
14550                fidl::encoding::UnboundedVector<u8>,
14551                D,
14552                &mut self.data,
14553                decoder,
14554                offset + 16,
14555                _depth
14556            )?;
14557            fidl::decode!(
14558                DatagramSocketRecvControlData,
14559                D,
14560                &mut self.control,
14561                decoder,
14562                offset + 32,
14563                _depth
14564            )?;
14565            fidl::decode!(u32, D, &mut self.truncated, decoder, offset + 48, _depth)?;
14566            Ok(())
14567        }
14568    }
14569
14570    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgResponse {
14571        type Borrowed<'a> = &'a Self;
14572        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14573            value
14574        }
14575    }
14576
14577    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgResponse {
14578        type Owned = Self;
14579
14580        #[inline(always)]
14581        fn inline_align(_context: fidl::encoding::Context) -> usize {
14582            8
14583        }
14584
14585        #[inline(always)]
14586        fn inline_size(_context: fidl::encoding::Context) -> usize {
14587            8
14588        }
14589        #[inline(always)]
14590        fn encode_is_copy() -> bool {
14591            true
14592        }
14593
14594        #[inline(always)]
14595        fn decode_is_copy() -> bool {
14596            true
14597        }
14598    }
14599
14600    unsafe impl<D: fidl::encoding::ResourceDialect>
14601        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D>
14602        for &SynchronousDatagramSocketSendMsgResponse
14603    {
14604        #[inline]
14605        unsafe fn encode(
14606            self,
14607            encoder: &mut fidl::encoding::Encoder<'_, D>,
14608            offset: usize,
14609            _depth: fidl::encoding::Depth,
14610        ) -> fidl::Result<()> {
14611            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14612            unsafe {
14613                // Copy the object into the buffer.
14614                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14615                (buf_ptr as *mut SynchronousDatagramSocketSendMsgResponse).write_unaligned(
14616                    (self as *const SynchronousDatagramSocketSendMsgResponse).read(),
14617                );
14618                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14619                // done second because the memcpy will write garbage to these bytes.
14620            }
14621            Ok(())
14622        }
14623    }
14624    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
14625        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D> for (T0,)
14626    {
14627        #[inline]
14628        unsafe fn encode(
14629            self,
14630            encoder: &mut fidl::encoding::Encoder<'_, D>,
14631            offset: usize,
14632            depth: fidl::encoding::Depth,
14633        ) -> fidl::Result<()> {
14634            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14635            // Zero out padding regions. There's no need to apply masks
14636            // because the unmasked parts will be overwritten by fields.
14637            // Write the fields.
14638            self.0.encode(encoder, offset + 0, depth)?;
14639            Ok(())
14640        }
14641    }
14642
14643    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14644        for SynchronousDatagramSocketSendMsgResponse
14645    {
14646        #[inline(always)]
14647        fn new_empty() -> Self {
14648            Self { len: fidl::new_empty!(i64, D) }
14649        }
14650
14651        #[inline]
14652        unsafe fn decode(
14653            &mut self,
14654            decoder: &mut fidl::encoding::Decoder<'_, D>,
14655            offset: usize,
14656            _depth: fidl::encoding::Depth,
14657        ) -> fidl::Result<()> {
14658            decoder.debug_check_bounds::<Self>(offset);
14659            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14660            // Verify that padding bytes are zero.
14661            // Copy from the buffer into the object.
14662            unsafe {
14663                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
14664            }
14665            Ok(())
14666        }
14667    }
14668
14669    impl fidl::encoding::ValueTypeMarker for Timestamp {
14670        type Borrowed<'a> = &'a Self;
14671        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14672            value
14673        }
14674    }
14675
14676    unsafe impl fidl::encoding::TypeMarker for Timestamp {
14677        type Owned = Self;
14678
14679        #[inline(always)]
14680        fn inline_align(_context: fidl::encoding::Context) -> usize {
14681            8
14682        }
14683
14684        #[inline(always)]
14685        fn inline_size(_context: fidl::encoding::Context) -> usize {
14686            16
14687        }
14688    }
14689
14690    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Timestamp, D>
14691        for &Timestamp
14692    {
14693        #[inline]
14694        unsafe fn encode(
14695            self,
14696            encoder: &mut fidl::encoding::Encoder<'_, D>,
14697            offset: usize,
14698            _depth: fidl::encoding::Depth,
14699        ) -> fidl::Result<()> {
14700            encoder.debug_check_bounds::<Timestamp>(offset);
14701            // Delegate to tuple encoding.
14702            fidl::encoding::Encode::<Timestamp, D>::encode(
14703                (
14704                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.nanoseconds),
14705                    <TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.requested),
14706                ),
14707                encoder,
14708                offset,
14709                _depth,
14710            )
14711        }
14712    }
14713    unsafe impl<
14714        D: fidl::encoding::ResourceDialect,
14715        T0: fidl::encoding::Encode<i64, D>,
14716        T1: fidl::encoding::Encode<TimestampOption, D>,
14717    > fidl::encoding::Encode<Timestamp, D> for (T0, T1)
14718    {
14719        #[inline]
14720        unsafe fn encode(
14721            self,
14722            encoder: &mut fidl::encoding::Encoder<'_, D>,
14723            offset: usize,
14724            depth: fidl::encoding::Depth,
14725        ) -> fidl::Result<()> {
14726            encoder.debug_check_bounds::<Timestamp>(offset);
14727            // Zero out padding regions. There's no need to apply masks
14728            // because the unmasked parts will be overwritten by fields.
14729            unsafe {
14730                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14731                (ptr as *mut u64).write_unaligned(0);
14732            }
14733            // Write the fields.
14734            self.0.encode(encoder, offset + 0, depth)?;
14735            self.1.encode(encoder, offset + 8, depth)?;
14736            Ok(())
14737        }
14738    }
14739
14740    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Timestamp {
14741        #[inline(always)]
14742        fn new_empty() -> Self {
14743            Self {
14744                nanoseconds: fidl::new_empty!(i64, D),
14745                requested: fidl::new_empty!(TimestampOption, D),
14746            }
14747        }
14748
14749        #[inline]
14750        unsafe fn decode(
14751            &mut self,
14752            decoder: &mut fidl::encoding::Decoder<'_, D>,
14753            offset: usize,
14754            _depth: fidl::encoding::Depth,
14755        ) -> fidl::Result<()> {
14756            decoder.debug_check_bounds::<Self>(offset);
14757            // Verify that padding bytes are zero.
14758            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14759            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14760            let mask = 0xffffffff00000000u64;
14761            let maskedval = padval & mask;
14762            if maskedval != 0 {
14763                return Err(fidl::Error::NonZeroPadding {
14764                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14765                });
14766            }
14767            fidl::decode!(i64, D, &mut self.nanoseconds, decoder, offset + 0, _depth)?;
14768            fidl::decode!(TimestampOption, D, &mut self.requested, decoder, offset + 8, _depth)?;
14769            Ok(())
14770        }
14771    }
14772
14773    impl DatagramSocketRecvControlData {
14774        #[inline(always)]
14775        fn max_ordinal_present(&self) -> u64 {
14776            if let Some(_) = self.network {
14777                return 1;
14778            }
14779            0
14780        }
14781    }
14782
14783    impl fidl::encoding::ValueTypeMarker for DatagramSocketRecvControlData {
14784        type Borrowed<'a> = &'a Self;
14785        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14786            value
14787        }
14788    }
14789
14790    unsafe impl fidl::encoding::TypeMarker for DatagramSocketRecvControlData {
14791        type Owned = Self;
14792
14793        #[inline(always)]
14794        fn inline_align(_context: fidl::encoding::Context) -> usize {
14795            8
14796        }
14797
14798        #[inline(always)]
14799        fn inline_size(_context: fidl::encoding::Context) -> usize {
14800            16
14801        }
14802    }
14803
14804    unsafe impl<D: fidl::encoding::ResourceDialect>
14805        fidl::encoding::Encode<DatagramSocketRecvControlData, D>
14806        for &DatagramSocketRecvControlData
14807    {
14808        unsafe fn encode(
14809            self,
14810            encoder: &mut fidl::encoding::Encoder<'_, D>,
14811            offset: usize,
14812            mut depth: fidl::encoding::Depth,
14813        ) -> fidl::Result<()> {
14814            encoder.debug_check_bounds::<DatagramSocketRecvControlData>(offset);
14815            // Vector header
14816            let max_ordinal: u64 = self.max_ordinal_present();
14817            encoder.write_num(max_ordinal, offset);
14818            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14819            // Calling encoder.out_of_line_offset(0) is not allowed.
14820            if max_ordinal == 0 {
14821                return Ok(());
14822            }
14823            depth.increment()?;
14824            let envelope_size = 8;
14825            let bytes_len = max_ordinal as usize * envelope_size;
14826            #[allow(unused_variables)]
14827            let offset = encoder.out_of_line_offset(bytes_len);
14828            let mut _prev_end_offset: usize = 0;
14829            if 1 > max_ordinal {
14830                return Ok(());
14831            }
14832
14833            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14834            // are envelope_size bytes.
14835            let cur_offset: usize = (1 - 1) * envelope_size;
14836
14837            // Zero reserved fields.
14838            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14839
14840            // Safety:
14841            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14842            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14843            //   envelope_size bytes, there is always sufficient room.
14844            fidl::encoding::encode_in_envelope_optional::<NetworkSocketRecvControlData, D>(
14845                self.network
14846                    .as_ref()
14847                    .map(<NetworkSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
14848                encoder,
14849                offset + cur_offset,
14850                depth,
14851            )?;
14852
14853            _prev_end_offset = cur_offset + envelope_size;
14854
14855            Ok(())
14856        }
14857    }
14858
14859    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14860        for DatagramSocketRecvControlData
14861    {
14862        #[inline(always)]
14863        fn new_empty() -> Self {
14864            Self::default()
14865        }
14866
14867        unsafe fn decode(
14868            &mut self,
14869            decoder: &mut fidl::encoding::Decoder<'_, D>,
14870            offset: usize,
14871            mut depth: fidl::encoding::Depth,
14872        ) -> fidl::Result<()> {
14873            decoder.debug_check_bounds::<Self>(offset);
14874            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14875                None => return Err(fidl::Error::NotNullable),
14876                Some(len) => len,
14877            };
14878            // Calling decoder.out_of_line_offset(0) is not allowed.
14879            if len == 0 {
14880                return Ok(());
14881            };
14882            depth.increment()?;
14883            let envelope_size = 8;
14884            let bytes_len = len * envelope_size;
14885            let offset = decoder.out_of_line_offset(bytes_len)?;
14886            // Decode the envelope for each type.
14887            let mut _next_ordinal_to_read = 0;
14888            let mut next_offset = offset;
14889            let end_offset = offset + bytes_len;
14890            _next_ordinal_to_read += 1;
14891            if next_offset >= end_offset {
14892                return Ok(());
14893            }
14894
14895            // Decode unknown envelopes for gaps in ordinals.
14896            while _next_ordinal_to_read < 1 {
14897                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14898                _next_ordinal_to_read += 1;
14899                next_offset += envelope_size;
14900            }
14901
14902            let next_out_of_line = decoder.next_out_of_line();
14903            let handles_before = decoder.remaining_handles();
14904            if let Some((inlined, num_bytes, num_handles)) =
14905                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14906            {
14907                let member_inline_size =
14908                    <NetworkSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
14909                        decoder.context,
14910                    );
14911                if inlined != (member_inline_size <= 4) {
14912                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14913                }
14914                let inner_offset;
14915                let mut inner_depth = depth.clone();
14916                if inlined {
14917                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14918                    inner_offset = next_offset;
14919                } else {
14920                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14921                    inner_depth.increment()?;
14922                }
14923                let val_ref = self
14924                    .network
14925                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketRecvControlData, D));
14926                fidl::decode!(
14927                    NetworkSocketRecvControlData,
14928                    D,
14929                    val_ref,
14930                    decoder,
14931                    inner_offset,
14932                    inner_depth
14933                )?;
14934                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14935                {
14936                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14937                }
14938                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14939                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14940                }
14941            }
14942
14943            next_offset += envelope_size;
14944
14945            // Decode the remaining unknown envelopes.
14946            while next_offset < end_offset {
14947                _next_ordinal_to_read += 1;
14948                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14949                next_offset += envelope_size;
14950            }
14951
14952            Ok(())
14953        }
14954    }
14955
14956    impl DatagramSocketSendControlData {
14957        #[inline(always)]
14958        fn max_ordinal_present(&self) -> u64 {
14959            if let Some(_) = self.network {
14960                return 1;
14961            }
14962            0
14963        }
14964    }
14965
14966    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendControlData {
14967        type Borrowed<'a> = &'a Self;
14968        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14969            value
14970        }
14971    }
14972
14973    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendControlData {
14974        type Owned = Self;
14975
14976        #[inline(always)]
14977        fn inline_align(_context: fidl::encoding::Context) -> usize {
14978            8
14979        }
14980
14981        #[inline(always)]
14982        fn inline_size(_context: fidl::encoding::Context) -> usize {
14983            16
14984        }
14985    }
14986
14987    unsafe impl<D: fidl::encoding::ResourceDialect>
14988        fidl::encoding::Encode<DatagramSocketSendControlData, D>
14989        for &DatagramSocketSendControlData
14990    {
14991        unsafe fn encode(
14992            self,
14993            encoder: &mut fidl::encoding::Encoder<'_, D>,
14994            offset: usize,
14995            mut depth: fidl::encoding::Depth,
14996        ) -> fidl::Result<()> {
14997            encoder.debug_check_bounds::<DatagramSocketSendControlData>(offset);
14998            // Vector header
14999            let max_ordinal: u64 = self.max_ordinal_present();
15000            encoder.write_num(max_ordinal, offset);
15001            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15002            // Calling encoder.out_of_line_offset(0) is not allowed.
15003            if max_ordinal == 0 {
15004                return Ok(());
15005            }
15006            depth.increment()?;
15007            let envelope_size = 8;
15008            let bytes_len = max_ordinal as usize * envelope_size;
15009            #[allow(unused_variables)]
15010            let offset = encoder.out_of_line_offset(bytes_len);
15011            let mut _prev_end_offset: usize = 0;
15012            if 1 > max_ordinal {
15013                return Ok(());
15014            }
15015
15016            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15017            // are envelope_size bytes.
15018            let cur_offset: usize = (1 - 1) * envelope_size;
15019
15020            // Zero reserved fields.
15021            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15022
15023            // Safety:
15024            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15025            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15026            //   envelope_size bytes, there is always sufficient room.
15027            fidl::encoding::encode_in_envelope_optional::<NetworkSocketSendControlData, D>(
15028                self.network
15029                    .as_ref()
15030                    .map(<NetworkSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15031                encoder,
15032                offset + cur_offset,
15033                depth,
15034            )?;
15035
15036            _prev_end_offset = cur_offset + envelope_size;
15037
15038            Ok(())
15039        }
15040    }
15041
15042    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15043        for DatagramSocketSendControlData
15044    {
15045        #[inline(always)]
15046        fn new_empty() -> Self {
15047            Self::default()
15048        }
15049
15050        unsafe fn decode(
15051            &mut self,
15052            decoder: &mut fidl::encoding::Decoder<'_, D>,
15053            offset: usize,
15054            mut depth: fidl::encoding::Depth,
15055        ) -> fidl::Result<()> {
15056            decoder.debug_check_bounds::<Self>(offset);
15057            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15058                None => return Err(fidl::Error::NotNullable),
15059                Some(len) => len,
15060            };
15061            // Calling decoder.out_of_line_offset(0) is not allowed.
15062            if len == 0 {
15063                return Ok(());
15064            };
15065            depth.increment()?;
15066            let envelope_size = 8;
15067            let bytes_len = len * envelope_size;
15068            let offset = decoder.out_of_line_offset(bytes_len)?;
15069            // Decode the envelope for each type.
15070            let mut _next_ordinal_to_read = 0;
15071            let mut next_offset = offset;
15072            let end_offset = offset + bytes_len;
15073            _next_ordinal_to_read += 1;
15074            if next_offset >= end_offset {
15075                return Ok(());
15076            }
15077
15078            // Decode unknown envelopes for gaps in ordinals.
15079            while _next_ordinal_to_read < 1 {
15080                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15081                _next_ordinal_to_read += 1;
15082                next_offset += envelope_size;
15083            }
15084
15085            let next_out_of_line = decoder.next_out_of_line();
15086            let handles_before = decoder.remaining_handles();
15087            if let Some((inlined, num_bytes, num_handles)) =
15088                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15089            {
15090                let member_inline_size =
15091                    <NetworkSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
15092                        decoder.context,
15093                    );
15094                if inlined != (member_inline_size <= 4) {
15095                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15096                }
15097                let inner_offset;
15098                let mut inner_depth = depth.clone();
15099                if inlined {
15100                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15101                    inner_offset = next_offset;
15102                } else {
15103                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15104                    inner_depth.increment()?;
15105                }
15106                let val_ref = self
15107                    .network
15108                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketSendControlData, D));
15109                fidl::decode!(
15110                    NetworkSocketSendControlData,
15111                    D,
15112                    val_ref,
15113                    decoder,
15114                    inner_offset,
15115                    inner_depth
15116                )?;
15117                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15118                {
15119                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15120                }
15121                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15122                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15123                }
15124            }
15125
15126            next_offset += envelope_size;
15127
15128            // Decode the remaining unknown envelopes.
15129            while next_offset < end_offset {
15130                _next_ordinal_to_read += 1;
15131                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15132                next_offset += envelope_size;
15133            }
15134
15135            Ok(())
15136        }
15137    }
15138
15139    impl DatagramSocketSendMsgPreflightRequest {
15140        #[inline(always)]
15141        fn max_ordinal_present(&self) -> u64 {
15142            if let Some(_) = self.ipv6_pktinfo {
15143                return 2;
15144            }
15145            if let Some(_) = self.to {
15146                return 1;
15147            }
15148            0
15149        }
15150    }
15151
15152    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendMsgPreflightRequest {
15153        type Borrowed<'a> = &'a Self;
15154        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15155            value
15156        }
15157    }
15158
15159    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendMsgPreflightRequest {
15160        type Owned = Self;
15161
15162        #[inline(always)]
15163        fn inline_align(_context: fidl::encoding::Context) -> usize {
15164            8
15165        }
15166
15167        #[inline(always)]
15168        fn inline_size(_context: fidl::encoding::Context) -> usize {
15169            16
15170        }
15171    }
15172
15173    unsafe impl<D: fidl::encoding::ResourceDialect>
15174        fidl::encoding::Encode<DatagramSocketSendMsgPreflightRequest, D>
15175        for &DatagramSocketSendMsgPreflightRequest
15176    {
15177        unsafe fn encode(
15178            self,
15179            encoder: &mut fidl::encoding::Encoder<'_, D>,
15180            offset: usize,
15181            mut depth: fidl::encoding::Depth,
15182        ) -> fidl::Result<()> {
15183            encoder.debug_check_bounds::<DatagramSocketSendMsgPreflightRequest>(offset);
15184            // Vector header
15185            let max_ordinal: u64 = self.max_ordinal_present();
15186            encoder.write_num(max_ordinal, offset);
15187            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15188            // Calling encoder.out_of_line_offset(0) is not allowed.
15189            if max_ordinal == 0 {
15190                return Ok(());
15191            }
15192            depth.increment()?;
15193            let envelope_size = 8;
15194            let bytes_len = max_ordinal as usize * envelope_size;
15195            #[allow(unused_variables)]
15196            let offset = encoder.out_of_line_offset(bytes_len);
15197            let mut _prev_end_offset: usize = 0;
15198            if 1 > max_ordinal {
15199                return Ok(());
15200            }
15201
15202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15203            // are envelope_size bytes.
15204            let cur_offset: usize = (1 - 1) * envelope_size;
15205
15206            // Zero reserved fields.
15207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15208
15209            // Safety:
15210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15212            //   envelope_size bytes, there is always sufficient room.
15213            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
15214            self.to.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
15215            encoder, offset + cur_offset, depth
15216        )?;
15217
15218            _prev_end_offset = cur_offset + envelope_size;
15219            if 2 > max_ordinal {
15220                return Ok(());
15221            }
15222
15223            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15224            // are envelope_size bytes.
15225            let cur_offset: usize = (2 - 1) * envelope_size;
15226
15227            // Zero reserved fields.
15228            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15229
15230            // Safety:
15231            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15232            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15233            //   envelope_size bytes, there is always sufficient room.
15234            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
15235                self.ipv6_pktinfo
15236                    .as_ref()
15237                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15238                encoder,
15239                offset + cur_offset,
15240                depth,
15241            )?;
15242
15243            _prev_end_offset = cur_offset + envelope_size;
15244
15245            Ok(())
15246        }
15247    }
15248
15249    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15250        for DatagramSocketSendMsgPreflightRequest
15251    {
15252        #[inline(always)]
15253        fn new_empty() -> Self {
15254            Self::default()
15255        }
15256
15257        unsafe fn decode(
15258            &mut self,
15259            decoder: &mut fidl::encoding::Decoder<'_, D>,
15260            offset: usize,
15261            mut depth: fidl::encoding::Depth,
15262        ) -> fidl::Result<()> {
15263            decoder.debug_check_bounds::<Self>(offset);
15264            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15265                None => return Err(fidl::Error::NotNullable),
15266                Some(len) => len,
15267            };
15268            // Calling decoder.out_of_line_offset(0) is not allowed.
15269            if len == 0 {
15270                return Ok(());
15271            };
15272            depth.increment()?;
15273            let envelope_size = 8;
15274            let bytes_len = len * envelope_size;
15275            let offset = decoder.out_of_line_offset(bytes_len)?;
15276            // Decode the envelope for each type.
15277            let mut _next_ordinal_to_read = 0;
15278            let mut next_offset = offset;
15279            let end_offset = offset + bytes_len;
15280            _next_ordinal_to_read += 1;
15281            if next_offset >= end_offset {
15282                return Ok(());
15283            }
15284
15285            // Decode unknown envelopes for gaps in ordinals.
15286            while _next_ordinal_to_read < 1 {
15287                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15288                _next_ordinal_to_read += 1;
15289                next_offset += envelope_size;
15290            }
15291
15292            let next_out_of_line = decoder.next_out_of_line();
15293            let handles_before = decoder.remaining_handles();
15294            if let Some((inlined, num_bytes, num_handles)) =
15295                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15296            {
15297                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15298                if inlined != (member_inline_size <= 4) {
15299                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15300                }
15301                let inner_offset;
15302                let mut inner_depth = depth.clone();
15303                if inlined {
15304                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15305                    inner_offset = next_offset;
15306                } else {
15307                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15308                    inner_depth.increment()?;
15309                }
15310                let val_ref = self.to.get_or_insert_with(|| {
15311                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
15312                });
15313                fidl::decode!(
15314                    fidl_fuchsia_net_common::SocketAddress,
15315                    D,
15316                    val_ref,
15317                    decoder,
15318                    inner_offset,
15319                    inner_depth
15320                )?;
15321                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15322                {
15323                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15324                }
15325                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15326                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15327                }
15328            }
15329
15330            next_offset += envelope_size;
15331            _next_ordinal_to_read += 1;
15332            if next_offset >= end_offset {
15333                return Ok(());
15334            }
15335
15336            // Decode unknown envelopes for gaps in ordinals.
15337            while _next_ordinal_to_read < 2 {
15338                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15339                _next_ordinal_to_read += 1;
15340                next_offset += envelope_size;
15341            }
15342
15343            let next_out_of_line = decoder.next_out_of_line();
15344            let handles_before = decoder.remaining_handles();
15345            if let Some((inlined, num_bytes, num_handles)) =
15346                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15347            {
15348                let member_inline_size =
15349                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
15350                        decoder.context,
15351                    );
15352                if inlined != (member_inline_size <= 4) {
15353                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15354                }
15355                let inner_offset;
15356                let mut inner_depth = depth.clone();
15357                if inlined {
15358                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15359                    inner_offset = next_offset;
15360                } else {
15361                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15362                    inner_depth.increment()?;
15363                }
15364                let val_ref = self
15365                    .ipv6_pktinfo
15366                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
15367                fidl::decode!(
15368                    Ipv6PktInfoSendControlData,
15369                    D,
15370                    val_ref,
15371                    decoder,
15372                    inner_offset,
15373                    inner_depth
15374                )?;
15375                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15376                {
15377                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15378                }
15379                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15380                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15381                }
15382            }
15383
15384            next_offset += envelope_size;
15385
15386            // Decode the remaining unknown envelopes.
15387            while next_offset < end_offset {
15388                _next_ordinal_to_read += 1;
15389                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15390                next_offset += envelope_size;
15391            }
15392
15393            Ok(())
15394        }
15395    }
15396
15397    impl InterfaceAddresses {
15398        #[inline(always)]
15399        fn max_ordinal_present(&self) -> u64 {
15400            if let Some(_) = self.interface_flags {
15401                return 5;
15402            }
15403            if let Some(_) = self.addresses {
15404                return 4;
15405            }
15406            if let Some(_) = self.name {
15407                return 2;
15408            }
15409            if let Some(_) = self.id {
15410                return 1;
15411            }
15412            0
15413        }
15414    }
15415
15416    impl fidl::encoding::ValueTypeMarker for InterfaceAddresses {
15417        type Borrowed<'a> = &'a Self;
15418        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15419            value
15420        }
15421    }
15422
15423    unsafe impl fidl::encoding::TypeMarker for InterfaceAddresses {
15424        type Owned = Self;
15425
15426        #[inline(always)]
15427        fn inline_align(_context: fidl::encoding::Context) -> usize {
15428            8
15429        }
15430
15431        #[inline(always)]
15432        fn inline_size(_context: fidl::encoding::Context) -> usize {
15433            16
15434        }
15435    }
15436
15437    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterfaceAddresses, D>
15438        for &InterfaceAddresses
15439    {
15440        unsafe fn encode(
15441            self,
15442            encoder: &mut fidl::encoding::Encoder<'_, D>,
15443            offset: usize,
15444            mut depth: fidl::encoding::Depth,
15445        ) -> fidl::Result<()> {
15446            encoder.debug_check_bounds::<InterfaceAddresses>(offset);
15447            // Vector header
15448            let max_ordinal: u64 = self.max_ordinal_present();
15449            encoder.write_num(max_ordinal, offset);
15450            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15451            // Calling encoder.out_of_line_offset(0) is not allowed.
15452            if max_ordinal == 0 {
15453                return Ok(());
15454            }
15455            depth.increment()?;
15456            let envelope_size = 8;
15457            let bytes_len = max_ordinal as usize * envelope_size;
15458            #[allow(unused_variables)]
15459            let offset = encoder.out_of_line_offset(bytes_len);
15460            let mut _prev_end_offset: usize = 0;
15461            if 1 > max_ordinal {
15462                return Ok(());
15463            }
15464
15465            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15466            // are envelope_size bytes.
15467            let cur_offset: usize = (1 - 1) * envelope_size;
15468
15469            // Zero reserved fields.
15470            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15471
15472            // Safety:
15473            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15474            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15475            //   envelope_size bytes, there is always sufficient room.
15476            fidl::encoding::encode_in_envelope_optional::<u64, D>(
15477                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15478                encoder,
15479                offset + cur_offset,
15480                depth,
15481            )?;
15482
15483            _prev_end_offset = cur_offset + envelope_size;
15484            if 2 > max_ordinal {
15485                return Ok(());
15486            }
15487
15488            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15489            // are envelope_size bytes.
15490            let cur_offset: usize = (2 - 1) * envelope_size;
15491
15492            // Zero reserved fields.
15493            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15494
15495            // Safety:
15496            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15497            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15498            //   envelope_size bytes, there is always sufficient room.
15499            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
15500                self.name.as_ref().map(
15501                    <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow,
15502                ),
15503                encoder,
15504                offset + cur_offset,
15505                depth,
15506            )?;
15507
15508            _prev_end_offset = cur_offset + envelope_size;
15509            if 4 > max_ordinal {
15510                return Ok(());
15511            }
15512
15513            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15514            // are envelope_size bytes.
15515            let cur_offset: usize = (4 - 1) * envelope_size;
15516
15517            // Zero reserved fields.
15518            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15519
15520            // Safety:
15521            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15522            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15523            //   envelope_size bytes, there is always sufficient room.
15524            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet>, D>(
15525            self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
15526            encoder, offset + cur_offset, depth
15527        )?;
15528
15529            _prev_end_offset = cur_offset + envelope_size;
15530            if 5 > max_ordinal {
15531                return Ok(());
15532            }
15533
15534            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15535            // are envelope_size bytes.
15536            let cur_offset: usize = (5 - 1) * envelope_size;
15537
15538            // Zero reserved fields.
15539            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15540
15541            // Safety:
15542            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15543            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15544            //   envelope_size bytes, there is always sufficient room.
15545            fidl::encoding::encode_in_envelope_optional::<InterfaceFlags, D>(
15546                self.interface_flags
15547                    .as_ref()
15548                    .map(<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow),
15549                encoder,
15550                offset + cur_offset,
15551                depth,
15552            )?;
15553
15554            _prev_end_offset = cur_offset + envelope_size;
15555
15556            Ok(())
15557        }
15558    }
15559
15560    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceAddresses {
15561        #[inline(always)]
15562        fn new_empty() -> Self {
15563            Self::default()
15564        }
15565
15566        unsafe fn decode(
15567            &mut self,
15568            decoder: &mut fidl::encoding::Decoder<'_, D>,
15569            offset: usize,
15570            mut depth: fidl::encoding::Depth,
15571        ) -> fidl::Result<()> {
15572            decoder.debug_check_bounds::<Self>(offset);
15573            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15574                None => return Err(fidl::Error::NotNullable),
15575                Some(len) => len,
15576            };
15577            // Calling decoder.out_of_line_offset(0) is not allowed.
15578            if len == 0 {
15579                return Ok(());
15580            };
15581            depth.increment()?;
15582            let envelope_size = 8;
15583            let bytes_len = len * envelope_size;
15584            let offset = decoder.out_of_line_offset(bytes_len)?;
15585            // Decode the envelope for each type.
15586            let mut _next_ordinal_to_read = 0;
15587            let mut next_offset = offset;
15588            let end_offset = offset + bytes_len;
15589            _next_ordinal_to_read += 1;
15590            if next_offset >= end_offset {
15591                return Ok(());
15592            }
15593
15594            // Decode unknown envelopes for gaps in ordinals.
15595            while _next_ordinal_to_read < 1 {
15596                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15597                _next_ordinal_to_read += 1;
15598                next_offset += envelope_size;
15599            }
15600
15601            let next_out_of_line = decoder.next_out_of_line();
15602            let handles_before = decoder.remaining_handles();
15603            if let Some((inlined, num_bytes, num_handles)) =
15604                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15605            {
15606                let member_inline_size =
15607                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15608                if inlined != (member_inline_size <= 4) {
15609                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15610                }
15611                let inner_offset;
15612                let mut inner_depth = depth.clone();
15613                if inlined {
15614                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15615                    inner_offset = next_offset;
15616                } else {
15617                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15618                    inner_depth.increment()?;
15619                }
15620                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
15621                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15622                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15623                {
15624                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15625                }
15626                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15627                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15628                }
15629            }
15630
15631            next_offset += envelope_size;
15632            _next_ordinal_to_read += 1;
15633            if next_offset >= end_offset {
15634                return Ok(());
15635            }
15636
15637            // Decode unknown envelopes for gaps in ordinals.
15638            while _next_ordinal_to_read < 2 {
15639                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15640                _next_ordinal_to_read += 1;
15641                next_offset += envelope_size;
15642            }
15643
15644            let next_out_of_line = decoder.next_out_of_line();
15645            let handles_before = decoder.remaining_handles();
15646            if let Some((inlined, num_bytes, num_handles)) =
15647                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15648            {
15649                let member_inline_size =
15650                    <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
15651                        decoder.context,
15652                    );
15653                if inlined != (member_inline_size <= 4) {
15654                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15655                }
15656                let inner_offset;
15657                let mut inner_depth = depth.clone();
15658                if inlined {
15659                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15660                    inner_offset = next_offset;
15661                } else {
15662                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15663                    inner_depth.increment()?;
15664                }
15665                let val_ref = self
15666                    .name
15667                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
15668                fidl::decode!(
15669                    fidl::encoding::BoundedString<15>,
15670                    D,
15671                    val_ref,
15672                    decoder,
15673                    inner_offset,
15674                    inner_depth
15675                )?;
15676                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15677                {
15678                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15679                }
15680                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15681                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15682                }
15683            }
15684
15685            next_offset += envelope_size;
15686            _next_ordinal_to_read += 1;
15687            if next_offset >= end_offset {
15688                return Ok(());
15689            }
15690
15691            // Decode unknown envelopes for gaps in ordinals.
15692            while _next_ordinal_to_read < 4 {
15693                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15694                _next_ordinal_to_read += 1;
15695                next_offset += envelope_size;
15696            }
15697
15698            let next_out_of_line = decoder.next_out_of_line();
15699            let handles_before = decoder.remaining_handles();
15700            if let Some((inlined, num_bytes, num_handles)) =
15701                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15702            {
15703                let member_inline_size = <fidl::encoding::UnboundedVector<
15704                    fidl_fuchsia_net_common::Subnet,
15705                > as fidl::encoding::TypeMarker>::inline_size(
15706                    decoder.context
15707                );
15708                if inlined != (member_inline_size <= 4) {
15709                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15710                }
15711                let inner_offset;
15712                let mut inner_depth = depth.clone();
15713                if inlined {
15714                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15715                    inner_offset = next_offset;
15716                } else {
15717                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15718                    inner_depth.increment()?;
15719                }
15720                let val_ref = self.addresses.get_or_insert_with(|| {
15721                    fidl::new_empty!(
15722                        fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet>,
15723                        D
15724                    )
15725                });
15726                fidl::decode!(
15727                    fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet>,
15728                    D,
15729                    val_ref,
15730                    decoder,
15731                    inner_offset,
15732                    inner_depth
15733                )?;
15734                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15735                {
15736                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15737                }
15738                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15739                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15740                }
15741            }
15742
15743            next_offset += envelope_size;
15744            _next_ordinal_to_read += 1;
15745            if next_offset >= end_offset {
15746                return Ok(());
15747            }
15748
15749            // Decode unknown envelopes for gaps in ordinals.
15750            while _next_ordinal_to_read < 5 {
15751                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15752                _next_ordinal_to_read += 1;
15753                next_offset += envelope_size;
15754            }
15755
15756            let next_out_of_line = decoder.next_out_of_line();
15757            let handles_before = decoder.remaining_handles();
15758            if let Some((inlined, num_bytes, num_handles)) =
15759                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15760            {
15761                let member_inline_size =
15762                    <InterfaceFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15763                if inlined != (member_inline_size <= 4) {
15764                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15765                }
15766                let inner_offset;
15767                let mut inner_depth = depth.clone();
15768                if inlined {
15769                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15770                    inner_offset = next_offset;
15771                } else {
15772                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15773                    inner_depth.increment()?;
15774                }
15775                let val_ref =
15776                    self.interface_flags.get_or_insert_with(|| fidl::new_empty!(InterfaceFlags, D));
15777                fidl::decode!(InterfaceFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
15778                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15779                {
15780                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15781                }
15782                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15783                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15784                }
15785            }
15786
15787            next_offset += envelope_size;
15788
15789            // Decode the remaining unknown envelopes.
15790            while next_offset < end_offset {
15791                _next_ordinal_to_read += 1;
15792                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15793                next_offset += envelope_size;
15794            }
15795
15796            Ok(())
15797        }
15798    }
15799
15800    impl IpRecvControlData {
15801        #[inline(always)]
15802        fn max_ordinal_present(&self) -> u64 {
15803            if let Some(_) = self.pktinfo {
15804                return 4;
15805            }
15806            if let Some(_) = self.original_destination_address {
15807                return 3;
15808            }
15809            if let Some(_) = self.ttl {
15810                return 2;
15811            }
15812            if let Some(_) = self.tos {
15813                return 1;
15814            }
15815            0
15816        }
15817    }
15818
15819    impl fidl::encoding::ValueTypeMarker for IpRecvControlData {
15820        type Borrowed<'a> = &'a Self;
15821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15822            value
15823        }
15824    }
15825
15826    unsafe impl fidl::encoding::TypeMarker for IpRecvControlData {
15827        type Owned = Self;
15828
15829        #[inline(always)]
15830        fn inline_align(_context: fidl::encoding::Context) -> usize {
15831            8
15832        }
15833
15834        #[inline(always)]
15835        fn inline_size(_context: fidl::encoding::Context) -> usize {
15836            16
15837        }
15838    }
15839
15840    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpRecvControlData, D>
15841        for &IpRecvControlData
15842    {
15843        unsafe fn encode(
15844            self,
15845            encoder: &mut fidl::encoding::Encoder<'_, D>,
15846            offset: usize,
15847            mut depth: fidl::encoding::Depth,
15848        ) -> fidl::Result<()> {
15849            encoder.debug_check_bounds::<IpRecvControlData>(offset);
15850            // Vector header
15851            let max_ordinal: u64 = self.max_ordinal_present();
15852            encoder.write_num(max_ordinal, offset);
15853            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15854            // Calling encoder.out_of_line_offset(0) is not allowed.
15855            if max_ordinal == 0 {
15856                return Ok(());
15857            }
15858            depth.increment()?;
15859            let envelope_size = 8;
15860            let bytes_len = max_ordinal as usize * envelope_size;
15861            #[allow(unused_variables)]
15862            let offset = encoder.out_of_line_offset(bytes_len);
15863            let mut _prev_end_offset: usize = 0;
15864            if 1 > max_ordinal {
15865                return Ok(());
15866            }
15867
15868            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15869            // are envelope_size bytes.
15870            let cur_offset: usize = (1 - 1) * envelope_size;
15871
15872            // Zero reserved fields.
15873            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15874
15875            // Safety:
15876            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15877            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15878            //   envelope_size bytes, there is always sufficient room.
15879            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15880                self.tos.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15881                encoder,
15882                offset + cur_offset,
15883                depth,
15884            )?;
15885
15886            _prev_end_offset = cur_offset + envelope_size;
15887            if 2 > max_ordinal {
15888                return Ok(());
15889            }
15890
15891            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15892            // are envelope_size bytes.
15893            let cur_offset: usize = (2 - 1) * envelope_size;
15894
15895            // Zero reserved fields.
15896            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15897
15898            // Safety:
15899            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15900            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15901            //   envelope_size bytes, there is always sufficient room.
15902            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15903                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15904                encoder,
15905                offset + cur_offset,
15906                depth,
15907            )?;
15908
15909            _prev_end_offset = cur_offset + envelope_size;
15910            if 3 > max_ordinal {
15911                return Ok(());
15912            }
15913
15914            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15915            // are envelope_size bytes.
15916            let cur_offset: usize = (3 - 1) * envelope_size;
15917
15918            // Zero reserved fields.
15919            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15920
15921            // Safety:
15922            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15923            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15924            //   envelope_size bytes, there is always sufficient room.
15925            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
15926            self.original_destination_address.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
15927            encoder, offset + cur_offset, depth
15928        )?;
15929
15930            _prev_end_offset = cur_offset + envelope_size;
15931            if 4 > max_ordinal {
15932                return Ok(());
15933            }
15934
15935            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15936            // are envelope_size bytes.
15937            let cur_offset: usize = (4 - 1) * envelope_size;
15938
15939            // Zero reserved fields.
15940            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15941
15942            // Safety:
15943            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15944            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15945            //   envelope_size bytes, there is always sufficient room.
15946            fidl::encoding::encode_in_envelope_optional::<Ipv4PktInfoRecvControlData, D>(
15947                self.pktinfo
15948                    .as_ref()
15949                    .map(<Ipv4PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
15950                encoder,
15951                offset + cur_offset,
15952                depth,
15953            )?;
15954
15955            _prev_end_offset = cur_offset + envelope_size;
15956
15957            Ok(())
15958        }
15959    }
15960
15961    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpRecvControlData {
15962        #[inline(always)]
15963        fn new_empty() -> Self {
15964            Self::default()
15965        }
15966
15967        unsafe fn decode(
15968            &mut self,
15969            decoder: &mut fidl::encoding::Decoder<'_, D>,
15970            offset: usize,
15971            mut depth: fidl::encoding::Depth,
15972        ) -> fidl::Result<()> {
15973            decoder.debug_check_bounds::<Self>(offset);
15974            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15975                None => return Err(fidl::Error::NotNullable),
15976                Some(len) => len,
15977            };
15978            // Calling decoder.out_of_line_offset(0) is not allowed.
15979            if len == 0 {
15980                return Ok(());
15981            };
15982            depth.increment()?;
15983            let envelope_size = 8;
15984            let bytes_len = len * envelope_size;
15985            let offset = decoder.out_of_line_offset(bytes_len)?;
15986            // Decode the envelope for each type.
15987            let mut _next_ordinal_to_read = 0;
15988            let mut next_offset = offset;
15989            let end_offset = offset + bytes_len;
15990            _next_ordinal_to_read += 1;
15991            if next_offset >= end_offset {
15992                return Ok(());
15993            }
15994
15995            // Decode unknown envelopes for gaps in ordinals.
15996            while _next_ordinal_to_read < 1 {
15997                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15998                _next_ordinal_to_read += 1;
15999                next_offset += envelope_size;
16000            }
16001
16002            let next_out_of_line = decoder.next_out_of_line();
16003            let handles_before = decoder.remaining_handles();
16004            if let Some((inlined, num_bytes, num_handles)) =
16005                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16006            {
16007                let member_inline_size =
16008                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16009                if inlined != (member_inline_size <= 4) {
16010                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16011                }
16012                let inner_offset;
16013                let mut inner_depth = depth.clone();
16014                if inlined {
16015                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16016                    inner_offset = next_offset;
16017                } else {
16018                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16019                    inner_depth.increment()?;
16020                }
16021                let val_ref = self.tos.get_or_insert_with(|| fidl::new_empty!(u8, D));
16022                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16023                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16024                {
16025                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16026                }
16027                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16028                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16029                }
16030            }
16031
16032            next_offset += envelope_size;
16033            _next_ordinal_to_read += 1;
16034            if next_offset >= end_offset {
16035                return Ok(());
16036            }
16037
16038            // Decode unknown envelopes for gaps in ordinals.
16039            while _next_ordinal_to_read < 2 {
16040                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16041                _next_ordinal_to_read += 1;
16042                next_offset += envelope_size;
16043            }
16044
16045            let next_out_of_line = decoder.next_out_of_line();
16046            let handles_before = decoder.remaining_handles();
16047            if let Some((inlined, num_bytes, num_handles)) =
16048                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16049            {
16050                let member_inline_size =
16051                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16052                if inlined != (member_inline_size <= 4) {
16053                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16054                }
16055                let inner_offset;
16056                let mut inner_depth = depth.clone();
16057                if inlined {
16058                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16059                    inner_offset = next_offset;
16060                } else {
16061                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16062                    inner_depth.increment()?;
16063                }
16064                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16065                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16066                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16067                {
16068                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16069                }
16070                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16071                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16072                }
16073            }
16074
16075            next_offset += envelope_size;
16076            _next_ordinal_to_read += 1;
16077            if next_offset >= end_offset {
16078                return Ok(());
16079            }
16080
16081            // Decode unknown envelopes for gaps in ordinals.
16082            while _next_ordinal_to_read < 3 {
16083                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16084                _next_ordinal_to_read += 1;
16085                next_offset += envelope_size;
16086            }
16087
16088            let next_out_of_line = decoder.next_out_of_line();
16089            let handles_before = decoder.remaining_handles();
16090            if let Some((inlined, num_bytes, num_handles)) =
16091                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16092            {
16093                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16094                if inlined != (member_inline_size <= 4) {
16095                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16096                }
16097                let inner_offset;
16098                let mut inner_depth = depth.clone();
16099                if inlined {
16100                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16101                    inner_offset = next_offset;
16102                } else {
16103                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16104                    inner_depth.increment()?;
16105                }
16106                let val_ref = self.original_destination_address.get_or_insert_with(|| {
16107                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
16108                });
16109                fidl::decode!(
16110                    fidl_fuchsia_net_common::SocketAddress,
16111                    D,
16112                    val_ref,
16113                    decoder,
16114                    inner_offset,
16115                    inner_depth
16116                )?;
16117                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16118                {
16119                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16120                }
16121                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16122                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16123                }
16124            }
16125
16126            next_offset += envelope_size;
16127            _next_ordinal_to_read += 1;
16128            if next_offset >= end_offset {
16129                return Ok(());
16130            }
16131
16132            // Decode unknown envelopes for gaps in ordinals.
16133            while _next_ordinal_to_read < 4 {
16134                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16135                _next_ordinal_to_read += 1;
16136                next_offset += envelope_size;
16137            }
16138
16139            let next_out_of_line = decoder.next_out_of_line();
16140            let handles_before = decoder.remaining_handles();
16141            if let Some((inlined, num_bytes, num_handles)) =
16142                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16143            {
16144                let member_inline_size =
16145                    <Ipv4PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16146                        decoder.context,
16147                    );
16148                if inlined != (member_inline_size <= 4) {
16149                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16150                }
16151                let inner_offset;
16152                let mut inner_depth = depth.clone();
16153                if inlined {
16154                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16155                    inner_offset = next_offset;
16156                } else {
16157                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16158                    inner_depth.increment()?;
16159                }
16160                let val_ref = self
16161                    .pktinfo
16162                    .get_or_insert_with(|| fidl::new_empty!(Ipv4PktInfoRecvControlData, D));
16163                fidl::decode!(
16164                    Ipv4PktInfoRecvControlData,
16165                    D,
16166                    val_ref,
16167                    decoder,
16168                    inner_offset,
16169                    inner_depth
16170                )?;
16171                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16172                {
16173                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16174                }
16175                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16176                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16177                }
16178            }
16179
16180            next_offset += envelope_size;
16181
16182            // Decode the remaining unknown envelopes.
16183            while next_offset < end_offset {
16184                _next_ordinal_to_read += 1;
16185                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16186                next_offset += envelope_size;
16187            }
16188
16189            Ok(())
16190        }
16191    }
16192
16193    impl IpSendControlData {
16194        #[inline(always)]
16195        fn max_ordinal_present(&self) -> u64 {
16196            if let Some(_) = self.ttl {
16197                return 2;
16198            }
16199            0
16200        }
16201    }
16202
16203    impl fidl::encoding::ValueTypeMarker for IpSendControlData {
16204        type Borrowed<'a> = &'a Self;
16205        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16206            value
16207        }
16208    }
16209
16210    unsafe impl fidl::encoding::TypeMarker for IpSendControlData {
16211        type Owned = Self;
16212
16213        #[inline(always)]
16214        fn inline_align(_context: fidl::encoding::Context) -> usize {
16215            8
16216        }
16217
16218        #[inline(always)]
16219        fn inline_size(_context: fidl::encoding::Context) -> usize {
16220            16
16221        }
16222    }
16223
16224    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpSendControlData, D>
16225        for &IpSendControlData
16226    {
16227        unsafe fn encode(
16228            self,
16229            encoder: &mut fidl::encoding::Encoder<'_, D>,
16230            offset: usize,
16231            mut depth: fidl::encoding::Depth,
16232        ) -> fidl::Result<()> {
16233            encoder.debug_check_bounds::<IpSendControlData>(offset);
16234            // Vector header
16235            let max_ordinal: u64 = self.max_ordinal_present();
16236            encoder.write_num(max_ordinal, offset);
16237            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16238            // Calling encoder.out_of_line_offset(0) is not allowed.
16239            if max_ordinal == 0 {
16240                return Ok(());
16241            }
16242            depth.increment()?;
16243            let envelope_size = 8;
16244            let bytes_len = max_ordinal as usize * envelope_size;
16245            #[allow(unused_variables)]
16246            let offset = encoder.out_of_line_offset(bytes_len);
16247            let mut _prev_end_offset: usize = 0;
16248            if 2 > max_ordinal {
16249                return Ok(());
16250            }
16251
16252            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16253            // are envelope_size bytes.
16254            let cur_offset: usize = (2 - 1) * envelope_size;
16255
16256            // Zero reserved fields.
16257            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16258
16259            // Safety:
16260            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16261            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16262            //   envelope_size bytes, there is always sufficient room.
16263            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16264                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16265                encoder,
16266                offset + cur_offset,
16267                depth,
16268            )?;
16269
16270            _prev_end_offset = cur_offset + envelope_size;
16271
16272            Ok(())
16273        }
16274    }
16275
16276    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpSendControlData {
16277        #[inline(always)]
16278        fn new_empty() -> Self {
16279            Self::default()
16280        }
16281
16282        unsafe fn decode(
16283            &mut self,
16284            decoder: &mut fidl::encoding::Decoder<'_, D>,
16285            offset: usize,
16286            mut depth: fidl::encoding::Depth,
16287        ) -> fidl::Result<()> {
16288            decoder.debug_check_bounds::<Self>(offset);
16289            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16290                None => return Err(fidl::Error::NotNullable),
16291                Some(len) => len,
16292            };
16293            // Calling decoder.out_of_line_offset(0) is not allowed.
16294            if len == 0 {
16295                return Ok(());
16296            };
16297            depth.increment()?;
16298            let envelope_size = 8;
16299            let bytes_len = len * envelope_size;
16300            let offset = decoder.out_of_line_offset(bytes_len)?;
16301            // Decode the envelope for each type.
16302            let mut _next_ordinal_to_read = 0;
16303            let mut next_offset = offset;
16304            let end_offset = offset + bytes_len;
16305            _next_ordinal_to_read += 1;
16306            if next_offset >= end_offset {
16307                return Ok(());
16308            }
16309
16310            // Decode unknown envelopes for gaps in ordinals.
16311            while _next_ordinal_to_read < 2 {
16312                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16313                _next_ordinal_to_read += 1;
16314                next_offset += envelope_size;
16315            }
16316
16317            let next_out_of_line = decoder.next_out_of_line();
16318            let handles_before = decoder.remaining_handles();
16319            if let Some((inlined, num_bytes, num_handles)) =
16320                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16321            {
16322                let member_inline_size =
16323                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16324                if inlined != (member_inline_size <= 4) {
16325                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16326                }
16327                let inner_offset;
16328                let mut inner_depth = depth.clone();
16329                if inlined {
16330                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16331                    inner_offset = next_offset;
16332                } else {
16333                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16334                    inner_depth.increment()?;
16335                }
16336                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16337                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16338                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16339                {
16340                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16341                }
16342                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16343                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16344                }
16345            }
16346
16347            next_offset += envelope_size;
16348
16349            // Decode the remaining unknown envelopes.
16350            while next_offset < end_offset {
16351                _next_ordinal_to_read += 1;
16352                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16353                next_offset += envelope_size;
16354            }
16355
16356            Ok(())
16357        }
16358    }
16359
16360    impl Ipv6RecvControlData {
16361        #[inline(always)]
16362        fn max_ordinal_present(&self) -> u64 {
16363            if let Some(_) = self.pktinfo {
16364                return 3;
16365            }
16366            if let Some(_) = self.hoplimit {
16367                return 2;
16368            }
16369            if let Some(_) = self.tclass {
16370                return 1;
16371            }
16372            0
16373        }
16374    }
16375
16376    impl fidl::encoding::ValueTypeMarker for Ipv6RecvControlData {
16377        type Borrowed<'a> = &'a Self;
16378        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16379            value
16380        }
16381    }
16382
16383    unsafe impl fidl::encoding::TypeMarker for Ipv6RecvControlData {
16384        type Owned = Self;
16385
16386        #[inline(always)]
16387        fn inline_align(_context: fidl::encoding::Context) -> usize {
16388            8
16389        }
16390
16391        #[inline(always)]
16392        fn inline_size(_context: fidl::encoding::Context) -> usize {
16393            16
16394        }
16395    }
16396
16397    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6RecvControlData, D>
16398        for &Ipv6RecvControlData
16399    {
16400        unsafe fn encode(
16401            self,
16402            encoder: &mut fidl::encoding::Encoder<'_, D>,
16403            offset: usize,
16404            mut depth: fidl::encoding::Depth,
16405        ) -> fidl::Result<()> {
16406            encoder.debug_check_bounds::<Ipv6RecvControlData>(offset);
16407            // Vector header
16408            let max_ordinal: u64 = self.max_ordinal_present();
16409            encoder.write_num(max_ordinal, offset);
16410            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16411            // Calling encoder.out_of_line_offset(0) is not allowed.
16412            if max_ordinal == 0 {
16413                return Ok(());
16414            }
16415            depth.increment()?;
16416            let envelope_size = 8;
16417            let bytes_len = max_ordinal as usize * envelope_size;
16418            #[allow(unused_variables)]
16419            let offset = encoder.out_of_line_offset(bytes_len);
16420            let mut _prev_end_offset: usize = 0;
16421            if 1 > max_ordinal {
16422                return Ok(());
16423            }
16424
16425            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16426            // are envelope_size bytes.
16427            let cur_offset: usize = (1 - 1) * envelope_size;
16428
16429            // Zero reserved fields.
16430            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16431
16432            // Safety:
16433            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16434            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16435            //   envelope_size bytes, there is always sufficient room.
16436            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16437                self.tclass.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16438                encoder,
16439                offset + cur_offset,
16440                depth,
16441            )?;
16442
16443            _prev_end_offset = cur_offset + envelope_size;
16444            if 2 > max_ordinal {
16445                return Ok(());
16446            }
16447
16448            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16449            // are envelope_size bytes.
16450            let cur_offset: usize = (2 - 1) * envelope_size;
16451
16452            // Zero reserved fields.
16453            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16454
16455            // Safety:
16456            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16457            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16458            //   envelope_size bytes, there is always sufficient room.
16459            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16460                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16461                encoder,
16462                offset + cur_offset,
16463                depth,
16464            )?;
16465
16466            _prev_end_offset = cur_offset + envelope_size;
16467            if 3 > max_ordinal {
16468                return Ok(());
16469            }
16470
16471            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16472            // are envelope_size bytes.
16473            let cur_offset: usize = (3 - 1) * envelope_size;
16474
16475            // Zero reserved fields.
16476            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16477
16478            // Safety:
16479            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16480            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16481            //   envelope_size bytes, there is always sufficient room.
16482            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoRecvControlData, D>(
16483                self.pktinfo
16484                    .as_ref()
16485                    .map(<Ipv6PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16486                encoder,
16487                offset + cur_offset,
16488                depth,
16489            )?;
16490
16491            _prev_end_offset = cur_offset + envelope_size;
16492
16493            Ok(())
16494        }
16495    }
16496
16497    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6RecvControlData {
16498        #[inline(always)]
16499        fn new_empty() -> Self {
16500            Self::default()
16501        }
16502
16503        unsafe fn decode(
16504            &mut self,
16505            decoder: &mut fidl::encoding::Decoder<'_, D>,
16506            offset: usize,
16507            mut depth: fidl::encoding::Depth,
16508        ) -> fidl::Result<()> {
16509            decoder.debug_check_bounds::<Self>(offset);
16510            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16511                None => return Err(fidl::Error::NotNullable),
16512                Some(len) => len,
16513            };
16514            // Calling decoder.out_of_line_offset(0) is not allowed.
16515            if len == 0 {
16516                return Ok(());
16517            };
16518            depth.increment()?;
16519            let envelope_size = 8;
16520            let bytes_len = len * envelope_size;
16521            let offset = decoder.out_of_line_offset(bytes_len)?;
16522            // Decode the envelope for each type.
16523            let mut _next_ordinal_to_read = 0;
16524            let mut next_offset = offset;
16525            let end_offset = offset + bytes_len;
16526            _next_ordinal_to_read += 1;
16527            if next_offset >= end_offset {
16528                return Ok(());
16529            }
16530
16531            // Decode unknown envelopes for gaps in ordinals.
16532            while _next_ordinal_to_read < 1 {
16533                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16534                _next_ordinal_to_read += 1;
16535                next_offset += envelope_size;
16536            }
16537
16538            let next_out_of_line = decoder.next_out_of_line();
16539            let handles_before = decoder.remaining_handles();
16540            if let Some((inlined, num_bytes, num_handles)) =
16541                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16542            {
16543                let member_inline_size =
16544                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16545                if inlined != (member_inline_size <= 4) {
16546                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16547                }
16548                let inner_offset;
16549                let mut inner_depth = depth.clone();
16550                if inlined {
16551                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16552                    inner_offset = next_offset;
16553                } else {
16554                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16555                    inner_depth.increment()?;
16556                }
16557                let val_ref = self.tclass.get_or_insert_with(|| fidl::new_empty!(u8, D));
16558                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16559                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16560                {
16561                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16562                }
16563                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16564                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16565                }
16566            }
16567
16568            next_offset += envelope_size;
16569            _next_ordinal_to_read += 1;
16570            if next_offset >= end_offset {
16571                return Ok(());
16572            }
16573
16574            // Decode unknown envelopes for gaps in ordinals.
16575            while _next_ordinal_to_read < 2 {
16576                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16577                _next_ordinal_to_read += 1;
16578                next_offset += envelope_size;
16579            }
16580
16581            let next_out_of_line = decoder.next_out_of_line();
16582            let handles_before = decoder.remaining_handles();
16583            if let Some((inlined, num_bytes, num_handles)) =
16584                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16585            {
16586                let member_inline_size =
16587                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16588                if inlined != (member_inline_size <= 4) {
16589                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16590                }
16591                let inner_offset;
16592                let mut inner_depth = depth.clone();
16593                if inlined {
16594                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16595                    inner_offset = next_offset;
16596                } else {
16597                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16598                    inner_depth.increment()?;
16599                }
16600                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16601                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16602                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16603                {
16604                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16605                }
16606                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16607                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16608                }
16609            }
16610
16611            next_offset += envelope_size;
16612            _next_ordinal_to_read += 1;
16613            if next_offset >= end_offset {
16614                return Ok(());
16615            }
16616
16617            // Decode unknown envelopes for gaps in ordinals.
16618            while _next_ordinal_to_read < 3 {
16619                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16620                _next_ordinal_to_read += 1;
16621                next_offset += envelope_size;
16622            }
16623
16624            let next_out_of_line = decoder.next_out_of_line();
16625            let handles_before = decoder.remaining_handles();
16626            if let Some((inlined, num_bytes, num_handles)) =
16627                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16628            {
16629                let member_inline_size =
16630                    <Ipv6PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16631                        decoder.context,
16632                    );
16633                if inlined != (member_inline_size <= 4) {
16634                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16635                }
16636                let inner_offset;
16637                let mut inner_depth = depth.clone();
16638                if inlined {
16639                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16640                    inner_offset = next_offset;
16641                } else {
16642                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16643                    inner_depth.increment()?;
16644                }
16645                let val_ref = self
16646                    .pktinfo
16647                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoRecvControlData, D));
16648                fidl::decode!(
16649                    Ipv6PktInfoRecvControlData,
16650                    D,
16651                    val_ref,
16652                    decoder,
16653                    inner_offset,
16654                    inner_depth
16655                )?;
16656                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16657                {
16658                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16659                }
16660                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16661                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16662                }
16663            }
16664
16665            next_offset += envelope_size;
16666
16667            // Decode the remaining unknown envelopes.
16668            while next_offset < end_offset {
16669                _next_ordinal_to_read += 1;
16670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16671                next_offset += envelope_size;
16672            }
16673
16674            Ok(())
16675        }
16676    }
16677
16678    impl Ipv6SendControlData {
16679        #[inline(always)]
16680        fn max_ordinal_present(&self) -> u64 {
16681            if let Some(_) = self.pktinfo {
16682                return 3;
16683            }
16684            if let Some(_) = self.hoplimit {
16685                return 2;
16686            }
16687            0
16688        }
16689    }
16690
16691    impl fidl::encoding::ValueTypeMarker for Ipv6SendControlData {
16692        type Borrowed<'a> = &'a Self;
16693        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16694            value
16695        }
16696    }
16697
16698    unsafe impl fidl::encoding::TypeMarker for Ipv6SendControlData {
16699        type Owned = Self;
16700
16701        #[inline(always)]
16702        fn inline_align(_context: fidl::encoding::Context) -> usize {
16703            8
16704        }
16705
16706        #[inline(always)]
16707        fn inline_size(_context: fidl::encoding::Context) -> usize {
16708            16
16709        }
16710    }
16711
16712    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6SendControlData, D>
16713        for &Ipv6SendControlData
16714    {
16715        unsafe fn encode(
16716            self,
16717            encoder: &mut fidl::encoding::Encoder<'_, D>,
16718            offset: usize,
16719            mut depth: fidl::encoding::Depth,
16720        ) -> fidl::Result<()> {
16721            encoder.debug_check_bounds::<Ipv6SendControlData>(offset);
16722            // Vector header
16723            let max_ordinal: u64 = self.max_ordinal_present();
16724            encoder.write_num(max_ordinal, offset);
16725            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16726            // Calling encoder.out_of_line_offset(0) is not allowed.
16727            if max_ordinal == 0 {
16728                return Ok(());
16729            }
16730            depth.increment()?;
16731            let envelope_size = 8;
16732            let bytes_len = max_ordinal as usize * envelope_size;
16733            #[allow(unused_variables)]
16734            let offset = encoder.out_of_line_offset(bytes_len);
16735            let mut _prev_end_offset: usize = 0;
16736            if 2 > max_ordinal {
16737                return Ok(());
16738            }
16739
16740            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16741            // are envelope_size bytes.
16742            let cur_offset: usize = (2 - 1) * envelope_size;
16743
16744            // Zero reserved fields.
16745            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16746
16747            // Safety:
16748            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16749            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16750            //   envelope_size bytes, there is always sufficient room.
16751            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16752                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16753                encoder,
16754                offset + cur_offset,
16755                depth,
16756            )?;
16757
16758            _prev_end_offset = cur_offset + envelope_size;
16759            if 3 > max_ordinal {
16760                return Ok(());
16761            }
16762
16763            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16764            // are envelope_size bytes.
16765            let cur_offset: usize = (3 - 1) * envelope_size;
16766
16767            // Zero reserved fields.
16768            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16769
16770            // Safety:
16771            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16772            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16773            //   envelope_size bytes, there is always sufficient room.
16774            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
16775                self.pktinfo
16776                    .as_ref()
16777                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16778                encoder,
16779                offset + cur_offset,
16780                depth,
16781            )?;
16782
16783            _prev_end_offset = cur_offset + envelope_size;
16784
16785            Ok(())
16786        }
16787    }
16788
16789    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6SendControlData {
16790        #[inline(always)]
16791        fn new_empty() -> Self {
16792            Self::default()
16793        }
16794
16795        unsafe fn decode(
16796            &mut self,
16797            decoder: &mut fidl::encoding::Decoder<'_, D>,
16798            offset: usize,
16799            mut depth: fidl::encoding::Depth,
16800        ) -> fidl::Result<()> {
16801            decoder.debug_check_bounds::<Self>(offset);
16802            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16803                None => return Err(fidl::Error::NotNullable),
16804                Some(len) => len,
16805            };
16806            // Calling decoder.out_of_line_offset(0) is not allowed.
16807            if len == 0 {
16808                return Ok(());
16809            };
16810            depth.increment()?;
16811            let envelope_size = 8;
16812            let bytes_len = len * envelope_size;
16813            let offset = decoder.out_of_line_offset(bytes_len)?;
16814            // Decode the envelope for each type.
16815            let mut _next_ordinal_to_read = 0;
16816            let mut next_offset = offset;
16817            let end_offset = offset + bytes_len;
16818            _next_ordinal_to_read += 1;
16819            if next_offset >= end_offset {
16820                return Ok(());
16821            }
16822
16823            // Decode unknown envelopes for gaps in ordinals.
16824            while _next_ordinal_to_read < 2 {
16825                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16826                _next_ordinal_to_read += 1;
16827                next_offset += envelope_size;
16828            }
16829
16830            let next_out_of_line = decoder.next_out_of_line();
16831            let handles_before = decoder.remaining_handles();
16832            if let Some((inlined, num_bytes, num_handles)) =
16833                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16834            {
16835                let member_inline_size =
16836                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16837                if inlined != (member_inline_size <= 4) {
16838                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16839                }
16840                let inner_offset;
16841                let mut inner_depth = depth.clone();
16842                if inlined {
16843                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16844                    inner_offset = next_offset;
16845                } else {
16846                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16847                    inner_depth.increment()?;
16848                }
16849                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16850                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16851                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16852                {
16853                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16854                }
16855                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16856                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16857                }
16858            }
16859
16860            next_offset += envelope_size;
16861            _next_ordinal_to_read += 1;
16862            if next_offset >= end_offset {
16863                return Ok(());
16864            }
16865
16866            // Decode unknown envelopes for gaps in ordinals.
16867            while _next_ordinal_to_read < 3 {
16868                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16869                _next_ordinal_to_read += 1;
16870                next_offset += envelope_size;
16871            }
16872
16873            let next_out_of_line = decoder.next_out_of_line();
16874            let handles_before = decoder.remaining_handles();
16875            if let Some((inlined, num_bytes, num_handles)) =
16876                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16877            {
16878                let member_inline_size =
16879                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
16880                        decoder.context,
16881                    );
16882                if inlined != (member_inline_size <= 4) {
16883                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16884                }
16885                let inner_offset;
16886                let mut inner_depth = depth.clone();
16887                if inlined {
16888                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16889                    inner_offset = next_offset;
16890                } else {
16891                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16892                    inner_depth.increment()?;
16893                }
16894                let val_ref = self
16895                    .pktinfo
16896                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
16897                fidl::decode!(
16898                    Ipv6PktInfoSendControlData,
16899                    D,
16900                    val_ref,
16901                    decoder,
16902                    inner_offset,
16903                    inner_depth
16904                )?;
16905                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16906                {
16907                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16908                }
16909                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16910                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16911                }
16912            }
16913
16914            next_offset += envelope_size;
16915
16916            // Decode the remaining unknown envelopes.
16917            while next_offset < end_offset {
16918                _next_ordinal_to_read += 1;
16919                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16920                next_offset += envelope_size;
16921            }
16922
16923            Ok(())
16924        }
16925    }
16926
16927    impl NetworkSocketRecvControlData {
16928        #[inline(always)]
16929        fn max_ordinal_present(&self) -> u64 {
16930            if let Some(_) = self.ipv6 {
16931                return 3;
16932            }
16933            if let Some(_) = self.ip {
16934                return 2;
16935            }
16936            if let Some(_) = self.socket {
16937                return 1;
16938            }
16939            0
16940        }
16941    }
16942
16943    impl fidl::encoding::ValueTypeMarker for NetworkSocketRecvControlData {
16944        type Borrowed<'a> = &'a Self;
16945        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16946            value
16947        }
16948    }
16949
16950    unsafe impl fidl::encoding::TypeMarker for NetworkSocketRecvControlData {
16951        type Owned = Self;
16952
16953        #[inline(always)]
16954        fn inline_align(_context: fidl::encoding::Context) -> usize {
16955            8
16956        }
16957
16958        #[inline(always)]
16959        fn inline_size(_context: fidl::encoding::Context) -> usize {
16960            16
16961        }
16962    }
16963
16964    unsafe impl<D: fidl::encoding::ResourceDialect>
16965        fidl::encoding::Encode<NetworkSocketRecvControlData, D> for &NetworkSocketRecvControlData
16966    {
16967        unsafe fn encode(
16968            self,
16969            encoder: &mut fidl::encoding::Encoder<'_, D>,
16970            offset: usize,
16971            mut depth: fidl::encoding::Depth,
16972        ) -> fidl::Result<()> {
16973            encoder.debug_check_bounds::<NetworkSocketRecvControlData>(offset);
16974            // Vector header
16975            let max_ordinal: u64 = self.max_ordinal_present();
16976            encoder.write_num(max_ordinal, offset);
16977            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16978            // Calling encoder.out_of_line_offset(0) is not allowed.
16979            if max_ordinal == 0 {
16980                return Ok(());
16981            }
16982            depth.increment()?;
16983            let envelope_size = 8;
16984            let bytes_len = max_ordinal as usize * envelope_size;
16985            #[allow(unused_variables)]
16986            let offset = encoder.out_of_line_offset(bytes_len);
16987            let mut _prev_end_offset: usize = 0;
16988            if 1 > max_ordinal {
16989                return Ok(());
16990            }
16991
16992            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16993            // are envelope_size bytes.
16994            let cur_offset: usize = (1 - 1) * envelope_size;
16995
16996            // Zero reserved fields.
16997            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16998
16999            // Safety:
17000            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17001            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17002            //   envelope_size bytes, there is always sufficient room.
17003            fidl::encoding::encode_in_envelope_optional::<SocketRecvControlData, D>(
17004                self.socket
17005                    .as_ref()
17006                    .map(<SocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17007                encoder,
17008                offset + cur_offset,
17009                depth,
17010            )?;
17011
17012            _prev_end_offset = cur_offset + envelope_size;
17013            if 2 > max_ordinal {
17014                return Ok(());
17015            }
17016
17017            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17018            // are envelope_size bytes.
17019            let cur_offset: usize = (2 - 1) * envelope_size;
17020
17021            // Zero reserved fields.
17022            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17023
17024            // Safety:
17025            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17026            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17027            //   envelope_size bytes, there is always sufficient room.
17028            fidl::encoding::encode_in_envelope_optional::<IpRecvControlData, D>(
17029                self.ip
17030                    .as_ref()
17031                    .map(<IpRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17032                encoder,
17033                offset + cur_offset,
17034                depth,
17035            )?;
17036
17037            _prev_end_offset = cur_offset + envelope_size;
17038            if 3 > max_ordinal {
17039                return Ok(());
17040            }
17041
17042            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17043            // are envelope_size bytes.
17044            let cur_offset: usize = (3 - 1) * envelope_size;
17045
17046            // Zero reserved fields.
17047            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17048
17049            // Safety:
17050            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17051            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17052            //   envelope_size bytes, there is always sufficient room.
17053            fidl::encoding::encode_in_envelope_optional::<Ipv6RecvControlData, D>(
17054                self.ipv6
17055                    .as_ref()
17056                    .map(<Ipv6RecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17057                encoder,
17058                offset + cur_offset,
17059                depth,
17060            )?;
17061
17062            _prev_end_offset = cur_offset + envelope_size;
17063
17064            Ok(())
17065        }
17066    }
17067
17068    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17069        for NetworkSocketRecvControlData
17070    {
17071        #[inline(always)]
17072        fn new_empty() -> Self {
17073            Self::default()
17074        }
17075
17076        unsafe fn decode(
17077            &mut self,
17078            decoder: &mut fidl::encoding::Decoder<'_, D>,
17079            offset: usize,
17080            mut depth: fidl::encoding::Depth,
17081        ) -> fidl::Result<()> {
17082            decoder.debug_check_bounds::<Self>(offset);
17083            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17084                None => return Err(fidl::Error::NotNullable),
17085                Some(len) => len,
17086            };
17087            // Calling decoder.out_of_line_offset(0) is not allowed.
17088            if len == 0 {
17089                return Ok(());
17090            };
17091            depth.increment()?;
17092            let envelope_size = 8;
17093            let bytes_len = len * envelope_size;
17094            let offset = decoder.out_of_line_offset(bytes_len)?;
17095            // Decode the envelope for each type.
17096            let mut _next_ordinal_to_read = 0;
17097            let mut next_offset = offset;
17098            let end_offset = offset + bytes_len;
17099            _next_ordinal_to_read += 1;
17100            if next_offset >= end_offset {
17101                return Ok(());
17102            }
17103
17104            // Decode unknown envelopes for gaps in ordinals.
17105            while _next_ordinal_to_read < 1 {
17106                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17107                _next_ordinal_to_read += 1;
17108                next_offset += envelope_size;
17109            }
17110
17111            let next_out_of_line = decoder.next_out_of_line();
17112            let handles_before = decoder.remaining_handles();
17113            if let Some((inlined, num_bytes, num_handles)) =
17114                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17115            {
17116                let member_inline_size =
17117                    <SocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17118                        decoder.context,
17119                    );
17120                if inlined != (member_inline_size <= 4) {
17121                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17122                }
17123                let inner_offset;
17124                let mut inner_depth = depth.clone();
17125                if inlined {
17126                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17127                    inner_offset = next_offset;
17128                } else {
17129                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17130                    inner_depth.increment()?;
17131                }
17132                let val_ref =
17133                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketRecvControlData, D));
17134                fidl::decode!(
17135                    SocketRecvControlData,
17136                    D,
17137                    val_ref,
17138                    decoder,
17139                    inner_offset,
17140                    inner_depth
17141                )?;
17142                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17143                {
17144                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17145                }
17146                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17147                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17148                }
17149            }
17150
17151            next_offset += envelope_size;
17152            _next_ordinal_to_read += 1;
17153            if next_offset >= end_offset {
17154                return Ok(());
17155            }
17156
17157            // Decode unknown envelopes for gaps in ordinals.
17158            while _next_ordinal_to_read < 2 {
17159                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17160                _next_ordinal_to_read += 1;
17161                next_offset += envelope_size;
17162            }
17163
17164            let next_out_of_line = decoder.next_out_of_line();
17165            let handles_before = decoder.remaining_handles();
17166            if let Some((inlined, num_bytes, num_handles)) =
17167                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17168            {
17169                let member_inline_size =
17170                    <IpRecvControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17171                if inlined != (member_inline_size <= 4) {
17172                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17173                }
17174                let inner_offset;
17175                let mut inner_depth = depth.clone();
17176                if inlined {
17177                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17178                    inner_offset = next_offset;
17179                } else {
17180                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17181                    inner_depth.increment()?;
17182                }
17183                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpRecvControlData, D));
17184                fidl::decode!(IpRecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17185                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17186                {
17187                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17188                }
17189                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17190                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17191                }
17192            }
17193
17194            next_offset += envelope_size;
17195            _next_ordinal_to_read += 1;
17196            if next_offset >= end_offset {
17197                return Ok(());
17198            }
17199
17200            // Decode unknown envelopes for gaps in ordinals.
17201            while _next_ordinal_to_read < 3 {
17202                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17203                _next_ordinal_to_read += 1;
17204                next_offset += envelope_size;
17205            }
17206
17207            let next_out_of_line = decoder.next_out_of_line();
17208            let handles_before = decoder.remaining_handles();
17209            if let Some((inlined, num_bytes, num_handles)) =
17210                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17211            {
17212                let member_inline_size =
17213                    <Ipv6RecvControlData as fidl::encoding::TypeMarker>::inline_size(
17214                        decoder.context,
17215                    );
17216                if inlined != (member_inline_size <= 4) {
17217                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17218                }
17219                let inner_offset;
17220                let mut inner_depth = depth.clone();
17221                if inlined {
17222                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17223                    inner_offset = next_offset;
17224                } else {
17225                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17226                    inner_depth.increment()?;
17227                }
17228                let val_ref =
17229                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6RecvControlData, D));
17230                fidl::decode!(Ipv6RecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17231                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17232                {
17233                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17234                }
17235                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17236                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17237                }
17238            }
17239
17240            next_offset += envelope_size;
17241
17242            // Decode the remaining unknown envelopes.
17243            while next_offset < end_offset {
17244                _next_ordinal_to_read += 1;
17245                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17246                next_offset += envelope_size;
17247            }
17248
17249            Ok(())
17250        }
17251    }
17252
17253    impl NetworkSocketSendControlData {
17254        #[inline(always)]
17255        fn max_ordinal_present(&self) -> u64 {
17256            if let Some(_) = self.ipv6 {
17257                return 3;
17258            }
17259            if let Some(_) = self.ip {
17260                return 2;
17261            }
17262            if let Some(_) = self.socket {
17263                return 1;
17264            }
17265            0
17266        }
17267    }
17268
17269    impl fidl::encoding::ValueTypeMarker for NetworkSocketSendControlData {
17270        type Borrowed<'a> = &'a Self;
17271        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17272            value
17273        }
17274    }
17275
17276    unsafe impl fidl::encoding::TypeMarker for NetworkSocketSendControlData {
17277        type Owned = Self;
17278
17279        #[inline(always)]
17280        fn inline_align(_context: fidl::encoding::Context) -> usize {
17281            8
17282        }
17283
17284        #[inline(always)]
17285        fn inline_size(_context: fidl::encoding::Context) -> usize {
17286            16
17287        }
17288    }
17289
17290    unsafe impl<D: fidl::encoding::ResourceDialect>
17291        fidl::encoding::Encode<NetworkSocketSendControlData, D> for &NetworkSocketSendControlData
17292    {
17293        unsafe fn encode(
17294            self,
17295            encoder: &mut fidl::encoding::Encoder<'_, D>,
17296            offset: usize,
17297            mut depth: fidl::encoding::Depth,
17298        ) -> fidl::Result<()> {
17299            encoder.debug_check_bounds::<NetworkSocketSendControlData>(offset);
17300            // Vector header
17301            let max_ordinal: u64 = self.max_ordinal_present();
17302            encoder.write_num(max_ordinal, offset);
17303            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17304            // Calling encoder.out_of_line_offset(0) is not allowed.
17305            if max_ordinal == 0 {
17306                return Ok(());
17307            }
17308            depth.increment()?;
17309            let envelope_size = 8;
17310            let bytes_len = max_ordinal as usize * envelope_size;
17311            #[allow(unused_variables)]
17312            let offset = encoder.out_of_line_offset(bytes_len);
17313            let mut _prev_end_offset: usize = 0;
17314            if 1 > max_ordinal {
17315                return Ok(());
17316            }
17317
17318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17319            // are envelope_size bytes.
17320            let cur_offset: usize = (1 - 1) * envelope_size;
17321
17322            // Zero reserved fields.
17323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17324
17325            // Safety:
17326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17328            //   envelope_size bytes, there is always sufficient room.
17329            fidl::encoding::encode_in_envelope_optional::<SocketSendControlData, D>(
17330                self.socket
17331                    .as_ref()
17332                    .map(<SocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17333                encoder,
17334                offset + cur_offset,
17335                depth,
17336            )?;
17337
17338            _prev_end_offset = cur_offset + envelope_size;
17339            if 2 > max_ordinal {
17340                return Ok(());
17341            }
17342
17343            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17344            // are envelope_size bytes.
17345            let cur_offset: usize = (2 - 1) * envelope_size;
17346
17347            // Zero reserved fields.
17348            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17349
17350            // Safety:
17351            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17352            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17353            //   envelope_size bytes, there is always sufficient room.
17354            fidl::encoding::encode_in_envelope_optional::<IpSendControlData, D>(
17355                self.ip
17356                    .as_ref()
17357                    .map(<IpSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17358                encoder,
17359                offset + cur_offset,
17360                depth,
17361            )?;
17362
17363            _prev_end_offset = cur_offset + envelope_size;
17364            if 3 > max_ordinal {
17365                return Ok(());
17366            }
17367
17368            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17369            // are envelope_size bytes.
17370            let cur_offset: usize = (3 - 1) * envelope_size;
17371
17372            // Zero reserved fields.
17373            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17374
17375            // Safety:
17376            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17377            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17378            //   envelope_size bytes, there is always sufficient room.
17379            fidl::encoding::encode_in_envelope_optional::<Ipv6SendControlData, D>(
17380                self.ipv6
17381                    .as_ref()
17382                    .map(<Ipv6SendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17383                encoder,
17384                offset + cur_offset,
17385                depth,
17386            )?;
17387
17388            _prev_end_offset = cur_offset + envelope_size;
17389
17390            Ok(())
17391        }
17392    }
17393
17394    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17395        for NetworkSocketSendControlData
17396    {
17397        #[inline(always)]
17398        fn new_empty() -> Self {
17399            Self::default()
17400        }
17401
17402        unsafe fn decode(
17403            &mut self,
17404            decoder: &mut fidl::encoding::Decoder<'_, D>,
17405            offset: usize,
17406            mut depth: fidl::encoding::Depth,
17407        ) -> fidl::Result<()> {
17408            decoder.debug_check_bounds::<Self>(offset);
17409            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17410                None => return Err(fidl::Error::NotNullable),
17411                Some(len) => len,
17412            };
17413            // Calling decoder.out_of_line_offset(0) is not allowed.
17414            if len == 0 {
17415                return Ok(());
17416            };
17417            depth.increment()?;
17418            let envelope_size = 8;
17419            let bytes_len = len * envelope_size;
17420            let offset = decoder.out_of_line_offset(bytes_len)?;
17421            // Decode the envelope for each type.
17422            let mut _next_ordinal_to_read = 0;
17423            let mut next_offset = offset;
17424            let end_offset = offset + bytes_len;
17425            _next_ordinal_to_read += 1;
17426            if next_offset >= end_offset {
17427                return Ok(());
17428            }
17429
17430            // Decode unknown envelopes for gaps in ordinals.
17431            while _next_ordinal_to_read < 1 {
17432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17433                _next_ordinal_to_read += 1;
17434                next_offset += envelope_size;
17435            }
17436
17437            let next_out_of_line = decoder.next_out_of_line();
17438            let handles_before = decoder.remaining_handles();
17439            if let Some((inlined, num_bytes, num_handles)) =
17440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17441            {
17442                let member_inline_size =
17443                    <SocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17444                        decoder.context,
17445                    );
17446                if inlined != (member_inline_size <= 4) {
17447                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17448                }
17449                let inner_offset;
17450                let mut inner_depth = depth.clone();
17451                if inlined {
17452                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17453                    inner_offset = next_offset;
17454                } else {
17455                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17456                    inner_depth.increment()?;
17457                }
17458                let val_ref =
17459                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketSendControlData, D));
17460                fidl::decode!(
17461                    SocketSendControlData,
17462                    D,
17463                    val_ref,
17464                    decoder,
17465                    inner_offset,
17466                    inner_depth
17467                )?;
17468                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17469                {
17470                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17471                }
17472                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17473                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17474                }
17475            }
17476
17477            next_offset += envelope_size;
17478            _next_ordinal_to_read += 1;
17479            if next_offset >= end_offset {
17480                return Ok(());
17481            }
17482
17483            // Decode unknown envelopes for gaps in ordinals.
17484            while _next_ordinal_to_read < 2 {
17485                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17486                _next_ordinal_to_read += 1;
17487                next_offset += envelope_size;
17488            }
17489
17490            let next_out_of_line = decoder.next_out_of_line();
17491            let handles_before = decoder.remaining_handles();
17492            if let Some((inlined, num_bytes, num_handles)) =
17493                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17494            {
17495                let member_inline_size =
17496                    <IpSendControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17497                if inlined != (member_inline_size <= 4) {
17498                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17499                }
17500                let inner_offset;
17501                let mut inner_depth = depth.clone();
17502                if inlined {
17503                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17504                    inner_offset = next_offset;
17505                } else {
17506                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17507                    inner_depth.increment()?;
17508                }
17509                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpSendControlData, D));
17510                fidl::decode!(IpSendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17511                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17512                {
17513                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17514                }
17515                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17516                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17517                }
17518            }
17519
17520            next_offset += envelope_size;
17521            _next_ordinal_to_read += 1;
17522            if next_offset >= end_offset {
17523                return Ok(());
17524            }
17525
17526            // Decode unknown envelopes for gaps in ordinals.
17527            while _next_ordinal_to_read < 3 {
17528                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17529                _next_ordinal_to_read += 1;
17530                next_offset += envelope_size;
17531            }
17532
17533            let next_out_of_line = decoder.next_out_of_line();
17534            let handles_before = decoder.remaining_handles();
17535            if let Some((inlined, num_bytes, num_handles)) =
17536                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17537            {
17538                let member_inline_size =
17539                    <Ipv6SendControlData as fidl::encoding::TypeMarker>::inline_size(
17540                        decoder.context,
17541                    );
17542                if inlined != (member_inline_size <= 4) {
17543                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17544                }
17545                let inner_offset;
17546                let mut inner_depth = depth.clone();
17547                if inlined {
17548                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17549                    inner_offset = next_offset;
17550                } else {
17551                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17552                    inner_depth.increment()?;
17553                }
17554                let val_ref =
17555                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6SendControlData, D));
17556                fidl::decode!(Ipv6SendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17557                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17558                {
17559                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17560                }
17561                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17562                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17563                }
17564            }
17565
17566            next_offset += envelope_size;
17567
17568            // Decode the remaining unknown envelopes.
17569            while next_offset < end_offset {
17570                _next_ordinal_to_read += 1;
17571                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17572                next_offset += envelope_size;
17573            }
17574
17575            Ok(())
17576        }
17577    }
17578
17579    impl RecvMsgMeta {
17580        #[inline(always)]
17581        fn max_ordinal_present(&self) -> u64 {
17582            if let Some(_) = self.payload_len {
17583                return 3;
17584            }
17585            if let Some(_) = self.control {
17586                return 2;
17587            }
17588            if let Some(_) = self.from {
17589                return 1;
17590            }
17591            0
17592        }
17593    }
17594
17595    impl fidl::encoding::ValueTypeMarker for RecvMsgMeta {
17596        type Borrowed<'a> = &'a Self;
17597        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17598            value
17599        }
17600    }
17601
17602    unsafe impl fidl::encoding::TypeMarker for RecvMsgMeta {
17603        type Owned = Self;
17604
17605        #[inline(always)]
17606        fn inline_align(_context: fidl::encoding::Context) -> usize {
17607            8
17608        }
17609
17610        #[inline(always)]
17611        fn inline_size(_context: fidl::encoding::Context) -> usize {
17612            16
17613        }
17614    }
17615
17616    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecvMsgMeta, D>
17617        for &RecvMsgMeta
17618    {
17619        unsafe fn encode(
17620            self,
17621            encoder: &mut fidl::encoding::Encoder<'_, D>,
17622            offset: usize,
17623            mut depth: fidl::encoding::Depth,
17624        ) -> fidl::Result<()> {
17625            encoder.debug_check_bounds::<RecvMsgMeta>(offset);
17626            // Vector header
17627            let max_ordinal: u64 = self.max_ordinal_present();
17628            encoder.write_num(max_ordinal, offset);
17629            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17630            // Calling encoder.out_of_line_offset(0) is not allowed.
17631            if max_ordinal == 0 {
17632                return Ok(());
17633            }
17634            depth.increment()?;
17635            let envelope_size = 8;
17636            let bytes_len = max_ordinal as usize * envelope_size;
17637            #[allow(unused_variables)]
17638            let offset = encoder.out_of_line_offset(bytes_len);
17639            let mut _prev_end_offset: usize = 0;
17640            if 1 > max_ordinal {
17641                return Ok(());
17642            }
17643
17644            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17645            // are envelope_size bytes.
17646            let cur_offset: usize = (1 - 1) * envelope_size;
17647
17648            // Zero reserved fields.
17649            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17650
17651            // Safety:
17652            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17653            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17654            //   envelope_size bytes, there is always sufficient room.
17655            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
17656            self.from.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17657            encoder, offset + cur_offset, depth
17658        )?;
17659
17660            _prev_end_offset = cur_offset + envelope_size;
17661            if 2 > max_ordinal {
17662                return Ok(());
17663            }
17664
17665            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17666            // are envelope_size bytes.
17667            let cur_offset: usize = (2 - 1) * envelope_size;
17668
17669            // Zero reserved fields.
17670            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17671
17672            // Safety:
17673            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17674            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17675            //   envelope_size bytes, there is always sufficient room.
17676            fidl::encoding::encode_in_envelope_optional::<DatagramSocketRecvControlData, D>(
17677                self.control.as_ref().map(
17678                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow,
17679                ),
17680                encoder,
17681                offset + cur_offset,
17682                depth,
17683            )?;
17684
17685            _prev_end_offset = cur_offset + envelope_size;
17686            if 3 > max_ordinal {
17687                return Ok(());
17688            }
17689
17690            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17691            // are envelope_size bytes.
17692            let cur_offset: usize = (3 - 1) * envelope_size;
17693
17694            // Zero reserved fields.
17695            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17696
17697            // Safety:
17698            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17699            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17700            //   envelope_size bytes, there is always sufficient room.
17701            fidl::encoding::encode_in_envelope_optional::<u16, D>(
17702                self.payload_len.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17703                encoder,
17704                offset + cur_offset,
17705                depth,
17706            )?;
17707
17708            _prev_end_offset = cur_offset + envelope_size;
17709
17710            Ok(())
17711        }
17712    }
17713
17714    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgMeta {
17715        #[inline(always)]
17716        fn new_empty() -> Self {
17717            Self::default()
17718        }
17719
17720        unsafe fn decode(
17721            &mut self,
17722            decoder: &mut fidl::encoding::Decoder<'_, D>,
17723            offset: usize,
17724            mut depth: fidl::encoding::Depth,
17725        ) -> fidl::Result<()> {
17726            decoder.debug_check_bounds::<Self>(offset);
17727            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17728                None => return Err(fidl::Error::NotNullable),
17729                Some(len) => len,
17730            };
17731            // Calling decoder.out_of_line_offset(0) is not allowed.
17732            if len == 0 {
17733                return Ok(());
17734            };
17735            depth.increment()?;
17736            let envelope_size = 8;
17737            let bytes_len = len * envelope_size;
17738            let offset = decoder.out_of_line_offset(bytes_len)?;
17739            // Decode the envelope for each type.
17740            let mut _next_ordinal_to_read = 0;
17741            let mut next_offset = offset;
17742            let end_offset = offset + bytes_len;
17743            _next_ordinal_to_read += 1;
17744            if next_offset >= end_offset {
17745                return Ok(());
17746            }
17747
17748            // Decode unknown envelopes for gaps in ordinals.
17749            while _next_ordinal_to_read < 1 {
17750                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17751                _next_ordinal_to_read += 1;
17752                next_offset += envelope_size;
17753            }
17754
17755            let next_out_of_line = decoder.next_out_of_line();
17756            let handles_before = decoder.remaining_handles();
17757            if let Some((inlined, num_bytes, num_handles)) =
17758                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17759            {
17760                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17761                if inlined != (member_inline_size <= 4) {
17762                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17763                }
17764                let inner_offset;
17765                let mut inner_depth = depth.clone();
17766                if inlined {
17767                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17768                    inner_offset = next_offset;
17769                } else {
17770                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17771                    inner_depth.increment()?;
17772                }
17773                let val_ref = self.from.get_or_insert_with(|| {
17774                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
17775                });
17776                fidl::decode!(
17777                    fidl_fuchsia_net_common::SocketAddress,
17778                    D,
17779                    val_ref,
17780                    decoder,
17781                    inner_offset,
17782                    inner_depth
17783                )?;
17784                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17785                {
17786                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17787                }
17788                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17789                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17790                }
17791            }
17792
17793            next_offset += envelope_size;
17794            _next_ordinal_to_read += 1;
17795            if next_offset >= end_offset {
17796                return Ok(());
17797            }
17798
17799            // Decode unknown envelopes for gaps in ordinals.
17800            while _next_ordinal_to_read < 2 {
17801                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17802                _next_ordinal_to_read += 1;
17803                next_offset += envelope_size;
17804            }
17805
17806            let next_out_of_line = decoder.next_out_of_line();
17807            let handles_before = decoder.remaining_handles();
17808            if let Some((inlined, num_bytes, num_handles)) =
17809                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17810            {
17811                let member_inline_size =
17812                    <DatagramSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17813                        decoder.context,
17814                    );
17815                if inlined != (member_inline_size <= 4) {
17816                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17817                }
17818                let inner_offset;
17819                let mut inner_depth = depth.clone();
17820                if inlined {
17821                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17822                    inner_offset = next_offset;
17823                } else {
17824                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17825                    inner_depth.increment()?;
17826                }
17827                let val_ref = self
17828                    .control
17829                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketRecvControlData, D));
17830                fidl::decode!(
17831                    DatagramSocketRecvControlData,
17832                    D,
17833                    val_ref,
17834                    decoder,
17835                    inner_offset,
17836                    inner_depth
17837                )?;
17838                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17839                {
17840                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17841                }
17842                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17843                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17844                }
17845            }
17846
17847            next_offset += envelope_size;
17848            _next_ordinal_to_read += 1;
17849            if next_offset >= end_offset {
17850                return Ok(());
17851            }
17852
17853            // Decode unknown envelopes for gaps in ordinals.
17854            while _next_ordinal_to_read < 3 {
17855                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17856                _next_ordinal_to_read += 1;
17857                next_offset += envelope_size;
17858            }
17859
17860            let next_out_of_line = decoder.next_out_of_line();
17861            let handles_before = decoder.remaining_handles();
17862            if let Some((inlined, num_bytes, num_handles)) =
17863                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17864            {
17865                let member_inline_size =
17866                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17867                if inlined != (member_inline_size <= 4) {
17868                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17869                }
17870                let inner_offset;
17871                let mut inner_depth = depth.clone();
17872                if inlined {
17873                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17874                    inner_offset = next_offset;
17875                } else {
17876                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17877                    inner_depth.increment()?;
17878                }
17879                let val_ref = self.payload_len.get_or_insert_with(|| fidl::new_empty!(u16, D));
17880                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
17881                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17882                {
17883                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17884                }
17885                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17886                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17887                }
17888            }
17889
17890            next_offset += envelope_size;
17891
17892            // Decode the remaining unknown envelopes.
17893            while next_offset < end_offset {
17894                _next_ordinal_to_read += 1;
17895                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17896                next_offset += envelope_size;
17897            }
17898
17899            Ok(())
17900        }
17901    }
17902
17903    impl SendMsgMeta {
17904        #[inline(always)]
17905        fn max_ordinal_present(&self) -> u64 {
17906            if let Some(_) = self.control {
17907                return 2;
17908            }
17909            if let Some(_) = self.to {
17910                return 1;
17911            }
17912            0
17913        }
17914    }
17915
17916    impl fidl::encoding::ValueTypeMarker for SendMsgMeta {
17917        type Borrowed<'a> = &'a Self;
17918        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17919            value
17920        }
17921    }
17922
17923    unsafe impl fidl::encoding::TypeMarker for SendMsgMeta {
17924        type Owned = Self;
17925
17926        #[inline(always)]
17927        fn inline_align(_context: fidl::encoding::Context) -> usize {
17928            8
17929        }
17930
17931        #[inline(always)]
17932        fn inline_size(_context: fidl::encoding::Context) -> usize {
17933            16
17934        }
17935    }
17936
17937    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SendMsgMeta, D>
17938        for &SendMsgMeta
17939    {
17940        unsafe fn encode(
17941            self,
17942            encoder: &mut fidl::encoding::Encoder<'_, D>,
17943            offset: usize,
17944            mut depth: fidl::encoding::Depth,
17945        ) -> fidl::Result<()> {
17946            encoder.debug_check_bounds::<SendMsgMeta>(offset);
17947            // Vector header
17948            let max_ordinal: u64 = self.max_ordinal_present();
17949            encoder.write_num(max_ordinal, offset);
17950            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17951            // Calling encoder.out_of_line_offset(0) is not allowed.
17952            if max_ordinal == 0 {
17953                return Ok(());
17954            }
17955            depth.increment()?;
17956            let envelope_size = 8;
17957            let bytes_len = max_ordinal as usize * envelope_size;
17958            #[allow(unused_variables)]
17959            let offset = encoder.out_of_line_offset(bytes_len);
17960            let mut _prev_end_offset: usize = 0;
17961            if 1 > max_ordinal {
17962                return Ok(());
17963            }
17964
17965            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17966            // are envelope_size bytes.
17967            let cur_offset: usize = (1 - 1) * envelope_size;
17968
17969            // Zero reserved fields.
17970            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17971
17972            // Safety:
17973            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17974            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17975            //   envelope_size bytes, there is always sufficient room.
17976            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
17977            self.to.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17978            encoder, offset + cur_offset, depth
17979        )?;
17980
17981            _prev_end_offset = cur_offset + envelope_size;
17982            if 2 > max_ordinal {
17983                return Ok(());
17984            }
17985
17986            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17987            // are envelope_size bytes.
17988            let cur_offset: usize = (2 - 1) * envelope_size;
17989
17990            // Zero reserved fields.
17991            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17992
17993            // Safety:
17994            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17995            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17996            //   envelope_size bytes, there is always sufficient room.
17997            fidl::encoding::encode_in_envelope_optional::<DatagramSocketSendControlData, D>(
17998                self.control.as_ref().map(
17999                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow,
18000                ),
18001                encoder,
18002                offset + cur_offset,
18003                depth,
18004            )?;
18005
18006            _prev_end_offset = cur_offset + envelope_size;
18007
18008            Ok(())
18009        }
18010    }
18011
18012    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgMeta {
18013        #[inline(always)]
18014        fn new_empty() -> Self {
18015            Self::default()
18016        }
18017
18018        unsafe fn decode(
18019            &mut self,
18020            decoder: &mut fidl::encoding::Decoder<'_, D>,
18021            offset: usize,
18022            mut depth: fidl::encoding::Depth,
18023        ) -> fidl::Result<()> {
18024            decoder.debug_check_bounds::<Self>(offset);
18025            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18026                None => return Err(fidl::Error::NotNullable),
18027                Some(len) => len,
18028            };
18029            // Calling decoder.out_of_line_offset(0) is not allowed.
18030            if len == 0 {
18031                return Ok(());
18032            };
18033            depth.increment()?;
18034            let envelope_size = 8;
18035            let bytes_len = len * envelope_size;
18036            let offset = decoder.out_of_line_offset(bytes_len)?;
18037            // Decode the envelope for each type.
18038            let mut _next_ordinal_to_read = 0;
18039            let mut next_offset = offset;
18040            let end_offset = offset + bytes_len;
18041            _next_ordinal_to_read += 1;
18042            if next_offset >= end_offset {
18043                return Ok(());
18044            }
18045
18046            // Decode unknown envelopes for gaps in ordinals.
18047            while _next_ordinal_to_read < 1 {
18048                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18049                _next_ordinal_to_read += 1;
18050                next_offset += envelope_size;
18051            }
18052
18053            let next_out_of_line = decoder.next_out_of_line();
18054            let handles_before = decoder.remaining_handles();
18055            if let Some((inlined, num_bytes, num_handles)) =
18056                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18057            {
18058                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18059                if inlined != (member_inline_size <= 4) {
18060                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18061                }
18062                let inner_offset;
18063                let mut inner_depth = depth.clone();
18064                if inlined {
18065                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18066                    inner_offset = next_offset;
18067                } else {
18068                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18069                    inner_depth.increment()?;
18070                }
18071                let val_ref = self.to.get_or_insert_with(|| {
18072                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
18073                });
18074                fidl::decode!(
18075                    fidl_fuchsia_net_common::SocketAddress,
18076                    D,
18077                    val_ref,
18078                    decoder,
18079                    inner_offset,
18080                    inner_depth
18081                )?;
18082                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18083                {
18084                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18085                }
18086                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18087                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18088                }
18089            }
18090
18091            next_offset += envelope_size;
18092            _next_ordinal_to_read += 1;
18093            if next_offset >= end_offset {
18094                return Ok(());
18095            }
18096
18097            // Decode unknown envelopes for gaps in ordinals.
18098            while _next_ordinal_to_read < 2 {
18099                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18100                _next_ordinal_to_read += 1;
18101                next_offset += envelope_size;
18102            }
18103
18104            let next_out_of_line = decoder.next_out_of_line();
18105            let handles_before = decoder.remaining_handles();
18106            if let Some((inlined, num_bytes, num_handles)) =
18107                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18108            {
18109                let member_inline_size =
18110                    <DatagramSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
18111                        decoder.context,
18112                    );
18113                if inlined != (member_inline_size <= 4) {
18114                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18115                }
18116                let inner_offset;
18117                let mut inner_depth = depth.clone();
18118                if inlined {
18119                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18120                    inner_offset = next_offset;
18121                } else {
18122                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18123                    inner_depth.increment()?;
18124                }
18125                let val_ref = self
18126                    .control
18127                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketSendControlData, D));
18128                fidl::decode!(
18129                    DatagramSocketSendControlData,
18130                    D,
18131                    val_ref,
18132                    decoder,
18133                    inner_offset,
18134                    inner_depth
18135                )?;
18136                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18137                {
18138                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18139                }
18140                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18141                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18142                }
18143            }
18144
18145            next_offset += envelope_size;
18146
18147            // Decode the remaining unknown envelopes.
18148            while next_offset < end_offset {
18149                _next_ordinal_to_read += 1;
18150                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18151                next_offset += envelope_size;
18152            }
18153
18154            Ok(())
18155        }
18156    }
18157
18158    impl SocketRecvControlData {
18159        #[inline(always)]
18160        fn max_ordinal_present(&self) -> u64 {
18161            if let Some(_) = self.timestamp {
18162                return 3;
18163            }
18164            0
18165        }
18166    }
18167
18168    impl fidl::encoding::ValueTypeMarker for SocketRecvControlData {
18169        type Borrowed<'a> = &'a Self;
18170        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18171            value
18172        }
18173    }
18174
18175    unsafe impl fidl::encoding::TypeMarker for SocketRecvControlData {
18176        type Owned = Self;
18177
18178        #[inline(always)]
18179        fn inline_align(_context: fidl::encoding::Context) -> usize {
18180            8
18181        }
18182
18183        #[inline(always)]
18184        fn inline_size(_context: fidl::encoding::Context) -> usize {
18185            16
18186        }
18187    }
18188
18189    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketRecvControlData, D>
18190        for &SocketRecvControlData
18191    {
18192        unsafe fn encode(
18193            self,
18194            encoder: &mut fidl::encoding::Encoder<'_, D>,
18195            offset: usize,
18196            mut depth: fidl::encoding::Depth,
18197        ) -> fidl::Result<()> {
18198            encoder.debug_check_bounds::<SocketRecvControlData>(offset);
18199            // Vector header
18200            let max_ordinal: u64 = self.max_ordinal_present();
18201            encoder.write_num(max_ordinal, offset);
18202            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18203            // Calling encoder.out_of_line_offset(0) is not allowed.
18204            if max_ordinal == 0 {
18205                return Ok(());
18206            }
18207            depth.increment()?;
18208            let envelope_size = 8;
18209            let bytes_len = max_ordinal as usize * envelope_size;
18210            #[allow(unused_variables)]
18211            let offset = encoder.out_of_line_offset(bytes_len);
18212            let mut _prev_end_offset: usize = 0;
18213            if 3 > max_ordinal {
18214                return Ok(());
18215            }
18216
18217            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18218            // are envelope_size bytes.
18219            let cur_offset: usize = (3 - 1) * envelope_size;
18220
18221            // Zero reserved fields.
18222            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18223
18224            // Safety:
18225            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18226            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18227            //   envelope_size bytes, there is always sufficient room.
18228            fidl::encoding::encode_in_envelope_optional::<Timestamp, D>(
18229                self.timestamp.as_ref().map(<Timestamp as fidl::encoding::ValueTypeMarker>::borrow),
18230                encoder,
18231                offset + cur_offset,
18232                depth,
18233            )?;
18234
18235            _prev_end_offset = cur_offset + envelope_size;
18236
18237            Ok(())
18238        }
18239    }
18240
18241    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketRecvControlData {
18242        #[inline(always)]
18243        fn new_empty() -> Self {
18244            Self::default()
18245        }
18246
18247        unsafe fn decode(
18248            &mut self,
18249            decoder: &mut fidl::encoding::Decoder<'_, D>,
18250            offset: usize,
18251            mut depth: fidl::encoding::Depth,
18252        ) -> fidl::Result<()> {
18253            decoder.debug_check_bounds::<Self>(offset);
18254            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18255                None => return Err(fidl::Error::NotNullable),
18256                Some(len) => len,
18257            };
18258            // Calling decoder.out_of_line_offset(0) is not allowed.
18259            if len == 0 {
18260                return Ok(());
18261            };
18262            depth.increment()?;
18263            let envelope_size = 8;
18264            let bytes_len = len * envelope_size;
18265            let offset = decoder.out_of_line_offset(bytes_len)?;
18266            // Decode the envelope for each type.
18267            let mut _next_ordinal_to_read = 0;
18268            let mut next_offset = offset;
18269            let end_offset = offset + bytes_len;
18270            _next_ordinal_to_read += 1;
18271            if next_offset >= end_offset {
18272                return Ok(());
18273            }
18274
18275            // Decode unknown envelopes for gaps in ordinals.
18276            while _next_ordinal_to_read < 3 {
18277                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18278                _next_ordinal_to_read += 1;
18279                next_offset += envelope_size;
18280            }
18281
18282            let next_out_of_line = decoder.next_out_of_line();
18283            let handles_before = decoder.remaining_handles();
18284            if let Some((inlined, num_bytes, num_handles)) =
18285                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18286            {
18287                let member_inline_size =
18288                    <Timestamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18289                if inlined != (member_inline_size <= 4) {
18290                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18291                }
18292                let inner_offset;
18293                let mut inner_depth = depth.clone();
18294                if inlined {
18295                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18296                    inner_offset = next_offset;
18297                } else {
18298                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18299                    inner_depth.increment()?;
18300                }
18301                let val_ref = self.timestamp.get_or_insert_with(|| fidl::new_empty!(Timestamp, D));
18302                fidl::decode!(Timestamp, D, val_ref, decoder, inner_offset, inner_depth)?;
18303                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18304                {
18305                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18306                }
18307                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18308                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18309                }
18310            }
18311
18312            next_offset += envelope_size;
18313
18314            // Decode the remaining unknown envelopes.
18315            while next_offset < end_offset {
18316                _next_ordinal_to_read += 1;
18317                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18318                next_offset += envelope_size;
18319            }
18320
18321            Ok(())
18322        }
18323    }
18324
18325    impl SocketSendControlData {
18326        #[inline(always)]
18327        fn max_ordinal_present(&self) -> u64 {
18328            0
18329        }
18330    }
18331
18332    impl fidl::encoding::ValueTypeMarker for SocketSendControlData {
18333        type Borrowed<'a> = &'a Self;
18334        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18335            value
18336        }
18337    }
18338
18339    unsafe impl fidl::encoding::TypeMarker for SocketSendControlData {
18340        type Owned = Self;
18341
18342        #[inline(always)]
18343        fn inline_align(_context: fidl::encoding::Context) -> usize {
18344            8
18345        }
18346
18347        #[inline(always)]
18348        fn inline_size(_context: fidl::encoding::Context) -> usize {
18349            16
18350        }
18351    }
18352
18353    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketSendControlData, D>
18354        for &SocketSendControlData
18355    {
18356        unsafe fn encode(
18357            self,
18358            encoder: &mut fidl::encoding::Encoder<'_, D>,
18359            offset: usize,
18360            mut depth: fidl::encoding::Depth,
18361        ) -> fidl::Result<()> {
18362            encoder.debug_check_bounds::<SocketSendControlData>(offset);
18363            // Vector header
18364            let max_ordinal: u64 = self.max_ordinal_present();
18365            encoder.write_num(max_ordinal, offset);
18366            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18367            // Calling encoder.out_of_line_offset(0) is not allowed.
18368            if max_ordinal == 0 {
18369                return Ok(());
18370            }
18371            depth.increment()?;
18372            let envelope_size = 8;
18373            let bytes_len = max_ordinal as usize * envelope_size;
18374            #[allow(unused_variables)]
18375            let offset = encoder.out_of_line_offset(bytes_len);
18376            let mut _prev_end_offset: usize = 0;
18377
18378            Ok(())
18379        }
18380    }
18381
18382    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketSendControlData {
18383        #[inline(always)]
18384        fn new_empty() -> Self {
18385            Self::default()
18386        }
18387
18388        unsafe fn decode(
18389            &mut self,
18390            decoder: &mut fidl::encoding::Decoder<'_, D>,
18391            offset: usize,
18392            mut depth: fidl::encoding::Depth,
18393        ) -> fidl::Result<()> {
18394            decoder.debug_check_bounds::<Self>(offset);
18395            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18396                None => return Err(fidl::Error::NotNullable),
18397                Some(len) => len,
18398            };
18399            // Calling decoder.out_of_line_offset(0) is not allowed.
18400            if len == 0 {
18401                return Ok(());
18402            };
18403            depth.increment()?;
18404            let envelope_size = 8;
18405            let bytes_len = len * envelope_size;
18406            let offset = decoder.out_of_line_offset(bytes_len)?;
18407            // Decode the envelope for each type.
18408            let mut _next_ordinal_to_read = 0;
18409            let mut next_offset = offset;
18410            let end_offset = offset + bytes_len;
18411
18412            // Decode the remaining unknown envelopes.
18413            while next_offset < end_offset {
18414                _next_ordinal_to_read += 1;
18415                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18416                next_offset += envelope_size;
18417            }
18418
18419            Ok(())
18420        }
18421    }
18422
18423    impl fidl::encoding::ValueTypeMarker for OptionalUint32 {
18424        type Borrowed<'a> = &'a Self;
18425        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18426            value
18427        }
18428    }
18429
18430    unsafe impl fidl::encoding::TypeMarker for OptionalUint32 {
18431        type Owned = Self;
18432
18433        #[inline(always)]
18434        fn inline_align(_context: fidl::encoding::Context) -> usize {
18435            8
18436        }
18437
18438        #[inline(always)]
18439        fn inline_size(_context: fidl::encoding::Context) -> usize {
18440            16
18441        }
18442    }
18443
18444    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint32, D>
18445        for &OptionalUint32
18446    {
18447        #[inline]
18448        unsafe fn encode(
18449            self,
18450            encoder: &mut fidl::encoding::Encoder<'_, D>,
18451            offset: usize,
18452            _depth: fidl::encoding::Depth,
18453        ) -> fidl::Result<()> {
18454            encoder.debug_check_bounds::<OptionalUint32>(offset);
18455            encoder.write_num::<u64>(self.ordinal(), offset);
18456            match self {
18457                OptionalUint32::Value(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
18458                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
18459                    encoder,
18460                    offset + 8,
18461                    _depth,
18462                ),
18463                OptionalUint32::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
18464                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
18465                    encoder,
18466                    offset + 8,
18467                    _depth,
18468                ),
18469            }
18470        }
18471    }
18472
18473    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint32 {
18474        #[inline(always)]
18475        fn new_empty() -> Self {
18476            Self::Value(fidl::new_empty!(u32, D))
18477        }
18478
18479        #[inline]
18480        unsafe fn decode(
18481            &mut self,
18482            decoder: &mut fidl::encoding::Decoder<'_, D>,
18483            offset: usize,
18484            mut depth: fidl::encoding::Depth,
18485        ) -> fidl::Result<()> {
18486            decoder.debug_check_bounds::<Self>(offset);
18487            #[allow(unused_variables)]
18488            let next_out_of_line = decoder.next_out_of_line();
18489            let handles_before = decoder.remaining_handles();
18490            let (ordinal, inlined, num_bytes, num_handles) =
18491                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
18492
18493            let member_inline_size = match ordinal {
18494                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18495                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18496                _ => return Err(fidl::Error::UnknownUnionTag),
18497            };
18498
18499            if inlined != (member_inline_size <= 4) {
18500                return Err(fidl::Error::InvalidInlineBitInEnvelope);
18501            }
18502            let _inner_offset;
18503            if inlined {
18504                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
18505                _inner_offset = offset + 8;
18506            } else {
18507                depth.increment()?;
18508                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18509            }
18510            match ordinal {
18511                1 => {
18512                    #[allow(irrefutable_let_patterns)]
18513                    if let OptionalUint32::Value(_) = self {
18514                        // Do nothing, read the value into the object
18515                    } else {
18516                        // Initialize `self` to the right variant
18517                        *self = OptionalUint32::Value(fidl::new_empty!(u32, D));
18518                    }
18519                    #[allow(irrefutable_let_patterns)]
18520                    if let OptionalUint32::Value(ref mut val) = self {
18521                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
18522                    } else {
18523                        unreachable!()
18524                    }
18525                }
18526                2 => {
18527                    #[allow(irrefutable_let_patterns)]
18528                    if let OptionalUint32::Unset(_) = self {
18529                        // Do nothing, read the value into the object
18530                    } else {
18531                        // Initialize `self` to the right variant
18532                        *self = OptionalUint32::Unset(fidl::new_empty!(Empty, D));
18533                    }
18534                    #[allow(irrefutable_let_patterns)]
18535                    if let OptionalUint32::Unset(ref mut val) = self {
18536                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
18537                    } else {
18538                        unreachable!()
18539                    }
18540                }
18541                ordinal => panic!("unexpected ordinal {:?}", ordinal),
18542            }
18543            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
18544                return Err(fidl::Error::InvalidNumBytesInEnvelope);
18545            }
18546            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18547                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18548            }
18549            Ok(())
18550        }
18551    }
18552
18553    impl fidl::encoding::ValueTypeMarker for OptionalUint8 {
18554        type Borrowed<'a> = &'a Self;
18555        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18556            value
18557        }
18558    }
18559
18560    unsafe impl fidl::encoding::TypeMarker for OptionalUint8 {
18561        type Owned = Self;
18562
18563        #[inline(always)]
18564        fn inline_align(_context: fidl::encoding::Context) -> usize {
18565            8
18566        }
18567
18568        #[inline(always)]
18569        fn inline_size(_context: fidl::encoding::Context) -> usize {
18570            16
18571        }
18572    }
18573
18574    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint8, D>
18575        for &OptionalUint8
18576    {
18577        #[inline]
18578        unsafe fn encode(
18579            self,
18580            encoder: &mut fidl::encoding::Encoder<'_, D>,
18581            offset: usize,
18582            _depth: fidl::encoding::Depth,
18583        ) -> fidl::Result<()> {
18584            encoder.debug_check_bounds::<OptionalUint8>(offset);
18585            encoder.write_num::<u64>(self.ordinal(), offset);
18586            match self {
18587                OptionalUint8::Value(ref val) => fidl::encoding::encode_in_envelope::<u8, D>(
18588                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
18589                    encoder,
18590                    offset + 8,
18591                    _depth,
18592                ),
18593                OptionalUint8::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
18594                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
18595                    encoder,
18596                    offset + 8,
18597                    _depth,
18598                ),
18599            }
18600        }
18601    }
18602
18603    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint8 {
18604        #[inline(always)]
18605        fn new_empty() -> Self {
18606            Self::Value(fidl::new_empty!(u8, D))
18607        }
18608
18609        #[inline]
18610        unsafe fn decode(
18611            &mut self,
18612            decoder: &mut fidl::encoding::Decoder<'_, D>,
18613            offset: usize,
18614            mut depth: fidl::encoding::Depth,
18615        ) -> fidl::Result<()> {
18616            decoder.debug_check_bounds::<Self>(offset);
18617            #[allow(unused_variables)]
18618            let next_out_of_line = decoder.next_out_of_line();
18619            let handles_before = decoder.remaining_handles();
18620            let (ordinal, inlined, num_bytes, num_handles) =
18621                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
18622
18623            let member_inline_size = match ordinal {
18624                1 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18625                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18626                _ => return Err(fidl::Error::UnknownUnionTag),
18627            };
18628
18629            if inlined != (member_inline_size <= 4) {
18630                return Err(fidl::Error::InvalidInlineBitInEnvelope);
18631            }
18632            let _inner_offset;
18633            if inlined {
18634                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
18635                _inner_offset = offset + 8;
18636            } else {
18637                depth.increment()?;
18638                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18639            }
18640            match ordinal {
18641                1 => {
18642                    #[allow(irrefutable_let_patterns)]
18643                    if let OptionalUint8::Value(_) = self {
18644                        // Do nothing, read the value into the object
18645                    } else {
18646                        // Initialize `self` to the right variant
18647                        *self = OptionalUint8::Value(fidl::new_empty!(u8, D));
18648                    }
18649                    #[allow(irrefutable_let_patterns)]
18650                    if let OptionalUint8::Value(ref mut val) = self {
18651                        fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
18652                    } else {
18653                        unreachable!()
18654                    }
18655                }
18656                2 => {
18657                    #[allow(irrefutable_let_patterns)]
18658                    if let OptionalUint8::Unset(_) = self {
18659                        // Do nothing, read the value into the object
18660                    } else {
18661                        // Initialize `self` to the right variant
18662                        *self = OptionalUint8::Unset(fidl::new_empty!(Empty, D));
18663                    }
18664                    #[allow(irrefutable_let_patterns)]
18665                    if let OptionalUint8::Unset(ref mut val) = self {
18666                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
18667                    } else {
18668                        unreachable!()
18669                    }
18670                }
18671                ordinal => panic!("unexpected ordinal {:?}", ordinal),
18672            }
18673            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
18674                return Err(fidl::Error::InvalidNumBytesInEnvelope);
18675            }
18676            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18677                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18678            }
18679            Ok(())
18680        }
18681    }
18682}