fidl_fuchsia_posix_socket__common/
fidl_fuchsia_posix_socket__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const DATAGRAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/DatagramSocket";
12
13/// Constant bounding the number of eventpairs returned by Netstack to clients
14/// of the fast protocol.
15///
16/// Set equal to `ZX_WAIT_MANY_MAXIMUM_ITEMS` - 1, where `ZX_WAIT_MANY_MAXIMUM_ITEMS`
17/// is defined in `//zircon/system/public/zircon/types.h` and bounds the number of eventpairs
18/// in a single call to `zx_object_wait_many`. The bias leaves room to allow clients to wait
19/// for errors on the zircon socket in the same call.
20pub const FAST_UDP_WAIT_MANY_MAXIMUM_ITEMS: u32 = 63;
21
22pub const SIGNAL_DATAGRAM_ERROR: u32 = USER_SIGNAL_2 as u32;
23
24pub const SIGNAL_DATAGRAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
25
26pub const SIGNAL_DATAGRAM_OUTGOING: u32 = USER_SIGNAL_1 as u32;
27
28pub const SIGNAL_DATAGRAM_SHUTDOWN_READ: u32 = USER_SIGNAL_4 as u32;
29
30pub const SIGNAL_DATAGRAM_SHUTDOWN_WRITE: u32 = USER_SIGNAL_5 as u32;
31
32pub const SIGNAL_STREAM_CONNECTED: u32 = USER_SIGNAL_3 as u32;
33
34pub const SIGNAL_STREAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
35
36pub const STREAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/StreamSocket";
37
38pub const SYNCHRONOUS_DATAGRAM_SOCKET_PROTOCOL_NAME: &str =
39    "fuchsia.posix.socket/SynchronousDatagramSocket";
40
41pub const USER_SIGNAL_0: u32 = 16777216;
42
43pub const USER_SIGNAL_1: u32 = 33554432;
44
45pub const USER_SIGNAL_2: u32 = 67108864;
46
47pub const USER_SIGNAL_3: u32 = 134217728;
48
49pub const USER_SIGNAL_4: u32 = 268435456;
50
51pub const USER_SIGNAL_5: u32 = 536870912;
52
53bitflags! {
54    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
55    pub struct CmsgRequests: u32 {
56        /// Identifies whether the `IP_RECVTOS` control message is requested.
57        const IP_TOS = 1;
58        /// Identifies whether the `IP_RECVTTL` control message is requested.
59        const IP_TTL = 2;
60        /// Identifies whether the `IPV6_RECVTCLASS` control message is requested.
61        const IPV6_TCLASS = 4;
62        /// Identifies whether the `IPV6_RECVHOPLIMIT` control message is requested.
63        const IPV6_HOPLIMIT = 8;
64        /// Identifies whether the `IPV6_RECVPKTINFO` control message is requested.
65        const IPV6_PKTINFO = 16;
66        /// Identifies whether the `IP_RECVORIGDSTADDR` control message is requested.
67        const IP_RECVORIGDSTADDR = 32;
68    }
69}
70
71impl CmsgRequests {
72    #[inline(always)]
73    pub fn from_bits_allow_unknown(bits: u32) -> Self {
74        Self::from_bits_retain(bits)
75    }
76
77    #[inline(always)]
78    pub fn has_unknown_bits(&self) -> bool {
79        self.get_unknown_bits() != 0
80    }
81
82    #[inline(always)]
83    pub fn get_unknown_bits(&self) -> u32 {
84        self.bits() & !Self::all().bits()
85    }
86}
87
88bitflags! {
89    /// Bits representing the interface flags as returned by the SIOCGIFFLAGS ioctl
90    /// operation. These bitmasks are intended to track the C API definition. For
91    /// example, `InterfaceFlags.UP` corresponds to `IFF_UP`, etc.
92    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
93    pub struct InterfaceFlags: u16 {
94        const UP = 1;
95        const BROADCAST = 2;
96        const DEBUG = 4;
97        const LOOPBACK = 8;
98        const POINTTOPOINT = 16;
99        const NOTRAILERS = 32;
100        const RUNNING = 64;
101        const NOARP = 128;
102        const PROMISC = 256;
103        const ALLMULTI = 512;
104        const LEADER = 1024;
105        const FOLLOWER = 2048;
106        const MULTICAST = 4096;
107        const PORTSEL = 8192;
108        const AUTOMEDIA = 16384;
109        const DYNAMIC = 32768;
110    }
111}
112
113impl InterfaceFlags {}
114
115bitflags! {
116    /// Flags controlling RecvMsg behavior.
117    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
118    pub struct RecvMsgFlags: u16 {
119        /// Returns data from the receive queue without removing from it.
120        ///
121        /// Equivalent to `MSG_PEEK`.
122        const PEEK = 2;
123    }
124}
125
126impl RecvMsgFlags {}
127
128bitflags! {
129    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
130    pub struct SendMsgFlags: u16 {
131        const RESERVED = 32768;
132    }
133}
134
135impl SendMsgFlags {}
136
137bitflags! {
138    /// Socket shutdown mode.
139    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
140    pub struct ShutdownMode: u16 {
141        /// Shutdown socket read endpoint.
142        const READ = 1;
143        /// Shutdown socket write endpoint.
144        const WRITE = 2;
145    }
146}
147
148impl ShutdownMode {}
149
150/// Protocols supported by [`fuchsia.posix.socket/DatagramSocket`].
151///
152/// `DatagramSocketProtocol` enumerates the protocols supported by the network
153/// stack over datagram sockets.
154#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
155#[repr(u32)]
156pub enum DatagramSocketProtocol {
157    /// UDP (User Datagram Protocol).
158    ///
159    /// A UDP socket is equivalent to the POSIX API of `SOCK_DGRAM` with a
160    /// protocol of 0 or `IPPROTO_UDP`.
161    Udp = 1,
162    /// ICMP (Internet Control Message Protocol) echo.
163    ///
164    /// An ICMP echo socket is equivalent to the POSIX API of `SOCK_DGRAM` with
165    /// a protocol of `IPPROTO_ICMP` `IPPROTO_ICMPV6` (depending on provided
166    /// domain).
167    ///
168    /// Datagrams sent over an ICMP echo socket *must* have a valid ICMP or
169    /// ICMPv6 echo header.
170    IcmpEcho = 2,
171}
172
173impl DatagramSocketProtocol {
174    #[inline]
175    pub fn from_primitive(prim: u32) -> Option<Self> {
176        match prim {
177            1 => Some(Self::Udp),
178            2 => Some(Self::IcmpEcho),
179            _ => None,
180        }
181    }
182
183    #[inline]
184    pub const fn into_primitive(self) -> u32 {
185        self as u32
186    }
187}
188
189/// A socket's domain.
190///
191/// Determines the addressing domain for a socket.
192#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
193#[repr(i16)]
194pub enum Domain {
195    /// An IPv4 socket. Equivalent to `AF_INET`.
196    Ipv4 = 0,
197    /// An IPv6 socket. Equivalent to `AF_INET6`.
198    Ipv6 = 1,
199}
200
201impl Domain {
202    #[inline]
203    pub fn from_primitive(prim: i16) -> Option<Self> {
204        match prim {
205            0 => Some(Self::Ipv4),
206            1 => Some(Self::Ipv6),
207            _ => None,
208        }
209    }
210
211    #[inline]
212    pub const fn into_primitive(self) -> i16 {
213        self as i16
214    }
215}
216
217/// Protocols supported by [`fuchsia.posix.socket/StreamSocket`].
218///
219/// `StreamSocketProtocol` enumerates the protocols supported by the network
220/// stack over stream sockets.
221#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
222#[repr(u32)]
223pub enum StreamSocketProtocol {
224    /// TCP (Transmission Control Protocol).
225    ///
226    /// A TCP socket is equivalent to the POSIX API of `SOCK_STREAM` with a
227    /// protocol of 0 or `IPPROTO_TCP`.
228    Tcp = 0,
229}
230
231impl StreamSocketProtocol {
232    #[inline]
233    pub fn from_primitive(prim: u32) -> Option<Self> {
234        match prim {
235            0 => Some(Self::Tcp),
236            _ => None,
237        }
238    }
239
240    #[inline]
241    pub const fn into_primitive(self) -> u32 {
242        self as u32
243    }
244}
245
246/// TCP congestion control modes.
247#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
248#[repr(u32)]
249pub enum TcpCongestionControl {
250    Reno = 1,
251    Cubic = 2,
252}
253
254impl TcpCongestionControl {
255    #[inline]
256    pub fn from_primitive(prim: u32) -> Option<Self> {
257        match prim {
258            1 => Some(Self::Reno),
259            2 => Some(Self::Cubic),
260            _ => None,
261        }
262    }
263
264    #[inline]
265    pub const fn into_primitive(self) -> u32 {
266        self as u32
267    }
268}
269
270/// TCP congestion control state machine state.
271#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
272#[repr(u32)]
273pub enum TcpCongestionControlState {
274    Open = 0,
275    Disorder = 1,
276    CongestionWindowReduced = 2,
277    Recovery = 3,
278    Loss = 4,
279}
280
281impl TcpCongestionControlState {
282    #[inline]
283    pub fn from_primitive(prim: u32) -> Option<Self> {
284        match prim {
285            0 => Some(Self::Open),
286            1 => Some(Self::Disorder),
287            2 => Some(Self::CongestionWindowReduced),
288            3 => Some(Self::Recovery),
289            4 => Some(Self::Loss),
290            _ => None,
291        }
292    }
293
294    #[inline]
295    pub const fn into_primitive(self) -> u32 {
296        self as u32
297    }
298}
299
300/// TCP state machine state.
301#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
302#[repr(u32)]
303pub enum TcpState {
304    Established = 1,
305    SynSent = 2,
306    SynRecv = 3,
307    FinWait1 = 4,
308    FinWait2 = 5,
309    TimeWait = 6,
310    Close = 7,
311    CloseWait = 8,
312    LastAck = 9,
313    Listen = 10,
314    Closing = 11,
315}
316
317impl TcpState {
318    #[inline]
319    pub fn from_primitive(prim: u32) -> Option<Self> {
320        match prim {
321            1 => Some(Self::Established),
322            2 => Some(Self::SynSent),
323            3 => Some(Self::SynRecv),
324            4 => Some(Self::FinWait1),
325            5 => Some(Self::FinWait2),
326            6 => Some(Self::TimeWait),
327            7 => Some(Self::Close),
328            8 => Some(Self::CloseWait),
329            9 => Some(Self::LastAck),
330            10 => Some(Self::Listen),
331            11 => Some(Self::Closing),
332            _ => None,
333        }
334    }
335
336    #[inline]
337    pub const fn into_primitive(self) -> u32 {
338        self as u32
339    }
340}
341
342/// Packet timestamp reporting precision options.
343#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
344#[repr(u32)]
345pub enum TimestampOption {
346    /// Do not report timestamp.
347    Disabled = 0,
348    /// Report timestamp with nanosecond precision.
349    Nanosecond = 1,
350    /// Report timestamp with microsecond precision.
351    Microsecond = 2,
352}
353
354impl TimestampOption {
355    #[inline]
356    pub fn from_primitive(prim: u32) -> Option<Self> {
357        match prim {
358            0 => Some(Self::Disabled),
359            1 => Some(Self::Nanosecond),
360            2 => Some(Self::Microsecond),
361            _ => None,
362        }
363    }
364
365    #[inline]
366    pub const fn into_primitive(self) -> u32 {
367        self as u32
368    }
369}
370
371#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
372pub enum UdpMetadataEncodingProtocolVersion {
373    Zero,
374    #[doc(hidden)]
375    __SourceBreaking {
376        unknown_ordinal: u16,
377    },
378}
379
380/// Pattern that matches an unknown `UdpMetadataEncodingProtocolVersion` member.
381#[macro_export]
382macro_rules! UdpMetadataEncodingProtocolVersionUnknown {
383    () => {
384        _
385    };
386}
387
388impl UdpMetadataEncodingProtocolVersion {
389    #[inline]
390    pub fn from_primitive(prim: u16) -> Option<Self> {
391        match prim {
392            0 => Some(Self::Zero),
393            _ => None,
394        }
395    }
396
397    #[inline]
398    pub fn from_primitive_allow_unknown(prim: u16) -> Self {
399        match prim {
400            0 => Self::Zero,
401            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
402        }
403    }
404
405    #[inline]
406    pub fn unknown() -> Self {
407        Self::__SourceBreaking { unknown_ordinal: 0xffff }
408    }
409
410    #[inline]
411    pub const fn into_primitive(self) -> u16 {
412        match self {
413            Self::Zero => 0,
414            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
415        }
416    }
417
418    #[inline]
419    pub fn is_unknown(&self) -> bool {
420        match self {
421            Self::__SourceBreaking { unknown_ordinal: _ } => true,
422            _ => false,
423        }
424    }
425}
426
427#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
428pub struct BaseDatagramSocketGetInfoResponse {
429    pub domain: Domain,
430    pub proto: DatagramSocketProtocol,
431}
432
433impl fidl::Persistable for BaseDatagramSocketGetInfoResponse {}
434
435#[derive(Clone, Debug, PartialEq)]
436pub struct BaseNetworkSocketAddIpMembershipRequest {
437    pub membership: IpMulticastMembership,
438}
439
440impl fidl::Persistable for BaseNetworkSocketAddIpMembershipRequest {}
441
442#[derive(Clone, Debug, PartialEq)]
443pub struct BaseNetworkSocketAddIpv6MembershipRequest {
444    pub membership: Ipv6MulticastMembership,
445}
446
447impl fidl::Persistable for BaseNetworkSocketAddIpv6MembershipRequest {}
448
449#[derive(Clone, Debug, PartialEq)]
450pub struct BaseNetworkSocketBindRequest {
451    pub addr: fidl_fuchsia_net__common::SocketAddress,
452}
453
454impl fidl::Persistable for BaseNetworkSocketBindRequest {}
455
456#[derive(Clone, Debug, PartialEq)]
457pub struct BaseNetworkSocketConnectRequest {
458    pub addr: fidl_fuchsia_net__common::SocketAddress,
459}
460
461impl fidl::Persistable for BaseNetworkSocketConnectRequest {}
462
463#[derive(Clone, Debug, PartialEq)]
464pub struct BaseNetworkSocketDropIpMembershipRequest {
465    pub membership: IpMulticastMembership,
466}
467
468impl fidl::Persistable for BaseNetworkSocketDropIpMembershipRequest {}
469
470#[derive(Clone, Debug, PartialEq)]
471pub struct BaseNetworkSocketDropIpv6MembershipRequest {
472    pub membership: Ipv6MulticastMembership,
473}
474
475impl fidl::Persistable for BaseNetworkSocketDropIpv6MembershipRequest {}
476
477#[derive(Clone, Debug, PartialEq)]
478pub struct BaseNetworkSocketSetIpMulticastInterfaceRequest {
479    pub iface: u64,
480    pub address: fidl_fuchsia_net__common::Ipv4Address,
481}
482
483impl fidl::Persistable for BaseNetworkSocketSetIpMulticastInterfaceRequest {}
484
485#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
486pub struct BaseNetworkSocketSetIpMulticastLoopbackRequest {
487    pub value: bool,
488}
489
490impl fidl::Persistable for BaseNetworkSocketSetIpMulticastLoopbackRequest {}
491
492#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
493pub struct BaseNetworkSocketSetIpMulticastTtlRequest {
494    pub value: OptionalUint8,
495}
496
497impl fidl::Persistable for BaseNetworkSocketSetIpMulticastTtlRequest {}
498
499#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
500pub struct BaseNetworkSocketSetIpPacketInfoRequest {
501    pub value: bool,
502}
503
504impl fidl::Persistable for BaseNetworkSocketSetIpPacketInfoRequest {}
505
506#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
507pub struct BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {
508    pub value: bool,
509}
510
511impl fidl::Persistable for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {}
512
513#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
514pub struct BaseNetworkSocketSetIpReceiveTtlRequest {
515    pub value: bool,
516}
517
518impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTtlRequest {}
519
520#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
521pub struct BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
522    pub value: bool,
523}
524
525impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {}
526
527#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
528pub struct BaseNetworkSocketSetIpTransparentRequest {
529    pub value: bool,
530}
531
532impl fidl::Persistable for BaseNetworkSocketSetIpTransparentRequest {}
533
534#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
535pub struct BaseNetworkSocketSetIpTtlRequest {
536    pub value: OptionalUint8,
537}
538
539impl fidl::Persistable for BaseNetworkSocketSetIpTtlRequest {}
540
541#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
542#[repr(C)]
543pub struct BaseNetworkSocketSetIpTypeOfServiceRequest {
544    pub value: u8,
545}
546
547impl fidl::Persistable for BaseNetworkSocketSetIpTypeOfServiceRequest {}
548
549#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
550pub struct BaseNetworkSocketSetIpv6MulticastHopsRequest {
551    pub value: OptionalUint8,
552}
553
554impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastHopsRequest {}
555
556#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
557#[repr(C)]
558pub struct BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
559    pub value: u64,
560}
561
562impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {}
563
564#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
565pub struct BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
566    pub value: bool,
567}
568
569impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {}
570
571#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
572pub struct BaseNetworkSocketSetIpv6OnlyRequest {
573    pub value: bool,
574}
575
576impl fidl::Persistable for BaseNetworkSocketSetIpv6OnlyRequest {}
577
578#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
579pub struct BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
580    pub value: bool,
581}
582
583impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {}
584
585#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
586pub struct BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
587    pub value: bool,
588}
589
590impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {}
591
592#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
593pub struct BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
594    pub value: bool,
595}
596
597impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {}
598
599#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
600pub struct BaseNetworkSocketSetIpv6TrafficClassRequest {
601    pub value: OptionalUint8,
602}
603
604impl fidl::Persistable for BaseNetworkSocketSetIpv6TrafficClassRequest {}
605
606#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
607pub struct BaseNetworkSocketSetIpv6UnicastHopsRequest {
608    pub value: OptionalUint8,
609}
610
611impl fidl::Persistable for BaseNetworkSocketSetIpv6UnicastHopsRequest {}
612
613#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
614pub struct BaseNetworkSocketShutdownRequest {
615    pub mode: ShutdownMode,
616}
617
618impl fidl::Persistable for BaseNetworkSocketShutdownRequest {}
619
620#[derive(Clone, Debug, PartialEq)]
621pub struct BaseNetworkSocketGetIpMulticastInterfaceResponse {
622    pub value: fidl_fuchsia_net__common::Ipv4Address,
623}
624
625impl fidl::Persistable for BaseNetworkSocketGetIpMulticastInterfaceResponse {}
626
627#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
628pub struct BaseNetworkSocketGetIpMulticastLoopbackResponse {
629    pub value: bool,
630}
631
632impl fidl::Persistable for BaseNetworkSocketGetIpMulticastLoopbackResponse {}
633
634#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
635#[repr(C)]
636pub struct BaseNetworkSocketGetIpMulticastTtlResponse {
637    pub value: u8,
638}
639
640impl fidl::Persistable for BaseNetworkSocketGetIpMulticastTtlResponse {}
641
642#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
643pub struct BaseNetworkSocketGetIpPacketInfoResponse {
644    pub value: bool,
645}
646
647impl fidl::Persistable for BaseNetworkSocketGetIpPacketInfoResponse {}
648
649#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
650pub struct BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {
651    pub value: bool,
652}
653
654impl fidl::Persistable for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {}
655
656#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
657pub struct BaseNetworkSocketGetIpReceiveTtlResponse {
658    pub value: bool,
659}
660
661impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTtlResponse {}
662
663#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
664pub struct BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
665    pub value: bool,
666}
667
668impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {}
669
670#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
671pub struct BaseNetworkSocketGetIpTransparentResponse {
672    pub value: bool,
673}
674
675impl fidl::Persistable for BaseNetworkSocketGetIpTransparentResponse {}
676
677#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
678#[repr(C)]
679pub struct BaseNetworkSocketGetIpTtlResponse {
680    pub value: u8,
681}
682
683impl fidl::Persistable for BaseNetworkSocketGetIpTtlResponse {}
684
685#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
686#[repr(C)]
687pub struct BaseNetworkSocketGetIpTypeOfServiceResponse {
688    pub value: u8,
689}
690
691impl fidl::Persistable for BaseNetworkSocketGetIpTypeOfServiceResponse {}
692
693#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
694#[repr(C)]
695pub struct BaseNetworkSocketGetIpv6MulticastHopsResponse {
696    pub value: u8,
697}
698
699impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastHopsResponse {}
700
701#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
702#[repr(C)]
703pub struct BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
704    pub value: u64,
705}
706
707impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {}
708
709#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
710pub struct BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
711    pub value: bool,
712}
713
714impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {}
715
716#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
717pub struct BaseNetworkSocketGetIpv6OnlyResponse {
718    pub value: bool,
719}
720
721impl fidl::Persistable for BaseNetworkSocketGetIpv6OnlyResponse {}
722
723#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
724pub struct BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
725    pub value: bool,
726}
727
728impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {}
729
730#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
731pub struct BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
732    pub value: bool,
733}
734
735impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {}
736
737#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
738pub struct BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
739    pub value: bool,
740}
741
742impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {}
743
744#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
745#[repr(C)]
746pub struct BaseNetworkSocketGetIpv6TrafficClassResponse {
747    pub value: u8,
748}
749
750impl fidl::Persistable for BaseNetworkSocketGetIpv6TrafficClassResponse {}
751
752#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
753#[repr(C)]
754pub struct BaseNetworkSocketGetIpv6UnicastHopsResponse {
755    pub value: u8,
756}
757
758impl fidl::Persistable for BaseNetworkSocketGetIpv6UnicastHopsResponse {}
759
760#[derive(Clone, Debug, PartialEq)]
761pub struct BaseNetworkSocketGetOriginalDestinationResponse {
762    pub value: fidl_fuchsia_net__common::SocketAddress,
763}
764
765impl fidl::Persistable for BaseNetworkSocketGetOriginalDestinationResponse {}
766
767#[derive(Clone, Debug, PartialEq)]
768pub struct BaseNetworkSocketGetPeerNameResponse {
769    pub addr: fidl_fuchsia_net__common::SocketAddress,
770}
771
772impl fidl::Persistable for BaseNetworkSocketGetPeerNameResponse {}
773
774#[derive(Clone, Debug, PartialEq)]
775pub struct BaseNetworkSocketGetSockNameResponse {
776    pub addr: fidl_fuchsia_net__common::SocketAddress,
777}
778
779impl fidl::Persistable for BaseNetworkSocketGetSockNameResponse {}
780
781#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
782pub struct BaseSocketGetMarkRequest {
783    pub domain: fidl_fuchsia_net__common::MarkDomain,
784}
785
786impl fidl::Persistable for BaseSocketGetMarkRequest {}
787
788#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
789pub struct BaseSocketSetBindToDeviceRequest {
790    pub value: String,
791}
792
793impl fidl::Persistable for BaseSocketSetBindToDeviceRequest {}
794
795#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
796#[repr(C)]
797pub struct BaseSocketSetBindToInterfaceIndexRequest {
798    pub value: u64,
799}
800
801impl fidl::Persistable for BaseSocketSetBindToInterfaceIndexRequest {}
802
803#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
804pub struct BaseSocketSetBroadcastRequest {
805    pub value: bool,
806}
807
808impl fidl::Persistable for BaseSocketSetBroadcastRequest {}
809
810#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
811pub struct BaseSocketSetKeepAliveRequest {
812    pub value: bool,
813}
814
815impl fidl::Persistable for BaseSocketSetKeepAliveRequest {}
816
817#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
818pub struct BaseSocketSetLingerRequest {
819    pub linger: bool,
820    pub length_secs: u32,
821}
822
823impl fidl::Persistable for BaseSocketSetLingerRequest {}
824
825#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
826pub struct BaseSocketSetMarkRequest {
827    pub domain: fidl_fuchsia_net__common::MarkDomain,
828    pub mark: OptionalUint32,
829}
830
831impl fidl::Persistable for BaseSocketSetMarkRequest {}
832
833#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
834pub struct BaseSocketSetNoCheckRequest {
835    pub value: bool,
836}
837
838impl fidl::Persistable for BaseSocketSetNoCheckRequest {}
839
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841pub struct BaseSocketSetOutOfBandInlineRequest {
842    pub value: bool,
843}
844
845impl fidl::Persistable for BaseSocketSetOutOfBandInlineRequest {}
846
847#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
848#[repr(C)]
849pub struct BaseSocketSetReceiveBufferRequest {
850    pub value_bytes: u64,
851}
852
853impl fidl::Persistable for BaseSocketSetReceiveBufferRequest {}
854
855#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
856pub struct BaseSocketSetReuseAddressRequest {
857    pub value: bool,
858}
859
860impl fidl::Persistable for BaseSocketSetReuseAddressRequest {}
861
862#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
863pub struct BaseSocketSetReusePortRequest {
864    pub value: bool,
865}
866
867impl fidl::Persistable for BaseSocketSetReusePortRequest {}
868
869#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
870#[repr(C)]
871pub struct BaseSocketSetSendBufferRequest {
872    pub value_bytes: u64,
873}
874
875impl fidl::Persistable for BaseSocketSetSendBufferRequest {}
876
877#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
878pub struct BaseSocketSetTimestampRequest {
879    pub value: TimestampOption,
880}
881
882impl fidl::Persistable for BaseSocketSetTimestampRequest {}
883
884#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
885pub struct BaseSocketGetAcceptConnResponse {
886    pub value: bool,
887}
888
889impl fidl::Persistable for BaseSocketGetAcceptConnResponse {}
890
891#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
892pub struct BaseSocketGetBindToDeviceResponse {
893    pub value: String,
894}
895
896impl fidl::Persistable for BaseSocketGetBindToDeviceResponse {}
897
898#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
899#[repr(C)]
900pub struct BaseSocketGetBindToInterfaceIndexResponse {
901    pub value: u64,
902}
903
904impl fidl::Persistable for BaseSocketGetBindToInterfaceIndexResponse {}
905
906#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
907pub struct BaseSocketGetBroadcastResponse {
908    pub value: bool,
909}
910
911impl fidl::Persistable for BaseSocketGetBroadcastResponse {}
912
913#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
914pub struct BaseSocketGetKeepAliveResponse {
915    pub value: bool,
916}
917
918impl fidl::Persistable for BaseSocketGetKeepAliveResponse {}
919
920#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
921pub struct BaseSocketGetLingerResponse {
922    pub linger: bool,
923    pub length_secs: u32,
924}
925
926impl fidl::Persistable for BaseSocketGetLingerResponse {}
927
928#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
929pub struct BaseSocketGetMarkResponse {
930    pub mark: OptionalUint32,
931}
932
933impl fidl::Persistable for BaseSocketGetMarkResponse {}
934
935#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
936pub struct BaseSocketGetNoCheckResponse {
937    pub value: bool,
938}
939
940impl fidl::Persistable for BaseSocketGetNoCheckResponse {}
941
942#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
943pub struct BaseSocketGetOutOfBandInlineResponse {
944    pub value: bool,
945}
946
947impl fidl::Persistable for BaseSocketGetOutOfBandInlineResponse {}
948
949#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
950#[repr(C)]
951pub struct BaseSocketGetReceiveBufferResponse {
952    pub value_bytes: u64,
953}
954
955impl fidl::Persistable for BaseSocketGetReceiveBufferResponse {}
956
957#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
958pub struct BaseSocketGetReuseAddressResponse {
959    pub value: bool,
960}
961
962impl fidl::Persistable for BaseSocketGetReuseAddressResponse {}
963
964#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
965pub struct BaseSocketGetReusePortResponse {
966    pub value: bool,
967}
968
969impl fidl::Persistable for BaseSocketGetReusePortResponse {}
970
971#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
972#[repr(C)]
973pub struct BaseSocketGetSendBufferResponse {
974    pub value_bytes: u64,
975}
976
977impl fidl::Persistable for BaseSocketGetSendBufferResponse {}
978
979#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
980pub struct BaseSocketGetTimestampResponse {
981    pub value: TimestampOption,
982}
983
984impl fidl::Persistable for BaseSocketGetTimestampResponse {}
985
986#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
987pub struct Empty;
988
989impl fidl::Persistable for Empty {}
990
991/// IPv4 multicast membership options.
992#[derive(Clone, Debug, PartialEq)]
993pub struct IpMulticastMembership {
994    /// Interface index for membership.
995    pub iface: u64,
996    /// Local interface address requesting or relinquishing ownership.
997    pub local_addr: fidl_fuchsia_net__common::Ipv4Address,
998    /// Address of the multicast group the membership refers to.
999    pub mcast_addr: fidl_fuchsia_net__common::Ipv4Address,
1000}
1001
1002impl fidl::Persistable for IpMulticastMembership {}
1003
1004/// IPv6 multicast membership options.
1005#[derive(Clone, Debug, PartialEq)]
1006pub struct Ipv6MulticastMembership {
1007    /// Interface index for membership.
1008    pub iface: u64,
1009    /// Address of the multicast group the membership refers to.
1010    pub mcast_addr: fidl_fuchsia_net__common::Ipv6Address,
1011}
1012
1013impl fidl::Persistable for Ipv6MulticastMembership {}
1014
1015#[derive(Clone, Debug, PartialEq)]
1016pub struct Ipv6PktInfoRecvControlData {
1017    /// The index of the interface on which the IP packet was received.
1018    pub iface: u64,
1019    /// The destination address specified in the received packet's IP
1020    /// header.
1021    pub header_destination_addr: fidl_fuchsia_net__common::Ipv6Address,
1022}
1023
1024impl fidl::Persistable for Ipv6PktInfoRecvControlData {}
1025
1026/// IPv6-specific disposition of sent data.
1027///
1028/// This is currently a struct instead of a table as it is meant to match
1029/// `in6_pktinfo` which is not expected to grow.
1030#[derive(Clone, Debug, PartialEq)]
1031pub struct Ipv6PktInfoSendControlData {
1032    /// The interface index from which the IPv6 packet should be sent.
1033    ///
1034    /// 0 indicates that the local interface is unspecified and the
1035    /// stack may choose an appropriate interface.
1036    pub iface: u64,
1037    /// The source address from which the IPv6 packet should be sent.
1038    ///
1039    /// All zeroes indicates that the local address is unspecified and
1040    /// the stack may choose an appropriate address (i.e. the local
1041    /// address to which the socket is bound).
1042    pub local_addr: fidl_fuchsia_net__common::Ipv6Address,
1043}
1044
1045impl fidl::Persistable for Ipv6PktInfoSendControlData {}
1046
1047#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1048pub struct ProviderDatagramSocketDeprecatedRequest {
1049    pub domain: Domain,
1050    pub proto: DatagramSocketProtocol,
1051}
1052
1053impl fidl::Persistable for ProviderDatagramSocketDeprecatedRequest {}
1054
1055#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1056pub struct ProviderDatagramSocketRequest {
1057    pub domain: Domain,
1058    pub proto: DatagramSocketProtocol,
1059}
1060
1061impl fidl::Persistable for ProviderDatagramSocketRequest {}
1062
1063#[derive(Clone, Debug, PartialEq)]
1064pub struct ProviderDatagramSocketWithOptionsRequest {
1065    pub domain: Domain,
1066    pub proto: DatagramSocketProtocol,
1067    pub opts: SocketCreationOptions,
1068}
1069
1070impl fidl::Persistable for ProviderDatagramSocketWithOptionsRequest {}
1071
1072#[derive(Clone, Debug, PartialEq)]
1073pub struct ProviderGetInterfaceAddressesResponse {
1074    pub interfaces: Vec<InterfaceAddresses>,
1075}
1076
1077impl fidl::Persistable for ProviderGetInterfaceAddressesResponse {}
1078
1079#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1080#[repr(C)]
1081pub struct ProviderInterfaceIndexToNameRequest {
1082    pub index: u64,
1083}
1084
1085impl fidl::Persistable for ProviderInterfaceIndexToNameRequest {}
1086
1087#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1088pub struct ProviderInterfaceNameToFlagsRequest {
1089    pub name: String,
1090}
1091
1092impl fidl::Persistable for ProviderInterfaceNameToFlagsRequest {}
1093
1094#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1095pub struct ProviderInterfaceNameToIndexRequest {
1096    pub name: String,
1097}
1098
1099impl fidl::Persistable for ProviderInterfaceNameToIndexRequest {}
1100
1101#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1102pub struct ProviderStreamSocketRequest {
1103    pub domain: Domain,
1104    pub proto: StreamSocketProtocol,
1105}
1106
1107impl fidl::Persistable for ProviderStreamSocketRequest {}
1108
1109#[derive(Clone, Debug, PartialEq)]
1110pub struct ProviderStreamSocketWithOptionsRequest {
1111    pub domain: Domain,
1112    pub proto: StreamSocketProtocol,
1113    pub opts: SocketCreationOptions,
1114}
1115
1116impl fidl::Persistable for ProviderStreamSocketWithOptionsRequest {}
1117
1118#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1119pub struct ProviderInterfaceIndexToNameResponse {
1120    pub name: String,
1121}
1122
1123impl fidl::Persistable for ProviderInterfaceIndexToNameResponse {}
1124
1125#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1126pub struct ProviderInterfaceNameToFlagsResponse {
1127    pub flags: InterfaceFlags,
1128}
1129
1130impl fidl::Persistable for ProviderInterfaceNameToFlagsResponse {}
1131
1132#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1133#[repr(C)]
1134pub struct ProviderInterfaceNameToIndexResponse {
1135    pub index: u64,
1136}
1137
1138impl fidl::Persistable for ProviderInterfaceNameToIndexResponse {}
1139
1140#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1141pub struct StreamSocketAcceptRequest {
1142    pub want_addr: bool,
1143}
1144
1145impl fidl::Persistable for StreamSocketAcceptRequest {}
1146
1147#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1148#[repr(C)]
1149pub struct StreamSocketListenRequest {
1150    pub backlog: i16,
1151}
1152
1153impl fidl::Persistable for StreamSocketListenRequest {}
1154
1155#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1156pub struct StreamSocketSetTcpCongestionRequest {
1157    pub value: TcpCongestionControl,
1158}
1159
1160impl fidl::Persistable for StreamSocketSetTcpCongestionRequest {}
1161
1162#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1163pub struct StreamSocketSetTcpCorkRequest {
1164    pub value: bool,
1165}
1166
1167impl fidl::Persistable for StreamSocketSetTcpCorkRequest {}
1168
1169#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1170#[repr(C)]
1171pub struct StreamSocketSetTcpDeferAcceptRequest {
1172    pub value_secs: u32,
1173}
1174
1175impl fidl::Persistable for StreamSocketSetTcpDeferAcceptRequest {}
1176
1177#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1178#[repr(C)]
1179pub struct StreamSocketSetTcpKeepAliveCountRequest {
1180    pub value: u32,
1181}
1182
1183impl fidl::Persistable for StreamSocketSetTcpKeepAliveCountRequest {}
1184
1185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1186#[repr(C)]
1187pub struct StreamSocketSetTcpKeepAliveIdleRequest {
1188    pub value_secs: u32,
1189}
1190
1191impl fidl::Persistable for StreamSocketSetTcpKeepAliveIdleRequest {}
1192
1193#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1194#[repr(C)]
1195pub struct StreamSocketSetTcpKeepAliveIntervalRequest {
1196    pub value_secs: u32,
1197}
1198
1199impl fidl::Persistable for StreamSocketSetTcpKeepAliveIntervalRequest {}
1200
1201#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1202pub struct StreamSocketSetTcpLingerRequest {
1203    pub value_secs: OptionalUint32,
1204}
1205
1206impl fidl::Persistable for StreamSocketSetTcpLingerRequest {}
1207
1208#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1209#[repr(C)]
1210pub struct StreamSocketSetTcpMaxSegmentRequest {
1211    pub value_bytes: u32,
1212}
1213
1214impl fidl::Persistable for StreamSocketSetTcpMaxSegmentRequest {}
1215
1216#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1217pub struct StreamSocketSetTcpNoDelayRequest {
1218    pub value: bool,
1219}
1220
1221impl fidl::Persistable for StreamSocketSetTcpNoDelayRequest {}
1222
1223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1224pub struct StreamSocketSetTcpQuickAckRequest {
1225    pub value: bool,
1226}
1227
1228impl fidl::Persistable for StreamSocketSetTcpQuickAckRequest {}
1229
1230#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1231#[repr(C)]
1232pub struct StreamSocketSetTcpSynCountRequest {
1233    pub value: u32,
1234}
1235
1236impl fidl::Persistable for StreamSocketSetTcpSynCountRequest {}
1237
1238#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1239#[repr(C)]
1240pub struct StreamSocketSetTcpUserTimeoutRequest {
1241    pub value_millis: u32,
1242}
1243
1244impl fidl::Persistable for StreamSocketSetTcpUserTimeoutRequest {}
1245
1246#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1247#[repr(C)]
1248pub struct StreamSocketSetTcpWindowClampRequest {
1249    pub value: u32,
1250}
1251
1252impl fidl::Persistable for StreamSocketSetTcpWindowClampRequest {}
1253
1254#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1255pub struct StreamSocketGetInfoResponse {
1256    pub domain: Domain,
1257    pub proto: StreamSocketProtocol,
1258}
1259
1260impl fidl::Persistable for StreamSocketGetInfoResponse {}
1261
1262#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1263pub struct StreamSocketGetTcpCongestionResponse {
1264    pub value: TcpCongestionControl,
1265}
1266
1267impl fidl::Persistable for StreamSocketGetTcpCongestionResponse {}
1268
1269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1270pub struct StreamSocketGetTcpCorkResponse {
1271    pub value: bool,
1272}
1273
1274impl fidl::Persistable for StreamSocketGetTcpCorkResponse {}
1275
1276#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1277#[repr(C)]
1278pub struct StreamSocketGetTcpDeferAcceptResponse {
1279    pub value_secs: u32,
1280}
1281
1282impl fidl::Persistable for StreamSocketGetTcpDeferAcceptResponse {}
1283
1284#[derive(Clone, Debug, PartialEq)]
1285pub struct StreamSocketGetTcpInfoResponse {
1286    pub info: TcpInfo,
1287}
1288
1289impl fidl::Persistable for StreamSocketGetTcpInfoResponse {}
1290
1291#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1292#[repr(C)]
1293pub struct StreamSocketGetTcpKeepAliveCountResponse {
1294    pub value: u32,
1295}
1296
1297impl fidl::Persistable for StreamSocketGetTcpKeepAliveCountResponse {}
1298
1299#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1300#[repr(C)]
1301pub struct StreamSocketGetTcpKeepAliveIdleResponse {
1302    pub value_secs: u32,
1303}
1304
1305impl fidl::Persistable for StreamSocketGetTcpKeepAliveIdleResponse {}
1306
1307#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1308#[repr(C)]
1309pub struct StreamSocketGetTcpKeepAliveIntervalResponse {
1310    pub value_secs: u32,
1311}
1312
1313impl fidl::Persistable for StreamSocketGetTcpKeepAliveIntervalResponse {}
1314
1315#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1316pub struct StreamSocketGetTcpLingerResponse {
1317    pub value_secs: OptionalUint32,
1318}
1319
1320impl fidl::Persistable for StreamSocketGetTcpLingerResponse {}
1321
1322#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1323#[repr(C)]
1324pub struct StreamSocketGetTcpMaxSegmentResponse {
1325    pub value_bytes: u32,
1326}
1327
1328impl fidl::Persistable for StreamSocketGetTcpMaxSegmentResponse {}
1329
1330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1331pub struct StreamSocketGetTcpNoDelayResponse {
1332    pub value: bool,
1333}
1334
1335impl fidl::Persistable for StreamSocketGetTcpNoDelayResponse {}
1336
1337#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1338pub struct StreamSocketGetTcpQuickAckResponse {
1339    pub value: bool,
1340}
1341
1342impl fidl::Persistable for StreamSocketGetTcpQuickAckResponse {}
1343
1344#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1345#[repr(C)]
1346pub struct StreamSocketGetTcpSynCountResponse {
1347    pub value: u32,
1348}
1349
1350impl fidl::Persistable for StreamSocketGetTcpSynCountResponse {}
1351
1352#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1353#[repr(C)]
1354pub struct StreamSocketGetTcpUserTimeoutResponse {
1355    pub value_millis: u32,
1356}
1357
1358impl fidl::Persistable for StreamSocketGetTcpUserTimeoutResponse {}
1359
1360#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1361#[repr(C)]
1362pub struct StreamSocketGetTcpWindowClampResponse {
1363    pub value: u32,
1364}
1365
1366impl fidl::Persistable for StreamSocketGetTcpWindowClampResponse {}
1367
1368#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1369pub struct SynchronousDatagramSocketRecvMsgRequest {
1370    pub want_addr: bool,
1371    pub data_len: u32,
1372    pub want_control: bool,
1373    pub flags: RecvMsgFlags,
1374}
1375
1376impl fidl::Persistable for SynchronousDatagramSocketRecvMsgRequest {}
1377
1378#[derive(Clone, Debug, PartialEq)]
1379pub struct SynchronousDatagramSocketSendMsgRequest {
1380    pub addr: Option<Box<fidl_fuchsia_net__common::SocketAddress>>,
1381    pub data: Vec<u8>,
1382    pub control: DatagramSocketSendControlData,
1383    pub flags: SendMsgFlags,
1384}
1385
1386impl fidl::Persistable for SynchronousDatagramSocketSendMsgRequest {}
1387
1388#[derive(Clone, Debug, PartialEq)]
1389pub struct SynchronousDatagramSocketRecvMsgResponse {
1390    pub addr: Option<Box<fidl_fuchsia_net__common::SocketAddress>>,
1391    pub data: Vec<u8>,
1392    pub control: DatagramSocketRecvControlData,
1393    pub truncated: u32,
1394}
1395
1396impl fidl::Persistable for SynchronousDatagramSocketRecvMsgResponse {}
1397
1398#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1399#[repr(C)]
1400pub struct SynchronousDatagramSocketSendMsgResponse {
1401    pub len: i64,
1402}
1403
1404impl fidl::Persistable for SynchronousDatagramSocketSendMsgResponse {}
1405
1406#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1407pub struct Timestamp {
1408    /// Time in nanoseconds since epoch (January 1 1970 GMT).
1409    pub nanoseconds: i64,
1410    /// Identifies whether/how the timestamp should be returned to the user.
1411    /// Ignored in the DatagramSocket protocol.
1412    pub requested: TimestampOption,
1413}
1414
1415impl fidl::Persistable for Timestamp {}
1416
1417#[derive(Clone, Debug, Default, PartialEq)]
1418pub struct DatagramSocketRecvControlData {
1419    /// Network socket ancillary data.
1420    pub network: Option<NetworkSocketRecvControlData>,
1421    #[doc(hidden)]
1422    pub __source_breaking: fidl::marker::SourceBreaking,
1423}
1424
1425impl fidl::Persistable for DatagramSocketRecvControlData {}
1426
1427#[derive(Clone, Debug, Default, PartialEq)]
1428pub struct DatagramSocketSendControlData {
1429    /// Network socket ancillary data.
1430    pub network: Option<NetworkSocketSendControlData>,
1431    #[doc(hidden)]
1432    pub __source_breaking: fidl::marker::SourceBreaking,
1433}
1434
1435impl fidl::Persistable for DatagramSocketSendControlData {}
1436
1437#[derive(Clone, Debug, Default, PartialEq)]
1438pub struct DatagramSocketSendMsgPreflightRequest {
1439    /// The destination address.
1440    ///
1441    /// If absent, interpreted as the method receiver's connected address and
1442    /// causes the connected address to be returned.
1443    ///
1444    /// Required if the method receiver is not connected.
1445    pub to: Option<fidl_fuchsia_net__common::SocketAddress>,
1446    /// Information controlling the local interface and/or address used when
1447    /// sending an IPv6 packet.
1448    ///
1449    /// If absent, indicates that the stack is free to choose an appropriate
1450    /// outgoing route.
1451    pub ipv6_pktinfo: Option<Ipv6PktInfoSendControlData>,
1452    #[doc(hidden)]
1453    pub __source_breaking: fidl::marker::SourceBreaking,
1454}
1455
1456impl fidl::Persistable for DatagramSocketSendMsgPreflightRequest {}
1457
1458/// Holds information about an interface and its addresses.
1459#[derive(Clone, Debug, Default, PartialEq)]
1460pub struct InterfaceAddresses {
1461    /// ID of the interface.
1462    pub id: Option<u64>,
1463    /// Name of the interface.
1464    pub name: Option<String>,
1465    /// All addresses currently assigned to the interface.
1466    pub addresses: Option<Vec<fidl_fuchsia_net__common::Subnet>>,
1467    /// Contains the interface flags, as returned by the SIOCGIFFLAGS ioctl
1468    /// operation.
1469    pub interface_flags: Option<InterfaceFlags>,
1470    #[doc(hidden)]
1471    pub __source_breaking: fidl::marker::SourceBreaking,
1472}
1473
1474impl fidl::Persistable for InterfaceAddresses {}
1475
1476#[derive(Clone, Debug, Default, PartialEq)]
1477pub struct IpRecvControlData {
1478    /// The Type of Service value found in a received packet's IPv4 header.
1479    ///
1480    /// Present if the `SOL_IP` -> `IP_RECVTOS` option is enabled.
1481    pub tos: Option<u8>,
1482    /// The Time to Live value found in a received packet's IPv4 header.
1483    ///
1484    /// Present if the `SOL_IP` -> `IP_RECVTTL` option is enabled.
1485    pub ttl: Option<u8>,
1486    /// The original destination address.
1487    ///
1488    /// Present if the `SOL_IP` -> `IP_RECVORIGDSTADDR` option is enabled.
1489    pub original_destination_address: Option<fidl_fuchsia_net__common::SocketAddress>,
1490    #[doc(hidden)]
1491    pub __source_breaking: fidl::marker::SourceBreaking,
1492}
1493
1494impl fidl::Persistable for IpRecvControlData {}
1495
1496#[derive(Clone, Debug, Default, PartialEq)]
1497pub struct IpSendControlData {
1498    /// The Time to Live value to set in the IPv4 header of an outgoing
1499    /// packet.
1500    pub ttl: Option<u8>,
1501    #[doc(hidden)]
1502    pub __source_breaking: fidl::marker::SourceBreaking,
1503}
1504
1505impl fidl::Persistable for IpSendControlData {}
1506
1507#[derive(Clone, Debug, Default, PartialEq)]
1508pub struct Ipv6RecvControlData {
1509    /// The Traffic Class of a packet that was received.
1510    ///
1511    /// Present if the `SOL_IPV6` -> `IPV6_RECVTCLASS` option is enabled.
1512    pub tclass: Option<u8>,
1513    /// The Hop Limit of a packet that was received.
1514    ///
1515    /// Present if the `SOL_IPV6` -> `IPV6_RECVHOPLIMIT` option is enabled.
1516    pub hoplimit: Option<u8>,
1517    /// The packet information of a packet that was received.
1518    ///
1519    /// Present if the `SOL_IPV6` -> `IPV6_RECVPKTINFO` option is enabled.
1520    pub pktinfo: Option<Ipv6PktInfoRecvControlData>,
1521    #[doc(hidden)]
1522    pub __source_breaking: fidl::marker::SourceBreaking,
1523}
1524
1525impl fidl::Persistable for Ipv6RecvControlData {}
1526
1527#[derive(Clone, Debug, Default, PartialEq)]
1528pub struct Ipv6SendControlData {
1529    /// The Hop Limit value to set in the IPv6 header of an outgoing
1530    /// packet.
1531    pub hoplimit: Option<u8>,
1532    /// Information controlling the local interface and/or address used when
1533    /// sending an IPv6 packet.
1534    pub pktinfo: Option<Ipv6PktInfoSendControlData>,
1535    #[doc(hidden)]
1536    pub __source_breaking: fidl::marker::SourceBreaking,
1537}
1538
1539impl fidl::Persistable for Ipv6SendControlData {}
1540
1541/// Network socket (L3) ancillary data that can be received.
1542#[derive(Clone, Debug, Default, PartialEq)]
1543pub struct NetworkSocketRecvControlData {
1544    /// Socket level ancillary data.
1545    pub socket: Option<SocketRecvControlData>,
1546    /// IPv4 level ancillary data.
1547    ///
1548    /// These match POSIX `SOL_IP` control messages.
1549    pub ip: Option<IpRecvControlData>,
1550    /// IPv6 level ancillary data.
1551    ///
1552    /// These match POSIX `SOL_IPV6` control messages.
1553    pub ipv6: Option<Ipv6RecvControlData>,
1554    #[doc(hidden)]
1555    pub __source_breaking: fidl::marker::SourceBreaking,
1556}
1557
1558impl fidl::Persistable for NetworkSocketRecvControlData {}
1559
1560/// Network socket (L3) ancillary data that can be sent.
1561#[derive(Clone, Debug, Default, PartialEq)]
1562pub struct NetworkSocketSendControlData {
1563    /// Socket level ancillary data.
1564    pub socket: Option<SocketSendControlData>,
1565    /// IPv4 level ancillary data.
1566    ///
1567    /// These match POSIX `SOL_IP` control messages.
1568    pub ip: Option<IpSendControlData>,
1569    /// IPv6 level ancillary data.
1570    ///
1571    /// These match POSIX `SOL_IPV6` control messages.
1572    pub ipv6: Option<Ipv6SendControlData>,
1573    #[doc(hidden)]
1574    pub __source_breaking: fidl::marker::SourceBreaking,
1575}
1576
1577impl fidl::Persistable for NetworkSocketSendControlData {}
1578
1579/// Metadata of a received datagram.
1580#[derive(Clone, Debug, Default, PartialEq)]
1581pub struct RecvMsgMeta {
1582    /// The from address of the datagram.
1583    pub from: Option<fidl_fuchsia_net__common::SocketAddress>,
1584    /// Ancillary control message data describing the datagram.
1585    pub control: Option<DatagramSocketRecvControlData>,
1586    /// The length of the payload, in bytes.
1587    pub payload_len: Option<u16>,
1588    #[doc(hidden)]
1589    pub __source_breaking: fidl::marker::SourceBreaking,
1590}
1591
1592impl fidl::Persistable for RecvMsgMeta {}
1593
1594/// Metadata of a sent datagram.
1595#[derive(Clone, Debug, Default, PartialEq)]
1596pub struct SendMsgMeta {
1597    /// The destination address, if specified.
1598    pub to: Option<fidl_fuchsia_net__common::SocketAddress>,
1599    /// Ancillary control message data used for sending the payload.
1600    pub control: Option<DatagramSocketSendControlData>,
1601    #[doc(hidden)]
1602    pub __source_breaking: fidl::marker::SourceBreaking,
1603}
1604
1605impl fidl::Persistable for SendMsgMeta {}
1606
1607/// Options that can be provided at socket creation.
1608#[derive(Clone, Debug, Default, PartialEq)]
1609pub struct SocketCreationOptions {
1610    /// The marks for the created socket. If a mark is missing from the table,
1611    /// it will remain unset for the created socket.
1612    pub marks: Option<fidl_fuchsia_net__common::Marks>,
1613    #[doc(hidden)]
1614    pub __source_breaking: fidl::marker::SourceBreaking,
1615}
1616
1617impl fidl::Persistable for SocketCreationOptions {}
1618
1619/// Socket level ancillary data that can be received.
1620///
1621/// These match control messages with a `SOL_SOCKET` level.
1622#[derive(Clone, Debug, Default, PartialEq)]
1623pub struct SocketRecvControlData {
1624    /// Data about the time at which the packet was received.
1625    pub timestamp: Option<Timestamp>,
1626    #[doc(hidden)]
1627    pub __source_breaking: fidl::marker::SourceBreaking,
1628}
1629
1630impl fidl::Persistable for SocketRecvControlData {}
1631
1632/// Socket level ancillary data that can be sent.
1633///
1634/// These match the POSIX `SOL_SOCKET` control messages.
1635#[derive(Clone, Debug, Default, PartialEq)]
1636pub struct SocketSendControlData {
1637    #[doc(hidden)]
1638    pub __source_breaking: fidl::marker::SourceBreaking,
1639}
1640
1641impl fidl::Persistable for SocketSendControlData {}
1642
1643/// TCP protocol state.
1644#[derive(Clone, Debug, Default, PartialEq)]
1645pub struct TcpInfo {
1646    pub state: Option<TcpState>,
1647    pub ca_state: Option<TcpCongestionControlState>,
1648    pub rto_usec: Option<u32>,
1649    pub rtt_usec: Option<u32>,
1650    pub rtt_var_usec: Option<u32>,
1651    pub snd_ssthresh: Option<u32>,
1652    pub snd_cwnd: Option<u32>,
1653    pub reorder_seen: Option<bool>,
1654    #[doc(hidden)]
1655    pub __source_breaking: fidl::marker::SourceBreaking,
1656}
1657
1658impl fidl::Persistable for TcpInfo {}
1659
1660/// An optional uint32 value.
1661#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1662pub enum OptionalUint32 {
1663    Value(u32),
1664    Unset(Empty),
1665}
1666
1667impl OptionalUint32 {
1668    #[inline]
1669    pub fn ordinal(&self) -> u64 {
1670        match *self {
1671            Self::Value(_) => 1,
1672            Self::Unset(_) => 2,
1673        }
1674    }
1675}
1676
1677impl fidl::Persistable for OptionalUint32 {}
1678
1679/// An optional byte value.
1680#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1681pub enum OptionalUint8 {
1682    Value(u8),
1683    Unset(Empty),
1684}
1685
1686impl OptionalUint8 {
1687    #[inline]
1688    pub fn ordinal(&self) -> u64 {
1689        match *self {
1690            Self::Value(_) => 1,
1691            Self::Unset(_) => 2,
1692        }
1693    }
1694}
1695
1696impl fidl::Persistable for OptionalUint8 {}
1697
1698pub mod base_datagram_socket_ordinals {
1699    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1700    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1701    pub const QUERY: u64 = 0x2658edee9decfc06;
1702    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1703    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1704    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1705    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1706    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1707    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1708    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1709    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1710    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1711    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1712    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1713    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1714    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1715    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1716    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1717    pub const SET_LINGER: u64 = 0x45386351246e998e;
1718    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1719    pub const SET_REUSE_PORT: u64 = 0x24dd3e5cb36d9ccb;
1720    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1721    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1722    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1723    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1724    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1725    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1726    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1727    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1728    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1729    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1730    pub const BIND: u64 = 0x4bc6400ae92125d;
1731    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1732    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1733    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1734    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1735    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1736    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1737    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1738    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1739    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1740    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1741    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1742    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1743    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1744    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1745    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1746    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1747    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1748    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1749    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1750    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1751    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1752    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1753    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1754    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1755    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1756    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1757    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1758    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1759    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1760    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1761    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1762    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1763    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1764    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1765    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1766    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1767    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1768    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1769    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1770    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1771    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1772    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1773    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1774    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1775    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1776    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1777    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1778    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1779    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
1780}
1781
1782pub mod base_network_socket_ordinals {
1783    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1784    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1785    pub const QUERY: u64 = 0x2658edee9decfc06;
1786    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1787    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1788    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1789    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1790    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1791    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1792    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1793    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1794    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1795    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1796    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1797    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1798    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1799    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1800    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1801    pub const SET_LINGER: u64 = 0x45386351246e998e;
1802    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1803    pub const SET_REUSE_PORT: u64 = 0x24dd3e5cb36d9ccb;
1804    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1805    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1806    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1807    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1808    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1809    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1810    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1811    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1812    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1813    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1814    pub const BIND: u64 = 0x4bc6400ae92125d;
1815    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1816    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1817    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1818    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1819    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1820    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1821    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1822    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1823    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1824    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1825    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1826    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1827    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1828    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1829    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1830    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1831    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1832    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1833    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1834    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1835    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1836    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1837    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1838    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1839    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1840    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1841    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1842    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1843    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1844    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1845    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1846    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1847    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1848    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1849    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1850    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1851    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1852    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1853    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1854    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1855    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1856    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1857    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1858    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1859    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1860    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1861    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1862    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1863}
1864
1865pub mod base_socket_ordinals {
1866    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1867    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1868    pub const QUERY: u64 = 0x2658edee9decfc06;
1869    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1870    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1871    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1872    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1873    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1874    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1875    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1876    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1877    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1878    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1879    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1880    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1881    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1882    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1883    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1884    pub const SET_LINGER: u64 = 0x45386351246e998e;
1885    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1886    pub const SET_REUSE_PORT: u64 = 0x24dd3e5cb36d9ccb;
1887    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1888    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1889    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1890    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1891    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1892    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1893    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1894    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1895    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1896    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1897}
1898
1899pub mod datagram_socket_ordinals {
1900    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1901    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1902    pub const QUERY: u64 = 0x2658edee9decfc06;
1903    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1904    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1905    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1906    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1907    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1908    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1909    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1910    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1911    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1912    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1913    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1914    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1915    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1916    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1917    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1918    pub const SET_LINGER: u64 = 0x45386351246e998e;
1919    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1920    pub const SET_REUSE_PORT: u64 = 0x24dd3e5cb36d9ccb;
1921    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1922    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1923    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1924    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1925    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1926    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1927    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1928    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1929    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1930    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1931    pub const BIND: u64 = 0x4bc6400ae92125d;
1932    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1933    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1934    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1935    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1936    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1937    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1938    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1939    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1940    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1941    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1942    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1943    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1944    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1945    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1946    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1947    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1948    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1949    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1950    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1951    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1952    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1953    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1954    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1955    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1956    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1957    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1958    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1959    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1960    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1961    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1962    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1963    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1964    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1965    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1966    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1967    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1968    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1969    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1970    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1971    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1972    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1973    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1974    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1975    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1976    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1977    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1978    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1979    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1980    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
1981    pub const DESCRIBE: u64 = 0xbf1e2f0a86601f3;
1982    pub const SEND_MSG_PREFLIGHT: u64 = 0x5362e668e777248a;
1983    pub const RECV_MSG_POSTFLIGHT: u64 = 0x1a7cdeca5f3eb8e2;
1984}
1985
1986pub mod provider_ordinals {
1987    pub const STREAM_SOCKET_WITH_OPTIONS: u64 = 0x3969bf7eb78386e0;
1988    pub const STREAM_SOCKET: u64 = 0x27c3581da2155545;
1989    pub const DATAGRAM_SOCKET_DEPRECATED: u64 = 0x38876c87cf031cb1;
1990    pub const DATAGRAM_SOCKET: u64 = 0x4021b4fa1b6452f2;
1991    pub const DATAGRAM_SOCKET_WITH_OPTIONS: u64 = 0x4cd0cffbffa39eb1;
1992    pub const INTERFACE_INDEX_TO_NAME: u64 = 0x4d59a64fce98272f;
1993    pub const INTERFACE_NAME_TO_INDEX: u64 = 0x690cd8d2f2d650f8;
1994    pub const INTERFACE_NAME_TO_FLAGS: u64 = 0x25d0efcdb6671a0b;
1995    pub const GET_INTERFACE_ADDRESSES: u64 = 0x2e7b9aaf327c870;
1996}
1997
1998pub mod stream_socket_ordinals {
1999    pub const CLONE: u64 = 0x20d8a7aba2168a79;
2000    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
2001    pub const QUERY: u64 = 0x2658edee9decfc06;
2002    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
2003    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
2004    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
2005    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
2006    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
2007    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
2008    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
2009    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
2010    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
2011    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
2012    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
2013    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
2014    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
2015    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
2016    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
2017    pub const SET_LINGER: u64 = 0x45386351246e998e;
2018    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
2019    pub const SET_REUSE_PORT: u64 = 0x24dd3e5cb36d9ccb;
2020    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
2021    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
2022    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
2023    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
2024    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
2025    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
2026    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
2027    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
2028    pub const SET_MARK: u64 = 0x6ead6de09f653236;
2029    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
2030    pub const BIND: u64 = 0x4bc6400ae92125d;
2031    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
2032    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
2033    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
2034    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
2035    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
2036    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
2037    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
2038    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
2039    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
2040    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
2041    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
2042    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
2043    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
2044    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
2045    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
2046    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
2047    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
2048    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
2049    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
2050    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
2051    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
2052    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
2053    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
2054    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
2055    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
2056    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
2057    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
2058    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
2059    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
2060    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
2061    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
2062    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
2063    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
2064    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
2065    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
2066    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
2067    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
2068    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
2069    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
2070    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
2071    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
2072    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
2073    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
2074    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
2075    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
2076    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
2077    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
2078    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
2079    pub const DESCRIBE: u64 = 0x29e22969a7dadc32;
2080    pub const LISTEN: u64 = 0x3d0a65ced3d10108;
2081    pub const ACCEPT: u64 = 0x5ab7ad620424c163;
2082    pub const GET_INFO: u64 = 0x87cfa55d19f878f;
2083    pub const SET_TCP_NO_DELAY: u64 = 0x5a59b778f7333ada;
2084    pub const GET_TCP_NO_DELAY: u64 = 0xac219a3218b0799;
2085    pub const SET_TCP_MAX_SEGMENT: u64 = 0xb3d30c498266d18;
2086    pub const GET_TCP_MAX_SEGMENT: u64 = 0x637404d1b4b9982c;
2087    pub const SET_TCP_CORK: u64 = 0x62e26891541143a0;
2088    pub const GET_TCP_CORK: u64 = 0x435bb232e0e74f32;
2089    pub const SET_TCP_KEEP_ALIVE_IDLE: u64 = 0x196d053d8363c42;
2090    pub const GET_TCP_KEEP_ALIVE_IDLE: u64 = 0x35ec58564879dac;
2091    pub const SET_TCP_KEEP_ALIVE_INTERVAL: u64 = 0x485ffbc2da1243f2;
2092    pub const GET_TCP_KEEP_ALIVE_INTERVAL: u64 = 0x264eaf46306b284;
2093    pub const SET_TCP_KEEP_ALIVE_COUNT: u64 = 0x2ab2e8c111708421;
2094    pub const GET_TCP_KEEP_ALIVE_COUNT: u64 = 0x2f176ae271fe7a09;
2095    pub const SET_TCP_SYN_COUNT: u64 = 0x4dcd6ab5573c1eb3;
2096    pub const GET_TCP_SYN_COUNT: u64 = 0x7d457cba8f5f3ee6;
2097    pub const SET_TCP_LINGER: u64 = 0xd5cc1e8654d36e4;
2098    pub const GET_TCP_LINGER: u64 = 0xad870d311cf30eb;
2099    pub const SET_TCP_DEFER_ACCEPT: u64 = 0x15092f181e57c404;
2100    pub const GET_TCP_DEFER_ACCEPT: u64 = 0x64589790842cb7c6;
2101    pub const SET_TCP_WINDOW_CLAMP: u64 = 0x4a26ce07d847f1c6;
2102    pub const GET_TCP_WINDOW_CLAMP: u64 = 0x2df6b636bf0a6a4e;
2103    pub const GET_TCP_INFO: u64 = 0x1ffb123d9f03ead2;
2104    pub const SET_TCP_QUICK_ACK: u64 = 0x6fa811be8fde7457;
2105    pub const GET_TCP_QUICK_ACK: u64 = 0x7356a949bef2df32;
2106    pub const SET_TCP_CONGESTION: u64 = 0x7924c6eabde7819e;
2107    pub const GET_TCP_CONGESTION: u64 = 0x11e16397e1b72a47;
2108    pub const SET_TCP_USER_TIMEOUT: u64 = 0x6b459e81c3741a60;
2109    pub const GET_TCP_USER_TIMEOUT: u64 = 0x24bbd5858ad8c380;
2110}
2111
2112pub mod synchronous_datagram_socket_ordinals {
2113    pub const CLONE: u64 = 0x20d8a7aba2168a79;
2114    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
2115    pub const QUERY: u64 = 0x2658edee9decfc06;
2116    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
2117    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
2118    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
2119    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
2120    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
2121    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
2122    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
2123    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
2124    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
2125    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
2126    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
2127    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
2128    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
2129    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
2130    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
2131    pub const SET_LINGER: u64 = 0x45386351246e998e;
2132    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
2133    pub const SET_REUSE_PORT: u64 = 0x24dd3e5cb36d9ccb;
2134    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
2135    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
2136    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
2137    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
2138    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
2139    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
2140    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
2141    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
2142    pub const SET_MARK: u64 = 0x6ead6de09f653236;
2143    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
2144    pub const BIND: u64 = 0x4bc6400ae92125d;
2145    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
2146    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
2147    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
2148    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
2149    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
2150    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
2151    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
2152    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
2153    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
2154    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
2155    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
2156    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
2157    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
2158    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
2159    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
2160    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
2161    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
2162    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
2163    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
2164    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
2165    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
2166    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
2167    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
2168    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
2169    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
2170    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
2171    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
2172    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
2173    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
2174    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
2175    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
2176    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
2177    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
2178    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
2179    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
2180    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
2181    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
2182    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
2183    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
2184    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
2185    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
2186    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
2187    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
2188    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
2189    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
2190    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
2191    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
2192    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
2193    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
2194    pub const DESCRIBE: u64 = 0x585f20b73631070d;
2195    pub const RECV_MSG: u64 = 0x28e494e48fb5dbf3;
2196    pub const SEND_MSG: u64 = 0x12dc2fceab6cefaa;
2197}
2198
2199mod internal {
2200    use super::*;
2201    unsafe impl fidl::encoding::TypeMarker for CmsgRequests {
2202        type Owned = Self;
2203
2204        #[inline(always)]
2205        fn inline_align(_context: fidl::encoding::Context) -> usize {
2206            4
2207        }
2208
2209        #[inline(always)]
2210        fn inline_size(_context: fidl::encoding::Context) -> usize {
2211            4
2212        }
2213    }
2214
2215    impl fidl::encoding::ValueTypeMarker for CmsgRequests {
2216        type Borrowed<'a> = Self;
2217        #[inline(always)]
2218        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2219            *value
2220        }
2221    }
2222
2223    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CmsgRequests {
2224        #[inline]
2225        unsafe fn encode(
2226            self,
2227            encoder: &mut fidl::encoding::Encoder<'_, D>,
2228            offset: usize,
2229            _depth: fidl::encoding::Depth,
2230        ) -> fidl::Result<()> {
2231            encoder.debug_check_bounds::<Self>(offset);
2232            encoder.write_num(self.bits(), offset);
2233            Ok(())
2234        }
2235    }
2236
2237    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CmsgRequests {
2238        #[inline(always)]
2239        fn new_empty() -> Self {
2240            Self::empty()
2241        }
2242
2243        #[inline]
2244        unsafe fn decode(
2245            &mut self,
2246            decoder: &mut fidl::encoding::Decoder<'_, D>,
2247            offset: usize,
2248            _depth: fidl::encoding::Depth,
2249        ) -> fidl::Result<()> {
2250            decoder.debug_check_bounds::<Self>(offset);
2251            let prim = decoder.read_num::<u32>(offset);
2252            *self = Self::from_bits_allow_unknown(prim);
2253            Ok(())
2254        }
2255    }
2256    unsafe impl fidl::encoding::TypeMarker for InterfaceFlags {
2257        type Owned = Self;
2258
2259        #[inline(always)]
2260        fn inline_align(_context: fidl::encoding::Context) -> usize {
2261            2
2262        }
2263
2264        #[inline(always)]
2265        fn inline_size(_context: fidl::encoding::Context) -> usize {
2266            2
2267        }
2268    }
2269
2270    impl fidl::encoding::ValueTypeMarker for InterfaceFlags {
2271        type Borrowed<'a> = Self;
2272        #[inline(always)]
2273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2274            *value
2275        }
2276    }
2277
2278    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for InterfaceFlags {
2279        #[inline]
2280        unsafe fn encode(
2281            self,
2282            encoder: &mut fidl::encoding::Encoder<'_, D>,
2283            offset: usize,
2284            _depth: fidl::encoding::Depth,
2285        ) -> fidl::Result<()> {
2286            encoder.debug_check_bounds::<Self>(offset);
2287            if self.bits() & Self::all().bits() != self.bits() {
2288                return Err(fidl::Error::InvalidBitsValue);
2289            }
2290            encoder.write_num(self.bits(), offset);
2291            Ok(())
2292        }
2293    }
2294
2295    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceFlags {
2296        #[inline(always)]
2297        fn new_empty() -> Self {
2298            Self::empty()
2299        }
2300
2301        #[inline]
2302        unsafe fn decode(
2303            &mut self,
2304            decoder: &mut fidl::encoding::Decoder<'_, D>,
2305            offset: usize,
2306            _depth: fidl::encoding::Depth,
2307        ) -> fidl::Result<()> {
2308            decoder.debug_check_bounds::<Self>(offset);
2309            let prim = decoder.read_num::<u16>(offset);
2310            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2311            Ok(())
2312        }
2313    }
2314    unsafe impl fidl::encoding::TypeMarker for RecvMsgFlags {
2315        type Owned = Self;
2316
2317        #[inline(always)]
2318        fn inline_align(_context: fidl::encoding::Context) -> usize {
2319            2
2320        }
2321
2322        #[inline(always)]
2323        fn inline_size(_context: fidl::encoding::Context) -> usize {
2324            2
2325        }
2326    }
2327
2328    impl fidl::encoding::ValueTypeMarker for RecvMsgFlags {
2329        type Borrowed<'a> = Self;
2330        #[inline(always)]
2331        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2332            *value
2333        }
2334    }
2335
2336    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RecvMsgFlags {
2337        #[inline]
2338        unsafe fn encode(
2339            self,
2340            encoder: &mut fidl::encoding::Encoder<'_, D>,
2341            offset: usize,
2342            _depth: fidl::encoding::Depth,
2343        ) -> fidl::Result<()> {
2344            encoder.debug_check_bounds::<Self>(offset);
2345            if self.bits() & Self::all().bits() != self.bits() {
2346                return Err(fidl::Error::InvalidBitsValue);
2347            }
2348            encoder.write_num(self.bits(), offset);
2349            Ok(())
2350        }
2351    }
2352
2353    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgFlags {
2354        #[inline(always)]
2355        fn new_empty() -> Self {
2356            Self::empty()
2357        }
2358
2359        #[inline]
2360        unsafe fn decode(
2361            &mut self,
2362            decoder: &mut fidl::encoding::Decoder<'_, D>,
2363            offset: usize,
2364            _depth: fidl::encoding::Depth,
2365        ) -> fidl::Result<()> {
2366            decoder.debug_check_bounds::<Self>(offset);
2367            let prim = decoder.read_num::<u16>(offset);
2368            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2369            Ok(())
2370        }
2371    }
2372    unsafe impl fidl::encoding::TypeMarker for SendMsgFlags {
2373        type Owned = Self;
2374
2375        #[inline(always)]
2376        fn inline_align(_context: fidl::encoding::Context) -> usize {
2377            2
2378        }
2379
2380        #[inline(always)]
2381        fn inline_size(_context: fidl::encoding::Context) -> usize {
2382            2
2383        }
2384    }
2385
2386    impl fidl::encoding::ValueTypeMarker for SendMsgFlags {
2387        type Borrowed<'a> = Self;
2388        #[inline(always)]
2389        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2390            *value
2391        }
2392    }
2393
2394    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SendMsgFlags {
2395        #[inline]
2396        unsafe fn encode(
2397            self,
2398            encoder: &mut fidl::encoding::Encoder<'_, D>,
2399            offset: usize,
2400            _depth: fidl::encoding::Depth,
2401        ) -> fidl::Result<()> {
2402            encoder.debug_check_bounds::<Self>(offset);
2403            if self.bits() & Self::all().bits() != self.bits() {
2404                return Err(fidl::Error::InvalidBitsValue);
2405            }
2406            encoder.write_num(self.bits(), offset);
2407            Ok(())
2408        }
2409    }
2410
2411    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgFlags {
2412        #[inline(always)]
2413        fn new_empty() -> Self {
2414            Self::empty()
2415        }
2416
2417        #[inline]
2418        unsafe fn decode(
2419            &mut self,
2420            decoder: &mut fidl::encoding::Decoder<'_, D>,
2421            offset: usize,
2422            _depth: fidl::encoding::Depth,
2423        ) -> fidl::Result<()> {
2424            decoder.debug_check_bounds::<Self>(offset);
2425            let prim = decoder.read_num::<u16>(offset);
2426            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2427            Ok(())
2428        }
2429    }
2430    unsafe impl fidl::encoding::TypeMarker for ShutdownMode {
2431        type Owned = Self;
2432
2433        #[inline(always)]
2434        fn inline_align(_context: fidl::encoding::Context) -> usize {
2435            2
2436        }
2437
2438        #[inline(always)]
2439        fn inline_size(_context: fidl::encoding::Context) -> usize {
2440            2
2441        }
2442    }
2443
2444    impl fidl::encoding::ValueTypeMarker for ShutdownMode {
2445        type Borrowed<'a> = Self;
2446        #[inline(always)]
2447        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2448            *value
2449        }
2450    }
2451
2452    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShutdownMode {
2453        #[inline]
2454        unsafe fn encode(
2455            self,
2456            encoder: &mut fidl::encoding::Encoder<'_, D>,
2457            offset: usize,
2458            _depth: fidl::encoding::Depth,
2459        ) -> fidl::Result<()> {
2460            encoder.debug_check_bounds::<Self>(offset);
2461            if self.bits() & Self::all().bits() != self.bits() {
2462                return Err(fidl::Error::InvalidBitsValue);
2463            }
2464            encoder.write_num(self.bits(), offset);
2465            Ok(())
2466        }
2467    }
2468
2469    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShutdownMode {
2470        #[inline(always)]
2471        fn new_empty() -> Self {
2472            Self::empty()
2473        }
2474
2475        #[inline]
2476        unsafe fn decode(
2477            &mut self,
2478            decoder: &mut fidl::encoding::Decoder<'_, D>,
2479            offset: usize,
2480            _depth: fidl::encoding::Depth,
2481        ) -> fidl::Result<()> {
2482            decoder.debug_check_bounds::<Self>(offset);
2483            let prim = decoder.read_num::<u16>(offset);
2484            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2485            Ok(())
2486        }
2487    }
2488    unsafe impl fidl::encoding::TypeMarker for DatagramSocketProtocol {
2489        type Owned = Self;
2490
2491        #[inline(always)]
2492        fn inline_align(_context: fidl::encoding::Context) -> usize {
2493            std::mem::align_of::<u32>()
2494        }
2495
2496        #[inline(always)]
2497        fn inline_size(_context: fidl::encoding::Context) -> usize {
2498            std::mem::size_of::<u32>()
2499        }
2500
2501        #[inline(always)]
2502        fn encode_is_copy() -> bool {
2503            true
2504        }
2505
2506        #[inline(always)]
2507        fn decode_is_copy() -> bool {
2508            false
2509        }
2510    }
2511
2512    impl fidl::encoding::ValueTypeMarker for DatagramSocketProtocol {
2513        type Borrowed<'a> = Self;
2514        #[inline(always)]
2515        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2516            *value
2517        }
2518    }
2519
2520    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2521        for DatagramSocketProtocol
2522    {
2523        #[inline]
2524        unsafe fn encode(
2525            self,
2526            encoder: &mut fidl::encoding::Encoder<'_, D>,
2527            offset: usize,
2528            _depth: fidl::encoding::Depth,
2529        ) -> fidl::Result<()> {
2530            encoder.debug_check_bounds::<Self>(offset);
2531            encoder.write_num(self.into_primitive(), offset);
2532            Ok(())
2533        }
2534    }
2535
2536    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2537        for DatagramSocketProtocol
2538    {
2539        #[inline(always)]
2540        fn new_empty() -> Self {
2541            Self::Udp
2542        }
2543
2544        #[inline]
2545        unsafe fn decode(
2546            &mut self,
2547            decoder: &mut fidl::encoding::Decoder<'_, D>,
2548            offset: usize,
2549            _depth: fidl::encoding::Depth,
2550        ) -> fidl::Result<()> {
2551            decoder.debug_check_bounds::<Self>(offset);
2552            let prim = decoder.read_num::<u32>(offset);
2553
2554            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2555            Ok(())
2556        }
2557    }
2558    unsafe impl fidl::encoding::TypeMarker for Domain {
2559        type Owned = Self;
2560
2561        #[inline(always)]
2562        fn inline_align(_context: fidl::encoding::Context) -> usize {
2563            std::mem::align_of::<i16>()
2564        }
2565
2566        #[inline(always)]
2567        fn inline_size(_context: fidl::encoding::Context) -> usize {
2568            std::mem::size_of::<i16>()
2569        }
2570
2571        #[inline(always)]
2572        fn encode_is_copy() -> bool {
2573            true
2574        }
2575
2576        #[inline(always)]
2577        fn decode_is_copy() -> bool {
2578            false
2579        }
2580    }
2581
2582    impl fidl::encoding::ValueTypeMarker for Domain {
2583        type Borrowed<'a> = Self;
2584        #[inline(always)]
2585        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2586            *value
2587        }
2588    }
2589
2590    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Domain {
2591        #[inline]
2592        unsafe fn encode(
2593            self,
2594            encoder: &mut fidl::encoding::Encoder<'_, D>,
2595            offset: usize,
2596            _depth: fidl::encoding::Depth,
2597        ) -> fidl::Result<()> {
2598            encoder.debug_check_bounds::<Self>(offset);
2599            encoder.write_num(self.into_primitive(), offset);
2600            Ok(())
2601        }
2602    }
2603
2604    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Domain {
2605        #[inline(always)]
2606        fn new_empty() -> Self {
2607            Self::Ipv4
2608        }
2609
2610        #[inline]
2611        unsafe fn decode(
2612            &mut self,
2613            decoder: &mut fidl::encoding::Decoder<'_, D>,
2614            offset: usize,
2615            _depth: fidl::encoding::Depth,
2616        ) -> fidl::Result<()> {
2617            decoder.debug_check_bounds::<Self>(offset);
2618            let prim = decoder.read_num::<i16>(offset);
2619
2620            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2621            Ok(())
2622        }
2623    }
2624    unsafe impl fidl::encoding::TypeMarker for StreamSocketProtocol {
2625        type Owned = Self;
2626
2627        #[inline(always)]
2628        fn inline_align(_context: fidl::encoding::Context) -> usize {
2629            std::mem::align_of::<u32>()
2630        }
2631
2632        #[inline(always)]
2633        fn inline_size(_context: fidl::encoding::Context) -> usize {
2634            std::mem::size_of::<u32>()
2635        }
2636
2637        #[inline(always)]
2638        fn encode_is_copy() -> bool {
2639            true
2640        }
2641
2642        #[inline(always)]
2643        fn decode_is_copy() -> bool {
2644            false
2645        }
2646    }
2647
2648    impl fidl::encoding::ValueTypeMarker for StreamSocketProtocol {
2649        type Borrowed<'a> = Self;
2650        #[inline(always)]
2651        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2652            *value
2653        }
2654    }
2655
2656    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2657        for StreamSocketProtocol
2658    {
2659        #[inline]
2660        unsafe fn encode(
2661            self,
2662            encoder: &mut fidl::encoding::Encoder<'_, D>,
2663            offset: usize,
2664            _depth: fidl::encoding::Depth,
2665        ) -> fidl::Result<()> {
2666            encoder.debug_check_bounds::<Self>(offset);
2667            encoder.write_num(self.into_primitive(), offset);
2668            Ok(())
2669        }
2670    }
2671
2672    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamSocketProtocol {
2673        #[inline(always)]
2674        fn new_empty() -> Self {
2675            Self::Tcp
2676        }
2677
2678        #[inline]
2679        unsafe fn decode(
2680            &mut self,
2681            decoder: &mut fidl::encoding::Decoder<'_, D>,
2682            offset: usize,
2683            _depth: fidl::encoding::Depth,
2684        ) -> fidl::Result<()> {
2685            decoder.debug_check_bounds::<Self>(offset);
2686            let prim = decoder.read_num::<u32>(offset);
2687
2688            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2689            Ok(())
2690        }
2691    }
2692    unsafe impl fidl::encoding::TypeMarker for TcpCongestionControl {
2693        type Owned = Self;
2694
2695        #[inline(always)]
2696        fn inline_align(_context: fidl::encoding::Context) -> usize {
2697            std::mem::align_of::<u32>()
2698        }
2699
2700        #[inline(always)]
2701        fn inline_size(_context: fidl::encoding::Context) -> usize {
2702            std::mem::size_of::<u32>()
2703        }
2704
2705        #[inline(always)]
2706        fn encode_is_copy() -> bool {
2707            true
2708        }
2709
2710        #[inline(always)]
2711        fn decode_is_copy() -> bool {
2712            false
2713        }
2714    }
2715
2716    impl fidl::encoding::ValueTypeMarker for TcpCongestionControl {
2717        type Borrowed<'a> = Self;
2718        #[inline(always)]
2719        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2720            *value
2721        }
2722    }
2723
2724    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2725        for TcpCongestionControl
2726    {
2727        #[inline]
2728        unsafe fn encode(
2729            self,
2730            encoder: &mut fidl::encoding::Encoder<'_, D>,
2731            offset: usize,
2732            _depth: fidl::encoding::Depth,
2733        ) -> fidl::Result<()> {
2734            encoder.debug_check_bounds::<Self>(offset);
2735            encoder.write_num(self.into_primitive(), offset);
2736            Ok(())
2737        }
2738    }
2739
2740    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpCongestionControl {
2741        #[inline(always)]
2742        fn new_empty() -> Self {
2743            Self::Reno
2744        }
2745
2746        #[inline]
2747        unsafe fn decode(
2748            &mut self,
2749            decoder: &mut fidl::encoding::Decoder<'_, D>,
2750            offset: usize,
2751            _depth: fidl::encoding::Depth,
2752        ) -> fidl::Result<()> {
2753            decoder.debug_check_bounds::<Self>(offset);
2754            let prim = decoder.read_num::<u32>(offset);
2755
2756            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2757            Ok(())
2758        }
2759    }
2760    unsafe impl fidl::encoding::TypeMarker for TcpCongestionControlState {
2761        type Owned = Self;
2762
2763        #[inline(always)]
2764        fn inline_align(_context: fidl::encoding::Context) -> usize {
2765            std::mem::align_of::<u32>()
2766        }
2767
2768        #[inline(always)]
2769        fn inline_size(_context: fidl::encoding::Context) -> usize {
2770            std::mem::size_of::<u32>()
2771        }
2772
2773        #[inline(always)]
2774        fn encode_is_copy() -> bool {
2775            true
2776        }
2777
2778        #[inline(always)]
2779        fn decode_is_copy() -> bool {
2780            false
2781        }
2782    }
2783
2784    impl fidl::encoding::ValueTypeMarker for TcpCongestionControlState {
2785        type Borrowed<'a> = Self;
2786        #[inline(always)]
2787        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2788            *value
2789        }
2790    }
2791
2792    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2793        for TcpCongestionControlState
2794    {
2795        #[inline]
2796        unsafe fn encode(
2797            self,
2798            encoder: &mut fidl::encoding::Encoder<'_, D>,
2799            offset: usize,
2800            _depth: fidl::encoding::Depth,
2801        ) -> fidl::Result<()> {
2802            encoder.debug_check_bounds::<Self>(offset);
2803            encoder.write_num(self.into_primitive(), offset);
2804            Ok(())
2805        }
2806    }
2807
2808    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2809        for TcpCongestionControlState
2810    {
2811        #[inline(always)]
2812        fn new_empty() -> Self {
2813            Self::Open
2814        }
2815
2816        #[inline]
2817        unsafe fn decode(
2818            &mut self,
2819            decoder: &mut fidl::encoding::Decoder<'_, D>,
2820            offset: usize,
2821            _depth: fidl::encoding::Depth,
2822        ) -> fidl::Result<()> {
2823            decoder.debug_check_bounds::<Self>(offset);
2824            let prim = decoder.read_num::<u32>(offset);
2825
2826            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2827            Ok(())
2828        }
2829    }
2830    unsafe impl fidl::encoding::TypeMarker for TcpState {
2831        type Owned = Self;
2832
2833        #[inline(always)]
2834        fn inline_align(_context: fidl::encoding::Context) -> usize {
2835            std::mem::align_of::<u32>()
2836        }
2837
2838        #[inline(always)]
2839        fn inline_size(_context: fidl::encoding::Context) -> usize {
2840            std::mem::size_of::<u32>()
2841        }
2842
2843        #[inline(always)]
2844        fn encode_is_copy() -> bool {
2845            true
2846        }
2847
2848        #[inline(always)]
2849        fn decode_is_copy() -> bool {
2850            false
2851        }
2852    }
2853
2854    impl fidl::encoding::ValueTypeMarker for TcpState {
2855        type Borrowed<'a> = Self;
2856        #[inline(always)]
2857        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2858            *value
2859        }
2860    }
2861
2862    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TcpState {
2863        #[inline]
2864        unsafe fn encode(
2865            self,
2866            encoder: &mut fidl::encoding::Encoder<'_, D>,
2867            offset: usize,
2868            _depth: fidl::encoding::Depth,
2869        ) -> fidl::Result<()> {
2870            encoder.debug_check_bounds::<Self>(offset);
2871            encoder.write_num(self.into_primitive(), offset);
2872            Ok(())
2873        }
2874    }
2875
2876    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpState {
2877        #[inline(always)]
2878        fn new_empty() -> Self {
2879            Self::Established
2880        }
2881
2882        #[inline]
2883        unsafe fn decode(
2884            &mut self,
2885            decoder: &mut fidl::encoding::Decoder<'_, D>,
2886            offset: usize,
2887            _depth: fidl::encoding::Depth,
2888        ) -> fidl::Result<()> {
2889            decoder.debug_check_bounds::<Self>(offset);
2890            let prim = decoder.read_num::<u32>(offset);
2891
2892            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2893            Ok(())
2894        }
2895    }
2896    unsafe impl fidl::encoding::TypeMarker for TimestampOption {
2897        type Owned = Self;
2898
2899        #[inline(always)]
2900        fn inline_align(_context: fidl::encoding::Context) -> usize {
2901            std::mem::align_of::<u32>()
2902        }
2903
2904        #[inline(always)]
2905        fn inline_size(_context: fidl::encoding::Context) -> usize {
2906            std::mem::size_of::<u32>()
2907        }
2908
2909        #[inline(always)]
2910        fn encode_is_copy() -> bool {
2911            true
2912        }
2913
2914        #[inline(always)]
2915        fn decode_is_copy() -> bool {
2916            false
2917        }
2918    }
2919
2920    impl fidl::encoding::ValueTypeMarker for TimestampOption {
2921        type Borrowed<'a> = Self;
2922        #[inline(always)]
2923        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2924            *value
2925        }
2926    }
2927
2928    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2929        for TimestampOption
2930    {
2931        #[inline]
2932        unsafe fn encode(
2933            self,
2934            encoder: &mut fidl::encoding::Encoder<'_, D>,
2935            offset: usize,
2936            _depth: fidl::encoding::Depth,
2937        ) -> fidl::Result<()> {
2938            encoder.debug_check_bounds::<Self>(offset);
2939            encoder.write_num(self.into_primitive(), offset);
2940            Ok(())
2941        }
2942    }
2943
2944    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimestampOption {
2945        #[inline(always)]
2946        fn new_empty() -> Self {
2947            Self::Disabled
2948        }
2949
2950        #[inline]
2951        unsafe fn decode(
2952            &mut self,
2953            decoder: &mut fidl::encoding::Decoder<'_, D>,
2954            offset: usize,
2955            _depth: fidl::encoding::Depth,
2956        ) -> fidl::Result<()> {
2957            decoder.debug_check_bounds::<Self>(offset);
2958            let prim = decoder.read_num::<u32>(offset);
2959
2960            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2961            Ok(())
2962        }
2963    }
2964    unsafe impl fidl::encoding::TypeMarker for UdpMetadataEncodingProtocolVersion {
2965        type Owned = Self;
2966
2967        #[inline(always)]
2968        fn inline_align(_context: fidl::encoding::Context) -> usize {
2969            std::mem::align_of::<u16>()
2970        }
2971
2972        #[inline(always)]
2973        fn inline_size(_context: fidl::encoding::Context) -> usize {
2974            std::mem::size_of::<u16>()
2975        }
2976
2977        #[inline(always)]
2978        fn encode_is_copy() -> bool {
2979            false
2980        }
2981
2982        #[inline(always)]
2983        fn decode_is_copy() -> bool {
2984            false
2985        }
2986    }
2987
2988    impl fidl::encoding::ValueTypeMarker for UdpMetadataEncodingProtocolVersion {
2989        type Borrowed<'a> = Self;
2990        #[inline(always)]
2991        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2992            *value
2993        }
2994    }
2995
2996    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2997        for UdpMetadataEncodingProtocolVersion
2998    {
2999        #[inline]
3000        unsafe fn encode(
3001            self,
3002            encoder: &mut fidl::encoding::Encoder<'_, D>,
3003            offset: usize,
3004            _depth: fidl::encoding::Depth,
3005        ) -> fidl::Result<()> {
3006            encoder.debug_check_bounds::<Self>(offset);
3007            encoder.write_num(self.into_primitive(), offset);
3008            Ok(())
3009        }
3010    }
3011
3012    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3013        for UdpMetadataEncodingProtocolVersion
3014    {
3015        #[inline(always)]
3016        fn new_empty() -> Self {
3017            Self::unknown()
3018        }
3019
3020        #[inline]
3021        unsafe fn decode(
3022            &mut self,
3023            decoder: &mut fidl::encoding::Decoder<'_, D>,
3024            offset: usize,
3025            _depth: fidl::encoding::Depth,
3026        ) -> fidl::Result<()> {
3027            decoder.debug_check_bounds::<Self>(offset);
3028            let prim = decoder.read_num::<u16>(offset);
3029
3030            *self = Self::from_primitive_allow_unknown(prim);
3031            Ok(())
3032        }
3033    }
3034
3035    impl fidl::encoding::ValueTypeMarker for BaseDatagramSocketGetInfoResponse {
3036        type Borrowed<'a> = &'a Self;
3037        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3038            value
3039        }
3040    }
3041
3042    unsafe impl fidl::encoding::TypeMarker for BaseDatagramSocketGetInfoResponse {
3043        type Owned = Self;
3044
3045        #[inline(always)]
3046        fn inline_align(_context: fidl::encoding::Context) -> usize {
3047            4
3048        }
3049
3050        #[inline(always)]
3051        fn inline_size(_context: fidl::encoding::Context) -> usize {
3052            8
3053        }
3054    }
3055
3056    unsafe impl<D: fidl::encoding::ResourceDialect>
3057        fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D>
3058        for &BaseDatagramSocketGetInfoResponse
3059    {
3060        #[inline]
3061        unsafe fn encode(
3062            self,
3063            encoder: &mut fidl::encoding::Encoder<'_, D>,
3064            offset: usize,
3065            _depth: fidl::encoding::Depth,
3066        ) -> fidl::Result<()> {
3067            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
3068            // Delegate to tuple encoding.
3069            fidl::encoding::Encode::<BaseDatagramSocketGetInfoResponse, D>::encode(
3070                (
3071                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
3072                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
3073                        &self.proto,
3074                    ),
3075                ),
3076                encoder,
3077                offset,
3078                _depth,
3079            )
3080        }
3081    }
3082    unsafe impl<
3083            D: fidl::encoding::ResourceDialect,
3084            T0: fidl::encoding::Encode<Domain, D>,
3085            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
3086        > fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D> for (T0, T1)
3087    {
3088        #[inline]
3089        unsafe fn encode(
3090            self,
3091            encoder: &mut fidl::encoding::Encoder<'_, D>,
3092            offset: usize,
3093            depth: fidl::encoding::Depth,
3094        ) -> fidl::Result<()> {
3095            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
3096            // Zero out padding regions. There's no need to apply masks
3097            // because the unmasked parts will be overwritten by fields.
3098            unsafe {
3099                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3100                (ptr as *mut u32).write_unaligned(0);
3101            }
3102            // Write the fields.
3103            self.0.encode(encoder, offset + 0, depth)?;
3104            self.1.encode(encoder, offset + 4, depth)?;
3105            Ok(())
3106        }
3107    }
3108
3109    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3110        for BaseDatagramSocketGetInfoResponse
3111    {
3112        #[inline(always)]
3113        fn new_empty() -> Self {
3114            Self {
3115                domain: fidl::new_empty!(Domain, D),
3116                proto: fidl::new_empty!(DatagramSocketProtocol, D),
3117            }
3118        }
3119
3120        #[inline]
3121        unsafe fn decode(
3122            &mut self,
3123            decoder: &mut fidl::encoding::Decoder<'_, D>,
3124            offset: usize,
3125            _depth: fidl::encoding::Depth,
3126        ) -> fidl::Result<()> {
3127            decoder.debug_check_bounds::<Self>(offset);
3128            // Verify that padding bytes are zero.
3129            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3130            let padval = unsafe { (ptr as *const u32).read_unaligned() };
3131            let mask = 0xffff0000u32;
3132            let maskedval = padval & mask;
3133            if maskedval != 0 {
3134                return Err(fidl::Error::NonZeroPadding {
3135                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3136                });
3137            }
3138            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
3139            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
3140            Ok(())
3141        }
3142    }
3143
3144    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpMembershipRequest {
3145        type Borrowed<'a> = &'a Self;
3146        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3147            value
3148        }
3149    }
3150
3151    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpMembershipRequest {
3152        type Owned = Self;
3153
3154        #[inline(always)]
3155        fn inline_align(_context: fidl::encoding::Context) -> usize {
3156            8
3157        }
3158
3159        #[inline(always)]
3160        fn inline_size(_context: fidl::encoding::Context) -> usize {
3161            16
3162        }
3163    }
3164
3165    unsafe impl<D: fidl::encoding::ResourceDialect>
3166        fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D>
3167        for &BaseNetworkSocketAddIpMembershipRequest
3168    {
3169        #[inline]
3170        unsafe fn encode(
3171            self,
3172            encoder: &mut fidl::encoding::Encoder<'_, D>,
3173            offset: usize,
3174            _depth: fidl::encoding::Depth,
3175        ) -> fidl::Result<()> {
3176            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
3177            // Delegate to tuple encoding.
3178            fidl::encoding::Encode::<BaseNetworkSocketAddIpMembershipRequest, D>::encode(
3179                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3180                    &self.membership,
3181                ),),
3182                encoder,
3183                offset,
3184                _depth,
3185            )
3186        }
3187    }
3188    unsafe impl<
3189            D: fidl::encoding::ResourceDialect,
3190            T0: fidl::encoding::Encode<IpMulticastMembership, D>,
3191        > fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D> for (T0,)
3192    {
3193        #[inline]
3194        unsafe fn encode(
3195            self,
3196            encoder: &mut fidl::encoding::Encoder<'_, D>,
3197            offset: usize,
3198            depth: fidl::encoding::Depth,
3199        ) -> fidl::Result<()> {
3200            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
3201            // Zero out padding regions. There's no need to apply masks
3202            // because the unmasked parts will be overwritten by fields.
3203            // Write the fields.
3204            self.0.encode(encoder, offset + 0, depth)?;
3205            Ok(())
3206        }
3207    }
3208
3209    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3210        for BaseNetworkSocketAddIpMembershipRequest
3211    {
3212        #[inline(always)]
3213        fn new_empty() -> Self {
3214            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3215        }
3216
3217        #[inline]
3218        unsafe fn decode(
3219            &mut self,
3220            decoder: &mut fidl::encoding::Decoder<'_, D>,
3221            offset: usize,
3222            _depth: fidl::encoding::Depth,
3223        ) -> fidl::Result<()> {
3224            decoder.debug_check_bounds::<Self>(offset);
3225            // Verify that padding bytes are zero.
3226            fidl::decode!(
3227                IpMulticastMembership,
3228                D,
3229                &mut self.membership,
3230                decoder,
3231                offset + 0,
3232                _depth
3233            )?;
3234            Ok(())
3235        }
3236    }
3237
3238    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
3239        type Borrowed<'a> = &'a Self;
3240        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3241            value
3242        }
3243    }
3244
3245    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
3246        type Owned = Self;
3247
3248        #[inline(always)]
3249        fn inline_align(_context: fidl::encoding::Context) -> usize {
3250            8
3251        }
3252
3253        #[inline(always)]
3254        fn inline_size(_context: fidl::encoding::Context) -> usize {
3255            24
3256        }
3257    }
3258
3259    unsafe impl<D: fidl::encoding::ResourceDialect>
3260        fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D>
3261        for &BaseNetworkSocketAddIpv6MembershipRequest
3262    {
3263        #[inline]
3264        unsafe fn encode(
3265            self,
3266            encoder: &mut fidl::encoding::Encoder<'_, D>,
3267            offset: usize,
3268            _depth: fidl::encoding::Depth,
3269        ) -> fidl::Result<()> {
3270            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
3271            // Delegate to tuple encoding.
3272            fidl::encoding::Encode::<BaseNetworkSocketAddIpv6MembershipRequest, D>::encode(
3273                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3274                    &self.membership,
3275                ),),
3276                encoder,
3277                offset,
3278                _depth,
3279            )
3280        }
3281    }
3282    unsafe impl<
3283            D: fidl::encoding::ResourceDialect,
3284            T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3285        > fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D> for (T0,)
3286    {
3287        #[inline]
3288        unsafe fn encode(
3289            self,
3290            encoder: &mut fidl::encoding::Encoder<'_, D>,
3291            offset: usize,
3292            depth: fidl::encoding::Depth,
3293        ) -> fidl::Result<()> {
3294            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
3295            // Zero out padding regions. There's no need to apply masks
3296            // because the unmasked parts will be overwritten by fields.
3297            // Write the fields.
3298            self.0.encode(encoder, offset + 0, depth)?;
3299            Ok(())
3300        }
3301    }
3302
3303    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3304        for BaseNetworkSocketAddIpv6MembershipRequest
3305    {
3306        #[inline(always)]
3307        fn new_empty() -> Self {
3308            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3309        }
3310
3311        #[inline]
3312        unsafe fn decode(
3313            &mut self,
3314            decoder: &mut fidl::encoding::Decoder<'_, D>,
3315            offset: usize,
3316            _depth: fidl::encoding::Depth,
3317        ) -> fidl::Result<()> {
3318            decoder.debug_check_bounds::<Self>(offset);
3319            // Verify that padding bytes are zero.
3320            fidl::decode!(
3321                Ipv6MulticastMembership,
3322                D,
3323                &mut self.membership,
3324                decoder,
3325                offset + 0,
3326                _depth
3327            )?;
3328            Ok(())
3329        }
3330    }
3331
3332    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketBindRequest {
3333        type Borrowed<'a> = &'a Self;
3334        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3335            value
3336        }
3337    }
3338
3339    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketBindRequest {
3340        type Owned = Self;
3341
3342        #[inline(always)]
3343        fn inline_align(_context: fidl::encoding::Context) -> usize {
3344            8
3345        }
3346
3347        #[inline(always)]
3348        fn inline_size(_context: fidl::encoding::Context) -> usize {
3349            16
3350        }
3351    }
3352
3353    unsafe impl<D: fidl::encoding::ResourceDialect>
3354        fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for &BaseNetworkSocketBindRequest
3355    {
3356        #[inline]
3357        unsafe fn encode(
3358            self,
3359            encoder: &mut fidl::encoding::Encoder<'_, D>,
3360            offset: usize,
3361            _depth: fidl::encoding::Depth,
3362        ) -> fidl::Result<()> {
3363            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
3364            // Delegate to tuple encoding.
3365            fidl::encoding::Encode::<BaseNetworkSocketBindRequest, D>::encode(
3366                (
3367                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
3368                ),
3369                encoder, offset, _depth
3370            )
3371        }
3372    }
3373    unsafe impl<
3374            D: fidl::encoding::ResourceDialect,
3375            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
3376        > fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for (T0,)
3377    {
3378        #[inline]
3379        unsafe fn encode(
3380            self,
3381            encoder: &mut fidl::encoding::Encoder<'_, D>,
3382            offset: usize,
3383            depth: fidl::encoding::Depth,
3384        ) -> fidl::Result<()> {
3385            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
3386            // Zero out padding regions. There's no need to apply masks
3387            // because the unmasked parts will be overwritten by fields.
3388            // Write the fields.
3389            self.0.encode(encoder, offset + 0, depth)?;
3390            Ok(())
3391        }
3392    }
3393
3394    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3395        for BaseNetworkSocketBindRequest
3396    {
3397        #[inline(always)]
3398        fn new_empty() -> Self {
3399            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
3400        }
3401
3402        #[inline]
3403        unsafe fn decode(
3404            &mut self,
3405            decoder: &mut fidl::encoding::Decoder<'_, D>,
3406            offset: usize,
3407            _depth: fidl::encoding::Depth,
3408        ) -> fidl::Result<()> {
3409            decoder.debug_check_bounds::<Self>(offset);
3410            // Verify that padding bytes are zero.
3411            fidl::decode!(
3412                fidl_fuchsia_net__common::SocketAddress,
3413                D,
3414                &mut self.addr,
3415                decoder,
3416                offset + 0,
3417                _depth
3418            )?;
3419            Ok(())
3420        }
3421    }
3422
3423    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketConnectRequest {
3424        type Borrowed<'a> = &'a Self;
3425        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3426            value
3427        }
3428    }
3429
3430    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketConnectRequest {
3431        type Owned = Self;
3432
3433        #[inline(always)]
3434        fn inline_align(_context: fidl::encoding::Context) -> usize {
3435            8
3436        }
3437
3438        #[inline(always)]
3439        fn inline_size(_context: fidl::encoding::Context) -> usize {
3440            16
3441        }
3442    }
3443
3444    unsafe impl<D: fidl::encoding::ResourceDialect>
3445        fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D>
3446        for &BaseNetworkSocketConnectRequest
3447    {
3448        #[inline]
3449        unsafe fn encode(
3450            self,
3451            encoder: &mut fidl::encoding::Encoder<'_, D>,
3452            offset: usize,
3453            _depth: fidl::encoding::Depth,
3454        ) -> fidl::Result<()> {
3455            encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3456            // Delegate to tuple encoding.
3457            fidl::encoding::Encode::<BaseNetworkSocketConnectRequest, D>::encode(
3458                (
3459                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
3460                ),
3461                encoder, offset, _depth
3462            )
3463        }
3464    }
3465    unsafe impl<
3466            D: fidl::encoding::ResourceDialect,
3467            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
3468        > fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D> for (T0,)
3469    {
3470        #[inline]
3471        unsafe fn encode(
3472            self,
3473            encoder: &mut fidl::encoding::Encoder<'_, D>,
3474            offset: usize,
3475            depth: fidl::encoding::Depth,
3476        ) -> fidl::Result<()> {
3477            encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3478            // Zero out padding regions. There's no need to apply masks
3479            // because the unmasked parts will be overwritten by fields.
3480            // Write the fields.
3481            self.0.encode(encoder, offset + 0, depth)?;
3482            Ok(())
3483        }
3484    }
3485
3486    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3487        for BaseNetworkSocketConnectRequest
3488    {
3489        #[inline(always)]
3490        fn new_empty() -> Self {
3491            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
3492        }
3493
3494        #[inline]
3495        unsafe fn decode(
3496            &mut self,
3497            decoder: &mut fidl::encoding::Decoder<'_, D>,
3498            offset: usize,
3499            _depth: fidl::encoding::Depth,
3500        ) -> fidl::Result<()> {
3501            decoder.debug_check_bounds::<Self>(offset);
3502            // Verify that padding bytes are zero.
3503            fidl::decode!(
3504                fidl_fuchsia_net__common::SocketAddress,
3505                D,
3506                &mut self.addr,
3507                decoder,
3508                offset + 0,
3509                _depth
3510            )?;
3511            Ok(())
3512        }
3513    }
3514
3515    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3516        type Borrowed<'a> = &'a Self;
3517        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3518            value
3519        }
3520    }
3521
3522    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3523        type Owned = Self;
3524
3525        #[inline(always)]
3526        fn inline_align(_context: fidl::encoding::Context) -> usize {
3527            8
3528        }
3529
3530        #[inline(always)]
3531        fn inline_size(_context: fidl::encoding::Context) -> usize {
3532            16
3533        }
3534    }
3535
3536    unsafe impl<D: fidl::encoding::ResourceDialect>
3537        fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D>
3538        for &BaseNetworkSocketDropIpMembershipRequest
3539    {
3540        #[inline]
3541        unsafe fn encode(
3542            self,
3543            encoder: &mut fidl::encoding::Encoder<'_, D>,
3544            offset: usize,
3545            _depth: fidl::encoding::Depth,
3546        ) -> fidl::Result<()> {
3547            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3548            // Delegate to tuple encoding.
3549            fidl::encoding::Encode::<BaseNetworkSocketDropIpMembershipRequest, D>::encode(
3550                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3551                    &self.membership,
3552                ),),
3553                encoder,
3554                offset,
3555                _depth,
3556            )
3557        }
3558    }
3559    unsafe impl<
3560            D: fidl::encoding::ResourceDialect,
3561            T0: fidl::encoding::Encode<IpMulticastMembership, D>,
3562        > fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D> for (T0,)
3563    {
3564        #[inline]
3565        unsafe fn encode(
3566            self,
3567            encoder: &mut fidl::encoding::Encoder<'_, D>,
3568            offset: usize,
3569            depth: fidl::encoding::Depth,
3570        ) -> fidl::Result<()> {
3571            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3572            // Zero out padding regions. There's no need to apply masks
3573            // because the unmasked parts will be overwritten by fields.
3574            // Write the fields.
3575            self.0.encode(encoder, offset + 0, depth)?;
3576            Ok(())
3577        }
3578    }
3579
3580    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3581        for BaseNetworkSocketDropIpMembershipRequest
3582    {
3583        #[inline(always)]
3584        fn new_empty() -> Self {
3585            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3586        }
3587
3588        #[inline]
3589        unsafe fn decode(
3590            &mut self,
3591            decoder: &mut fidl::encoding::Decoder<'_, D>,
3592            offset: usize,
3593            _depth: fidl::encoding::Depth,
3594        ) -> fidl::Result<()> {
3595            decoder.debug_check_bounds::<Self>(offset);
3596            // Verify that padding bytes are zero.
3597            fidl::decode!(
3598                IpMulticastMembership,
3599                D,
3600                &mut self.membership,
3601                decoder,
3602                offset + 0,
3603                _depth
3604            )?;
3605            Ok(())
3606        }
3607    }
3608
3609    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3610        type Borrowed<'a> = &'a Self;
3611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3612            value
3613        }
3614    }
3615
3616    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3617        type Owned = Self;
3618
3619        #[inline(always)]
3620        fn inline_align(_context: fidl::encoding::Context) -> usize {
3621            8
3622        }
3623
3624        #[inline(always)]
3625        fn inline_size(_context: fidl::encoding::Context) -> usize {
3626            24
3627        }
3628    }
3629
3630    unsafe impl<D: fidl::encoding::ResourceDialect>
3631        fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D>
3632        for &BaseNetworkSocketDropIpv6MembershipRequest
3633    {
3634        #[inline]
3635        unsafe fn encode(
3636            self,
3637            encoder: &mut fidl::encoding::Encoder<'_, D>,
3638            offset: usize,
3639            _depth: fidl::encoding::Depth,
3640        ) -> fidl::Result<()> {
3641            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3642            // Delegate to tuple encoding.
3643            fidl::encoding::Encode::<BaseNetworkSocketDropIpv6MembershipRequest, D>::encode(
3644                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3645                    &self.membership,
3646                ),),
3647                encoder,
3648                offset,
3649                _depth,
3650            )
3651        }
3652    }
3653    unsafe impl<
3654            D: fidl::encoding::ResourceDialect,
3655            T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3656        > fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D> for (T0,)
3657    {
3658        #[inline]
3659        unsafe fn encode(
3660            self,
3661            encoder: &mut fidl::encoding::Encoder<'_, D>,
3662            offset: usize,
3663            depth: fidl::encoding::Depth,
3664        ) -> fidl::Result<()> {
3665            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3666            // Zero out padding regions. There's no need to apply masks
3667            // because the unmasked parts will be overwritten by fields.
3668            // Write the fields.
3669            self.0.encode(encoder, offset + 0, depth)?;
3670            Ok(())
3671        }
3672    }
3673
3674    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3675        for BaseNetworkSocketDropIpv6MembershipRequest
3676    {
3677        #[inline(always)]
3678        fn new_empty() -> Self {
3679            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3680        }
3681
3682        #[inline]
3683        unsafe fn decode(
3684            &mut self,
3685            decoder: &mut fidl::encoding::Decoder<'_, D>,
3686            offset: usize,
3687            _depth: fidl::encoding::Depth,
3688        ) -> fidl::Result<()> {
3689            decoder.debug_check_bounds::<Self>(offset);
3690            // Verify that padding bytes are zero.
3691            fidl::decode!(
3692                Ipv6MulticastMembership,
3693                D,
3694                &mut self.membership,
3695                decoder,
3696                offset + 0,
3697                _depth
3698            )?;
3699            Ok(())
3700        }
3701    }
3702
3703    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3704        type Borrowed<'a> = &'a Self;
3705        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3706            value
3707        }
3708    }
3709
3710    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3711        type Owned = Self;
3712
3713        #[inline(always)]
3714        fn inline_align(_context: fidl::encoding::Context) -> usize {
3715            8
3716        }
3717
3718        #[inline(always)]
3719        fn inline_size(_context: fidl::encoding::Context) -> usize {
3720            16
3721        }
3722    }
3723
3724    unsafe impl<D: fidl::encoding::ResourceDialect>
3725        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>
3726        for &BaseNetworkSocketSetIpMulticastInterfaceRequest
3727    {
3728        #[inline]
3729        unsafe fn encode(
3730            self,
3731            encoder: &mut fidl::encoding::Encoder<'_, D>,
3732            offset: usize,
3733            _depth: fidl::encoding::Depth,
3734        ) -> fidl::Result<()> {
3735            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3736            // Delegate to tuple encoding.
3737            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>::encode(
3738                (
3739                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
3740                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
3741                ),
3742                encoder, offset, _depth
3743            )
3744        }
3745    }
3746    unsafe impl<
3747            D: fidl::encoding::ResourceDialect,
3748            T0: fidl::encoding::Encode<u64, D>,
3749            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
3750        > fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D> for (T0, T1)
3751    {
3752        #[inline]
3753        unsafe fn encode(
3754            self,
3755            encoder: &mut fidl::encoding::Encoder<'_, D>,
3756            offset: usize,
3757            depth: fidl::encoding::Depth,
3758        ) -> fidl::Result<()> {
3759            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3760            // Zero out padding regions. There's no need to apply masks
3761            // because the unmasked parts will be overwritten by fields.
3762            unsafe {
3763                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3764                (ptr as *mut u64).write_unaligned(0);
3765            }
3766            // Write the fields.
3767            self.0.encode(encoder, offset + 0, depth)?;
3768            self.1.encode(encoder, offset + 8, depth)?;
3769            Ok(())
3770        }
3771    }
3772
3773    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3774        for BaseNetworkSocketSetIpMulticastInterfaceRequest
3775    {
3776        #[inline(always)]
3777        fn new_empty() -> Self {
3778            Self {
3779                iface: fidl::new_empty!(u64, D),
3780                address: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D),
3781            }
3782        }
3783
3784        #[inline]
3785        unsafe fn decode(
3786            &mut self,
3787            decoder: &mut fidl::encoding::Decoder<'_, D>,
3788            offset: usize,
3789            _depth: fidl::encoding::Depth,
3790        ) -> fidl::Result<()> {
3791            decoder.debug_check_bounds::<Self>(offset);
3792            // Verify that padding bytes are zero.
3793            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3794            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3795            let mask = 0xffffffff00000000u64;
3796            let maskedval = padval & mask;
3797            if maskedval != 0 {
3798                return Err(fidl::Error::NonZeroPadding {
3799                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3800                });
3801            }
3802            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
3803            fidl::decode!(
3804                fidl_fuchsia_net__common::Ipv4Address,
3805                D,
3806                &mut self.address,
3807                decoder,
3808                offset + 8,
3809                _depth
3810            )?;
3811            Ok(())
3812        }
3813    }
3814
3815    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3816        type Borrowed<'a> = &'a Self;
3817        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3818            value
3819        }
3820    }
3821
3822    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3823        type Owned = Self;
3824
3825        #[inline(always)]
3826        fn inline_align(_context: fidl::encoding::Context) -> usize {
3827            1
3828        }
3829
3830        #[inline(always)]
3831        fn inline_size(_context: fidl::encoding::Context) -> usize {
3832            1
3833        }
3834    }
3835
3836    unsafe impl<D: fidl::encoding::ResourceDialect>
3837        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>
3838        for &BaseNetworkSocketSetIpMulticastLoopbackRequest
3839    {
3840        #[inline]
3841        unsafe fn encode(
3842            self,
3843            encoder: &mut fidl::encoding::Encoder<'_, D>,
3844            offset: usize,
3845            _depth: fidl::encoding::Depth,
3846        ) -> fidl::Result<()> {
3847            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3848            // Delegate to tuple encoding.
3849            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>::encode(
3850                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3851                encoder,
3852                offset,
3853                _depth,
3854            )
3855        }
3856    }
3857    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3858        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D> for (T0,)
3859    {
3860        #[inline]
3861        unsafe fn encode(
3862            self,
3863            encoder: &mut fidl::encoding::Encoder<'_, D>,
3864            offset: usize,
3865            depth: fidl::encoding::Depth,
3866        ) -> fidl::Result<()> {
3867            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3868            // Zero out padding regions. There's no need to apply masks
3869            // because the unmasked parts will be overwritten by fields.
3870            // Write the fields.
3871            self.0.encode(encoder, offset + 0, depth)?;
3872            Ok(())
3873        }
3874    }
3875
3876    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3877        for BaseNetworkSocketSetIpMulticastLoopbackRequest
3878    {
3879        #[inline(always)]
3880        fn new_empty() -> Self {
3881            Self { value: fidl::new_empty!(bool, D) }
3882        }
3883
3884        #[inline]
3885        unsafe fn decode(
3886            &mut self,
3887            decoder: &mut fidl::encoding::Decoder<'_, D>,
3888            offset: usize,
3889            _depth: fidl::encoding::Depth,
3890        ) -> fidl::Result<()> {
3891            decoder.debug_check_bounds::<Self>(offset);
3892            // Verify that padding bytes are zero.
3893            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3894            Ok(())
3895        }
3896    }
3897
3898    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3899        type Borrowed<'a> = &'a Self;
3900        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3901            value
3902        }
3903    }
3904
3905    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3906        type Owned = Self;
3907
3908        #[inline(always)]
3909        fn inline_align(_context: fidl::encoding::Context) -> usize {
3910            8
3911        }
3912
3913        #[inline(always)]
3914        fn inline_size(_context: fidl::encoding::Context) -> usize {
3915            16
3916        }
3917    }
3918
3919    unsafe impl<D: fidl::encoding::ResourceDialect>
3920        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D>
3921        for &BaseNetworkSocketSetIpMulticastTtlRequest
3922    {
3923        #[inline]
3924        unsafe fn encode(
3925            self,
3926            encoder: &mut fidl::encoding::Encoder<'_, D>,
3927            offset: usize,
3928            _depth: fidl::encoding::Depth,
3929        ) -> fidl::Result<()> {
3930            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3931            // Delegate to tuple encoding.
3932            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastTtlRequest, D>::encode(
3933                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3934                encoder,
3935                offset,
3936                _depth,
3937            )
3938        }
3939    }
3940    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
3941        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D> for (T0,)
3942    {
3943        #[inline]
3944        unsafe fn encode(
3945            self,
3946            encoder: &mut fidl::encoding::Encoder<'_, D>,
3947            offset: usize,
3948            depth: fidl::encoding::Depth,
3949        ) -> fidl::Result<()> {
3950            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3951            // Zero out padding regions. There's no need to apply masks
3952            // because the unmasked parts will be overwritten by fields.
3953            // Write the fields.
3954            self.0.encode(encoder, offset + 0, depth)?;
3955            Ok(())
3956        }
3957    }
3958
3959    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3960        for BaseNetworkSocketSetIpMulticastTtlRequest
3961    {
3962        #[inline(always)]
3963        fn new_empty() -> Self {
3964            Self { value: fidl::new_empty!(OptionalUint8, D) }
3965        }
3966
3967        #[inline]
3968        unsafe fn decode(
3969            &mut self,
3970            decoder: &mut fidl::encoding::Decoder<'_, D>,
3971            offset: usize,
3972            _depth: fidl::encoding::Depth,
3973        ) -> fidl::Result<()> {
3974            decoder.debug_check_bounds::<Self>(offset);
3975            // Verify that padding bytes are zero.
3976            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
3977            Ok(())
3978        }
3979    }
3980
3981    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3982        type Borrowed<'a> = &'a Self;
3983        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3984            value
3985        }
3986    }
3987
3988    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3989        type Owned = Self;
3990
3991        #[inline(always)]
3992        fn inline_align(_context: fidl::encoding::Context) -> usize {
3993            1
3994        }
3995
3996        #[inline(always)]
3997        fn inline_size(_context: fidl::encoding::Context) -> usize {
3998            1
3999        }
4000    }
4001
4002    unsafe impl<D: fidl::encoding::ResourceDialect>
4003        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D>
4004        for &BaseNetworkSocketSetIpPacketInfoRequest
4005    {
4006        #[inline]
4007        unsafe fn encode(
4008            self,
4009            encoder: &mut fidl::encoding::Encoder<'_, D>,
4010            offset: usize,
4011            _depth: fidl::encoding::Depth,
4012        ) -> fidl::Result<()> {
4013            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
4014            // Delegate to tuple encoding.
4015            fidl::encoding::Encode::<BaseNetworkSocketSetIpPacketInfoRequest, D>::encode(
4016                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4017                encoder,
4018                offset,
4019                _depth,
4020            )
4021        }
4022    }
4023    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4024        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D> for (T0,)
4025    {
4026        #[inline]
4027        unsafe fn encode(
4028            self,
4029            encoder: &mut fidl::encoding::Encoder<'_, D>,
4030            offset: usize,
4031            depth: fidl::encoding::Depth,
4032        ) -> fidl::Result<()> {
4033            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
4034            // Zero out padding regions. There's no need to apply masks
4035            // because the unmasked parts will be overwritten by fields.
4036            // Write the fields.
4037            self.0.encode(encoder, offset + 0, depth)?;
4038            Ok(())
4039        }
4040    }
4041
4042    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4043        for BaseNetworkSocketSetIpPacketInfoRequest
4044    {
4045        #[inline(always)]
4046        fn new_empty() -> Self {
4047            Self { value: fidl::new_empty!(bool, D) }
4048        }
4049
4050        #[inline]
4051        unsafe fn decode(
4052            &mut self,
4053            decoder: &mut fidl::encoding::Decoder<'_, D>,
4054            offset: usize,
4055            _depth: fidl::encoding::Depth,
4056        ) -> fidl::Result<()> {
4057            decoder.debug_check_bounds::<Self>(offset);
4058            // Verify that padding bytes are zero.
4059            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4060            Ok(())
4061        }
4062    }
4063
4064    impl fidl::encoding::ValueTypeMarker
4065        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
4066    {
4067        type Borrowed<'a> = &'a Self;
4068        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4069            value
4070        }
4071    }
4072
4073    unsafe impl fidl::encoding::TypeMarker
4074        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
4075    {
4076        type Owned = Self;
4077
4078        #[inline(always)]
4079        fn inline_align(_context: fidl::encoding::Context) -> usize {
4080            1
4081        }
4082
4083        #[inline(always)]
4084        fn inline_size(_context: fidl::encoding::Context) -> usize {
4085            1
4086        }
4087    }
4088
4089    unsafe impl<D: fidl::encoding::ResourceDialect>
4090        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
4091        for &BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
4092    {
4093        #[inline]
4094        unsafe fn encode(
4095            self,
4096            encoder: &mut fidl::encoding::Encoder<'_, D>,
4097            offset: usize,
4098            _depth: fidl::encoding::Depth,
4099        ) -> fidl::Result<()> {
4100            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
4101            // Delegate to tuple encoding.
4102            fidl::encoding::Encode::<
4103                BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest,
4104                D,
4105            >::encode(
4106                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4107                encoder,
4108                offset,
4109                _depth,
4110            )
4111        }
4112    }
4113    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4114        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
4115        for (T0,)
4116    {
4117        #[inline]
4118        unsafe fn encode(
4119            self,
4120            encoder: &mut fidl::encoding::Encoder<'_, D>,
4121            offset: usize,
4122            depth: fidl::encoding::Depth,
4123        ) -> fidl::Result<()> {
4124            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
4125            // Zero out padding regions. There's no need to apply masks
4126            // because the unmasked parts will be overwritten by fields.
4127            // Write the fields.
4128            self.0.encode(encoder, offset + 0, depth)?;
4129            Ok(())
4130        }
4131    }
4132
4133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4134        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
4135    {
4136        #[inline(always)]
4137        fn new_empty() -> Self {
4138            Self { value: fidl::new_empty!(bool, D) }
4139        }
4140
4141        #[inline]
4142        unsafe fn decode(
4143            &mut self,
4144            decoder: &mut fidl::encoding::Decoder<'_, D>,
4145            offset: usize,
4146            _depth: fidl::encoding::Depth,
4147        ) -> fidl::Result<()> {
4148            decoder.debug_check_bounds::<Self>(offset);
4149            // Verify that padding bytes are zero.
4150            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4151            Ok(())
4152        }
4153    }
4154
4155    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
4156        type Borrowed<'a> = &'a Self;
4157        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4158            value
4159        }
4160    }
4161
4162    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
4163        type Owned = Self;
4164
4165        #[inline(always)]
4166        fn inline_align(_context: fidl::encoding::Context) -> usize {
4167            1
4168        }
4169
4170        #[inline(always)]
4171        fn inline_size(_context: fidl::encoding::Context) -> usize {
4172            1
4173        }
4174    }
4175
4176    unsafe impl<D: fidl::encoding::ResourceDialect>
4177        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D>
4178        for &BaseNetworkSocketSetIpReceiveTtlRequest
4179    {
4180        #[inline]
4181        unsafe fn encode(
4182            self,
4183            encoder: &mut fidl::encoding::Encoder<'_, D>,
4184            offset: usize,
4185            _depth: fidl::encoding::Depth,
4186        ) -> fidl::Result<()> {
4187            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
4188            // Delegate to tuple encoding.
4189            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTtlRequest, D>::encode(
4190                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4191                encoder,
4192                offset,
4193                _depth,
4194            )
4195        }
4196    }
4197    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4198        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D> for (T0,)
4199    {
4200        #[inline]
4201        unsafe fn encode(
4202            self,
4203            encoder: &mut fidl::encoding::Encoder<'_, D>,
4204            offset: usize,
4205            depth: fidl::encoding::Depth,
4206        ) -> fidl::Result<()> {
4207            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
4208            // Zero out padding regions. There's no need to apply masks
4209            // because the unmasked parts will be overwritten by fields.
4210            // Write the fields.
4211            self.0.encode(encoder, offset + 0, depth)?;
4212            Ok(())
4213        }
4214    }
4215
4216    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4217        for BaseNetworkSocketSetIpReceiveTtlRequest
4218    {
4219        #[inline(always)]
4220        fn new_empty() -> Self {
4221            Self { value: fidl::new_empty!(bool, D) }
4222        }
4223
4224        #[inline]
4225        unsafe fn decode(
4226            &mut self,
4227            decoder: &mut fidl::encoding::Decoder<'_, D>,
4228            offset: usize,
4229            _depth: fidl::encoding::Depth,
4230        ) -> fidl::Result<()> {
4231            decoder.debug_check_bounds::<Self>(offset);
4232            // Verify that padding bytes are zero.
4233            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4234            Ok(())
4235        }
4236    }
4237
4238    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
4239        type Borrowed<'a> = &'a Self;
4240        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4241            value
4242        }
4243    }
4244
4245    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
4246        type Owned = Self;
4247
4248        #[inline(always)]
4249        fn inline_align(_context: fidl::encoding::Context) -> usize {
4250            1
4251        }
4252
4253        #[inline(always)]
4254        fn inline_size(_context: fidl::encoding::Context) -> usize {
4255            1
4256        }
4257    }
4258
4259    unsafe impl<D: fidl::encoding::ResourceDialect>
4260        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>
4261        for &BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
4262    {
4263        #[inline]
4264        unsafe fn encode(
4265            self,
4266            encoder: &mut fidl::encoding::Encoder<'_, D>,
4267            offset: usize,
4268            _depth: fidl::encoding::Depth,
4269        ) -> fidl::Result<()> {
4270            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
4271            // Delegate to tuple encoding.
4272            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>::encode(
4273                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4274                encoder,
4275                offset,
4276                _depth,
4277            )
4278        }
4279    }
4280    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4281        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D> for (T0,)
4282    {
4283        #[inline]
4284        unsafe fn encode(
4285            self,
4286            encoder: &mut fidl::encoding::Encoder<'_, D>,
4287            offset: usize,
4288            depth: fidl::encoding::Depth,
4289        ) -> fidl::Result<()> {
4290            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
4291            // Zero out padding regions. There's no need to apply masks
4292            // because the unmasked parts will be overwritten by fields.
4293            // Write the fields.
4294            self.0.encode(encoder, offset + 0, depth)?;
4295            Ok(())
4296        }
4297    }
4298
4299    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4300        for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
4301    {
4302        #[inline(always)]
4303        fn new_empty() -> Self {
4304            Self { value: fidl::new_empty!(bool, D) }
4305        }
4306
4307        #[inline]
4308        unsafe fn decode(
4309            &mut self,
4310            decoder: &mut fidl::encoding::Decoder<'_, D>,
4311            offset: usize,
4312            _depth: fidl::encoding::Depth,
4313        ) -> fidl::Result<()> {
4314            decoder.debug_check_bounds::<Self>(offset);
4315            // Verify that padding bytes are zero.
4316            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4317            Ok(())
4318        }
4319    }
4320
4321    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTransparentRequest {
4322        type Borrowed<'a> = &'a Self;
4323        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4324            value
4325        }
4326    }
4327
4328    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTransparentRequest {
4329        type Owned = Self;
4330
4331        #[inline(always)]
4332        fn inline_align(_context: fidl::encoding::Context) -> usize {
4333            1
4334        }
4335
4336        #[inline(always)]
4337        fn inline_size(_context: fidl::encoding::Context) -> usize {
4338            1
4339        }
4340    }
4341
4342    unsafe impl<D: fidl::encoding::ResourceDialect>
4343        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D>
4344        for &BaseNetworkSocketSetIpTransparentRequest
4345    {
4346        #[inline]
4347        unsafe fn encode(
4348            self,
4349            encoder: &mut fidl::encoding::Encoder<'_, D>,
4350            offset: usize,
4351            _depth: fidl::encoding::Depth,
4352        ) -> fidl::Result<()> {
4353            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
4354            // Delegate to tuple encoding.
4355            fidl::encoding::Encode::<BaseNetworkSocketSetIpTransparentRequest, D>::encode(
4356                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4357                encoder,
4358                offset,
4359                _depth,
4360            )
4361        }
4362    }
4363    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4364        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D> for (T0,)
4365    {
4366        #[inline]
4367        unsafe fn encode(
4368            self,
4369            encoder: &mut fidl::encoding::Encoder<'_, D>,
4370            offset: usize,
4371            depth: fidl::encoding::Depth,
4372        ) -> fidl::Result<()> {
4373            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
4374            // Zero out padding regions. There's no need to apply masks
4375            // because the unmasked parts will be overwritten by fields.
4376            // Write the fields.
4377            self.0.encode(encoder, offset + 0, depth)?;
4378            Ok(())
4379        }
4380    }
4381
4382    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4383        for BaseNetworkSocketSetIpTransparentRequest
4384    {
4385        #[inline(always)]
4386        fn new_empty() -> Self {
4387            Self { value: fidl::new_empty!(bool, D) }
4388        }
4389
4390        #[inline]
4391        unsafe fn decode(
4392            &mut self,
4393            decoder: &mut fidl::encoding::Decoder<'_, D>,
4394            offset: usize,
4395            _depth: fidl::encoding::Depth,
4396        ) -> fidl::Result<()> {
4397            decoder.debug_check_bounds::<Self>(offset);
4398            // Verify that padding bytes are zero.
4399            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4400            Ok(())
4401        }
4402    }
4403
4404    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTtlRequest {
4405        type Borrowed<'a> = &'a Self;
4406        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4407            value
4408        }
4409    }
4410
4411    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTtlRequest {
4412        type Owned = Self;
4413
4414        #[inline(always)]
4415        fn inline_align(_context: fidl::encoding::Context) -> usize {
4416            8
4417        }
4418
4419        #[inline(always)]
4420        fn inline_size(_context: fidl::encoding::Context) -> usize {
4421            16
4422        }
4423    }
4424
4425    unsafe impl<D: fidl::encoding::ResourceDialect>
4426        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D>
4427        for &BaseNetworkSocketSetIpTtlRequest
4428    {
4429        #[inline]
4430        unsafe fn encode(
4431            self,
4432            encoder: &mut fidl::encoding::Encoder<'_, D>,
4433            offset: usize,
4434            _depth: fidl::encoding::Depth,
4435        ) -> fidl::Result<()> {
4436            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4437            // Delegate to tuple encoding.
4438            fidl::encoding::Encode::<BaseNetworkSocketSetIpTtlRequest, D>::encode(
4439                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4440                encoder,
4441                offset,
4442                _depth,
4443            )
4444        }
4445    }
4446    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4447        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D> for (T0,)
4448    {
4449        #[inline]
4450        unsafe fn encode(
4451            self,
4452            encoder: &mut fidl::encoding::Encoder<'_, D>,
4453            offset: usize,
4454            depth: fidl::encoding::Depth,
4455        ) -> fidl::Result<()> {
4456            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4457            // Zero out padding regions. There's no need to apply masks
4458            // because the unmasked parts will be overwritten by fields.
4459            // Write the fields.
4460            self.0.encode(encoder, offset + 0, depth)?;
4461            Ok(())
4462        }
4463    }
4464
4465    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4466        for BaseNetworkSocketSetIpTtlRequest
4467    {
4468        #[inline(always)]
4469        fn new_empty() -> Self {
4470            Self { value: fidl::new_empty!(OptionalUint8, D) }
4471        }
4472
4473        #[inline]
4474        unsafe fn decode(
4475            &mut self,
4476            decoder: &mut fidl::encoding::Decoder<'_, D>,
4477            offset: usize,
4478            _depth: fidl::encoding::Depth,
4479        ) -> fidl::Result<()> {
4480            decoder.debug_check_bounds::<Self>(offset);
4481            // Verify that padding bytes are zero.
4482            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4483            Ok(())
4484        }
4485    }
4486
4487    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4488        type Borrowed<'a> = &'a Self;
4489        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4490            value
4491        }
4492    }
4493
4494    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4495        type Owned = Self;
4496
4497        #[inline(always)]
4498        fn inline_align(_context: fidl::encoding::Context) -> usize {
4499            1
4500        }
4501
4502        #[inline(always)]
4503        fn inline_size(_context: fidl::encoding::Context) -> usize {
4504            1
4505        }
4506        #[inline(always)]
4507        fn encode_is_copy() -> bool {
4508            true
4509        }
4510
4511        #[inline(always)]
4512        fn decode_is_copy() -> bool {
4513            true
4514        }
4515    }
4516
4517    unsafe impl<D: fidl::encoding::ResourceDialect>
4518        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D>
4519        for &BaseNetworkSocketSetIpTypeOfServiceRequest
4520    {
4521        #[inline]
4522        unsafe fn encode(
4523            self,
4524            encoder: &mut fidl::encoding::Encoder<'_, D>,
4525            offset: usize,
4526            _depth: fidl::encoding::Depth,
4527        ) -> fidl::Result<()> {
4528            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4529            unsafe {
4530                // Copy the object into the buffer.
4531                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4532                (buf_ptr as *mut BaseNetworkSocketSetIpTypeOfServiceRequest).write_unaligned(
4533                    (self as *const BaseNetworkSocketSetIpTypeOfServiceRequest).read(),
4534                );
4535                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4536                // done second because the memcpy will write garbage to these bytes.
4537            }
4538            Ok(())
4539        }
4540    }
4541    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
4542        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D> for (T0,)
4543    {
4544        #[inline]
4545        unsafe fn encode(
4546            self,
4547            encoder: &mut fidl::encoding::Encoder<'_, D>,
4548            offset: usize,
4549            depth: fidl::encoding::Depth,
4550        ) -> fidl::Result<()> {
4551            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4552            // Zero out padding regions. There's no need to apply masks
4553            // because the unmasked parts will be overwritten by fields.
4554            // Write the fields.
4555            self.0.encode(encoder, offset + 0, depth)?;
4556            Ok(())
4557        }
4558    }
4559
4560    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4561        for BaseNetworkSocketSetIpTypeOfServiceRequest
4562    {
4563        #[inline(always)]
4564        fn new_empty() -> Self {
4565            Self { value: fidl::new_empty!(u8, D) }
4566        }
4567
4568        #[inline]
4569        unsafe fn decode(
4570            &mut self,
4571            decoder: &mut fidl::encoding::Decoder<'_, D>,
4572            offset: usize,
4573            _depth: fidl::encoding::Depth,
4574        ) -> fidl::Result<()> {
4575            decoder.debug_check_bounds::<Self>(offset);
4576            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4577            // Verify that padding bytes are zero.
4578            // Copy from the buffer into the object.
4579            unsafe {
4580                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
4581            }
4582            Ok(())
4583        }
4584    }
4585
4586    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4587        type Borrowed<'a> = &'a Self;
4588        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4589            value
4590        }
4591    }
4592
4593    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4594        type Owned = Self;
4595
4596        #[inline(always)]
4597        fn inline_align(_context: fidl::encoding::Context) -> usize {
4598            8
4599        }
4600
4601        #[inline(always)]
4602        fn inline_size(_context: fidl::encoding::Context) -> usize {
4603            16
4604        }
4605    }
4606
4607    unsafe impl<D: fidl::encoding::ResourceDialect>
4608        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>
4609        for &BaseNetworkSocketSetIpv6MulticastHopsRequest
4610    {
4611        #[inline]
4612        unsafe fn encode(
4613            self,
4614            encoder: &mut fidl::encoding::Encoder<'_, D>,
4615            offset: usize,
4616            _depth: fidl::encoding::Depth,
4617        ) -> fidl::Result<()> {
4618            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4619            // Delegate to tuple encoding.
4620            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>::encode(
4621                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4622                encoder,
4623                offset,
4624                _depth,
4625            )
4626        }
4627    }
4628    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4629        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D> for (T0,)
4630    {
4631        #[inline]
4632        unsafe fn encode(
4633            self,
4634            encoder: &mut fidl::encoding::Encoder<'_, D>,
4635            offset: usize,
4636            depth: fidl::encoding::Depth,
4637        ) -> fidl::Result<()> {
4638            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4639            // Zero out padding regions. There's no need to apply masks
4640            // because the unmasked parts will be overwritten by fields.
4641            // Write the fields.
4642            self.0.encode(encoder, offset + 0, depth)?;
4643            Ok(())
4644        }
4645    }
4646
4647    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4648        for BaseNetworkSocketSetIpv6MulticastHopsRequest
4649    {
4650        #[inline(always)]
4651        fn new_empty() -> Self {
4652            Self { value: fidl::new_empty!(OptionalUint8, D) }
4653        }
4654
4655        #[inline]
4656        unsafe fn decode(
4657            &mut self,
4658            decoder: &mut fidl::encoding::Decoder<'_, D>,
4659            offset: usize,
4660            _depth: fidl::encoding::Depth,
4661        ) -> fidl::Result<()> {
4662            decoder.debug_check_bounds::<Self>(offset);
4663            // Verify that padding bytes are zero.
4664            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4665            Ok(())
4666        }
4667    }
4668
4669    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4670        type Borrowed<'a> = &'a Self;
4671        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4672            value
4673        }
4674    }
4675
4676    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4677        type Owned = Self;
4678
4679        #[inline(always)]
4680        fn inline_align(_context: fidl::encoding::Context) -> usize {
4681            8
4682        }
4683
4684        #[inline(always)]
4685        fn inline_size(_context: fidl::encoding::Context) -> usize {
4686            8
4687        }
4688        #[inline(always)]
4689        fn encode_is_copy() -> bool {
4690            true
4691        }
4692
4693        #[inline(always)]
4694        fn decode_is_copy() -> bool {
4695            true
4696        }
4697    }
4698
4699    unsafe impl<D: fidl::encoding::ResourceDialect>
4700        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D>
4701        for &BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4702    {
4703        #[inline]
4704        unsafe fn encode(
4705            self,
4706            encoder: &mut fidl::encoding::Encoder<'_, D>,
4707            offset: usize,
4708            _depth: fidl::encoding::Depth,
4709        ) -> fidl::Result<()> {
4710            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4711            unsafe {
4712                // Copy the object into the buffer.
4713                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4714                (buf_ptr as *mut BaseNetworkSocketSetIpv6MulticastInterfaceRequest)
4715                    .write_unaligned(
4716                        (self as *const BaseNetworkSocketSetIpv6MulticastInterfaceRequest).read(),
4717                    );
4718                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4719                // done second because the memcpy will write garbage to these bytes.
4720            }
4721            Ok(())
4722        }
4723    }
4724    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4725        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D> for (T0,)
4726    {
4727        #[inline]
4728        unsafe fn encode(
4729            self,
4730            encoder: &mut fidl::encoding::Encoder<'_, D>,
4731            offset: usize,
4732            depth: fidl::encoding::Depth,
4733        ) -> fidl::Result<()> {
4734            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4735            // Zero out padding regions. There's no need to apply masks
4736            // because the unmasked parts will be overwritten by fields.
4737            // Write the fields.
4738            self.0.encode(encoder, offset + 0, depth)?;
4739            Ok(())
4740        }
4741    }
4742
4743    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4744        for BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4745    {
4746        #[inline(always)]
4747        fn new_empty() -> Self {
4748            Self { value: fidl::new_empty!(u64, D) }
4749        }
4750
4751        #[inline]
4752        unsafe fn decode(
4753            &mut self,
4754            decoder: &mut fidl::encoding::Decoder<'_, D>,
4755            offset: usize,
4756            _depth: fidl::encoding::Depth,
4757        ) -> fidl::Result<()> {
4758            decoder.debug_check_bounds::<Self>(offset);
4759            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4760            // Verify that padding bytes are zero.
4761            // Copy from the buffer into the object.
4762            unsafe {
4763                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4764            }
4765            Ok(())
4766        }
4767    }
4768
4769    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4770        type Borrowed<'a> = &'a Self;
4771        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4772            value
4773        }
4774    }
4775
4776    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4777        type Owned = Self;
4778
4779        #[inline(always)]
4780        fn inline_align(_context: fidl::encoding::Context) -> usize {
4781            1
4782        }
4783
4784        #[inline(always)]
4785        fn inline_size(_context: fidl::encoding::Context) -> usize {
4786            1
4787        }
4788    }
4789
4790    unsafe impl<D: fidl::encoding::ResourceDialect>
4791        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>
4792        for &BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4793    {
4794        #[inline]
4795        unsafe fn encode(
4796            self,
4797            encoder: &mut fidl::encoding::Encoder<'_, D>,
4798            offset: usize,
4799            _depth: fidl::encoding::Depth,
4800        ) -> fidl::Result<()> {
4801            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4802            // Delegate to tuple encoding.
4803            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>::encode(
4804                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4805                encoder,
4806                offset,
4807                _depth,
4808            )
4809        }
4810    }
4811    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4812        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D> for (T0,)
4813    {
4814        #[inline]
4815        unsafe fn encode(
4816            self,
4817            encoder: &mut fidl::encoding::Encoder<'_, D>,
4818            offset: usize,
4819            depth: fidl::encoding::Depth,
4820        ) -> fidl::Result<()> {
4821            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4822            // Zero out padding regions. There's no need to apply masks
4823            // because the unmasked parts will be overwritten by fields.
4824            // Write the fields.
4825            self.0.encode(encoder, offset + 0, depth)?;
4826            Ok(())
4827        }
4828    }
4829
4830    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4831        for BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4832    {
4833        #[inline(always)]
4834        fn new_empty() -> Self {
4835            Self { value: fidl::new_empty!(bool, D) }
4836        }
4837
4838        #[inline]
4839        unsafe fn decode(
4840            &mut self,
4841            decoder: &mut fidl::encoding::Decoder<'_, D>,
4842            offset: usize,
4843            _depth: fidl::encoding::Depth,
4844        ) -> fidl::Result<()> {
4845            decoder.debug_check_bounds::<Self>(offset);
4846            // Verify that padding bytes are zero.
4847            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4848            Ok(())
4849        }
4850    }
4851
4852    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4853        type Borrowed<'a> = &'a Self;
4854        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4855            value
4856        }
4857    }
4858
4859    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4860        type Owned = Self;
4861
4862        #[inline(always)]
4863        fn inline_align(_context: fidl::encoding::Context) -> usize {
4864            1
4865        }
4866
4867        #[inline(always)]
4868        fn inline_size(_context: fidl::encoding::Context) -> usize {
4869            1
4870        }
4871    }
4872
4873    unsafe impl<D: fidl::encoding::ResourceDialect>
4874        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D>
4875        for &BaseNetworkSocketSetIpv6OnlyRequest
4876    {
4877        #[inline]
4878        unsafe fn encode(
4879            self,
4880            encoder: &mut fidl::encoding::Encoder<'_, D>,
4881            offset: usize,
4882            _depth: fidl::encoding::Depth,
4883        ) -> fidl::Result<()> {
4884            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4885            // Delegate to tuple encoding.
4886            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6OnlyRequest, D>::encode(
4887                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4888                encoder,
4889                offset,
4890                _depth,
4891            )
4892        }
4893    }
4894    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4895        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D> for (T0,)
4896    {
4897        #[inline]
4898        unsafe fn encode(
4899            self,
4900            encoder: &mut fidl::encoding::Encoder<'_, D>,
4901            offset: usize,
4902            depth: fidl::encoding::Depth,
4903        ) -> fidl::Result<()> {
4904            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4905            // Zero out padding regions. There's no need to apply masks
4906            // because the unmasked parts will be overwritten by fields.
4907            // Write the fields.
4908            self.0.encode(encoder, offset + 0, depth)?;
4909            Ok(())
4910        }
4911    }
4912
4913    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4914        for BaseNetworkSocketSetIpv6OnlyRequest
4915    {
4916        #[inline(always)]
4917        fn new_empty() -> Self {
4918            Self { value: fidl::new_empty!(bool, D) }
4919        }
4920
4921        #[inline]
4922        unsafe fn decode(
4923            &mut self,
4924            decoder: &mut fidl::encoding::Decoder<'_, D>,
4925            offset: usize,
4926            _depth: fidl::encoding::Depth,
4927        ) -> fidl::Result<()> {
4928            decoder.debug_check_bounds::<Self>(offset);
4929            // Verify that padding bytes are zero.
4930            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4931            Ok(())
4932        }
4933    }
4934
4935    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4936        type Borrowed<'a> = &'a Self;
4937        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4938            value
4939        }
4940    }
4941
4942    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4943        type Owned = Self;
4944
4945        #[inline(always)]
4946        fn inline_align(_context: fidl::encoding::Context) -> usize {
4947            1
4948        }
4949
4950        #[inline(always)]
4951        fn inline_size(_context: fidl::encoding::Context) -> usize {
4952            1
4953        }
4954    }
4955
4956    unsafe impl<D: fidl::encoding::ResourceDialect>
4957        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>
4958        for &BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4959    {
4960        #[inline]
4961        unsafe fn encode(
4962            self,
4963            encoder: &mut fidl::encoding::Encoder<'_, D>,
4964            offset: usize,
4965            _depth: fidl::encoding::Depth,
4966        ) -> fidl::Result<()> {
4967            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4968            // Delegate to tuple encoding.
4969            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>::encode(
4970                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4971                encoder,
4972                offset,
4973                _depth,
4974            )
4975        }
4976    }
4977    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4978        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D> for (T0,)
4979    {
4980        #[inline]
4981        unsafe fn encode(
4982            self,
4983            encoder: &mut fidl::encoding::Encoder<'_, D>,
4984            offset: usize,
4985            depth: fidl::encoding::Depth,
4986        ) -> fidl::Result<()> {
4987            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4988            // Zero out padding regions. There's no need to apply masks
4989            // because the unmasked parts will be overwritten by fields.
4990            // Write the fields.
4991            self.0.encode(encoder, offset + 0, depth)?;
4992            Ok(())
4993        }
4994    }
4995
4996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4997        for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4998    {
4999        #[inline(always)]
5000        fn new_empty() -> Self {
5001            Self { value: fidl::new_empty!(bool, D) }
5002        }
5003
5004        #[inline]
5005        unsafe fn decode(
5006            &mut self,
5007            decoder: &mut fidl::encoding::Decoder<'_, D>,
5008            offset: usize,
5009            _depth: fidl::encoding::Depth,
5010        ) -> fidl::Result<()> {
5011            decoder.debug_check_bounds::<Self>(offset);
5012            // Verify that padding bytes are zero.
5013            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5014            Ok(())
5015        }
5016    }
5017
5018    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
5019        type Borrowed<'a> = &'a Self;
5020        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5021            value
5022        }
5023    }
5024
5025    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
5026        type Owned = Self;
5027
5028        #[inline(always)]
5029        fn inline_align(_context: fidl::encoding::Context) -> usize {
5030            1
5031        }
5032
5033        #[inline(always)]
5034        fn inline_size(_context: fidl::encoding::Context) -> usize {
5035            1
5036        }
5037    }
5038
5039    unsafe impl<D: fidl::encoding::ResourceDialect>
5040        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>
5041        for &BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
5042    {
5043        #[inline]
5044        unsafe fn encode(
5045            self,
5046            encoder: &mut fidl::encoding::Encoder<'_, D>,
5047            offset: usize,
5048            _depth: fidl::encoding::Depth,
5049        ) -> fidl::Result<()> {
5050            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
5051            // Delegate to tuple encoding.
5052            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>::encode(
5053                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5054                encoder,
5055                offset,
5056                _depth,
5057            )
5058        }
5059    }
5060    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5061        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D> for (T0,)
5062    {
5063        #[inline]
5064        unsafe fn encode(
5065            self,
5066            encoder: &mut fidl::encoding::Encoder<'_, D>,
5067            offset: usize,
5068            depth: fidl::encoding::Depth,
5069        ) -> fidl::Result<()> {
5070            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
5071            // Zero out padding regions. There's no need to apply masks
5072            // because the unmasked parts will be overwritten by fields.
5073            // Write the fields.
5074            self.0.encode(encoder, offset + 0, depth)?;
5075            Ok(())
5076        }
5077    }
5078
5079    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5080        for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
5081    {
5082        #[inline(always)]
5083        fn new_empty() -> Self {
5084            Self { value: fidl::new_empty!(bool, D) }
5085        }
5086
5087        #[inline]
5088        unsafe fn decode(
5089            &mut self,
5090            decoder: &mut fidl::encoding::Decoder<'_, D>,
5091            offset: usize,
5092            _depth: fidl::encoding::Depth,
5093        ) -> fidl::Result<()> {
5094            decoder.debug_check_bounds::<Self>(offset);
5095            // Verify that padding bytes are zero.
5096            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5097            Ok(())
5098        }
5099    }
5100
5101    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
5102        type Borrowed<'a> = &'a Self;
5103        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5104            value
5105        }
5106    }
5107
5108    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
5109        type Owned = Self;
5110
5111        #[inline(always)]
5112        fn inline_align(_context: fidl::encoding::Context) -> usize {
5113            1
5114        }
5115
5116        #[inline(always)]
5117        fn inline_size(_context: fidl::encoding::Context) -> usize {
5118            1
5119        }
5120    }
5121
5122    unsafe impl<D: fidl::encoding::ResourceDialect>
5123        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>
5124        for &BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
5125    {
5126        #[inline]
5127        unsafe fn encode(
5128            self,
5129            encoder: &mut fidl::encoding::Encoder<'_, D>,
5130            offset: usize,
5131            _depth: fidl::encoding::Depth,
5132        ) -> fidl::Result<()> {
5133            encoder
5134                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
5135            // Delegate to tuple encoding.
5136            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>::encode(
5137                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5138                encoder,
5139                offset,
5140                _depth,
5141            )
5142        }
5143    }
5144    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5145        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D> for (T0,)
5146    {
5147        #[inline]
5148        unsafe fn encode(
5149            self,
5150            encoder: &mut fidl::encoding::Encoder<'_, D>,
5151            offset: usize,
5152            depth: fidl::encoding::Depth,
5153        ) -> fidl::Result<()> {
5154            encoder
5155                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
5156            // Zero out padding regions. There's no need to apply masks
5157            // because the unmasked parts will be overwritten by fields.
5158            // Write the fields.
5159            self.0.encode(encoder, offset + 0, depth)?;
5160            Ok(())
5161        }
5162    }
5163
5164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5165        for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
5166    {
5167        #[inline(always)]
5168        fn new_empty() -> Self {
5169            Self { value: fidl::new_empty!(bool, D) }
5170        }
5171
5172        #[inline]
5173        unsafe fn decode(
5174            &mut self,
5175            decoder: &mut fidl::encoding::Decoder<'_, D>,
5176            offset: usize,
5177            _depth: fidl::encoding::Depth,
5178        ) -> fidl::Result<()> {
5179            decoder.debug_check_bounds::<Self>(offset);
5180            // Verify that padding bytes are zero.
5181            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5182            Ok(())
5183        }
5184    }
5185
5186    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
5187        type Borrowed<'a> = &'a Self;
5188        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5189            value
5190        }
5191    }
5192
5193    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
5194        type Owned = Self;
5195
5196        #[inline(always)]
5197        fn inline_align(_context: fidl::encoding::Context) -> usize {
5198            8
5199        }
5200
5201        #[inline(always)]
5202        fn inline_size(_context: fidl::encoding::Context) -> usize {
5203            16
5204        }
5205    }
5206
5207    unsafe impl<D: fidl::encoding::ResourceDialect>
5208        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D>
5209        for &BaseNetworkSocketSetIpv6TrafficClassRequest
5210    {
5211        #[inline]
5212        unsafe fn encode(
5213            self,
5214            encoder: &mut fidl::encoding::Encoder<'_, D>,
5215            offset: usize,
5216            _depth: fidl::encoding::Depth,
5217        ) -> fidl::Result<()> {
5218            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
5219            // Delegate to tuple encoding.
5220            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6TrafficClassRequest, D>::encode(
5221                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5222                encoder,
5223                offset,
5224                _depth,
5225            )
5226        }
5227    }
5228    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
5229        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D> for (T0,)
5230    {
5231        #[inline]
5232        unsafe fn encode(
5233            self,
5234            encoder: &mut fidl::encoding::Encoder<'_, D>,
5235            offset: usize,
5236            depth: fidl::encoding::Depth,
5237        ) -> fidl::Result<()> {
5238            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
5239            // Zero out padding regions. There's no need to apply masks
5240            // because the unmasked parts will be overwritten by fields.
5241            // Write the fields.
5242            self.0.encode(encoder, offset + 0, depth)?;
5243            Ok(())
5244        }
5245    }
5246
5247    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5248        for BaseNetworkSocketSetIpv6TrafficClassRequest
5249    {
5250        #[inline(always)]
5251        fn new_empty() -> Self {
5252            Self { value: fidl::new_empty!(OptionalUint8, D) }
5253        }
5254
5255        #[inline]
5256        unsafe fn decode(
5257            &mut self,
5258            decoder: &mut fidl::encoding::Decoder<'_, D>,
5259            offset: usize,
5260            _depth: fidl::encoding::Depth,
5261        ) -> fidl::Result<()> {
5262            decoder.debug_check_bounds::<Self>(offset);
5263            // Verify that padding bytes are zero.
5264            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
5265            Ok(())
5266        }
5267    }
5268
5269    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
5270        type Borrowed<'a> = &'a Self;
5271        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5272            value
5273        }
5274    }
5275
5276    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
5277        type Owned = Self;
5278
5279        #[inline(always)]
5280        fn inline_align(_context: fidl::encoding::Context) -> usize {
5281            8
5282        }
5283
5284        #[inline(always)]
5285        fn inline_size(_context: fidl::encoding::Context) -> usize {
5286            16
5287        }
5288    }
5289
5290    unsafe impl<D: fidl::encoding::ResourceDialect>
5291        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>
5292        for &BaseNetworkSocketSetIpv6UnicastHopsRequest
5293    {
5294        #[inline]
5295        unsafe fn encode(
5296            self,
5297            encoder: &mut fidl::encoding::Encoder<'_, D>,
5298            offset: usize,
5299            _depth: fidl::encoding::Depth,
5300        ) -> fidl::Result<()> {
5301            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
5302            // Delegate to tuple encoding.
5303            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>::encode(
5304                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5305                encoder,
5306                offset,
5307                _depth,
5308            )
5309        }
5310    }
5311    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
5312        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D> for (T0,)
5313    {
5314        #[inline]
5315        unsafe fn encode(
5316            self,
5317            encoder: &mut fidl::encoding::Encoder<'_, D>,
5318            offset: usize,
5319            depth: fidl::encoding::Depth,
5320        ) -> fidl::Result<()> {
5321            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
5322            // Zero out padding regions. There's no need to apply masks
5323            // because the unmasked parts will be overwritten by fields.
5324            // Write the fields.
5325            self.0.encode(encoder, offset + 0, depth)?;
5326            Ok(())
5327        }
5328    }
5329
5330    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5331        for BaseNetworkSocketSetIpv6UnicastHopsRequest
5332    {
5333        #[inline(always)]
5334        fn new_empty() -> Self {
5335            Self { value: fidl::new_empty!(OptionalUint8, D) }
5336        }
5337
5338        #[inline]
5339        unsafe fn decode(
5340            &mut self,
5341            decoder: &mut fidl::encoding::Decoder<'_, D>,
5342            offset: usize,
5343            _depth: fidl::encoding::Depth,
5344        ) -> fidl::Result<()> {
5345            decoder.debug_check_bounds::<Self>(offset);
5346            // Verify that padding bytes are zero.
5347            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
5348            Ok(())
5349        }
5350    }
5351
5352    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketShutdownRequest {
5353        type Borrowed<'a> = &'a Self;
5354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5355            value
5356        }
5357    }
5358
5359    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketShutdownRequest {
5360        type Owned = Self;
5361
5362        #[inline(always)]
5363        fn inline_align(_context: fidl::encoding::Context) -> usize {
5364            2
5365        }
5366
5367        #[inline(always)]
5368        fn inline_size(_context: fidl::encoding::Context) -> usize {
5369            2
5370        }
5371    }
5372
5373    unsafe impl<D: fidl::encoding::ResourceDialect>
5374        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D>
5375        for &BaseNetworkSocketShutdownRequest
5376    {
5377        #[inline]
5378        unsafe fn encode(
5379            self,
5380            encoder: &mut fidl::encoding::Encoder<'_, D>,
5381            offset: usize,
5382            _depth: fidl::encoding::Depth,
5383        ) -> fidl::Result<()> {
5384            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5385            // Delegate to tuple encoding.
5386            fidl::encoding::Encode::<BaseNetworkSocketShutdownRequest, D>::encode(
5387                (<ShutdownMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
5388                encoder,
5389                offset,
5390                _depth,
5391            )
5392        }
5393    }
5394    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ShutdownMode, D>>
5395        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D> for (T0,)
5396    {
5397        #[inline]
5398        unsafe fn encode(
5399            self,
5400            encoder: &mut fidl::encoding::Encoder<'_, D>,
5401            offset: usize,
5402            depth: fidl::encoding::Depth,
5403        ) -> fidl::Result<()> {
5404            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5405            // Zero out padding regions. There's no need to apply masks
5406            // because the unmasked parts will be overwritten by fields.
5407            // Write the fields.
5408            self.0.encode(encoder, offset + 0, depth)?;
5409            Ok(())
5410        }
5411    }
5412
5413    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5414        for BaseNetworkSocketShutdownRequest
5415    {
5416        #[inline(always)]
5417        fn new_empty() -> Self {
5418            Self { mode: fidl::new_empty!(ShutdownMode, D) }
5419        }
5420
5421        #[inline]
5422        unsafe fn decode(
5423            &mut self,
5424            decoder: &mut fidl::encoding::Decoder<'_, D>,
5425            offset: usize,
5426            _depth: fidl::encoding::Depth,
5427        ) -> fidl::Result<()> {
5428            decoder.debug_check_bounds::<Self>(offset);
5429            // Verify that padding bytes are zero.
5430            fidl::decode!(ShutdownMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
5431            Ok(())
5432        }
5433    }
5434
5435    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5436        type Borrowed<'a> = &'a Self;
5437        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5438            value
5439        }
5440    }
5441
5442    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5443        type Owned = Self;
5444
5445        #[inline(always)]
5446        fn inline_align(_context: fidl::encoding::Context) -> usize {
5447            1
5448        }
5449
5450        #[inline(always)]
5451        fn inline_size(_context: fidl::encoding::Context) -> usize {
5452            4
5453        }
5454    }
5455
5456    unsafe impl<D: fidl::encoding::ResourceDialect>
5457        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>
5458        for &BaseNetworkSocketGetIpMulticastInterfaceResponse
5459    {
5460        #[inline]
5461        unsafe fn encode(
5462            self,
5463            encoder: &mut fidl::encoding::Encoder<'_, D>,
5464            offset: usize,
5465            _depth: fidl::encoding::Depth,
5466        ) -> fidl::Result<()> {
5467            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5468            // Delegate to tuple encoding.
5469            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>::encode(
5470                (
5471                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5472                ),
5473                encoder, offset, _depth
5474            )
5475        }
5476    }
5477    unsafe impl<
5478            D: fidl::encoding::ResourceDialect,
5479            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
5480        > fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D> for (T0,)
5481    {
5482        #[inline]
5483        unsafe fn encode(
5484            self,
5485            encoder: &mut fidl::encoding::Encoder<'_, D>,
5486            offset: usize,
5487            depth: fidl::encoding::Depth,
5488        ) -> fidl::Result<()> {
5489            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5490            // Zero out padding regions. There's no need to apply masks
5491            // because the unmasked parts will be overwritten by fields.
5492            // Write the fields.
5493            self.0.encode(encoder, offset + 0, depth)?;
5494            Ok(())
5495        }
5496    }
5497
5498    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5499        for BaseNetworkSocketGetIpMulticastInterfaceResponse
5500    {
5501        #[inline(always)]
5502        fn new_empty() -> Self {
5503            Self { value: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D) }
5504        }
5505
5506        #[inline]
5507        unsafe fn decode(
5508            &mut self,
5509            decoder: &mut fidl::encoding::Decoder<'_, D>,
5510            offset: usize,
5511            _depth: fidl::encoding::Depth,
5512        ) -> fidl::Result<()> {
5513            decoder.debug_check_bounds::<Self>(offset);
5514            // Verify that padding bytes are zero.
5515            fidl::decode!(
5516                fidl_fuchsia_net__common::Ipv4Address,
5517                D,
5518                &mut self.value,
5519                decoder,
5520                offset + 0,
5521                _depth
5522            )?;
5523            Ok(())
5524        }
5525    }
5526
5527    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5528        type Borrowed<'a> = &'a Self;
5529        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5530            value
5531        }
5532    }
5533
5534    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5535        type Owned = Self;
5536
5537        #[inline(always)]
5538        fn inline_align(_context: fidl::encoding::Context) -> usize {
5539            1
5540        }
5541
5542        #[inline(always)]
5543        fn inline_size(_context: fidl::encoding::Context) -> usize {
5544            1
5545        }
5546    }
5547
5548    unsafe impl<D: fidl::encoding::ResourceDialect>
5549        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>
5550        for &BaseNetworkSocketGetIpMulticastLoopbackResponse
5551    {
5552        #[inline]
5553        unsafe fn encode(
5554            self,
5555            encoder: &mut fidl::encoding::Encoder<'_, D>,
5556            offset: usize,
5557            _depth: fidl::encoding::Depth,
5558        ) -> fidl::Result<()> {
5559            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5560            // Delegate to tuple encoding.
5561            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>::encode(
5562                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5563                encoder,
5564                offset,
5565                _depth,
5566            )
5567        }
5568    }
5569    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5570        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D> for (T0,)
5571    {
5572        #[inline]
5573        unsafe fn encode(
5574            self,
5575            encoder: &mut fidl::encoding::Encoder<'_, D>,
5576            offset: usize,
5577            depth: fidl::encoding::Depth,
5578        ) -> fidl::Result<()> {
5579            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5580            // Zero out padding regions. There's no need to apply masks
5581            // because the unmasked parts will be overwritten by fields.
5582            // Write the fields.
5583            self.0.encode(encoder, offset + 0, depth)?;
5584            Ok(())
5585        }
5586    }
5587
5588    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5589        for BaseNetworkSocketGetIpMulticastLoopbackResponse
5590    {
5591        #[inline(always)]
5592        fn new_empty() -> Self {
5593            Self { value: fidl::new_empty!(bool, D) }
5594        }
5595
5596        #[inline]
5597        unsafe fn decode(
5598            &mut self,
5599            decoder: &mut fidl::encoding::Decoder<'_, D>,
5600            offset: usize,
5601            _depth: fidl::encoding::Depth,
5602        ) -> fidl::Result<()> {
5603            decoder.debug_check_bounds::<Self>(offset);
5604            // Verify that padding bytes are zero.
5605            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5606            Ok(())
5607        }
5608    }
5609
5610    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5611        type Borrowed<'a> = &'a Self;
5612        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5613            value
5614        }
5615    }
5616
5617    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5618        type Owned = Self;
5619
5620        #[inline(always)]
5621        fn inline_align(_context: fidl::encoding::Context) -> usize {
5622            1
5623        }
5624
5625        #[inline(always)]
5626        fn inline_size(_context: fidl::encoding::Context) -> usize {
5627            1
5628        }
5629        #[inline(always)]
5630        fn encode_is_copy() -> bool {
5631            true
5632        }
5633
5634        #[inline(always)]
5635        fn decode_is_copy() -> bool {
5636            true
5637        }
5638    }
5639
5640    unsafe impl<D: fidl::encoding::ResourceDialect>
5641        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D>
5642        for &BaseNetworkSocketGetIpMulticastTtlResponse
5643    {
5644        #[inline]
5645        unsafe fn encode(
5646            self,
5647            encoder: &mut fidl::encoding::Encoder<'_, D>,
5648            offset: usize,
5649            _depth: fidl::encoding::Depth,
5650        ) -> fidl::Result<()> {
5651            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5652            unsafe {
5653                // Copy the object into the buffer.
5654                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5655                (buf_ptr as *mut BaseNetworkSocketGetIpMulticastTtlResponse).write_unaligned(
5656                    (self as *const BaseNetworkSocketGetIpMulticastTtlResponse).read(),
5657                );
5658                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5659                // done second because the memcpy will write garbage to these bytes.
5660            }
5661            Ok(())
5662        }
5663    }
5664    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5665        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D> for (T0,)
5666    {
5667        #[inline]
5668        unsafe fn encode(
5669            self,
5670            encoder: &mut fidl::encoding::Encoder<'_, D>,
5671            offset: usize,
5672            depth: fidl::encoding::Depth,
5673        ) -> fidl::Result<()> {
5674            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5675            // Zero out padding regions. There's no need to apply masks
5676            // because the unmasked parts will be overwritten by fields.
5677            // Write the fields.
5678            self.0.encode(encoder, offset + 0, depth)?;
5679            Ok(())
5680        }
5681    }
5682
5683    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5684        for BaseNetworkSocketGetIpMulticastTtlResponse
5685    {
5686        #[inline(always)]
5687        fn new_empty() -> Self {
5688            Self { value: fidl::new_empty!(u8, D) }
5689        }
5690
5691        #[inline]
5692        unsafe fn decode(
5693            &mut self,
5694            decoder: &mut fidl::encoding::Decoder<'_, D>,
5695            offset: usize,
5696            _depth: fidl::encoding::Depth,
5697        ) -> fidl::Result<()> {
5698            decoder.debug_check_bounds::<Self>(offset);
5699            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5700            // Verify that padding bytes are zero.
5701            // Copy from the buffer into the object.
5702            unsafe {
5703                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5704            }
5705            Ok(())
5706        }
5707    }
5708
5709    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5710        type Borrowed<'a> = &'a Self;
5711        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5712            value
5713        }
5714    }
5715
5716    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5717        type Owned = Self;
5718
5719        #[inline(always)]
5720        fn inline_align(_context: fidl::encoding::Context) -> usize {
5721            1
5722        }
5723
5724        #[inline(always)]
5725        fn inline_size(_context: fidl::encoding::Context) -> usize {
5726            1
5727        }
5728    }
5729
5730    unsafe impl<D: fidl::encoding::ResourceDialect>
5731        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D>
5732        for &BaseNetworkSocketGetIpPacketInfoResponse
5733    {
5734        #[inline]
5735        unsafe fn encode(
5736            self,
5737            encoder: &mut fidl::encoding::Encoder<'_, D>,
5738            offset: usize,
5739            _depth: fidl::encoding::Depth,
5740        ) -> fidl::Result<()> {
5741            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5742            // Delegate to tuple encoding.
5743            fidl::encoding::Encode::<BaseNetworkSocketGetIpPacketInfoResponse, D>::encode(
5744                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5745                encoder,
5746                offset,
5747                _depth,
5748            )
5749        }
5750    }
5751    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5752        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D> for (T0,)
5753    {
5754        #[inline]
5755        unsafe fn encode(
5756            self,
5757            encoder: &mut fidl::encoding::Encoder<'_, D>,
5758            offset: usize,
5759            depth: fidl::encoding::Depth,
5760        ) -> fidl::Result<()> {
5761            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5762            // Zero out padding regions. There's no need to apply masks
5763            // because the unmasked parts will be overwritten by fields.
5764            // Write the fields.
5765            self.0.encode(encoder, offset + 0, depth)?;
5766            Ok(())
5767        }
5768    }
5769
5770    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5771        for BaseNetworkSocketGetIpPacketInfoResponse
5772    {
5773        #[inline(always)]
5774        fn new_empty() -> Self {
5775            Self { value: fidl::new_empty!(bool, D) }
5776        }
5777
5778        #[inline]
5779        unsafe fn decode(
5780            &mut self,
5781            decoder: &mut fidl::encoding::Decoder<'_, D>,
5782            offset: usize,
5783            _depth: fidl::encoding::Depth,
5784        ) -> fidl::Result<()> {
5785            decoder.debug_check_bounds::<Self>(offset);
5786            // Verify that padding bytes are zero.
5787            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5788            Ok(())
5789        }
5790    }
5791
5792    impl fidl::encoding::ValueTypeMarker
5793        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5794    {
5795        type Borrowed<'a> = &'a Self;
5796        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5797            value
5798        }
5799    }
5800
5801    unsafe impl fidl::encoding::TypeMarker
5802        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5803    {
5804        type Owned = Self;
5805
5806        #[inline(always)]
5807        fn inline_align(_context: fidl::encoding::Context) -> usize {
5808            1
5809        }
5810
5811        #[inline(always)]
5812        fn inline_size(_context: fidl::encoding::Context) -> usize {
5813            1
5814        }
5815    }
5816
5817    unsafe impl<D: fidl::encoding::ResourceDialect>
5818        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5819        for &BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5820    {
5821        #[inline]
5822        unsafe fn encode(
5823            self,
5824            encoder: &mut fidl::encoding::Encoder<'_, D>,
5825            offset: usize,
5826            _depth: fidl::encoding::Depth,
5827        ) -> fidl::Result<()> {
5828            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5829            // Delegate to tuple encoding.
5830            fidl::encoding::Encode::<
5831                BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse,
5832                D,
5833            >::encode(
5834                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5835                encoder,
5836                offset,
5837                _depth,
5838            )
5839        }
5840    }
5841    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5842        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5843        for (T0,)
5844    {
5845        #[inline]
5846        unsafe fn encode(
5847            self,
5848            encoder: &mut fidl::encoding::Encoder<'_, D>,
5849            offset: usize,
5850            depth: fidl::encoding::Depth,
5851        ) -> fidl::Result<()> {
5852            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5853            // Zero out padding regions. There's no need to apply masks
5854            // because the unmasked parts will be overwritten by fields.
5855            // Write the fields.
5856            self.0.encode(encoder, offset + 0, depth)?;
5857            Ok(())
5858        }
5859    }
5860
5861    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5862        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5863    {
5864        #[inline(always)]
5865        fn new_empty() -> Self {
5866            Self { value: fidl::new_empty!(bool, D) }
5867        }
5868
5869        #[inline]
5870        unsafe fn decode(
5871            &mut self,
5872            decoder: &mut fidl::encoding::Decoder<'_, D>,
5873            offset: usize,
5874            _depth: fidl::encoding::Depth,
5875        ) -> fidl::Result<()> {
5876            decoder.debug_check_bounds::<Self>(offset);
5877            // Verify that padding bytes are zero.
5878            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5879            Ok(())
5880        }
5881    }
5882
5883    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5884        type Borrowed<'a> = &'a Self;
5885        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5886            value
5887        }
5888    }
5889
5890    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5891        type Owned = Self;
5892
5893        #[inline(always)]
5894        fn inline_align(_context: fidl::encoding::Context) -> usize {
5895            1
5896        }
5897
5898        #[inline(always)]
5899        fn inline_size(_context: fidl::encoding::Context) -> usize {
5900            1
5901        }
5902    }
5903
5904    unsafe impl<D: fidl::encoding::ResourceDialect>
5905        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D>
5906        for &BaseNetworkSocketGetIpReceiveTtlResponse
5907    {
5908        #[inline]
5909        unsafe fn encode(
5910            self,
5911            encoder: &mut fidl::encoding::Encoder<'_, D>,
5912            offset: usize,
5913            _depth: fidl::encoding::Depth,
5914        ) -> fidl::Result<()> {
5915            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5916            // Delegate to tuple encoding.
5917            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTtlResponse, D>::encode(
5918                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5919                encoder,
5920                offset,
5921                _depth,
5922            )
5923        }
5924    }
5925    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5926        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D> for (T0,)
5927    {
5928        #[inline]
5929        unsafe fn encode(
5930            self,
5931            encoder: &mut fidl::encoding::Encoder<'_, D>,
5932            offset: usize,
5933            depth: fidl::encoding::Depth,
5934        ) -> fidl::Result<()> {
5935            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5936            // Zero out padding regions. There's no need to apply masks
5937            // because the unmasked parts will be overwritten by fields.
5938            // Write the fields.
5939            self.0.encode(encoder, offset + 0, depth)?;
5940            Ok(())
5941        }
5942    }
5943
5944    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5945        for BaseNetworkSocketGetIpReceiveTtlResponse
5946    {
5947        #[inline(always)]
5948        fn new_empty() -> Self {
5949            Self { value: fidl::new_empty!(bool, D) }
5950        }
5951
5952        #[inline]
5953        unsafe fn decode(
5954            &mut self,
5955            decoder: &mut fidl::encoding::Decoder<'_, D>,
5956            offset: usize,
5957            _depth: fidl::encoding::Depth,
5958        ) -> fidl::Result<()> {
5959            decoder.debug_check_bounds::<Self>(offset);
5960            // Verify that padding bytes are zero.
5961            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5962            Ok(())
5963        }
5964    }
5965
5966    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5967        type Borrowed<'a> = &'a Self;
5968        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5969            value
5970        }
5971    }
5972
5973    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5974        type Owned = Self;
5975
5976        #[inline(always)]
5977        fn inline_align(_context: fidl::encoding::Context) -> usize {
5978            1
5979        }
5980
5981        #[inline(always)]
5982        fn inline_size(_context: fidl::encoding::Context) -> usize {
5983            1
5984        }
5985    }
5986
5987    unsafe impl<D: fidl::encoding::ResourceDialect>
5988        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>
5989        for &BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5990    {
5991        #[inline]
5992        unsafe fn encode(
5993            self,
5994            encoder: &mut fidl::encoding::Encoder<'_, D>,
5995            offset: usize,
5996            _depth: fidl::encoding::Depth,
5997        ) -> fidl::Result<()> {
5998            encoder
5999                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
6000            // Delegate to tuple encoding.
6001            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>::encode(
6002                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6003                encoder,
6004                offset,
6005                _depth,
6006            )
6007        }
6008    }
6009    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6010        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D> for (T0,)
6011    {
6012        #[inline]
6013        unsafe fn encode(
6014            self,
6015            encoder: &mut fidl::encoding::Encoder<'_, D>,
6016            offset: usize,
6017            depth: fidl::encoding::Depth,
6018        ) -> fidl::Result<()> {
6019            encoder
6020                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
6021            // Zero out padding regions. There's no need to apply masks
6022            // because the unmasked parts will be overwritten by fields.
6023            // Write the fields.
6024            self.0.encode(encoder, offset + 0, depth)?;
6025            Ok(())
6026        }
6027    }
6028
6029    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6030        for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
6031    {
6032        #[inline(always)]
6033        fn new_empty() -> Self {
6034            Self { value: fidl::new_empty!(bool, D) }
6035        }
6036
6037        #[inline]
6038        unsafe fn decode(
6039            &mut self,
6040            decoder: &mut fidl::encoding::Decoder<'_, D>,
6041            offset: usize,
6042            _depth: fidl::encoding::Depth,
6043        ) -> fidl::Result<()> {
6044            decoder.debug_check_bounds::<Self>(offset);
6045            // Verify that padding bytes are zero.
6046            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6047            Ok(())
6048        }
6049    }
6050
6051    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTransparentResponse {
6052        type Borrowed<'a> = &'a Self;
6053        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6054            value
6055        }
6056    }
6057
6058    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTransparentResponse {
6059        type Owned = Self;
6060
6061        #[inline(always)]
6062        fn inline_align(_context: fidl::encoding::Context) -> usize {
6063            1
6064        }
6065
6066        #[inline(always)]
6067        fn inline_size(_context: fidl::encoding::Context) -> usize {
6068            1
6069        }
6070    }
6071
6072    unsafe impl<D: fidl::encoding::ResourceDialect>
6073        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D>
6074        for &BaseNetworkSocketGetIpTransparentResponse
6075    {
6076        #[inline]
6077        unsafe fn encode(
6078            self,
6079            encoder: &mut fidl::encoding::Encoder<'_, D>,
6080            offset: usize,
6081            _depth: fidl::encoding::Depth,
6082        ) -> fidl::Result<()> {
6083            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
6084            // Delegate to tuple encoding.
6085            fidl::encoding::Encode::<BaseNetworkSocketGetIpTransparentResponse, D>::encode(
6086                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6087                encoder,
6088                offset,
6089                _depth,
6090            )
6091        }
6092    }
6093    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6094        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D> for (T0,)
6095    {
6096        #[inline]
6097        unsafe fn encode(
6098            self,
6099            encoder: &mut fidl::encoding::Encoder<'_, D>,
6100            offset: usize,
6101            depth: fidl::encoding::Depth,
6102        ) -> fidl::Result<()> {
6103            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
6104            // Zero out padding regions. There's no need to apply masks
6105            // because the unmasked parts will be overwritten by fields.
6106            // Write the fields.
6107            self.0.encode(encoder, offset + 0, depth)?;
6108            Ok(())
6109        }
6110    }
6111
6112    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6113        for BaseNetworkSocketGetIpTransparentResponse
6114    {
6115        #[inline(always)]
6116        fn new_empty() -> Self {
6117            Self { value: fidl::new_empty!(bool, D) }
6118        }
6119
6120        #[inline]
6121        unsafe fn decode(
6122            &mut self,
6123            decoder: &mut fidl::encoding::Decoder<'_, D>,
6124            offset: usize,
6125            _depth: fidl::encoding::Depth,
6126        ) -> fidl::Result<()> {
6127            decoder.debug_check_bounds::<Self>(offset);
6128            // Verify that padding bytes are zero.
6129            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6130            Ok(())
6131        }
6132    }
6133
6134    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTtlResponse {
6135        type Borrowed<'a> = &'a Self;
6136        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6137            value
6138        }
6139    }
6140
6141    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTtlResponse {
6142        type Owned = Self;
6143
6144        #[inline(always)]
6145        fn inline_align(_context: fidl::encoding::Context) -> usize {
6146            1
6147        }
6148
6149        #[inline(always)]
6150        fn inline_size(_context: fidl::encoding::Context) -> usize {
6151            1
6152        }
6153        #[inline(always)]
6154        fn encode_is_copy() -> bool {
6155            true
6156        }
6157
6158        #[inline(always)]
6159        fn decode_is_copy() -> bool {
6160            true
6161        }
6162    }
6163
6164    unsafe impl<D: fidl::encoding::ResourceDialect>
6165        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D>
6166        for &BaseNetworkSocketGetIpTtlResponse
6167    {
6168        #[inline]
6169        unsafe fn encode(
6170            self,
6171            encoder: &mut fidl::encoding::Encoder<'_, D>,
6172            offset: usize,
6173            _depth: fidl::encoding::Depth,
6174        ) -> fidl::Result<()> {
6175            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
6176            unsafe {
6177                // Copy the object into the buffer.
6178                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6179                (buf_ptr as *mut BaseNetworkSocketGetIpTtlResponse)
6180                    .write_unaligned((self as *const BaseNetworkSocketGetIpTtlResponse).read());
6181                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6182                // done second because the memcpy will write garbage to these bytes.
6183            }
6184            Ok(())
6185        }
6186    }
6187    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6188        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D> for (T0,)
6189    {
6190        #[inline]
6191        unsafe fn encode(
6192            self,
6193            encoder: &mut fidl::encoding::Encoder<'_, D>,
6194            offset: usize,
6195            depth: fidl::encoding::Depth,
6196        ) -> fidl::Result<()> {
6197            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
6198            // Zero out padding regions. There's no need to apply masks
6199            // because the unmasked parts will be overwritten by fields.
6200            // Write the fields.
6201            self.0.encode(encoder, offset + 0, depth)?;
6202            Ok(())
6203        }
6204    }
6205
6206    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6207        for BaseNetworkSocketGetIpTtlResponse
6208    {
6209        #[inline(always)]
6210        fn new_empty() -> Self {
6211            Self { value: fidl::new_empty!(u8, D) }
6212        }
6213
6214        #[inline]
6215        unsafe fn decode(
6216            &mut self,
6217            decoder: &mut fidl::encoding::Decoder<'_, D>,
6218            offset: usize,
6219            _depth: fidl::encoding::Depth,
6220        ) -> fidl::Result<()> {
6221            decoder.debug_check_bounds::<Self>(offset);
6222            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6223            // Verify that padding bytes are zero.
6224            // Copy from the buffer into the object.
6225            unsafe {
6226                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6227            }
6228            Ok(())
6229        }
6230    }
6231
6232    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
6233        type Borrowed<'a> = &'a Self;
6234        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6235            value
6236        }
6237    }
6238
6239    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
6240        type Owned = Self;
6241
6242        #[inline(always)]
6243        fn inline_align(_context: fidl::encoding::Context) -> usize {
6244            1
6245        }
6246
6247        #[inline(always)]
6248        fn inline_size(_context: fidl::encoding::Context) -> usize {
6249            1
6250        }
6251        #[inline(always)]
6252        fn encode_is_copy() -> bool {
6253            true
6254        }
6255
6256        #[inline(always)]
6257        fn decode_is_copy() -> bool {
6258            true
6259        }
6260    }
6261
6262    unsafe impl<D: fidl::encoding::ResourceDialect>
6263        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D>
6264        for &BaseNetworkSocketGetIpTypeOfServiceResponse
6265    {
6266        #[inline]
6267        unsafe fn encode(
6268            self,
6269            encoder: &mut fidl::encoding::Encoder<'_, D>,
6270            offset: usize,
6271            _depth: fidl::encoding::Depth,
6272        ) -> fidl::Result<()> {
6273            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
6274            unsafe {
6275                // Copy the object into the buffer.
6276                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6277                (buf_ptr as *mut BaseNetworkSocketGetIpTypeOfServiceResponse).write_unaligned(
6278                    (self as *const BaseNetworkSocketGetIpTypeOfServiceResponse).read(),
6279                );
6280                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6281                // done second because the memcpy will write garbage to these bytes.
6282            }
6283            Ok(())
6284        }
6285    }
6286    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6287        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D> for (T0,)
6288    {
6289        #[inline]
6290        unsafe fn encode(
6291            self,
6292            encoder: &mut fidl::encoding::Encoder<'_, D>,
6293            offset: usize,
6294            depth: fidl::encoding::Depth,
6295        ) -> fidl::Result<()> {
6296            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
6297            // Zero out padding regions. There's no need to apply masks
6298            // because the unmasked parts will be overwritten by fields.
6299            // Write the fields.
6300            self.0.encode(encoder, offset + 0, depth)?;
6301            Ok(())
6302        }
6303    }
6304
6305    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6306        for BaseNetworkSocketGetIpTypeOfServiceResponse
6307    {
6308        #[inline(always)]
6309        fn new_empty() -> Self {
6310            Self { value: fidl::new_empty!(u8, D) }
6311        }
6312
6313        #[inline]
6314        unsafe fn decode(
6315            &mut self,
6316            decoder: &mut fidl::encoding::Decoder<'_, D>,
6317            offset: usize,
6318            _depth: fidl::encoding::Depth,
6319        ) -> fidl::Result<()> {
6320            decoder.debug_check_bounds::<Self>(offset);
6321            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6322            // Verify that padding bytes are zero.
6323            // Copy from the buffer into the object.
6324            unsafe {
6325                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6326            }
6327            Ok(())
6328        }
6329    }
6330
6331    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
6332        type Borrowed<'a> = &'a Self;
6333        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6334            value
6335        }
6336    }
6337
6338    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
6339        type Owned = Self;
6340
6341        #[inline(always)]
6342        fn inline_align(_context: fidl::encoding::Context) -> usize {
6343            1
6344        }
6345
6346        #[inline(always)]
6347        fn inline_size(_context: fidl::encoding::Context) -> usize {
6348            1
6349        }
6350        #[inline(always)]
6351        fn encode_is_copy() -> bool {
6352            true
6353        }
6354
6355        #[inline(always)]
6356        fn decode_is_copy() -> bool {
6357            true
6358        }
6359    }
6360
6361    unsafe impl<D: fidl::encoding::ResourceDialect>
6362        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D>
6363        for &BaseNetworkSocketGetIpv6MulticastHopsResponse
6364    {
6365        #[inline]
6366        unsafe fn encode(
6367            self,
6368            encoder: &mut fidl::encoding::Encoder<'_, D>,
6369            offset: usize,
6370            _depth: fidl::encoding::Depth,
6371        ) -> fidl::Result<()> {
6372            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6373            unsafe {
6374                // Copy the object into the buffer.
6375                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6376                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastHopsResponse).write_unaligned(
6377                    (self as *const BaseNetworkSocketGetIpv6MulticastHopsResponse).read(),
6378                );
6379                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6380                // done second because the memcpy will write garbage to these bytes.
6381            }
6382            Ok(())
6383        }
6384    }
6385    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6386        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D> for (T0,)
6387    {
6388        #[inline]
6389        unsafe fn encode(
6390            self,
6391            encoder: &mut fidl::encoding::Encoder<'_, D>,
6392            offset: usize,
6393            depth: fidl::encoding::Depth,
6394        ) -> fidl::Result<()> {
6395            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6396            // Zero out padding regions. There's no need to apply masks
6397            // because the unmasked parts will be overwritten by fields.
6398            // Write the fields.
6399            self.0.encode(encoder, offset + 0, depth)?;
6400            Ok(())
6401        }
6402    }
6403
6404    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6405        for BaseNetworkSocketGetIpv6MulticastHopsResponse
6406    {
6407        #[inline(always)]
6408        fn new_empty() -> Self {
6409            Self { value: fidl::new_empty!(u8, D) }
6410        }
6411
6412        #[inline]
6413        unsafe fn decode(
6414            &mut self,
6415            decoder: &mut fidl::encoding::Decoder<'_, D>,
6416            offset: usize,
6417            _depth: fidl::encoding::Depth,
6418        ) -> fidl::Result<()> {
6419            decoder.debug_check_bounds::<Self>(offset);
6420            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6421            // Verify that padding bytes are zero.
6422            // Copy from the buffer into the object.
6423            unsafe {
6424                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6425            }
6426            Ok(())
6427        }
6428    }
6429
6430    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6431        type Borrowed<'a> = &'a Self;
6432        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6433            value
6434        }
6435    }
6436
6437    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6438        type Owned = Self;
6439
6440        #[inline(always)]
6441        fn inline_align(_context: fidl::encoding::Context) -> usize {
6442            8
6443        }
6444
6445        #[inline(always)]
6446        fn inline_size(_context: fidl::encoding::Context) -> usize {
6447            8
6448        }
6449        #[inline(always)]
6450        fn encode_is_copy() -> bool {
6451            true
6452        }
6453
6454        #[inline(always)]
6455        fn decode_is_copy() -> bool {
6456            true
6457        }
6458    }
6459
6460    unsafe impl<D: fidl::encoding::ResourceDialect>
6461        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D>
6462        for &BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6463    {
6464        #[inline]
6465        unsafe fn encode(
6466            self,
6467            encoder: &mut fidl::encoding::Encoder<'_, D>,
6468            offset: usize,
6469            _depth: fidl::encoding::Depth,
6470        ) -> fidl::Result<()> {
6471            encoder
6472                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6473            unsafe {
6474                // Copy the object into the buffer.
6475                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6476                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastInterfaceResponse)
6477                    .write_unaligned(
6478                        (self as *const BaseNetworkSocketGetIpv6MulticastInterfaceResponse).read(),
6479                    );
6480                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6481                // done second because the memcpy will write garbage to these bytes.
6482            }
6483            Ok(())
6484        }
6485    }
6486    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6487        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D> for (T0,)
6488    {
6489        #[inline]
6490        unsafe fn encode(
6491            self,
6492            encoder: &mut fidl::encoding::Encoder<'_, D>,
6493            offset: usize,
6494            depth: fidl::encoding::Depth,
6495        ) -> fidl::Result<()> {
6496            encoder
6497                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6498            // Zero out padding regions. There's no need to apply masks
6499            // because the unmasked parts will be overwritten by fields.
6500            // Write the fields.
6501            self.0.encode(encoder, offset + 0, depth)?;
6502            Ok(())
6503        }
6504    }
6505
6506    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6507        for BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6508    {
6509        #[inline(always)]
6510        fn new_empty() -> Self {
6511            Self { value: fidl::new_empty!(u64, D) }
6512        }
6513
6514        #[inline]
6515        unsafe fn decode(
6516            &mut self,
6517            decoder: &mut fidl::encoding::Decoder<'_, D>,
6518            offset: usize,
6519            _depth: fidl::encoding::Depth,
6520        ) -> fidl::Result<()> {
6521            decoder.debug_check_bounds::<Self>(offset);
6522            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6523            // Verify that padding bytes are zero.
6524            // Copy from the buffer into the object.
6525            unsafe {
6526                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6527            }
6528            Ok(())
6529        }
6530    }
6531
6532    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6533        type Borrowed<'a> = &'a Self;
6534        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6535            value
6536        }
6537    }
6538
6539    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6540        type Owned = Self;
6541
6542        #[inline(always)]
6543        fn inline_align(_context: fidl::encoding::Context) -> usize {
6544            1
6545        }
6546
6547        #[inline(always)]
6548        fn inline_size(_context: fidl::encoding::Context) -> usize {
6549            1
6550        }
6551    }
6552
6553    unsafe impl<D: fidl::encoding::ResourceDialect>
6554        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>
6555        for &BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6556    {
6557        #[inline]
6558        unsafe fn encode(
6559            self,
6560            encoder: &mut fidl::encoding::Encoder<'_, D>,
6561            offset: usize,
6562            _depth: fidl::encoding::Depth,
6563        ) -> fidl::Result<()> {
6564            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6565            // Delegate to tuple encoding.
6566            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>::encode(
6567                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6568                encoder,
6569                offset,
6570                _depth,
6571            )
6572        }
6573    }
6574    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6575        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D> for (T0,)
6576    {
6577        #[inline]
6578        unsafe fn encode(
6579            self,
6580            encoder: &mut fidl::encoding::Encoder<'_, D>,
6581            offset: usize,
6582            depth: fidl::encoding::Depth,
6583        ) -> fidl::Result<()> {
6584            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6585            // Zero out padding regions. There's no need to apply masks
6586            // because the unmasked parts will be overwritten by fields.
6587            // Write the fields.
6588            self.0.encode(encoder, offset + 0, depth)?;
6589            Ok(())
6590        }
6591    }
6592
6593    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6594        for BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6595    {
6596        #[inline(always)]
6597        fn new_empty() -> Self {
6598            Self { value: fidl::new_empty!(bool, D) }
6599        }
6600
6601        #[inline]
6602        unsafe fn decode(
6603            &mut self,
6604            decoder: &mut fidl::encoding::Decoder<'_, D>,
6605            offset: usize,
6606            _depth: fidl::encoding::Depth,
6607        ) -> fidl::Result<()> {
6608            decoder.debug_check_bounds::<Self>(offset);
6609            // Verify that padding bytes are zero.
6610            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6611            Ok(())
6612        }
6613    }
6614
6615    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6616        type Borrowed<'a> = &'a Self;
6617        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6618            value
6619        }
6620    }
6621
6622    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6623        type Owned = Self;
6624
6625        #[inline(always)]
6626        fn inline_align(_context: fidl::encoding::Context) -> usize {
6627            1
6628        }
6629
6630        #[inline(always)]
6631        fn inline_size(_context: fidl::encoding::Context) -> usize {
6632            1
6633        }
6634    }
6635
6636    unsafe impl<D: fidl::encoding::ResourceDialect>
6637        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D>
6638        for &BaseNetworkSocketGetIpv6OnlyResponse
6639    {
6640        #[inline]
6641        unsafe fn encode(
6642            self,
6643            encoder: &mut fidl::encoding::Encoder<'_, D>,
6644            offset: usize,
6645            _depth: fidl::encoding::Depth,
6646        ) -> fidl::Result<()> {
6647            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6648            // Delegate to tuple encoding.
6649            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6OnlyResponse, D>::encode(
6650                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6651                encoder,
6652                offset,
6653                _depth,
6654            )
6655        }
6656    }
6657    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6658        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D> for (T0,)
6659    {
6660        #[inline]
6661        unsafe fn encode(
6662            self,
6663            encoder: &mut fidl::encoding::Encoder<'_, D>,
6664            offset: usize,
6665            depth: fidl::encoding::Depth,
6666        ) -> fidl::Result<()> {
6667            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6668            // Zero out padding regions. There's no need to apply masks
6669            // because the unmasked parts will be overwritten by fields.
6670            // Write the fields.
6671            self.0.encode(encoder, offset + 0, depth)?;
6672            Ok(())
6673        }
6674    }
6675
6676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6677        for BaseNetworkSocketGetIpv6OnlyResponse
6678    {
6679        #[inline(always)]
6680        fn new_empty() -> Self {
6681            Self { value: fidl::new_empty!(bool, D) }
6682        }
6683
6684        #[inline]
6685        unsafe fn decode(
6686            &mut self,
6687            decoder: &mut fidl::encoding::Decoder<'_, D>,
6688            offset: usize,
6689            _depth: fidl::encoding::Depth,
6690        ) -> fidl::Result<()> {
6691            decoder.debug_check_bounds::<Self>(offset);
6692            // Verify that padding bytes are zero.
6693            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6694            Ok(())
6695        }
6696    }
6697
6698    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6699        type Borrowed<'a> = &'a Self;
6700        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6701            value
6702        }
6703    }
6704
6705    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6706        type Owned = Self;
6707
6708        #[inline(always)]
6709        fn inline_align(_context: fidl::encoding::Context) -> usize {
6710            1
6711        }
6712
6713        #[inline(always)]
6714        fn inline_size(_context: fidl::encoding::Context) -> usize {
6715            1
6716        }
6717    }
6718
6719    unsafe impl<D: fidl::encoding::ResourceDialect>
6720        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>
6721        for &BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6722    {
6723        #[inline]
6724        unsafe fn encode(
6725            self,
6726            encoder: &mut fidl::encoding::Encoder<'_, D>,
6727            offset: usize,
6728            _depth: fidl::encoding::Depth,
6729        ) -> fidl::Result<()> {
6730            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6731            // Delegate to tuple encoding.
6732            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>::encode(
6733                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6734                encoder,
6735                offset,
6736                _depth,
6737            )
6738        }
6739    }
6740    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6741        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D> for (T0,)
6742    {
6743        #[inline]
6744        unsafe fn encode(
6745            self,
6746            encoder: &mut fidl::encoding::Encoder<'_, D>,
6747            offset: usize,
6748            depth: fidl::encoding::Depth,
6749        ) -> fidl::Result<()> {
6750            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6751            // Zero out padding regions. There's no need to apply masks
6752            // because the unmasked parts will be overwritten by fields.
6753            // Write the fields.
6754            self.0.encode(encoder, offset + 0, depth)?;
6755            Ok(())
6756        }
6757    }
6758
6759    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6760        for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6761    {
6762        #[inline(always)]
6763        fn new_empty() -> Self {
6764            Self { value: fidl::new_empty!(bool, D) }
6765        }
6766
6767        #[inline]
6768        unsafe fn decode(
6769            &mut self,
6770            decoder: &mut fidl::encoding::Decoder<'_, D>,
6771            offset: usize,
6772            _depth: fidl::encoding::Depth,
6773        ) -> fidl::Result<()> {
6774            decoder.debug_check_bounds::<Self>(offset);
6775            // Verify that padding bytes are zero.
6776            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6777            Ok(())
6778        }
6779    }
6780
6781    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6782        type Borrowed<'a> = &'a Self;
6783        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6784            value
6785        }
6786    }
6787
6788    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6789        type Owned = Self;
6790
6791        #[inline(always)]
6792        fn inline_align(_context: fidl::encoding::Context) -> usize {
6793            1
6794        }
6795
6796        #[inline(always)]
6797        fn inline_size(_context: fidl::encoding::Context) -> usize {
6798            1
6799        }
6800    }
6801
6802    unsafe impl<D: fidl::encoding::ResourceDialect>
6803        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>
6804        for &BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6805    {
6806        #[inline]
6807        unsafe fn encode(
6808            self,
6809            encoder: &mut fidl::encoding::Encoder<'_, D>,
6810            offset: usize,
6811            _depth: fidl::encoding::Depth,
6812        ) -> fidl::Result<()> {
6813            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6814            // Delegate to tuple encoding.
6815            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>::encode(
6816                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6817                encoder,
6818                offset,
6819                _depth,
6820            )
6821        }
6822    }
6823    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6824        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D> for (T0,)
6825    {
6826        #[inline]
6827        unsafe fn encode(
6828            self,
6829            encoder: &mut fidl::encoding::Encoder<'_, D>,
6830            offset: usize,
6831            depth: fidl::encoding::Depth,
6832        ) -> fidl::Result<()> {
6833            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6834            // Zero out padding regions. There's no need to apply masks
6835            // because the unmasked parts will be overwritten by fields.
6836            // Write the fields.
6837            self.0.encode(encoder, offset + 0, depth)?;
6838            Ok(())
6839        }
6840    }
6841
6842    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6843        for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6844    {
6845        #[inline(always)]
6846        fn new_empty() -> Self {
6847            Self { value: fidl::new_empty!(bool, D) }
6848        }
6849
6850        #[inline]
6851        unsafe fn decode(
6852            &mut self,
6853            decoder: &mut fidl::encoding::Decoder<'_, D>,
6854            offset: usize,
6855            _depth: fidl::encoding::Depth,
6856        ) -> fidl::Result<()> {
6857            decoder.debug_check_bounds::<Self>(offset);
6858            // Verify that padding bytes are zero.
6859            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6860            Ok(())
6861        }
6862    }
6863
6864    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6865        type Borrowed<'a> = &'a Self;
6866        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6867            value
6868        }
6869    }
6870
6871    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6872        type Owned = Self;
6873
6874        #[inline(always)]
6875        fn inline_align(_context: fidl::encoding::Context) -> usize {
6876            1
6877        }
6878
6879        #[inline(always)]
6880        fn inline_size(_context: fidl::encoding::Context) -> usize {
6881            1
6882        }
6883    }
6884
6885    unsafe impl<D: fidl::encoding::ResourceDialect>
6886        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>
6887        for &BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6888    {
6889        #[inline]
6890        unsafe fn encode(
6891            self,
6892            encoder: &mut fidl::encoding::Encoder<'_, D>,
6893            offset: usize,
6894            _depth: fidl::encoding::Depth,
6895        ) -> fidl::Result<()> {
6896            encoder
6897                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6898            // Delegate to tuple encoding.
6899            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>::encode(
6900                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6901                encoder,
6902                offset,
6903                _depth,
6904            )
6905        }
6906    }
6907    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6908        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D> for (T0,)
6909    {
6910        #[inline]
6911        unsafe fn encode(
6912            self,
6913            encoder: &mut fidl::encoding::Encoder<'_, D>,
6914            offset: usize,
6915            depth: fidl::encoding::Depth,
6916        ) -> fidl::Result<()> {
6917            encoder
6918                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6919            // Zero out padding regions. There's no need to apply masks
6920            // because the unmasked parts will be overwritten by fields.
6921            // Write the fields.
6922            self.0.encode(encoder, offset + 0, depth)?;
6923            Ok(())
6924        }
6925    }
6926
6927    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6928        for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6929    {
6930        #[inline(always)]
6931        fn new_empty() -> Self {
6932            Self { value: fidl::new_empty!(bool, D) }
6933        }
6934
6935        #[inline]
6936        unsafe fn decode(
6937            &mut self,
6938            decoder: &mut fidl::encoding::Decoder<'_, D>,
6939            offset: usize,
6940            _depth: fidl::encoding::Depth,
6941        ) -> fidl::Result<()> {
6942            decoder.debug_check_bounds::<Self>(offset);
6943            // Verify that padding bytes are zero.
6944            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6945            Ok(())
6946        }
6947    }
6948
6949    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6950        type Borrowed<'a> = &'a Self;
6951        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6952            value
6953        }
6954    }
6955
6956    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6957        type Owned = Self;
6958
6959        #[inline(always)]
6960        fn inline_align(_context: fidl::encoding::Context) -> usize {
6961            1
6962        }
6963
6964        #[inline(always)]
6965        fn inline_size(_context: fidl::encoding::Context) -> usize {
6966            1
6967        }
6968        #[inline(always)]
6969        fn encode_is_copy() -> bool {
6970            true
6971        }
6972
6973        #[inline(always)]
6974        fn decode_is_copy() -> bool {
6975            true
6976        }
6977    }
6978
6979    unsafe impl<D: fidl::encoding::ResourceDialect>
6980        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D>
6981        for &BaseNetworkSocketGetIpv6TrafficClassResponse
6982    {
6983        #[inline]
6984        unsafe fn encode(
6985            self,
6986            encoder: &mut fidl::encoding::Encoder<'_, D>,
6987            offset: usize,
6988            _depth: fidl::encoding::Depth,
6989        ) -> fidl::Result<()> {
6990            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6991            unsafe {
6992                // Copy the object into the buffer.
6993                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6994                (buf_ptr as *mut BaseNetworkSocketGetIpv6TrafficClassResponse).write_unaligned(
6995                    (self as *const BaseNetworkSocketGetIpv6TrafficClassResponse).read(),
6996                );
6997                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6998                // done second because the memcpy will write garbage to these bytes.
6999            }
7000            Ok(())
7001        }
7002    }
7003    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
7004        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D> for (T0,)
7005    {
7006        #[inline]
7007        unsafe fn encode(
7008            self,
7009            encoder: &mut fidl::encoding::Encoder<'_, D>,
7010            offset: usize,
7011            depth: fidl::encoding::Depth,
7012        ) -> fidl::Result<()> {
7013            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
7014            // Zero out padding regions. There's no need to apply masks
7015            // because the unmasked parts will be overwritten by fields.
7016            // Write the fields.
7017            self.0.encode(encoder, offset + 0, depth)?;
7018            Ok(())
7019        }
7020    }
7021
7022    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7023        for BaseNetworkSocketGetIpv6TrafficClassResponse
7024    {
7025        #[inline(always)]
7026        fn new_empty() -> Self {
7027            Self { value: fidl::new_empty!(u8, D) }
7028        }
7029
7030        #[inline]
7031        unsafe fn decode(
7032            &mut self,
7033            decoder: &mut fidl::encoding::Decoder<'_, D>,
7034            offset: usize,
7035            _depth: fidl::encoding::Depth,
7036        ) -> fidl::Result<()> {
7037            decoder.debug_check_bounds::<Self>(offset);
7038            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7039            // Verify that padding bytes are zero.
7040            // Copy from the buffer into the object.
7041            unsafe {
7042                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
7043            }
7044            Ok(())
7045        }
7046    }
7047
7048    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
7049        type Borrowed<'a> = &'a Self;
7050        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7051            value
7052        }
7053    }
7054
7055    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
7056        type Owned = Self;
7057
7058        #[inline(always)]
7059        fn inline_align(_context: fidl::encoding::Context) -> usize {
7060            1
7061        }
7062
7063        #[inline(always)]
7064        fn inline_size(_context: fidl::encoding::Context) -> usize {
7065            1
7066        }
7067        #[inline(always)]
7068        fn encode_is_copy() -> bool {
7069            true
7070        }
7071
7072        #[inline(always)]
7073        fn decode_is_copy() -> bool {
7074            true
7075        }
7076    }
7077
7078    unsafe impl<D: fidl::encoding::ResourceDialect>
7079        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D>
7080        for &BaseNetworkSocketGetIpv6UnicastHopsResponse
7081    {
7082        #[inline]
7083        unsafe fn encode(
7084            self,
7085            encoder: &mut fidl::encoding::Encoder<'_, D>,
7086            offset: usize,
7087            _depth: fidl::encoding::Depth,
7088        ) -> fidl::Result<()> {
7089            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
7090            unsafe {
7091                // Copy the object into the buffer.
7092                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7093                (buf_ptr as *mut BaseNetworkSocketGetIpv6UnicastHopsResponse).write_unaligned(
7094                    (self as *const BaseNetworkSocketGetIpv6UnicastHopsResponse).read(),
7095                );
7096                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7097                // done second because the memcpy will write garbage to these bytes.
7098            }
7099            Ok(())
7100        }
7101    }
7102    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
7103        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D> for (T0,)
7104    {
7105        #[inline]
7106        unsafe fn encode(
7107            self,
7108            encoder: &mut fidl::encoding::Encoder<'_, D>,
7109            offset: usize,
7110            depth: fidl::encoding::Depth,
7111        ) -> fidl::Result<()> {
7112            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
7113            // Zero out padding regions. There's no need to apply masks
7114            // because the unmasked parts will be overwritten by fields.
7115            // Write the fields.
7116            self.0.encode(encoder, offset + 0, depth)?;
7117            Ok(())
7118        }
7119    }
7120
7121    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7122        for BaseNetworkSocketGetIpv6UnicastHopsResponse
7123    {
7124        #[inline(always)]
7125        fn new_empty() -> Self {
7126            Self { value: fidl::new_empty!(u8, D) }
7127        }
7128
7129        #[inline]
7130        unsafe fn decode(
7131            &mut self,
7132            decoder: &mut fidl::encoding::Decoder<'_, D>,
7133            offset: usize,
7134            _depth: fidl::encoding::Depth,
7135        ) -> fidl::Result<()> {
7136            decoder.debug_check_bounds::<Self>(offset);
7137            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7138            // Verify that padding bytes are zero.
7139            // Copy from the buffer into the object.
7140            unsafe {
7141                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
7142            }
7143            Ok(())
7144        }
7145    }
7146
7147    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
7148        type Borrowed<'a> = &'a Self;
7149        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7150            value
7151        }
7152    }
7153
7154    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
7155        type Owned = Self;
7156
7157        #[inline(always)]
7158        fn inline_align(_context: fidl::encoding::Context) -> usize {
7159            8
7160        }
7161
7162        #[inline(always)]
7163        fn inline_size(_context: fidl::encoding::Context) -> usize {
7164            16
7165        }
7166    }
7167
7168    unsafe impl<D: fidl::encoding::ResourceDialect>
7169        fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D>
7170        for &BaseNetworkSocketGetOriginalDestinationResponse
7171    {
7172        #[inline]
7173        unsafe fn encode(
7174            self,
7175            encoder: &mut fidl::encoding::Encoder<'_, D>,
7176            offset: usize,
7177            _depth: fidl::encoding::Depth,
7178        ) -> fidl::Result<()> {
7179            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
7180            // Delegate to tuple encoding.
7181            fidl::encoding::Encode::<BaseNetworkSocketGetOriginalDestinationResponse, D>::encode(
7182                (
7183                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7184                ),
7185                encoder, offset, _depth
7186            )
7187        }
7188    }
7189    unsafe impl<
7190            D: fidl::encoding::ResourceDialect,
7191            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
7192        > fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D> for (T0,)
7193    {
7194        #[inline]
7195        unsafe fn encode(
7196            self,
7197            encoder: &mut fidl::encoding::Encoder<'_, D>,
7198            offset: usize,
7199            depth: fidl::encoding::Depth,
7200        ) -> fidl::Result<()> {
7201            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
7202            // Zero out padding regions. There's no need to apply masks
7203            // because the unmasked parts will be overwritten by fields.
7204            // Write the fields.
7205            self.0.encode(encoder, offset + 0, depth)?;
7206            Ok(())
7207        }
7208    }
7209
7210    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7211        for BaseNetworkSocketGetOriginalDestinationResponse
7212    {
7213        #[inline(always)]
7214        fn new_empty() -> Self {
7215            Self { value: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
7216        }
7217
7218        #[inline]
7219        unsafe fn decode(
7220            &mut self,
7221            decoder: &mut fidl::encoding::Decoder<'_, D>,
7222            offset: usize,
7223            _depth: fidl::encoding::Depth,
7224        ) -> fidl::Result<()> {
7225            decoder.debug_check_bounds::<Self>(offset);
7226            // Verify that padding bytes are zero.
7227            fidl::decode!(
7228                fidl_fuchsia_net__common::SocketAddress,
7229                D,
7230                &mut self.value,
7231                decoder,
7232                offset + 0,
7233                _depth
7234            )?;
7235            Ok(())
7236        }
7237    }
7238
7239    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetPeerNameResponse {
7240        type Borrowed<'a> = &'a Self;
7241        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7242            value
7243        }
7244    }
7245
7246    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetPeerNameResponse {
7247        type Owned = Self;
7248
7249        #[inline(always)]
7250        fn inline_align(_context: fidl::encoding::Context) -> usize {
7251            8
7252        }
7253
7254        #[inline(always)]
7255        fn inline_size(_context: fidl::encoding::Context) -> usize {
7256            16
7257        }
7258    }
7259
7260    unsafe impl<D: fidl::encoding::ResourceDialect>
7261        fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D>
7262        for &BaseNetworkSocketGetPeerNameResponse
7263    {
7264        #[inline]
7265        unsafe fn encode(
7266            self,
7267            encoder: &mut fidl::encoding::Encoder<'_, D>,
7268            offset: usize,
7269            _depth: fidl::encoding::Depth,
7270        ) -> fidl::Result<()> {
7271            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
7272            // Delegate to tuple encoding.
7273            fidl::encoding::Encode::<BaseNetworkSocketGetPeerNameResponse, D>::encode(
7274                (
7275                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
7276                ),
7277                encoder, offset, _depth
7278            )
7279        }
7280    }
7281    unsafe impl<
7282            D: fidl::encoding::ResourceDialect,
7283            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
7284        > fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D> for (T0,)
7285    {
7286        #[inline]
7287        unsafe fn encode(
7288            self,
7289            encoder: &mut fidl::encoding::Encoder<'_, D>,
7290            offset: usize,
7291            depth: fidl::encoding::Depth,
7292        ) -> fidl::Result<()> {
7293            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
7294            // Zero out padding regions. There's no need to apply masks
7295            // because the unmasked parts will be overwritten by fields.
7296            // Write the fields.
7297            self.0.encode(encoder, offset + 0, depth)?;
7298            Ok(())
7299        }
7300    }
7301
7302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7303        for BaseNetworkSocketGetPeerNameResponse
7304    {
7305        #[inline(always)]
7306        fn new_empty() -> Self {
7307            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
7308        }
7309
7310        #[inline]
7311        unsafe fn decode(
7312            &mut self,
7313            decoder: &mut fidl::encoding::Decoder<'_, D>,
7314            offset: usize,
7315            _depth: fidl::encoding::Depth,
7316        ) -> fidl::Result<()> {
7317            decoder.debug_check_bounds::<Self>(offset);
7318            // Verify that padding bytes are zero.
7319            fidl::decode!(
7320                fidl_fuchsia_net__common::SocketAddress,
7321                D,
7322                &mut self.addr,
7323                decoder,
7324                offset + 0,
7325                _depth
7326            )?;
7327            Ok(())
7328        }
7329    }
7330
7331    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetSockNameResponse {
7332        type Borrowed<'a> = &'a Self;
7333        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7334            value
7335        }
7336    }
7337
7338    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetSockNameResponse {
7339        type Owned = Self;
7340
7341        #[inline(always)]
7342        fn inline_align(_context: fidl::encoding::Context) -> usize {
7343            8
7344        }
7345
7346        #[inline(always)]
7347        fn inline_size(_context: fidl::encoding::Context) -> usize {
7348            16
7349        }
7350    }
7351
7352    unsafe impl<D: fidl::encoding::ResourceDialect>
7353        fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D>
7354        for &BaseNetworkSocketGetSockNameResponse
7355    {
7356        #[inline]
7357        unsafe fn encode(
7358            self,
7359            encoder: &mut fidl::encoding::Encoder<'_, D>,
7360            offset: usize,
7361            _depth: fidl::encoding::Depth,
7362        ) -> fidl::Result<()> {
7363            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
7364            // Delegate to tuple encoding.
7365            fidl::encoding::Encode::<BaseNetworkSocketGetSockNameResponse, D>::encode(
7366                (
7367                    <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
7368                ),
7369                encoder, offset, _depth
7370            )
7371        }
7372    }
7373    unsafe impl<
7374            D: fidl::encoding::ResourceDialect,
7375            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::SocketAddress, D>,
7376        > fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D> for (T0,)
7377    {
7378        #[inline]
7379        unsafe fn encode(
7380            self,
7381            encoder: &mut fidl::encoding::Encoder<'_, D>,
7382            offset: usize,
7383            depth: fidl::encoding::Depth,
7384        ) -> fidl::Result<()> {
7385            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
7386            // Zero out padding regions. There's no need to apply masks
7387            // because the unmasked parts will be overwritten by fields.
7388            // Write the fields.
7389            self.0.encode(encoder, offset + 0, depth)?;
7390            Ok(())
7391        }
7392    }
7393
7394    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7395        for BaseNetworkSocketGetSockNameResponse
7396    {
7397        #[inline(always)]
7398        fn new_empty() -> Self {
7399            Self { addr: fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D) }
7400        }
7401
7402        #[inline]
7403        unsafe fn decode(
7404            &mut self,
7405            decoder: &mut fidl::encoding::Decoder<'_, D>,
7406            offset: usize,
7407            _depth: fidl::encoding::Depth,
7408        ) -> fidl::Result<()> {
7409            decoder.debug_check_bounds::<Self>(offset);
7410            // Verify that padding bytes are zero.
7411            fidl::decode!(
7412                fidl_fuchsia_net__common::SocketAddress,
7413                D,
7414                &mut self.addr,
7415                decoder,
7416                offset + 0,
7417                _depth
7418            )?;
7419            Ok(())
7420        }
7421    }
7422
7423    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkRequest {
7424        type Borrowed<'a> = &'a Self;
7425        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7426            value
7427        }
7428    }
7429
7430    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkRequest {
7431        type Owned = Self;
7432
7433        #[inline(always)]
7434        fn inline_align(_context: fidl::encoding::Context) -> usize {
7435            1
7436        }
7437
7438        #[inline(always)]
7439        fn inline_size(_context: fidl::encoding::Context) -> usize {
7440            1
7441        }
7442    }
7443
7444    unsafe impl<D: fidl::encoding::ResourceDialect>
7445        fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for &BaseSocketGetMarkRequest
7446    {
7447        #[inline]
7448        unsafe fn encode(
7449            self,
7450            encoder: &mut fidl::encoding::Encoder<'_, D>,
7451            offset: usize,
7452            _depth: fidl::encoding::Depth,
7453        ) -> fidl::Result<()> {
7454            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7455            // Delegate to tuple encoding.
7456            fidl::encoding::Encode::<BaseSocketGetMarkRequest, D>::encode(
7457                (
7458                    <fidl_fuchsia_net__common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
7459                ),
7460                encoder, offset, _depth
7461            )
7462        }
7463    }
7464    unsafe impl<
7465            D: fidl::encoding::ResourceDialect,
7466            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MarkDomain, D>,
7467        > fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for (T0,)
7468    {
7469        #[inline]
7470        unsafe fn encode(
7471            self,
7472            encoder: &mut fidl::encoding::Encoder<'_, D>,
7473            offset: usize,
7474            depth: fidl::encoding::Depth,
7475        ) -> fidl::Result<()> {
7476            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7477            // Zero out padding regions. There's no need to apply masks
7478            // because the unmasked parts will be overwritten by fields.
7479            // Write the fields.
7480            self.0.encode(encoder, offset + 0, depth)?;
7481            Ok(())
7482        }
7483    }
7484
7485    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7486        for BaseSocketGetMarkRequest
7487    {
7488        #[inline(always)]
7489        fn new_empty() -> Self {
7490            Self { domain: fidl::new_empty!(fidl_fuchsia_net__common::MarkDomain, D) }
7491        }
7492
7493        #[inline]
7494        unsafe fn decode(
7495            &mut self,
7496            decoder: &mut fidl::encoding::Decoder<'_, D>,
7497            offset: usize,
7498            _depth: fidl::encoding::Depth,
7499        ) -> fidl::Result<()> {
7500            decoder.debug_check_bounds::<Self>(offset);
7501            // Verify that padding bytes are zero.
7502            fidl::decode!(
7503                fidl_fuchsia_net__common::MarkDomain,
7504                D,
7505                &mut self.domain,
7506                decoder,
7507                offset + 0,
7508                _depth
7509            )?;
7510            Ok(())
7511        }
7512    }
7513
7514    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToDeviceRequest {
7515        type Borrowed<'a> = &'a Self;
7516        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7517            value
7518        }
7519    }
7520
7521    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToDeviceRequest {
7522        type Owned = Self;
7523
7524        #[inline(always)]
7525        fn inline_align(_context: fidl::encoding::Context) -> usize {
7526            8
7527        }
7528
7529        #[inline(always)]
7530        fn inline_size(_context: fidl::encoding::Context) -> usize {
7531            16
7532        }
7533    }
7534
7535    unsafe impl<D: fidl::encoding::ResourceDialect>
7536        fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D>
7537        for &BaseSocketSetBindToDeviceRequest
7538    {
7539        #[inline]
7540        unsafe fn encode(
7541            self,
7542            encoder: &mut fidl::encoding::Encoder<'_, D>,
7543            offset: usize,
7544            _depth: fidl::encoding::Depth,
7545        ) -> fidl::Result<()> {
7546            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7547            // Delegate to tuple encoding.
7548            fidl::encoding::Encode::<BaseSocketSetBindToDeviceRequest, D>::encode(
7549                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
7550                    &self.value,
7551                ),),
7552                encoder,
7553                offset,
7554                _depth,
7555            )
7556        }
7557    }
7558    unsafe impl<
7559            D: fidl::encoding::ResourceDialect,
7560            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
7561        > fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D> for (T0,)
7562    {
7563        #[inline]
7564        unsafe fn encode(
7565            self,
7566            encoder: &mut fidl::encoding::Encoder<'_, D>,
7567            offset: usize,
7568            depth: fidl::encoding::Depth,
7569        ) -> fidl::Result<()> {
7570            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7571            // Zero out padding regions. There's no need to apply masks
7572            // because the unmasked parts will be overwritten by fields.
7573            // Write the fields.
7574            self.0.encode(encoder, offset + 0, depth)?;
7575            Ok(())
7576        }
7577    }
7578
7579    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7580        for BaseSocketSetBindToDeviceRequest
7581    {
7582        #[inline(always)]
7583        fn new_empty() -> Self {
7584            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
7585        }
7586
7587        #[inline]
7588        unsafe fn decode(
7589            &mut self,
7590            decoder: &mut fidl::encoding::Decoder<'_, D>,
7591            offset: usize,
7592            _depth: fidl::encoding::Depth,
7593        ) -> fidl::Result<()> {
7594            decoder.debug_check_bounds::<Self>(offset);
7595            // Verify that padding bytes are zero.
7596            fidl::decode!(
7597                fidl::encoding::BoundedString<15>,
7598                D,
7599                &mut self.value,
7600                decoder,
7601                offset + 0,
7602                _depth
7603            )?;
7604            Ok(())
7605        }
7606    }
7607
7608    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7609        type Borrowed<'a> = &'a Self;
7610        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7611            value
7612        }
7613    }
7614
7615    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7616        type Owned = Self;
7617
7618        #[inline(always)]
7619        fn inline_align(_context: fidl::encoding::Context) -> usize {
7620            8
7621        }
7622
7623        #[inline(always)]
7624        fn inline_size(_context: fidl::encoding::Context) -> usize {
7625            8
7626        }
7627        #[inline(always)]
7628        fn encode_is_copy() -> bool {
7629            true
7630        }
7631
7632        #[inline(always)]
7633        fn decode_is_copy() -> bool {
7634            true
7635        }
7636    }
7637
7638    unsafe impl<D: fidl::encoding::ResourceDialect>
7639        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D>
7640        for &BaseSocketSetBindToInterfaceIndexRequest
7641    {
7642        #[inline]
7643        unsafe fn encode(
7644            self,
7645            encoder: &mut fidl::encoding::Encoder<'_, D>,
7646            offset: usize,
7647            _depth: fidl::encoding::Depth,
7648        ) -> fidl::Result<()> {
7649            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7650            unsafe {
7651                // Copy the object into the buffer.
7652                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7653                (buf_ptr as *mut BaseSocketSetBindToInterfaceIndexRequest).write_unaligned(
7654                    (self as *const BaseSocketSetBindToInterfaceIndexRequest).read(),
7655                );
7656                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7657                // done second because the memcpy will write garbage to these bytes.
7658            }
7659            Ok(())
7660        }
7661    }
7662    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7663        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D> for (T0,)
7664    {
7665        #[inline]
7666        unsafe fn encode(
7667            self,
7668            encoder: &mut fidl::encoding::Encoder<'_, D>,
7669            offset: usize,
7670            depth: fidl::encoding::Depth,
7671        ) -> fidl::Result<()> {
7672            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7673            // Zero out padding regions. There's no need to apply masks
7674            // because the unmasked parts will be overwritten by fields.
7675            // Write the fields.
7676            self.0.encode(encoder, offset + 0, depth)?;
7677            Ok(())
7678        }
7679    }
7680
7681    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7682        for BaseSocketSetBindToInterfaceIndexRequest
7683    {
7684        #[inline(always)]
7685        fn new_empty() -> Self {
7686            Self { value: fidl::new_empty!(u64, D) }
7687        }
7688
7689        #[inline]
7690        unsafe fn decode(
7691            &mut self,
7692            decoder: &mut fidl::encoding::Decoder<'_, D>,
7693            offset: usize,
7694            _depth: fidl::encoding::Depth,
7695        ) -> fidl::Result<()> {
7696            decoder.debug_check_bounds::<Self>(offset);
7697            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7698            // Verify that padding bytes are zero.
7699            // Copy from the buffer into the object.
7700            unsafe {
7701                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7702            }
7703            Ok(())
7704        }
7705    }
7706
7707    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBroadcastRequest {
7708        type Borrowed<'a> = &'a Self;
7709        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7710            value
7711        }
7712    }
7713
7714    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBroadcastRequest {
7715        type Owned = Self;
7716
7717        #[inline(always)]
7718        fn inline_align(_context: fidl::encoding::Context) -> usize {
7719            1
7720        }
7721
7722        #[inline(always)]
7723        fn inline_size(_context: fidl::encoding::Context) -> usize {
7724            1
7725        }
7726    }
7727
7728    unsafe impl<D: fidl::encoding::ResourceDialect>
7729        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D>
7730        for &BaseSocketSetBroadcastRequest
7731    {
7732        #[inline]
7733        unsafe fn encode(
7734            self,
7735            encoder: &mut fidl::encoding::Encoder<'_, D>,
7736            offset: usize,
7737            _depth: fidl::encoding::Depth,
7738        ) -> fidl::Result<()> {
7739            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7740            // Delegate to tuple encoding.
7741            fidl::encoding::Encode::<BaseSocketSetBroadcastRequest, D>::encode(
7742                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7743                encoder,
7744                offset,
7745                _depth,
7746            )
7747        }
7748    }
7749    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7750        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D> for (T0,)
7751    {
7752        #[inline]
7753        unsafe fn encode(
7754            self,
7755            encoder: &mut fidl::encoding::Encoder<'_, D>,
7756            offset: usize,
7757            depth: fidl::encoding::Depth,
7758        ) -> fidl::Result<()> {
7759            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7760            // Zero out padding regions. There's no need to apply masks
7761            // because the unmasked parts will be overwritten by fields.
7762            // Write the fields.
7763            self.0.encode(encoder, offset + 0, depth)?;
7764            Ok(())
7765        }
7766    }
7767
7768    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7769        for BaseSocketSetBroadcastRequest
7770    {
7771        #[inline(always)]
7772        fn new_empty() -> Self {
7773            Self { value: fidl::new_empty!(bool, D) }
7774        }
7775
7776        #[inline]
7777        unsafe fn decode(
7778            &mut self,
7779            decoder: &mut fidl::encoding::Decoder<'_, D>,
7780            offset: usize,
7781            _depth: fidl::encoding::Depth,
7782        ) -> fidl::Result<()> {
7783            decoder.debug_check_bounds::<Self>(offset);
7784            // Verify that padding bytes are zero.
7785            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7786            Ok(())
7787        }
7788    }
7789
7790    impl fidl::encoding::ValueTypeMarker for BaseSocketSetKeepAliveRequest {
7791        type Borrowed<'a> = &'a Self;
7792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7793            value
7794        }
7795    }
7796
7797    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetKeepAliveRequest {
7798        type Owned = Self;
7799
7800        #[inline(always)]
7801        fn inline_align(_context: fidl::encoding::Context) -> usize {
7802            1
7803        }
7804
7805        #[inline(always)]
7806        fn inline_size(_context: fidl::encoding::Context) -> usize {
7807            1
7808        }
7809    }
7810
7811    unsafe impl<D: fidl::encoding::ResourceDialect>
7812        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D>
7813        for &BaseSocketSetKeepAliveRequest
7814    {
7815        #[inline]
7816        unsafe fn encode(
7817            self,
7818            encoder: &mut fidl::encoding::Encoder<'_, D>,
7819            offset: usize,
7820            _depth: fidl::encoding::Depth,
7821        ) -> fidl::Result<()> {
7822            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7823            // Delegate to tuple encoding.
7824            fidl::encoding::Encode::<BaseSocketSetKeepAliveRequest, D>::encode(
7825                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7826                encoder,
7827                offset,
7828                _depth,
7829            )
7830        }
7831    }
7832    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7833        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D> for (T0,)
7834    {
7835        #[inline]
7836        unsafe fn encode(
7837            self,
7838            encoder: &mut fidl::encoding::Encoder<'_, D>,
7839            offset: usize,
7840            depth: fidl::encoding::Depth,
7841        ) -> fidl::Result<()> {
7842            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7843            // Zero out padding regions. There's no need to apply masks
7844            // because the unmasked parts will be overwritten by fields.
7845            // Write the fields.
7846            self.0.encode(encoder, offset + 0, depth)?;
7847            Ok(())
7848        }
7849    }
7850
7851    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7852        for BaseSocketSetKeepAliveRequest
7853    {
7854        #[inline(always)]
7855        fn new_empty() -> Self {
7856            Self { value: fidl::new_empty!(bool, D) }
7857        }
7858
7859        #[inline]
7860        unsafe fn decode(
7861            &mut self,
7862            decoder: &mut fidl::encoding::Decoder<'_, D>,
7863            offset: usize,
7864            _depth: fidl::encoding::Depth,
7865        ) -> fidl::Result<()> {
7866            decoder.debug_check_bounds::<Self>(offset);
7867            // Verify that padding bytes are zero.
7868            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7869            Ok(())
7870        }
7871    }
7872
7873    impl fidl::encoding::ValueTypeMarker for BaseSocketSetLingerRequest {
7874        type Borrowed<'a> = &'a Self;
7875        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7876            value
7877        }
7878    }
7879
7880    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetLingerRequest {
7881        type Owned = Self;
7882
7883        #[inline(always)]
7884        fn inline_align(_context: fidl::encoding::Context) -> usize {
7885            4
7886        }
7887
7888        #[inline(always)]
7889        fn inline_size(_context: fidl::encoding::Context) -> usize {
7890            8
7891        }
7892    }
7893
7894    unsafe impl<D: fidl::encoding::ResourceDialect>
7895        fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for &BaseSocketSetLingerRequest
7896    {
7897        #[inline]
7898        unsafe fn encode(
7899            self,
7900            encoder: &mut fidl::encoding::Encoder<'_, D>,
7901            offset: usize,
7902            _depth: fidl::encoding::Depth,
7903        ) -> fidl::Result<()> {
7904            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7905            // Delegate to tuple encoding.
7906            fidl::encoding::Encode::<BaseSocketSetLingerRequest, D>::encode(
7907                (
7908                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
7909                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
7910                ),
7911                encoder,
7912                offset,
7913                _depth,
7914            )
7915        }
7916    }
7917    unsafe impl<
7918            D: fidl::encoding::ResourceDialect,
7919            T0: fidl::encoding::Encode<bool, D>,
7920            T1: fidl::encoding::Encode<u32, D>,
7921        > fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for (T0, T1)
7922    {
7923        #[inline]
7924        unsafe fn encode(
7925            self,
7926            encoder: &mut fidl::encoding::Encoder<'_, D>,
7927            offset: usize,
7928            depth: fidl::encoding::Depth,
7929        ) -> fidl::Result<()> {
7930            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7931            // Zero out padding regions. There's no need to apply masks
7932            // because the unmasked parts will be overwritten by fields.
7933            unsafe {
7934                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7935                (ptr as *mut u32).write_unaligned(0);
7936            }
7937            // Write the fields.
7938            self.0.encode(encoder, offset + 0, depth)?;
7939            self.1.encode(encoder, offset + 4, depth)?;
7940            Ok(())
7941        }
7942    }
7943
7944    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7945        for BaseSocketSetLingerRequest
7946    {
7947        #[inline(always)]
7948        fn new_empty() -> Self {
7949            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
7950        }
7951
7952        #[inline]
7953        unsafe fn decode(
7954            &mut self,
7955            decoder: &mut fidl::encoding::Decoder<'_, D>,
7956            offset: usize,
7957            _depth: fidl::encoding::Depth,
7958        ) -> fidl::Result<()> {
7959            decoder.debug_check_bounds::<Self>(offset);
7960            // Verify that padding bytes are zero.
7961            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7962            let padval = unsafe { (ptr as *const u32).read_unaligned() };
7963            let mask = 0xffffff00u32;
7964            let maskedval = padval & mask;
7965            if maskedval != 0 {
7966                return Err(fidl::Error::NonZeroPadding {
7967                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7968                });
7969            }
7970            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
7971            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
7972            Ok(())
7973        }
7974    }
7975
7976    impl fidl::encoding::ValueTypeMarker for BaseSocketSetMarkRequest {
7977        type Borrowed<'a> = &'a Self;
7978        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7979            value
7980        }
7981    }
7982
7983    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetMarkRequest {
7984        type Owned = Self;
7985
7986        #[inline(always)]
7987        fn inline_align(_context: fidl::encoding::Context) -> usize {
7988            8
7989        }
7990
7991        #[inline(always)]
7992        fn inline_size(_context: fidl::encoding::Context) -> usize {
7993            24
7994        }
7995    }
7996
7997    unsafe impl<D: fidl::encoding::ResourceDialect>
7998        fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for &BaseSocketSetMarkRequest
7999    {
8000        #[inline]
8001        unsafe fn encode(
8002            self,
8003            encoder: &mut fidl::encoding::Encoder<'_, D>,
8004            offset: usize,
8005            _depth: fidl::encoding::Depth,
8006        ) -> fidl::Result<()> {
8007            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
8008            // Delegate to tuple encoding.
8009            fidl::encoding::Encode::<BaseSocketSetMarkRequest, D>::encode(
8010                (
8011                    <fidl_fuchsia_net__common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
8012                    <OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),
8013                ),
8014                encoder, offset, _depth
8015            )
8016        }
8017    }
8018    unsafe impl<
8019            D: fidl::encoding::ResourceDialect,
8020            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MarkDomain, D>,
8021            T1: fidl::encoding::Encode<OptionalUint32, D>,
8022        > fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for (T0, T1)
8023    {
8024        #[inline]
8025        unsafe fn encode(
8026            self,
8027            encoder: &mut fidl::encoding::Encoder<'_, D>,
8028            offset: usize,
8029            depth: fidl::encoding::Depth,
8030        ) -> fidl::Result<()> {
8031            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
8032            // Zero out padding regions. There's no need to apply masks
8033            // because the unmasked parts will be overwritten by fields.
8034            unsafe {
8035                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8036                (ptr as *mut u64).write_unaligned(0);
8037            }
8038            // Write the fields.
8039            self.0.encode(encoder, offset + 0, depth)?;
8040            self.1.encode(encoder, offset + 8, depth)?;
8041            Ok(())
8042        }
8043    }
8044
8045    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8046        for BaseSocketSetMarkRequest
8047    {
8048        #[inline(always)]
8049        fn new_empty() -> Self {
8050            Self {
8051                domain: fidl::new_empty!(fidl_fuchsia_net__common::MarkDomain, D),
8052                mark: fidl::new_empty!(OptionalUint32, D),
8053            }
8054        }
8055
8056        #[inline]
8057        unsafe fn decode(
8058            &mut self,
8059            decoder: &mut fidl::encoding::Decoder<'_, D>,
8060            offset: usize,
8061            _depth: fidl::encoding::Depth,
8062        ) -> fidl::Result<()> {
8063            decoder.debug_check_bounds::<Self>(offset);
8064            // Verify that padding bytes are zero.
8065            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8066            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8067            let mask = 0xffffffffffffff00u64;
8068            let maskedval = padval & mask;
8069            if maskedval != 0 {
8070                return Err(fidl::Error::NonZeroPadding {
8071                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8072                });
8073            }
8074            fidl::decode!(
8075                fidl_fuchsia_net__common::MarkDomain,
8076                D,
8077                &mut self.domain,
8078                decoder,
8079                offset + 0,
8080                _depth
8081            )?;
8082            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 8, _depth)?;
8083            Ok(())
8084        }
8085    }
8086
8087    impl fidl::encoding::ValueTypeMarker for BaseSocketSetNoCheckRequest {
8088        type Borrowed<'a> = &'a Self;
8089        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8090            value
8091        }
8092    }
8093
8094    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetNoCheckRequest {
8095        type Owned = Self;
8096
8097        #[inline(always)]
8098        fn inline_align(_context: fidl::encoding::Context) -> usize {
8099            1
8100        }
8101
8102        #[inline(always)]
8103        fn inline_size(_context: fidl::encoding::Context) -> usize {
8104            1
8105        }
8106    }
8107
8108    unsafe impl<D: fidl::encoding::ResourceDialect>
8109        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for &BaseSocketSetNoCheckRequest
8110    {
8111        #[inline]
8112        unsafe fn encode(
8113            self,
8114            encoder: &mut fidl::encoding::Encoder<'_, D>,
8115            offset: usize,
8116            _depth: fidl::encoding::Depth,
8117        ) -> fidl::Result<()> {
8118            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
8119            // Delegate to tuple encoding.
8120            fidl::encoding::Encode::<BaseSocketSetNoCheckRequest, D>::encode(
8121                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8122                encoder,
8123                offset,
8124                _depth,
8125            )
8126        }
8127    }
8128    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8129        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for (T0,)
8130    {
8131        #[inline]
8132        unsafe fn encode(
8133            self,
8134            encoder: &mut fidl::encoding::Encoder<'_, D>,
8135            offset: usize,
8136            depth: fidl::encoding::Depth,
8137        ) -> fidl::Result<()> {
8138            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
8139            // Zero out padding regions. There's no need to apply masks
8140            // because the unmasked parts will be overwritten by fields.
8141            // Write the fields.
8142            self.0.encode(encoder, offset + 0, depth)?;
8143            Ok(())
8144        }
8145    }
8146
8147    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8148        for BaseSocketSetNoCheckRequest
8149    {
8150        #[inline(always)]
8151        fn new_empty() -> Self {
8152            Self { value: fidl::new_empty!(bool, D) }
8153        }
8154
8155        #[inline]
8156        unsafe fn decode(
8157            &mut self,
8158            decoder: &mut fidl::encoding::Decoder<'_, D>,
8159            offset: usize,
8160            _depth: fidl::encoding::Depth,
8161        ) -> fidl::Result<()> {
8162            decoder.debug_check_bounds::<Self>(offset);
8163            // Verify that padding bytes are zero.
8164            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8165            Ok(())
8166        }
8167    }
8168
8169    impl fidl::encoding::ValueTypeMarker for BaseSocketSetOutOfBandInlineRequest {
8170        type Borrowed<'a> = &'a Self;
8171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8172            value
8173        }
8174    }
8175
8176    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetOutOfBandInlineRequest {
8177        type Owned = Self;
8178
8179        #[inline(always)]
8180        fn inline_align(_context: fidl::encoding::Context) -> usize {
8181            1
8182        }
8183
8184        #[inline(always)]
8185        fn inline_size(_context: fidl::encoding::Context) -> usize {
8186            1
8187        }
8188    }
8189
8190    unsafe impl<D: fidl::encoding::ResourceDialect>
8191        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D>
8192        for &BaseSocketSetOutOfBandInlineRequest
8193    {
8194        #[inline]
8195        unsafe fn encode(
8196            self,
8197            encoder: &mut fidl::encoding::Encoder<'_, D>,
8198            offset: usize,
8199            _depth: fidl::encoding::Depth,
8200        ) -> fidl::Result<()> {
8201            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
8202            // Delegate to tuple encoding.
8203            fidl::encoding::Encode::<BaseSocketSetOutOfBandInlineRequest, D>::encode(
8204                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8205                encoder,
8206                offset,
8207                _depth,
8208            )
8209        }
8210    }
8211    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8212        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D> for (T0,)
8213    {
8214        #[inline]
8215        unsafe fn encode(
8216            self,
8217            encoder: &mut fidl::encoding::Encoder<'_, D>,
8218            offset: usize,
8219            depth: fidl::encoding::Depth,
8220        ) -> fidl::Result<()> {
8221            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
8222            // Zero out padding regions. There's no need to apply masks
8223            // because the unmasked parts will be overwritten by fields.
8224            // Write the fields.
8225            self.0.encode(encoder, offset + 0, depth)?;
8226            Ok(())
8227        }
8228    }
8229
8230    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8231        for BaseSocketSetOutOfBandInlineRequest
8232    {
8233        #[inline(always)]
8234        fn new_empty() -> Self {
8235            Self { value: fidl::new_empty!(bool, D) }
8236        }
8237
8238        #[inline]
8239        unsafe fn decode(
8240            &mut self,
8241            decoder: &mut fidl::encoding::Decoder<'_, D>,
8242            offset: usize,
8243            _depth: fidl::encoding::Depth,
8244        ) -> fidl::Result<()> {
8245            decoder.debug_check_bounds::<Self>(offset);
8246            // Verify that padding bytes are zero.
8247            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8248            Ok(())
8249        }
8250    }
8251
8252    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReceiveBufferRequest {
8253        type Borrowed<'a> = &'a Self;
8254        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8255            value
8256        }
8257    }
8258
8259    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReceiveBufferRequest {
8260        type Owned = Self;
8261
8262        #[inline(always)]
8263        fn inline_align(_context: fidl::encoding::Context) -> usize {
8264            8
8265        }
8266
8267        #[inline(always)]
8268        fn inline_size(_context: fidl::encoding::Context) -> usize {
8269            8
8270        }
8271        #[inline(always)]
8272        fn encode_is_copy() -> bool {
8273            true
8274        }
8275
8276        #[inline(always)]
8277        fn decode_is_copy() -> bool {
8278            true
8279        }
8280    }
8281
8282    unsafe impl<D: fidl::encoding::ResourceDialect>
8283        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D>
8284        for &BaseSocketSetReceiveBufferRequest
8285    {
8286        #[inline]
8287        unsafe fn encode(
8288            self,
8289            encoder: &mut fidl::encoding::Encoder<'_, D>,
8290            offset: usize,
8291            _depth: fidl::encoding::Depth,
8292        ) -> fidl::Result<()> {
8293            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
8294            unsafe {
8295                // Copy the object into the buffer.
8296                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8297                (buf_ptr as *mut BaseSocketSetReceiveBufferRequest)
8298                    .write_unaligned((self as *const BaseSocketSetReceiveBufferRequest).read());
8299                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8300                // done second because the memcpy will write garbage to these bytes.
8301            }
8302            Ok(())
8303        }
8304    }
8305    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8306        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D> for (T0,)
8307    {
8308        #[inline]
8309        unsafe fn encode(
8310            self,
8311            encoder: &mut fidl::encoding::Encoder<'_, D>,
8312            offset: usize,
8313            depth: fidl::encoding::Depth,
8314        ) -> fidl::Result<()> {
8315            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
8316            // Zero out padding regions. There's no need to apply masks
8317            // because the unmasked parts will be overwritten by fields.
8318            // Write the fields.
8319            self.0.encode(encoder, offset + 0, depth)?;
8320            Ok(())
8321        }
8322    }
8323
8324    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8325        for BaseSocketSetReceiveBufferRequest
8326    {
8327        #[inline(always)]
8328        fn new_empty() -> Self {
8329            Self { value_bytes: fidl::new_empty!(u64, D) }
8330        }
8331
8332        #[inline]
8333        unsafe fn decode(
8334            &mut self,
8335            decoder: &mut fidl::encoding::Decoder<'_, D>,
8336            offset: usize,
8337            _depth: fidl::encoding::Depth,
8338        ) -> fidl::Result<()> {
8339            decoder.debug_check_bounds::<Self>(offset);
8340            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8341            // Verify that padding bytes are zero.
8342            // Copy from the buffer into the object.
8343            unsafe {
8344                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8345            }
8346            Ok(())
8347        }
8348    }
8349
8350    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReuseAddressRequest {
8351        type Borrowed<'a> = &'a Self;
8352        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8353            value
8354        }
8355    }
8356
8357    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReuseAddressRequest {
8358        type Owned = Self;
8359
8360        #[inline(always)]
8361        fn inline_align(_context: fidl::encoding::Context) -> usize {
8362            1
8363        }
8364
8365        #[inline(always)]
8366        fn inline_size(_context: fidl::encoding::Context) -> usize {
8367            1
8368        }
8369    }
8370
8371    unsafe impl<D: fidl::encoding::ResourceDialect>
8372        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D>
8373        for &BaseSocketSetReuseAddressRequest
8374    {
8375        #[inline]
8376        unsafe fn encode(
8377            self,
8378            encoder: &mut fidl::encoding::Encoder<'_, D>,
8379            offset: usize,
8380            _depth: fidl::encoding::Depth,
8381        ) -> fidl::Result<()> {
8382            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8383            // Delegate to tuple encoding.
8384            fidl::encoding::Encode::<BaseSocketSetReuseAddressRequest, D>::encode(
8385                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8386                encoder,
8387                offset,
8388                _depth,
8389            )
8390        }
8391    }
8392    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8393        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D> for (T0,)
8394    {
8395        #[inline]
8396        unsafe fn encode(
8397            self,
8398            encoder: &mut fidl::encoding::Encoder<'_, D>,
8399            offset: usize,
8400            depth: fidl::encoding::Depth,
8401        ) -> fidl::Result<()> {
8402            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8403            // Zero out padding regions. There's no need to apply masks
8404            // because the unmasked parts will be overwritten by fields.
8405            // Write the fields.
8406            self.0.encode(encoder, offset + 0, depth)?;
8407            Ok(())
8408        }
8409    }
8410
8411    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8412        for BaseSocketSetReuseAddressRequest
8413    {
8414        #[inline(always)]
8415        fn new_empty() -> Self {
8416            Self { value: fidl::new_empty!(bool, D) }
8417        }
8418
8419        #[inline]
8420        unsafe fn decode(
8421            &mut self,
8422            decoder: &mut fidl::encoding::Decoder<'_, D>,
8423            offset: usize,
8424            _depth: fidl::encoding::Depth,
8425        ) -> fidl::Result<()> {
8426            decoder.debug_check_bounds::<Self>(offset);
8427            // Verify that padding bytes are zero.
8428            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8429            Ok(())
8430        }
8431    }
8432
8433    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReusePortRequest {
8434        type Borrowed<'a> = &'a Self;
8435        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8436            value
8437        }
8438    }
8439
8440    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReusePortRequest {
8441        type Owned = Self;
8442
8443        #[inline(always)]
8444        fn inline_align(_context: fidl::encoding::Context) -> usize {
8445            1
8446        }
8447
8448        #[inline(always)]
8449        fn inline_size(_context: fidl::encoding::Context) -> usize {
8450            1
8451        }
8452    }
8453
8454    unsafe impl<D: fidl::encoding::ResourceDialect>
8455        fidl::encoding::Encode<BaseSocketSetReusePortRequest, D>
8456        for &BaseSocketSetReusePortRequest
8457    {
8458        #[inline]
8459        unsafe fn encode(
8460            self,
8461            encoder: &mut fidl::encoding::Encoder<'_, D>,
8462            offset: usize,
8463            _depth: fidl::encoding::Depth,
8464        ) -> fidl::Result<()> {
8465            encoder.debug_check_bounds::<BaseSocketSetReusePortRequest>(offset);
8466            // Delegate to tuple encoding.
8467            fidl::encoding::Encode::<BaseSocketSetReusePortRequest, D>::encode(
8468                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8469                encoder,
8470                offset,
8471                _depth,
8472            )
8473        }
8474    }
8475    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8476        fidl::encoding::Encode<BaseSocketSetReusePortRequest, D> for (T0,)
8477    {
8478        #[inline]
8479        unsafe fn encode(
8480            self,
8481            encoder: &mut fidl::encoding::Encoder<'_, D>,
8482            offset: usize,
8483            depth: fidl::encoding::Depth,
8484        ) -> fidl::Result<()> {
8485            encoder.debug_check_bounds::<BaseSocketSetReusePortRequest>(offset);
8486            // Zero out padding regions. There's no need to apply masks
8487            // because the unmasked parts will be overwritten by fields.
8488            // Write the fields.
8489            self.0.encode(encoder, offset + 0, depth)?;
8490            Ok(())
8491        }
8492    }
8493
8494    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8495        for BaseSocketSetReusePortRequest
8496    {
8497        #[inline(always)]
8498        fn new_empty() -> Self {
8499            Self { value: fidl::new_empty!(bool, D) }
8500        }
8501
8502        #[inline]
8503        unsafe fn decode(
8504            &mut self,
8505            decoder: &mut fidl::encoding::Decoder<'_, D>,
8506            offset: usize,
8507            _depth: fidl::encoding::Depth,
8508        ) -> fidl::Result<()> {
8509            decoder.debug_check_bounds::<Self>(offset);
8510            // Verify that padding bytes are zero.
8511            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8512            Ok(())
8513        }
8514    }
8515
8516    impl fidl::encoding::ValueTypeMarker for BaseSocketSetSendBufferRequest {
8517        type Borrowed<'a> = &'a Self;
8518        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8519            value
8520        }
8521    }
8522
8523    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetSendBufferRequest {
8524        type Owned = Self;
8525
8526        #[inline(always)]
8527        fn inline_align(_context: fidl::encoding::Context) -> usize {
8528            8
8529        }
8530
8531        #[inline(always)]
8532        fn inline_size(_context: fidl::encoding::Context) -> usize {
8533            8
8534        }
8535        #[inline(always)]
8536        fn encode_is_copy() -> bool {
8537            true
8538        }
8539
8540        #[inline(always)]
8541        fn decode_is_copy() -> bool {
8542            true
8543        }
8544    }
8545
8546    unsafe impl<D: fidl::encoding::ResourceDialect>
8547        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D>
8548        for &BaseSocketSetSendBufferRequest
8549    {
8550        #[inline]
8551        unsafe fn encode(
8552            self,
8553            encoder: &mut fidl::encoding::Encoder<'_, D>,
8554            offset: usize,
8555            _depth: fidl::encoding::Depth,
8556        ) -> fidl::Result<()> {
8557            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8558            unsafe {
8559                // Copy the object into the buffer.
8560                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8561                (buf_ptr as *mut BaseSocketSetSendBufferRequest)
8562                    .write_unaligned((self as *const BaseSocketSetSendBufferRequest).read());
8563                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8564                // done second because the memcpy will write garbage to these bytes.
8565            }
8566            Ok(())
8567        }
8568    }
8569    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8570        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D> for (T0,)
8571    {
8572        #[inline]
8573        unsafe fn encode(
8574            self,
8575            encoder: &mut fidl::encoding::Encoder<'_, D>,
8576            offset: usize,
8577            depth: fidl::encoding::Depth,
8578        ) -> fidl::Result<()> {
8579            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8580            // Zero out padding regions. There's no need to apply masks
8581            // because the unmasked parts will be overwritten by fields.
8582            // Write the fields.
8583            self.0.encode(encoder, offset + 0, depth)?;
8584            Ok(())
8585        }
8586    }
8587
8588    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8589        for BaseSocketSetSendBufferRequest
8590    {
8591        #[inline(always)]
8592        fn new_empty() -> Self {
8593            Self { value_bytes: fidl::new_empty!(u64, D) }
8594        }
8595
8596        #[inline]
8597        unsafe fn decode(
8598            &mut self,
8599            decoder: &mut fidl::encoding::Decoder<'_, D>,
8600            offset: usize,
8601            _depth: fidl::encoding::Depth,
8602        ) -> fidl::Result<()> {
8603            decoder.debug_check_bounds::<Self>(offset);
8604            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8605            // Verify that padding bytes are zero.
8606            // Copy from the buffer into the object.
8607            unsafe {
8608                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8609            }
8610            Ok(())
8611        }
8612    }
8613
8614    impl fidl::encoding::ValueTypeMarker for BaseSocketSetTimestampRequest {
8615        type Borrowed<'a> = &'a Self;
8616        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8617            value
8618        }
8619    }
8620
8621    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetTimestampRequest {
8622        type Owned = Self;
8623
8624        #[inline(always)]
8625        fn inline_align(_context: fidl::encoding::Context) -> usize {
8626            4
8627        }
8628
8629        #[inline(always)]
8630        fn inline_size(_context: fidl::encoding::Context) -> usize {
8631            4
8632        }
8633    }
8634
8635    unsafe impl<D: fidl::encoding::ResourceDialect>
8636        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D>
8637        for &BaseSocketSetTimestampRequest
8638    {
8639        #[inline]
8640        unsafe fn encode(
8641            self,
8642            encoder: &mut fidl::encoding::Encoder<'_, D>,
8643            offset: usize,
8644            _depth: fidl::encoding::Depth,
8645        ) -> fidl::Result<()> {
8646            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8647            // Delegate to tuple encoding.
8648            fidl::encoding::Encode::<BaseSocketSetTimestampRequest, D>::encode(
8649                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8650                encoder,
8651                offset,
8652                _depth,
8653            )
8654        }
8655    }
8656    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
8657        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D> for (T0,)
8658    {
8659        #[inline]
8660        unsafe fn encode(
8661            self,
8662            encoder: &mut fidl::encoding::Encoder<'_, D>,
8663            offset: usize,
8664            depth: fidl::encoding::Depth,
8665        ) -> fidl::Result<()> {
8666            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8667            // Zero out padding regions. There's no need to apply masks
8668            // because the unmasked parts will be overwritten by fields.
8669            // Write the fields.
8670            self.0.encode(encoder, offset + 0, depth)?;
8671            Ok(())
8672        }
8673    }
8674
8675    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8676        for BaseSocketSetTimestampRequest
8677    {
8678        #[inline(always)]
8679        fn new_empty() -> Self {
8680            Self { value: fidl::new_empty!(TimestampOption, D) }
8681        }
8682
8683        #[inline]
8684        unsafe fn decode(
8685            &mut self,
8686            decoder: &mut fidl::encoding::Decoder<'_, D>,
8687            offset: usize,
8688            _depth: fidl::encoding::Depth,
8689        ) -> fidl::Result<()> {
8690            decoder.debug_check_bounds::<Self>(offset);
8691            // Verify that padding bytes are zero.
8692            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
8693            Ok(())
8694        }
8695    }
8696
8697    impl fidl::encoding::ValueTypeMarker for BaseSocketGetAcceptConnResponse {
8698        type Borrowed<'a> = &'a Self;
8699        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8700            value
8701        }
8702    }
8703
8704    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetAcceptConnResponse {
8705        type Owned = Self;
8706
8707        #[inline(always)]
8708        fn inline_align(_context: fidl::encoding::Context) -> usize {
8709            1
8710        }
8711
8712        #[inline(always)]
8713        fn inline_size(_context: fidl::encoding::Context) -> usize {
8714            1
8715        }
8716    }
8717
8718    unsafe impl<D: fidl::encoding::ResourceDialect>
8719        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D>
8720        for &BaseSocketGetAcceptConnResponse
8721    {
8722        #[inline]
8723        unsafe fn encode(
8724            self,
8725            encoder: &mut fidl::encoding::Encoder<'_, D>,
8726            offset: usize,
8727            _depth: fidl::encoding::Depth,
8728        ) -> fidl::Result<()> {
8729            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8730            // Delegate to tuple encoding.
8731            fidl::encoding::Encode::<BaseSocketGetAcceptConnResponse, D>::encode(
8732                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8733                encoder,
8734                offset,
8735                _depth,
8736            )
8737        }
8738    }
8739    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8740        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D> for (T0,)
8741    {
8742        #[inline]
8743        unsafe fn encode(
8744            self,
8745            encoder: &mut fidl::encoding::Encoder<'_, D>,
8746            offset: usize,
8747            depth: fidl::encoding::Depth,
8748        ) -> fidl::Result<()> {
8749            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8750            // Zero out padding regions. There's no need to apply masks
8751            // because the unmasked parts will be overwritten by fields.
8752            // Write the fields.
8753            self.0.encode(encoder, offset + 0, depth)?;
8754            Ok(())
8755        }
8756    }
8757
8758    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8759        for BaseSocketGetAcceptConnResponse
8760    {
8761        #[inline(always)]
8762        fn new_empty() -> Self {
8763            Self { value: fidl::new_empty!(bool, D) }
8764        }
8765
8766        #[inline]
8767        unsafe fn decode(
8768            &mut self,
8769            decoder: &mut fidl::encoding::Decoder<'_, D>,
8770            offset: usize,
8771            _depth: fidl::encoding::Depth,
8772        ) -> fidl::Result<()> {
8773            decoder.debug_check_bounds::<Self>(offset);
8774            // Verify that padding bytes are zero.
8775            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8776            Ok(())
8777        }
8778    }
8779
8780    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToDeviceResponse {
8781        type Borrowed<'a> = &'a Self;
8782        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8783            value
8784        }
8785    }
8786
8787    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToDeviceResponse {
8788        type Owned = Self;
8789
8790        #[inline(always)]
8791        fn inline_align(_context: fidl::encoding::Context) -> usize {
8792            8
8793        }
8794
8795        #[inline(always)]
8796        fn inline_size(_context: fidl::encoding::Context) -> usize {
8797            16
8798        }
8799    }
8800
8801    unsafe impl<D: fidl::encoding::ResourceDialect>
8802        fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D>
8803        for &BaseSocketGetBindToDeviceResponse
8804    {
8805        #[inline]
8806        unsafe fn encode(
8807            self,
8808            encoder: &mut fidl::encoding::Encoder<'_, D>,
8809            offset: usize,
8810            _depth: fidl::encoding::Depth,
8811        ) -> fidl::Result<()> {
8812            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8813            // Delegate to tuple encoding.
8814            fidl::encoding::Encode::<BaseSocketGetBindToDeviceResponse, D>::encode(
8815                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
8816                    &self.value,
8817                ),),
8818                encoder,
8819                offset,
8820                _depth,
8821            )
8822        }
8823    }
8824    unsafe impl<
8825            D: fidl::encoding::ResourceDialect,
8826            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
8827        > fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D> for (T0,)
8828    {
8829        #[inline]
8830        unsafe fn encode(
8831            self,
8832            encoder: &mut fidl::encoding::Encoder<'_, D>,
8833            offset: usize,
8834            depth: fidl::encoding::Depth,
8835        ) -> fidl::Result<()> {
8836            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8837            // Zero out padding regions. There's no need to apply masks
8838            // because the unmasked parts will be overwritten by fields.
8839            // Write the fields.
8840            self.0.encode(encoder, offset + 0, depth)?;
8841            Ok(())
8842        }
8843    }
8844
8845    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8846        for BaseSocketGetBindToDeviceResponse
8847    {
8848        #[inline(always)]
8849        fn new_empty() -> Self {
8850            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
8851        }
8852
8853        #[inline]
8854        unsafe fn decode(
8855            &mut self,
8856            decoder: &mut fidl::encoding::Decoder<'_, D>,
8857            offset: usize,
8858            _depth: fidl::encoding::Depth,
8859        ) -> fidl::Result<()> {
8860            decoder.debug_check_bounds::<Self>(offset);
8861            // Verify that padding bytes are zero.
8862            fidl::decode!(
8863                fidl::encoding::BoundedString<15>,
8864                D,
8865                &mut self.value,
8866                decoder,
8867                offset + 0,
8868                _depth
8869            )?;
8870            Ok(())
8871        }
8872    }
8873
8874    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8875        type Borrowed<'a> = &'a Self;
8876        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8877            value
8878        }
8879    }
8880
8881    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8882        type Owned = Self;
8883
8884        #[inline(always)]
8885        fn inline_align(_context: fidl::encoding::Context) -> usize {
8886            8
8887        }
8888
8889        #[inline(always)]
8890        fn inline_size(_context: fidl::encoding::Context) -> usize {
8891            8
8892        }
8893        #[inline(always)]
8894        fn encode_is_copy() -> bool {
8895            true
8896        }
8897
8898        #[inline(always)]
8899        fn decode_is_copy() -> bool {
8900            true
8901        }
8902    }
8903
8904    unsafe impl<D: fidl::encoding::ResourceDialect>
8905        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D>
8906        for &BaseSocketGetBindToInterfaceIndexResponse
8907    {
8908        #[inline]
8909        unsafe fn encode(
8910            self,
8911            encoder: &mut fidl::encoding::Encoder<'_, D>,
8912            offset: usize,
8913            _depth: fidl::encoding::Depth,
8914        ) -> fidl::Result<()> {
8915            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8916            unsafe {
8917                // Copy the object into the buffer.
8918                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8919                (buf_ptr as *mut BaseSocketGetBindToInterfaceIndexResponse).write_unaligned(
8920                    (self as *const BaseSocketGetBindToInterfaceIndexResponse).read(),
8921                );
8922                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8923                // done second because the memcpy will write garbage to these bytes.
8924            }
8925            Ok(())
8926        }
8927    }
8928    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8929        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D> for (T0,)
8930    {
8931        #[inline]
8932        unsafe fn encode(
8933            self,
8934            encoder: &mut fidl::encoding::Encoder<'_, D>,
8935            offset: usize,
8936            depth: fidl::encoding::Depth,
8937        ) -> fidl::Result<()> {
8938            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8939            // Zero out padding regions. There's no need to apply masks
8940            // because the unmasked parts will be overwritten by fields.
8941            // Write the fields.
8942            self.0.encode(encoder, offset + 0, depth)?;
8943            Ok(())
8944        }
8945    }
8946
8947    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8948        for BaseSocketGetBindToInterfaceIndexResponse
8949    {
8950        #[inline(always)]
8951        fn new_empty() -> Self {
8952            Self { value: fidl::new_empty!(u64, D) }
8953        }
8954
8955        #[inline]
8956        unsafe fn decode(
8957            &mut self,
8958            decoder: &mut fidl::encoding::Decoder<'_, D>,
8959            offset: usize,
8960            _depth: fidl::encoding::Depth,
8961        ) -> fidl::Result<()> {
8962            decoder.debug_check_bounds::<Self>(offset);
8963            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8964            // Verify that padding bytes are zero.
8965            // Copy from the buffer into the object.
8966            unsafe {
8967                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8968            }
8969            Ok(())
8970        }
8971    }
8972
8973    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBroadcastResponse {
8974        type Borrowed<'a> = &'a Self;
8975        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8976            value
8977        }
8978    }
8979
8980    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBroadcastResponse {
8981        type Owned = Self;
8982
8983        #[inline(always)]
8984        fn inline_align(_context: fidl::encoding::Context) -> usize {
8985            1
8986        }
8987
8988        #[inline(always)]
8989        fn inline_size(_context: fidl::encoding::Context) -> usize {
8990            1
8991        }
8992    }
8993
8994    unsafe impl<D: fidl::encoding::ResourceDialect>
8995        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D>
8996        for &BaseSocketGetBroadcastResponse
8997    {
8998        #[inline]
8999        unsafe fn encode(
9000            self,
9001            encoder: &mut fidl::encoding::Encoder<'_, D>,
9002            offset: usize,
9003            _depth: fidl::encoding::Depth,
9004        ) -> fidl::Result<()> {
9005            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
9006            // Delegate to tuple encoding.
9007            fidl::encoding::Encode::<BaseSocketGetBroadcastResponse, D>::encode(
9008                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9009                encoder,
9010                offset,
9011                _depth,
9012            )
9013        }
9014    }
9015    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9016        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D> for (T0,)
9017    {
9018        #[inline]
9019        unsafe fn encode(
9020            self,
9021            encoder: &mut fidl::encoding::Encoder<'_, D>,
9022            offset: usize,
9023            depth: fidl::encoding::Depth,
9024        ) -> fidl::Result<()> {
9025            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
9026            // Zero out padding regions. There's no need to apply masks
9027            // because the unmasked parts will be overwritten by fields.
9028            // Write the fields.
9029            self.0.encode(encoder, offset + 0, depth)?;
9030            Ok(())
9031        }
9032    }
9033
9034    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9035        for BaseSocketGetBroadcastResponse
9036    {
9037        #[inline(always)]
9038        fn new_empty() -> Self {
9039            Self { value: fidl::new_empty!(bool, D) }
9040        }
9041
9042        #[inline]
9043        unsafe fn decode(
9044            &mut self,
9045            decoder: &mut fidl::encoding::Decoder<'_, D>,
9046            offset: usize,
9047            _depth: fidl::encoding::Depth,
9048        ) -> fidl::Result<()> {
9049            decoder.debug_check_bounds::<Self>(offset);
9050            // Verify that padding bytes are zero.
9051            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9052            Ok(())
9053        }
9054    }
9055
9056    impl fidl::encoding::ValueTypeMarker for BaseSocketGetKeepAliveResponse {
9057        type Borrowed<'a> = &'a Self;
9058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9059            value
9060        }
9061    }
9062
9063    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetKeepAliveResponse {
9064        type Owned = Self;
9065
9066        #[inline(always)]
9067        fn inline_align(_context: fidl::encoding::Context) -> usize {
9068            1
9069        }
9070
9071        #[inline(always)]
9072        fn inline_size(_context: fidl::encoding::Context) -> usize {
9073            1
9074        }
9075    }
9076
9077    unsafe impl<D: fidl::encoding::ResourceDialect>
9078        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D>
9079        for &BaseSocketGetKeepAliveResponse
9080    {
9081        #[inline]
9082        unsafe fn encode(
9083            self,
9084            encoder: &mut fidl::encoding::Encoder<'_, D>,
9085            offset: usize,
9086            _depth: fidl::encoding::Depth,
9087        ) -> fidl::Result<()> {
9088            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
9089            // Delegate to tuple encoding.
9090            fidl::encoding::Encode::<BaseSocketGetKeepAliveResponse, D>::encode(
9091                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9092                encoder,
9093                offset,
9094                _depth,
9095            )
9096        }
9097    }
9098    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9099        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D> for (T0,)
9100    {
9101        #[inline]
9102        unsafe fn encode(
9103            self,
9104            encoder: &mut fidl::encoding::Encoder<'_, D>,
9105            offset: usize,
9106            depth: fidl::encoding::Depth,
9107        ) -> fidl::Result<()> {
9108            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
9109            // Zero out padding regions. There's no need to apply masks
9110            // because the unmasked parts will be overwritten by fields.
9111            // Write the fields.
9112            self.0.encode(encoder, offset + 0, depth)?;
9113            Ok(())
9114        }
9115    }
9116
9117    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9118        for BaseSocketGetKeepAliveResponse
9119    {
9120        #[inline(always)]
9121        fn new_empty() -> Self {
9122            Self { value: fidl::new_empty!(bool, D) }
9123        }
9124
9125        #[inline]
9126        unsafe fn decode(
9127            &mut self,
9128            decoder: &mut fidl::encoding::Decoder<'_, D>,
9129            offset: usize,
9130            _depth: fidl::encoding::Depth,
9131        ) -> fidl::Result<()> {
9132            decoder.debug_check_bounds::<Self>(offset);
9133            // Verify that padding bytes are zero.
9134            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9135            Ok(())
9136        }
9137    }
9138
9139    impl fidl::encoding::ValueTypeMarker for BaseSocketGetLingerResponse {
9140        type Borrowed<'a> = &'a Self;
9141        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9142            value
9143        }
9144    }
9145
9146    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetLingerResponse {
9147        type Owned = Self;
9148
9149        #[inline(always)]
9150        fn inline_align(_context: fidl::encoding::Context) -> usize {
9151            4
9152        }
9153
9154        #[inline(always)]
9155        fn inline_size(_context: fidl::encoding::Context) -> usize {
9156            8
9157        }
9158    }
9159
9160    unsafe impl<D: fidl::encoding::ResourceDialect>
9161        fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for &BaseSocketGetLingerResponse
9162    {
9163        #[inline]
9164        unsafe fn encode(
9165            self,
9166            encoder: &mut fidl::encoding::Encoder<'_, D>,
9167            offset: usize,
9168            _depth: fidl::encoding::Depth,
9169        ) -> fidl::Result<()> {
9170            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
9171            // Delegate to tuple encoding.
9172            fidl::encoding::Encode::<BaseSocketGetLingerResponse, D>::encode(
9173                (
9174                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
9175                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
9176                ),
9177                encoder,
9178                offset,
9179                _depth,
9180            )
9181        }
9182    }
9183    unsafe impl<
9184            D: fidl::encoding::ResourceDialect,
9185            T0: fidl::encoding::Encode<bool, D>,
9186            T1: fidl::encoding::Encode<u32, D>,
9187        > fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for (T0, T1)
9188    {
9189        #[inline]
9190        unsafe fn encode(
9191            self,
9192            encoder: &mut fidl::encoding::Encoder<'_, D>,
9193            offset: usize,
9194            depth: fidl::encoding::Depth,
9195        ) -> fidl::Result<()> {
9196            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
9197            // Zero out padding regions. There's no need to apply masks
9198            // because the unmasked parts will be overwritten by fields.
9199            unsafe {
9200                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9201                (ptr as *mut u32).write_unaligned(0);
9202            }
9203            // Write the fields.
9204            self.0.encode(encoder, offset + 0, depth)?;
9205            self.1.encode(encoder, offset + 4, depth)?;
9206            Ok(())
9207        }
9208    }
9209
9210    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9211        for BaseSocketGetLingerResponse
9212    {
9213        #[inline(always)]
9214        fn new_empty() -> Self {
9215            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
9216        }
9217
9218        #[inline]
9219        unsafe fn decode(
9220            &mut self,
9221            decoder: &mut fidl::encoding::Decoder<'_, D>,
9222            offset: usize,
9223            _depth: fidl::encoding::Depth,
9224        ) -> fidl::Result<()> {
9225            decoder.debug_check_bounds::<Self>(offset);
9226            // Verify that padding bytes are zero.
9227            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9228            let padval = unsafe { (ptr as *const u32).read_unaligned() };
9229            let mask = 0xffffff00u32;
9230            let maskedval = padval & mask;
9231            if maskedval != 0 {
9232                return Err(fidl::Error::NonZeroPadding {
9233                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9234                });
9235            }
9236            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
9237            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
9238            Ok(())
9239        }
9240    }
9241
9242    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkResponse {
9243        type Borrowed<'a> = &'a Self;
9244        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9245            value
9246        }
9247    }
9248
9249    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkResponse {
9250        type Owned = Self;
9251
9252        #[inline(always)]
9253        fn inline_align(_context: fidl::encoding::Context) -> usize {
9254            8
9255        }
9256
9257        #[inline(always)]
9258        fn inline_size(_context: fidl::encoding::Context) -> usize {
9259            16
9260        }
9261    }
9262
9263    unsafe impl<D: fidl::encoding::ResourceDialect>
9264        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for &BaseSocketGetMarkResponse
9265    {
9266        #[inline]
9267        unsafe fn encode(
9268            self,
9269            encoder: &mut fidl::encoding::Encoder<'_, D>,
9270            offset: usize,
9271            _depth: fidl::encoding::Depth,
9272        ) -> fidl::Result<()> {
9273            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
9274            // Delegate to tuple encoding.
9275            fidl::encoding::Encode::<BaseSocketGetMarkResponse, D>::encode(
9276                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),),
9277                encoder,
9278                offset,
9279                _depth,
9280            )
9281        }
9282    }
9283    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
9284        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for (T0,)
9285    {
9286        #[inline]
9287        unsafe fn encode(
9288            self,
9289            encoder: &mut fidl::encoding::Encoder<'_, D>,
9290            offset: usize,
9291            depth: fidl::encoding::Depth,
9292        ) -> fidl::Result<()> {
9293            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
9294            // Zero out padding regions. There's no need to apply masks
9295            // because the unmasked parts will be overwritten by fields.
9296            // Write the fields.
9297            self.0.encode(encoder, offset + 0, depth)?;
9298            Ok(())
9299        }
9300    }
9301
9302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9303        for BaseSocketGetMarkResponse
9304    {
9305        #[inline(always)]
9306        fn new_empty() -> Self {
9307            Self { mark: fidl::new_empty!(OptionalUint32, D) }
9308        }
9309
9310        #[inline]
9311        unsafe fn decode(
9312            &mut self,
9313            decoder: &mut fidl::encoding::Decoder<'_, D>,
9314            offset: usize,
9315            _depth: fidl::encoding::Depth,
9316        ) -> fidl::Result<()> {
9317            decoder.debug_check_bounds::<Self>(offset);
9318            // Verify that padding bytes are zero.
9319            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 0, _depth)?;
9320            Ok(())
9321        }
9322    }
9323
9324    impl fidl::encoding::ValueTypeMarker for BaseSocketGetNoCheckResponse {
9325        type Borrowed<'a> = &'a Self;
9326        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9327            value
9328        }
9329    }
9330
9331    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetNoCheckResponse {
9332        type Owned = Self;
9333
9334        #[inline(always)]
9335        fn inline_align(_context: fidl::encoding::Context) -> usize {
9336            1
9337        }
9338
9339        #[inline(always)]
9340        fn inline_size(_context: fidl::encoding::Context) -> usize {
9341            1
9342        }
9343    }
9344
9345    unsafe impl<D: fidl::encoding::ResourceDialect>
9346        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for &BaseSocketGetNoCheckResponse
9347    {
9348        #[inline]
9349        unsafe fn encode(
9350            self,
9351            encoder: &mut fidl::encoding::Encoder<'_, D>,
9352            offset: usize,
9353            _depth: fidl::encoding::Depth,
9354        ) -> fidl::Result<()> {
9355            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
9356            // Delegate to tuple encoding.
9357            fidl::encoding::Encode::<BaseSocketGetNoCheckResponse, D>::encode(
9358                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9359                encoder,
9360                offset,
9361                _depth,
9362            )
9363        }
9364    }
9365    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9366        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for (T0,)
9367    {
9368        #[inline]
9369        unsafe fn encode(
9370            self,
9371            encoder: &mut fidl::encoding::Encoder<'_, D>,
9372            offset: usize,
9373            depth: fidl::encoding::Depth,
9374        ) -> fidl::Result<()> {
9375            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
9376            // Zero out padding regions. There's no need to apply masks
9377            // because the unmasked parts will be overwritten by fields.
9378            // Write the fields.
9379            self.0.encode(encoder, offset + 0, depth)?;
9380            Ok(())
9381        }
9382    }
9383
9384    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9385        for BaseSocketGetNoCheckResponse
9386    {
9387        #[inline(always)]
9388        fn new_empty() -> Self {
9389            Self { value: fidl::new_empty!(bool, D) }
9390        }
9391
9392        #[inline]
9393        unsafe fn decode(
9394            &mut self,
9395            decoder: &mut fidl::encoding::Decoder<'_, D>,
9396            offset: usize,
9397            _depth: fidl::encoding::Depth,
9398        ) -> fidl::Result<()> {
9399            decoder.debug_check_bounds::<Self>(offset);
9400            // Verify that padding bytes are zero.
9401            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9402            Ok(())
9403        }
9404    }
9405
9406    impl fidl::encoding::ValueTypeMarker for BaseSocketGetOutOfBandInlineResponse {
9407        type Borrowed<'a> = &'a Self;
9408        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9409            value
9410        }
9411    }
9412
9413    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetOutOfBandInlineResponse {
9414        type Owned = Self;
9415
9416        #[inline(always)]
9417        fn inline_align(_context: fidl::encoding::Context) -> usize {
9418            1
9419        }
9420
9421        #[inline(always)]
9422        fn inline_size(_context: fidl::encoding::Context) -> usize {
9423            1
9424        }
9425    }
9426
9427    unsafe impl<D: fidl::encoding::ResourceDialect>
9428        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D>
9429        for &BaseSocketGetOutOfBandInlineResponse
9430    {
9431        #[inline]
9432        unsafe fn encode(
9433            self,
9434            encoder: &mut fidl::encoding::Encoder<'_, D>,
9435            offset: usize,
9436            _depth: fidl::encoding::Depth,
9437        ) -> fidl::Result<()> {
9438            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9439            // Delegate to tuple encoding.
9440            fidl::encoding::Encode::<BaseSocketGetOutOfBandInlineResponse, D>::encode(
9441                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9442                encoder,
9443                offset,
9444                _depth,
9445            )
9446        }
9447    }
9448    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9449        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D> for (T0,)
9450    {
9451        #[inline]
9452        unsafe fn encode(
9453            self,
9454            encoder: &mut fidl::encoding::Encoder<'_, D>,
9455            offset: usize,
9456            depth: fidl::encoding::Depth,
9457        ) -> fidl::Result<()> {
9458            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9459            // Zero out padding regions. There's no need to apply masks
9460            // because the unmasked parts will be overwritten by fields.
9461            // Write the fields.
9462            self.0.encode(encoder, offset + 0, depth)?;
9463            Ok(())
9464        }
9465    }
9466
9467    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9468        for BaseSocketGetOutOfBandInlineResponse
9469    {
9470        #[inline(always)]
9471        fn new_empty() -> Self {
9472            Self { value: fidl::new_empty!(bool, D) }
9473        }
9474
9475        #[inline]
9476        unsafe fn decode(
9477            &mut self,
9478            decoder: &mut fidl::encoding::Decoder<'_, D>,
9479            offset: usize,
9480            _depth: fidl::encoding::Depth,
9481        ) -> fidl::Result<()> {
9482            decoder.debug_check_bounds::<Self>(offset);
9483            // Verify that padding bytes are zero.
9484            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9485            Ok(())
9486        }
9487    }
9488
9489    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReceiveBufferResponse {
9490        type Borrowed<'a> = &'a Self;
9491        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9492            value
9493        }
9494    }
9495
9496    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReceiveBufferResponse {
9497        type Owned = Self;
9498
9499        #[inline(always)]
9500        fn inline_align(_context: fidl::encoding::Context) -> usize {
9501            8
9502        }
9503
9504        #[inline(always)]
9505        fn inline_size(_context: fidl::encoding::Context) -> usize {
9506            8
9507        }
9508        #[inline(always)]
9509        fn encode_is_copy() -> bool {
9510            true
9511        }
9512
9513        #[inline(always)]
9514        fn decode_is_copy() -> bool {
9515            true
9516        }
9517    }
9518
9519    unsafe impl<D: fidl::encoding::ResourceDialect>
9520        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D>
9521        for &BaseSocketGetReceiveBufferResponse
9522    {
9523        #[inline]
9524        unsafe fn encode(
9525            self,
9526            encoder: &mut fidl::encoding::Encoder<'_, D>,
9527            offset: usize,
9528            _depth: fidl::encoding::Depth,
9529        ) -> fidl::Result<()> {
9530            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9531            unsafe {
9532                // Copy the object into the buffer.
9533                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9534                (buf_ptr as *mut BaseSocketGetReceiveBufferResponse)
9535                    .write_unaligned((self as *const BaseSocketGetReceiveBufferResponse).read());
9536                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9537                // done second because the memcpy will write garbage to these bytes.
9538            }
9539            Ok(())
9540        }
9541    }
9542    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9543        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D> for (T0,)
9544    {
9545        #[inline]
9546        unsafe fn encode(
9547            self,
9548            encoder: &mut fidl::encoding::Encoder<'_, D>,
9549            offset: usize,
9550            depth: fidl::encoding::Depth,
9551        ) -> fidl::Result<()> {
9552            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9553            // Zero out padding regions. There's no need to apply masks
9554            // because the unmasked parts will be overwritten by fields.
9555            // Write the fields.
9556            self.0.encode(encoder, offset + 0, depth)?;
9557            Ok(())
9558        }
9559    }
9560
9561    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9562        for BaseSocketGetReceiveBufferResponse
9563    {
9564        #[inline(always)]
9565        fn new_empty() -> Self {
9566            Self { value_bytes: fidl::new_empty!(u64, D) }
9567        }
9568
9569        #[inline]
9570        unsafe fn decode(
9571            &mut self,
9572            decoder: &mut fidl::encoding::Decoder<'_, D>,
9573            offset: usize,
9574            _depth: fidl::encoding::Depth,
9575        ) -> fidl::Result<()> {
9576            decoder.debug_check_bounds::<Self>(offset);
9577            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9578            // Verify that padding bytes are zero.
9579            // Copy from the buffer into the object.
9580            unsafe {
9581                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9582            }
9583            Ok(())
9584        }
9585    }
9586
9587    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReuseAddressResponse {
9588        type Borrowed<'a> = &'a Self;
9589        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9590            value
9591        }
9592    }
9593
9594    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReuseAddressResponse {
9595        type Owned = Self;
9596
9597        #[inline(always)]
9598        fn inline_align(_context: fidl::encoding::Context) -> usize {
9599            1
9600        }
9601
9602        #[inline(always)]
9603        fn inline_size(_context: fidl::encoding::Context) -> usize {
9604            1
9605        }
9606    }
9607
9608    unsafe impl<D: fidl::encoding::ResourceDialect>
9609        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D>
9610        for &BaseSocketGetReuseAddressResponse
9611    {
9612        #[inline]
9613        unsafe fn encode(
9614            self,
9615            encoder: &mut fidl::encoding::Encoder<'_, D>,
9616            offset: usize,
9617            _depth: fidl::encoding::Depth,
9618        ) -> fidl::Result<()> {
9619            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9620            // Delegate to tuple encoding.
9621            fidl::encoding::Encode::<BaseSocketGetReuseAddressResponse, D>::encode(
9622                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9623                encoder,
9624                offset,
9625                _depth,
9626            )
9627        }
9628    }
9629    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9630        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D> for (T0,)
9631    {
9632        #[inline]
9633        unsafe fn encode(
9634            self,
9635            encoder: &mut fidl::encoding::Encoder<'_, D>,
9636            offset: usize,
9637            depth: fidl::encoding::Depth,
9638        ) -> fidl::Result<()> {
9639            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9640            // Zero out padding regions. There's no need to apply masks
9641            // because the unmasked parts will be overwritten by fields.
9642            // Write the fields.
9643            self.0.encode(encoder, offset + 0, depth)?;
9644            Ok(())
9645        }
9646    }
9647
9648    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9649        for BaseSocketGetReuseAddressResponse
9650    {
9651        #[inline(always)]
9652        fn new_empty() -> Self {
9653            Self { value: fidl::new_empty!(bool, D) }
9654        }
9655
9656        #[inline]
9657        unsafe fn decode(
9658            &mut self,
9659            decoder: &mut fidl::encoding::Decoder<'_, D>,
9660            offset: usize,
9661            _depth: fidl::encoding::Depth,
9662        ) -> fidl::Result<()> {
9663            decoder.debug_check_bounds::<Self>(offset);
9664            // Verify that padding bytes are zero.
9665            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9666            Ok(())
9667        }
9668    }
9669
9670    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReusePortResponse {
9671        type Borrowed<'a> = &'a Self;
9672        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9673            value
9674        }
9675    }
9676
9677    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReusePortResponse {
9678        type Owned = Self;
9679
9680        #[inline(always)]
9681        fn inline_align(_context: fidl::encoding::Context) -> usize {
9682            1
9683        }
9684
9685        #[inline(always)]
9686        fn inline_size(_context: fidl::encoding::Context) -> usize {
9687            1
9688        }
9689    }
9690
9691    unsafe impl<D: fidl::encoding::ResourceDialect>
9692        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D>
9693        for &BaseSocketGetReusePortResponse
9694    {
9695        #[inline]
9696        unsafe fn encode(
9697            self,
9698            encoder: &mut fidl::encoding::Encoder<'_, D>,
9699            offset: usize,
9700            _depth: fidl::encoding::Depth,
9701        ) -> fidl::Result<()> {
9702            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9703            // Delegate to tuple encoding.
9704            fidl::encoding::Encode::<BaseSocketGetReusePortResponse, D>::encode(
9705                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9706                encoder,
9707                offset,
9708                _depth,
9709            )
9710        }
9711    }
9712    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9713        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D> for (T0,)
9714    {
9715        #[inline]
9716        unsafe fn encode(
9717            self,
9718            encoder: &mut fidl::encoding::Encoder<'_, D>,
9719            offset: usize,
9720            depth: fidl::encoding::Depth,
9721        ) -> fidl::Result<()> {
9722            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9723            // Zero out padding regions. There's no need to apply masks
9724            // because the unmasked parts will be overwritten by fields.
9725            // Write the fields.
9726            self.0.encode(encoder, offset + 0, depth)?;
9727            Ok(())
9728        }
9729    }
9730
9731    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9732        for BaseSocketGetReusePortResponse
9733    {
9734        #[inline(always)]
9735        fn new_empty() -> Self {
9736            Self { value: fidl::new_empty!(bool, D) }
9737        }
9738
9739        #[inline]
9740        unsafe fn decode(
9741            &mut self,
9742            decoder: &mut fidl::encoding::Decoder<'_, D>,
9743            offset: usize,
9744            _depth: fidl::encoding::Depth,
9745        ) -> fidl::Result<()> {
9746            decoder.debug_check_bounds::<Self>(offset);
9747            // Verify that padding bytes are zero.
9748            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9749            Ok(())
9750        }
9751    }
9752
9753    impl fidl::encoding::ValueTypeMarker for BaseSocketGetSendBufferResponse {
9754        type Borrowed<'a> = &'a Self;
9755        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9756            value
9757        }
9758    }
9759
9760    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetSendBufferResponse {
9761        type Owned = Self;
9762
9763        #[inline(always)]
9764        fn inline_align(_context: fidl::encoding::Context) -> usize {
9765            8
9766        }
9767
9768        #[inline(always)]
9769        fn inline_size(_context: fidl::encoding::Context) -> usize {
9770            8
9771        }
9772        #[inline(always)]
9773        fn encode_is_copy() -> bool {
9774            true
9775        }
9776
9777        #[inline(always)]
9778        fn decode_is_copy() -> bool {
9779            true
9780        }
9781    }
9782
9783    unsafe impl<D: fidl::encoding::ResourceDialect>
9784        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D>
9785        for &BaseSocketGetSendBufferResponse
9786    {
9787        #[inline]
9788        unsafe fn encode(
9789            self,
9790            encoder: &mut fidl::encoding::Encoder<'_, D>,
9791            offset: usize,
9792            _depth: fidl::encoding::Depth,
9793        ) -> fidl::Result<()> {
9794            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9795            unsafe {
9796                // Copy the object into the buffer.
9797                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9798                (buf_ptr as *mut BaseSocketGetSendBufferResponse)
9799                    .write_unaligned((self as *const BaseSocketGetSendBufferResponse).read());
9800                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9801                // done second because the memcpy will write garbage to these bytes.
9802            }
9803            Ok(())
9804        }
9805    }
9806    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9807        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D> for (T0,)
9808    {
9809        #[inline]
9810        unsafe fn encode(
9811            self,
9812            encoder: &mut fidl::encoding::Encoder<'_, D>,
9813            offset: usize,
9814            depth: fidl::encoding::Depth,
9815        ) -> fidl::Result<()> {
9816            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9817            // Zero out padding regions. There's no need to apply masks
9818            // because the unmasked parts will be overwritten by fields.
9819            // Write the fields.
9820            self.0.encode(encoder, offset + 0, depth)?;
9821            Ok(())
9822        }
9823    }
9824
9825    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9826        for BaseSocketGetSendBufferResponse
9827    {
9828        #[inline(always)]
9829        fn new_empty() -> Self {
9830            Self { value_bytes: fidl::new_empty!(u64, D) }
9831        }
9832
9833        #[inline]
9834        unsafe fn decode(
9835            &mut self,
9836            decoder: &mut fidl::encoding::Decoder<'_, D>,
9837            offset: usize,
9838            _depth: fidl::encoding::Depth,
9839        ) -> fidl::Result<()> {
9840            decoder.debug_check_bounds::<Self>(offset);
9841            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9842            // Verify that padding bytes are zero.
9843            // Copy from the buffer into the object.
9844            unsafe {
9845                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9846            }
9847            Ok(())
9848        }
9849    }
9850
9851    impl fidl::encoding::ValueTypeMarker for BaseSocketGetTimestampResponse {
9852        type Borrowed<'a> = &'a Self;
9853        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9854            value
9855        }
9856    }
9857
9858    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetTimestampResponse {
9859        type Owned = Self;
9860
9861        #[inline(always)]
9862        fn inline_align(_context: fidl::encoding::Context) -> usize {
9863            4
9864        }
9865
9866        #[inline(always)]
9867        fn inline_size(_context: fidl::encoding::Context) -> usize {
9868            4
9869        }
9870    }
9871
9872    unsafe impl<D: fidl::encoding::ResourceDialect>
9873        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D>
9874        for &BaseSocketGetTimestampResponse
9875    {
9876        #[inline]
9877        unsafe fn encode(
9878            self,
9879            encoder: &mut fidl::encoding::Encoder<'_, D>,
9880            offset: usize,
9881            _depth: fidl::encoding::Depth,
9882        ) -> fidl::Result<()> {
9883            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9884            // Delegate to tuple encoding.
9885            fidl::encoding::Encode::<BaseSocketGetTimestampResponse, D>::encode(
9886                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9887                encoder,
9888                offset,
9889                _depth,
9890            )
9891        }
9892    }
9893    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
9894        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D> for (T0,)
9895    {
9896        #[inline]
9897        unsafe fn encode(
9898            self,
9899            encoder: &mut fidl::encoding::Encoder<'_, D>,
9900            offset: usize,
9901            depth: fidl::encoding::Depth,
9902        ) -> fidl::Result<()> {
9903            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9904            // Zero out padding regions. There's no need to apply masks
9905            // because the unmasked parts will be overwritten by fields.
9906            // Write the fields.
9907            self.0.encode(encoder, offset + 0, depth)?;
9908            Ok(())
9909        }
9910    }
9911
9912    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9913        for BaseSocketGetTimestampResponse
9914    {
9915        #[inline(always)]
9916        fn new_empty() -> Self {
9917            Self { value: fidl::new_empty!(TimestampOption, D) }
9918        }
9919
9920        #[inline]
9921        unsafe fn decode(
9922            &mut self,
9923            decoder: &mut fidl::encoding::Decoder<'_, D>,
9924            offset: usize,
9925            _depth: fidl::encoding::Depth,
9926        ) -> fidl::Result<()> {
9927            decoder.debug_check_bounds::<Self>(offset);
9928            // Verify that padding bytes are zero.
9929            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
9930            Ok(())
9931        }
9932    }
9933
9934    impl fidl::encoding::ValueTypeMarker for Empty {
9935        type Borrowed<'a> = &'a Self;
9936        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9937            value
9938        }
9939    }
9940
9941    unsafe impl fidl::encoding::TypeMarker for Empty {
9942        type Owned = Self;
9943
9944        #[inline(always)]
9945        fn inline_align(_context: fidl::encoding::Context) -> usize {
9946            1
9947        }
9948
9949        #[inline(always)]
9950        fn inline_size(_context: fidl::encoding::Context) -> usize {
9951            1
9952        }
9953    }
9954
9955    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
9956        #[inline]
9957        unsafe fn encode(
9958            self,
9959            encoder: &mut fidl::encoding::Encoder<'_, D>,
9960            offset: usize,
9961            _depth: fidl::encoding::Depth,
9962        ) -> fidl::Result<()> {
9963            encoder.debug_check_bounds::<Empty>(offset);
9964            encoder.write_num(0u8, offset);
9965            Ok(())
9966        }
9967    }
9968
9969    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
9970        #[inline(always)]
9971        fn new_empty() -> Self {
9972            Self
9973        }
9974
9975        #[inline]
9976        unsafe fn decode(
9977            &mut self,
9978            decoder: &mut fidl::encoding::Decoder<'_, D>,
9979            offset: usize,
9980            _depth: fidl::encoding::Depth,
9981        ) -> fidl::Result<()> {
9982            decoder.debug_check_bounds::<Self>(offset);
9983            match decoder.read_num::<u8>(offset) {
9984                0 => Ok(()),
9985                _ => Err(fidl::Error::Invalid),
9986            }
9987        }
9988    }
9989
9990    impl fidl::encoding::ValueTypeMarker for IpMulticastMembership {
9991        type Borrowed<'a> = &'a Self;
9992        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9993            value
9994        }
9995    }
9996
9997    unsafe impl fidl::encoding::TypeMarker for IpMulticastMembership {
9998        type Owned = Self;
9999
10000        #[inline(always)]
10001        fn inline_align(_context: fidl::encoding::Context) -> usize {
10002            8
10003        }
10004
10005        #[inline(always)]
10006        fn inline_size(_context: fidl::encoding::Context) -> usize {
10007            16
10008        }
10009    }
10010
10011    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpMulticastMembership, D>
10012        for &IpMulticastMembership
10013    {
10014        #[inline]
10015        unsafe fn encode(
10016            self,
10017            encoder: &mut fidl::encoding::Encoder<'_, D>,
10018            offset: usize,
10019            _depth: fidl::encoding::Depth,
10020        ) -> fidl::Result<()> {
10021            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
10022            // Delegate to tuple encoding.
10023            fidl::encoding::Encode::<IpMulticastMembership, D>::encode(
10024                (
10025                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10026                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
10027                    <fidl_fuchsia_net__common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
10028                ),
10029                encoder, offset, _depth
10030            )
10031        }
10032    }
10033    unsafe impl<
10034            D: fidl::encoding::ResourceDialect,
10035            T0: fidl::encoding::Encode<u64, D>,
10036            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
10037            T2: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4Address, D>,
10038        > fidl::encoding::Encode<IpMulticastMembership, D> for (T0, T1, T2)
10039    {
10040        #[inline]
10041        unsafe fn encode(
10042            self,
10043            encoder: &mut fidl::encoding::Encoder<'_, D>,
10044            offset: usize,
10045            depth: fidl::encoding::Depth,
10046        ) -> fidl::Result<()> {
10047            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
10048            // Zero out padding regions. There's no need to apply masks
10049            // because the unmasked parts will be overwritten by fields.
10050            // Write the fields.
10051            self.0.encode(encoder, offset + 0, depth)?;
10052            self.1.encode(encoder, offset + 8, depth)?;
10053            self.2.encode(encoder, offset + 12, depth)?;
10054            Ok(())
10055        }
10056    }
10057
10058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpMulticastMembership {
10059        #[inline(always)]
10060        fn new_empty() -> Self {
10061            Self {
10062                iface: fidl::new_empty!(u64, D),
10063                local_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D),
10064                mcast_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4Address, D),
10065            }
10066        }
10067
10068        #[inline]
10069        unsafe fn decode(
10070            &mut self,
10071            decoder: &mut fidl::encoding::Decoder<'_, D>,
10072            offset: usize,
10073            _depth: fidl::encoding::Depth,
10074        ) -> fidl::Result<()> {
10075            decoder.debug_check_bounds::<Self>(offset);
10076            // Verify that padding bytes are zero.
10077            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10078            fidl::decode!(
10079                fidl_fuchsia_net__common::Ipv4Address,
10080                D,
10081                &mut self.local_addr,
10082                decoder,
10083                offset + 8,
10084                _depth
10085            )?;
10086            fidl::decode!(
10087                fidl_fuchsia_net__common::Ipv4Address,
10088                D,
10089                &mut self.mcast_addr,
10090                decoder,
10091                offset + 12,
10092                _depth
10093            )?;
10094            Ok(())
10095        }
10096    }
10097
10098    impl fidl::encoding::ValueTypeMarker for Ipv6MulticastMembership {
10099        type Borrowed<'a> = &'a Self;
10100        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10101            value
10102        }
10103    }
10104
10105    unsafe impl fidl::encoding::TypeMarker for Ipv6MulticastMembership {
10106        type Owned = Self;
10107
10108        #[inline(always)]
10109        fn inline_align(_context: fidl::encoding::Context) -> usize {
10110            8
10111        }
10112
10113        #[inline(always)]
10114        fn inline_size(_context: fidl::encoding::Context) -> usize {
10115            24
10116        }
10117    }
10118
10119    unsafe impl<D: fidl::encoding::ResourceDialect>
10120        fidl::encoding::Encode<Ipv6MulticastMembership, D> for &Ipv6MulticastMembership
10121    {
10122        #[inline]
10123        unsafe fn encode(
10124            self,
10125            encoder: &mut fidl::encoding::Encoder<'_, D>,
10126            offset: usize,
10127            _depth: fidl::encoding::Depth,
10128        ) -> fidl::Result<()> {
10129            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
10130            // Delegate to tuple encoding.
10131            fidl::encoding::Encode::<Ipv6MulticastMembership, D>::encode(
10132                (
10133                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10134                    <fidl_fuchsia_net__common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
10135                ),
10136                encoder, offset, _depth
10137            )
10138        }
10139    }
10140    unsafe impl<
10141            D: fidl::encoding::ResourceDialect,
10142            T0: fidl::encoding::Encode<u64, D>,
10143            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6Address, D>,
10144        > fidl::encoding::Encode<Ipv6MulticastMembership, D> for (T0, T1)
10145    {
10146        #[inline]
10147        unsafe fn encode(
10148            self,
10149            encoder: &mut fidl::encoding::Encoder<'_, D>,
10150            offset: usize,
10151            depth: fidl::encoding::Depth,
10152        ) -> fidl::Result<()> {
10153            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
10154            // Zero out padding regions. There's no need to apply masks
10155            // because the unmasked parts will be overwritten by fields.
10156            // Write the fields.
10157            self.0.encode(encoder, offset + 0, depth)?;
10158            self.1.encode(encoder, offset + 8, depth)?;
10159            Ok(())
10160        }
10161    }
10162
10163    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10164        for Ipv6MulticastMembership
10165    {
10166        #[inline(always)]
10167        fn new_empty() -> Self {
10168            Self {
10169                iface: fidl::new_empty!(u64, D),
10170                mcast_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6Address, D),
10171            }
10172        }
10173
10174        #[inline]
10175        unsafe fn decode(
10176            &mut self,
10177            decoder: &mut fidl::encoding::Decoder<'_, D>,
10178            offset: usize,
10179            _depth: fidl::encoding::Depth,
10180        ) -> fidl::Result<()> {
10181            decoder.debug_check_bounds::<Self>(offset);
10182            // Verify that padding bytes are zero.
10183            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10184            fidl::decode!(
10185                fidl_fuchsia_net__common::Ipv6Address,
10186                D,
10187                &mut self.mcast_addr,
10188                decoder,
10189                offset + 8,
10190                _depth
10191            )?;
10192            Ok(())
10193        }
10194    }
10195
10196    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoRecvControlData {
10197        type Borrowed<'a> = &'a Self;
10198        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10199            value
10200        }
10201    }
10202
10203    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoRecvControlData {
10204        type Owned = Self;
10205
10206        #[inline(always)]
10207        fn inline_align(_context: fidl::encoding::Context) -> usize {
10208            8
10209        }
10210
10211        #[inline(always)]
10212        fn inline_size(_context: fidl::encoding::Context) -> usize {
10213            24
10214        }
10215    }
10216
10217    unsafe impl<D: fidl::encoding::ResourceDialect>
10218        fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for &Ipv6PktInfoRecvControlData
10219    {
10220        #[inline]
10221        unsafe fn encode(
10222            self,
10223            encoder: &mut fidl::encoding::Encoder<'_, D>,
10224            offset: usize,
10225            _depth: fidl::encoding::Depth,
10226        ) -> fidl::Result<()> {
10227            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
10228            // Delegate to tuple encoding.
10229            fidl::encoding::Encode::<Ipv6PktInfoRecvControlData, D>::encode(
10230                (
10231                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10232                    <fidl_fuchsia_net__common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.header_destination_addr),
10233                ),
10234                encoder, offset, _depth
10235            )
10236        }
10237    }
10238    unsafe impl<
10239            D: fidl::encoding::ResourceDialect,
10240            T0: fidl::encoding::Encode<u64, D>,
10241            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6Address, D>,
10242        > fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for (T0, T1)
10243    {
10244        #[inline]
10245        unsafe fn encode(
10246            self,
10247            encoder: &mut fidl::encoding::Encoder<'_, D>,
10248            offset: usize,
10249            depth: fidl::encoding::Depth,
10250        ) -> fidl::Result<()> {
10251            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
10252            // Zero out padding regions. There's no need to apply masks
10253            // because the unmasked parts will be overwritten by fields.
10254            // Write the fields.
10255            self.0.encode(encoder, offset + 0, depth)?;
10256            self.1.encode(encoder, offset + 8, depth)?;
10257            Ok(())
10258        }
10259    }
10260
10261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10262        for Ipv6PktInfoRecvControlData
10263    {
10264        #[inline(always)]
10265        fn new_empty() -> Self {
10266            Self {
10267                iface: fidl::new_empty!(u64, D),
10268                header_destination_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6Address, D),
10269            }
10270        }
10271
10272        #[inline]
10273        unsafe fn decode(
10274            &mut self,
10275            decoder: &mut fidl::encoding::Decoder<'_, D>,
10276            offset: usize,
10277            _depth: fidl::encoding::Depth,
10278        ) -> fidl::Result<()> {
10279            decoder.debug_check_bounds::<Self>(offset);
10280            // Verify that padding bytes are zero.
10281            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10282            fidl::decode!(
10283                fidl_fuchsia_net__common::Ipv6Address,
10284                D,
10285                &mut self.header_destination_addr,
10286                decoder,
10287                offset + 8,
10288                _depth
10289            )?;
10290            Ok(())
10291        }
10292    }
10293
10294    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoSendControlData {
10295        type Borrowed<'a> = &'a Self;
10296        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10297            value
10298        }
10299    }
10300
10301    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoSendControlData {
10302        type Owned = Self;
10303
10304        #[inline(always)]
10305        fn inline_align(_context: fidl::encoding::Context) -> usize {
10306            8
10307        }
10308
10309        #[inline(always)]
10310        fn inline_size(_context: fidl::encoding::Context) -> usize {
10311            24
10312        }
10313    }
10314
10315    unsafe impl<D: fidl::encoding::ResourceDialect>
10316        fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for &Ipv6PktInfoSendControlData
10317    {
10318        #[inline]
10319        unsafe fn encode(
10320            self,
10321            encoder: &mut fidl::encoding::Encoder<'_, D>,
10322            offset: usize,
10323            _depth: fidl::encoding::Depth,
10324        ) -> fidl::Result<()> {
10325            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
10326            // Delegate to tuple encoding.
10327            fidl::encoding::Encode::<Ipv6PktInfoSendControlData, D>::encode(
10328                (
10329                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10330                    <fidl_fuchsia_net__common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
10331                ),
10332                encoder, offset, _depth
10333            )
10334        }
10335    }
10336    unsafe impl<
10337            D: fidl::encoding::ResourceDialect,
10338            T0: fidl::encoding::Encode<u64, D>,
10339            T1: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6Address, D>,
10340        > fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for (T0, T1)
10341    {
10342        #[inline]
10343        unsafe fn encode(
10344            self,
10345            encoder: &mut fidl::encoding::Encoder<'_, D>,
10346            offset: usize,
10347            depth: fidl::encoding::Depth,
10348        ) -> fidl::Result<()> {
10349            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
10350            // Zero out padding regions. There's no need to apply masks
10351            // because the unmasked parts will be overwritten by fields.
10352            // Write the fields.
10353            self.0.encode(encoder, offset + 0, depth)?;
10354            self.1.encode(encoder, offset + 8, depth)?;
10355            Ok(())
10356        }
10357    }
10358
10359    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10360        for Ipv6PktInfoSendControlData
10361    {
10362        #[inline(always)]
10363        fn new_empty() -> Self {
10364            Self {
10365                iface: fidl::new_empty!(u64, D),
10366                local_addr: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6Address, D),
10367            }
10368        }
10369
10370        #[inline]
10371        unsafe fn decode(
10372            &mut self,
10373            decoder: &mut fidl::encoding::Decoder<'_, D>,
10374            offset: usize,
10375            _depth: fidl::encoding::Depth,
10376        ) -> fidl::Result<()> {
10377            decoder.debug_check_bounds::<Self>(offset);
10378            // Verify that padding bytes are zero.
10379            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10380            fidl::decode!(
10381                fidl_fuchsia_net__common::Ipv6Address,
10382                D,
10383                &mut self.local_addr,
10384                decoder,
10385                offset + 8,
10386                _depth
10387            )?;
10388            Ok(())
10389        }
10390    }
10391
10392    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketDeprecatedRequest {
10393        type Borrowed<'a> = &'a Self;
10394        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10395            value
10396        }
10397    }
10398
10399    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketDeprecatedRequest {
10400        type Owned = Self;
10401
10402        #[inline(always)]
10403        fn inline_align(_context: fidl::encoding::Context) -> usize {
10404            4
10405        }
10406
10407        #[inline(always)]
10408        fn inline_size(_context: fidl::encoding::Context) -> usize {
10409            8
10410        }
10411    }
10412
10413    unsafe impl<D: fidl::encoding::ResourceDialect>
10414        fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D>
10415        for &ProviderDatagramSocketDeprecatedRequest
10416    {
10417        #[inline]
10418        unsafe fn encode(
10419            self,
10420            encoder: &mut fidl::encoding::Encoder<'_, D>,
10421            offset: usize,
10422            _depth: fidl::encoding::Depth,
10423        ) -> fidl::Result<()> {
10424            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10425            // Delegate to tuple encoding.
10426            fidl::encoding::Encode::<ProviderDatagramSocketDeprecatedRequest, D>::encode(
10427                (
10428                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10429                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10430                        &self.proto,
10431                    ),
10432                ),
10433                encoder,
10434                offset,
10435                _depth,
10436            )
10437        }
10438    }
10439    unsafe impl<
10440            D: fidl::encoding::ResourceDialect,
10441            T0: fidl::encoding::Encode<Domain, D>,
10442            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10443        > fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D> for (T0, T1)
10444    {
10445        #[inline]
10446        unsafe fn encode(
10447            self,
10448            encoder: &mut fidl::encoding::Encoder<'_, D>,
10449            offset: usize,
10450            depth: fidl::encoding::Depth,
10451        ) -> fidl::Result<()> {
10452            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10453            // Zero out padding regions. There's no need to apply masks
10454            // because the unmasked parts will be overwritten by fields.
10455            unsafe {
10456                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10457                (ptr as *mut u32).write_unaligned(0);
10458            }
10459            // Write the fields.
10460            self.0.encode(encoder, offset + 0, depth)?;
10461            self.1.encode(encoder, offset + 4, depth)?;
10462            Ok(())
10463        }
10464    }
10465
10466    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10467        for ProviderDatagramSocketDeprecatedRequest
10468    {
10469        #[inline(always)]
10470        fn new_empty() -> Self {
10471            Self {
10472                domain: fidl::new_empty!(Domain, D),
10473                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10474            }
10475        }
10476
10477        #[inline]
10478        unsafe fn decode(
10479            &mut self,
10480            decoder: &mut fidl::encoding::Decoder<'_, D>,
10481            offset: usize,
10482            _depth: fidl::encoding::Depth,
10483        ) -> fidl::Result<()> {
10484            decoder.debug_check_bounds::<Self>(offset);
10485            // Verify that padding bytes are zero.
10486            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10487            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10488            let mask = 0xffff0000u32;
10489            let maskedval = padval & mask;
10490            if maskedval != 0 {
10491                return Err(fidl::Error::NonZeroPadding {
10492                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10493                });
10494            }
10495            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10496            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10497            Ok(())
10498        }
10499    }
10500
10501    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketRequest {
10502        type Borrowed<'a> = &'a Self;
10503        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10504            value
10505        }
10506    }
10507
10508    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketRequest {
10509        type Owned = Self;
10510
10511        #[inline(always)]
10512        fn inline_align(_context: fidl::encoding::Context) -> usize {
10513            4
10514        }
10515
10516        #[inline(always)]
10517        fn inline_size(_context: fidl::encoding::Context) -> usize {
10518            8
10519        }
10520    }
10521
10522    unsafe impl<D: fidl::encoding::ResourceDialect>
10523        fidl::encoding::Encode<ProviderDatagramSocketRequest, D>
10524        for &ProviderDatagramSocketRequest
10525    {
10526        #[inline]
10527        unsafe fn encode(
10528            self,
10529            encoder: &mut fidl::encoding::Encoder<'_, D>,
10530            offset: usize,
10531            _depth: fidl::encoding::Depth,
10532        ) -> fidl::Result<()> {
10533            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10534            // Delegate to tuple encoding.
10535            fidl::encoding::Encode::<ProviderDatagramSocketRequest, D>::encode(
10536                (
10537                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10538                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10539                        &self.proto,
10540                    ),
10541                ),
10542                encoder,
10543                offset,
10544                _depth,
10545            )
10546        }
10547    }
10548    unsafe impl<
10549            D: fidl::encoding::ResourceDialect,
10550            T0: fidl::encoding::Encode<Domain, D>,
10551            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10552        > fidl::encoding::Encode<ProviderDatagramSocketRequest, D> for (T0, T1)
10553    {
10554        #[inline]
10555        unsafe fn encode(
10556            self,
10557            encoder: &mut fidl::encoding::Encoder<'_, D>,
10558            offset: usize,
10559            depth: fidl::encoding::Depth,
10560        ) -> fidl::Result<()> {
10561            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10562            // Zero out padding regions. There's no need to apply masks
10563            // because the unmasked parts will be overwritten by fields.
10564            unsafe {
10565                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10566                (ptr as *mut u32).write_unaligned(0);
10567            }
10568            // Write the fields.
10569            self.0.encode(encoder, offset + 0, depth)?;
10570            self.1.encode(encoder, offset + 4, depth)?;
10571            Ok(())
10572        }
10573    }
10574
10575    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10576        for ProviderDatagramSocketRequest
10577    {
10578        #[inline(always)]
10579        fn new_empty() -> Self {
10580            Self {
10581                domain: fidl::new_empty!(Domain, D),
10582                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10583            }
10584        }
10585
10586        #[inline]
10587        unsafe fn decode(
10588            &mut self,
10589            decoder: &mut fidl::encoding::Decoder<'_, D>,
10590            offset: usize,
10591            _depth: fidl::encoding::Depth,
10592        ) -> fidl::Result<()> {
10593            decoder.debug_check_bounds::<Self>(offset);
10594            // Verify that padding bytes are zero.
10595            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10596            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10597            let mask = 0xffff0000u32;
10598            let maskedval = padval & mask;
10599            if maskedval != 0 {
10600                return Err(fidl::Error::NonZeroPadding {
10601                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10602                });
10603            }
10604            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10605            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10606            Ok(())
10607        }
10608    }
10609
10610    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketWithOptionsRequest {
10611        type Borrowed<'a> = &'a Self;
10612        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10613            value
10614        }
10615    }
10616
10617    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketWithOptionsRequest {
10618        type Owned = Self;
10619
10620        #[inline(always)]
10621        fn inline_align(_context: fidl::encoding::Context) -> usize {
10622            8
10623        }
10624
10625        #[inline(always)]
10626        fn inline_size(_context: fidl::encoding::Context) -> usize {
10627            24
10628        }
10629    }
10630
10631    unsafe impl<D: fidl::encoding::ResourceDialect>
10632        fidl::encoding::Encode<ProviderDatagramSocketWithOptionsRequest, D>
10633        for &ProviderDatagramSocketWithOptionsRequest
10634    {
10635        #[inline]
10636        unsafe fn encode(
10637            self,
10638            encoder: &mut fidl::encoding::Encoder<'_, D>,
10639            offset: usize,
10640            _depth: fidl::encoding::Depth,
10641        ) -> fidl::Result<()> {
10642            encoder.debug_check_bounds::<ProviderDatagramSocketWithOptionsRequest>(offset);
10643            // Delegate to tuple encoding.
10644            fidl::encoding::Encode::<ProviderDatagramSocketWithOptionsRequest, D>::encode(
10645                (
10646                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10647                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10648                        &self.proto,
10649                    ),
10650                    <SocketCreationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.opts),
10651                ),
10652                encoder,
10653                offset,
10654                _depth,
10655            )
10656        }
10657    }
10658    unsafe impl<
10659            D: fidl::encoding::ResourceDialect,
10660            T0: fidl::encoding::Encode<Domain, D>,
10661            T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10662            T2: fidl::encoding::Encode<SocketCreationOptions, D>,
10663        > fidl::encoding::Encode<ProviderDatagramSocketWithOptionsRequest, D> for (T0, T1, T2)
10664    {
10665        #[inline]
10666        unsafe fn encode(
10667            self,
10668            encoder: &mut fidl::encoding::Encoder<'_, D>,
10669            offset: usize,
10670            depth: fidl::encoding::Depth,
10671        ) -> fidl::Result<()> {
10672            encoder.debug_check_bounds::<ProviderDatagramSocketWithOptionsRequest>(offset);
10673            // Zero out padding regions. There's no need to apply masks
10674            // because the unmasked parts will be overwritten by fields.
10675            unsafe {
10676                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10677                (ptr as *mut u64).write_unaligned(0);
10678            }
10679            // Write the fields.
10680            self.0.encode(encoder, offset + 0, depth)?;
10681            self.1.encode(encoder, offset + 4, depth)?;
10682            self.2.encode(encoder, offset + 8, depth)?;
10683            Ok(())
10684        }
10685    }
10686
10687    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10688        for ProviderDatagramSocketWithOptionsRequest
10689    {
10690        #[inline(always)]
10691        fn new_empty() -> Self {
10692            Self {
10693                domain: fidl::new_empty!(Domain, D),
10694                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10695                opts: fidl::new_empty!(SocketCreationOptions, D),
10696            }
10697        }
10698
10699        #[inline]
10700        unsafe fn decode(
10701            &mut self,
10702            decoder: &mut fidl::encoding::Decoder<'_, D>,
10703            offset: usize,
10704            _depth: fidl::encoding::Depth,
10705        ) -> fidl::Result<()> {
10706            decoder.debug_check_bounds::<Self>(offset);
10707            // Verify that padding bytes are zero.
10708            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10709            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10710            let mask = 0xffff0000u64;
10711            let maskedval = padval & mask;
10712            if maskedval != 0 {
10713                return Err(fidl::Error::NonZeroPadding {
10714                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10715                });
10716            }
10717            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10718            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10719            fidl::decode!(SocketCreationOptions, D, &mut self.opts, decoder, offset + 8, _depth)?;
10720            Ok(())
10721        }
10722    }
10723
10724    impl fidl::encoding::ValueTypeMarker for ProviderGetInterfaceAddressesResponse {
10725        type Borrowed<'a> = &'a Self;
10726        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10727            value
10728        }
10729    }
10730
10731    unsafe impl fidl::encoding::TypeMarker for ProviderGetInterfaceAddressesResponse {
10732        type Owned = Self;
10733
10734        #[inline(always)]
10735        fn inline_align(_context: fidl::encoding::Context) -> usize {
10736            8
10737        }
10738
10739        #[inline(always)]
10740        fn inline_size(_context: fidl::encoding::Context) -> usize {
10741            16
10742        }
10743    }
10744
10745    unsafe impl<D: fidl::encoding::ResourceDialect>
10746        fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D>
10747        for &ProviderGetInterfaceAddressesResponse
10748    {
10749        #[inline]
10750        unsafe fn encode(
10751            self,
10752            encoder: &mut fidl::encoding::Encoder<'_, D>,
10753            offset: usize,
10754            _depth: fidl::encoding::Depth,
10755        ) -> fidl::Result<()> {
10756            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10757            // Delegate to tuple encoding.
10758            fidl::encoding::Encode::<ProviderGetInterfaceAddressesResponse, D>::encode(
10759                (
10760                    <fidl::encoding::UnboundedVector<InterfaceAddresses> as fidl::encoding::ValueTypeMarker>::borrow(&self.interfaces),
10761                ),
10762                encoder, offset, _depth
10763            )
10764        }
10765    }
10766    unsafe impl<
10767            D: fidl::encoding::ResourceDialect,
10768            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<InterfaceAddresses>, D>,
10769        > fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D> for (T0,)
10770    {
10771        #[inline]
10772        unsafe fn encode(
10773            self,
10774            encoder: &mut fidl::encoding::Encoder<'_, D>,
10775            offset: usize,
10776            depth: fidl::encoding::Depth,
10777        ) -> fidl::Result<()> {
10778            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10779            // Zero out padding regions. There's no need to apply masks
10780            // because the unmasked parts will be overwritten by fields.
10781            // Write the fields.
10782            self.0.encode(encoder, offset + 0, depth)?;
10783            Ok(())
10784        }
10785    }
10786
10787    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10788        for ProviderGetInterfaceAddressesResponse
10789    {
10790        #[inline(always)]
10791        fn new_empty() -> Self {
10792            Self {
10793                interfaces: fidl::new_empty!(
10794                    fidl::encoding::UnboundedVector<InterfaceAddresses>,
10795                    D
10796                ),
10797            }
10798        }
10799
10800        #[inline]
10801        unsafe fn decode(
10802            &mut self,
10803            decoder: &mut fidl::encoding::Decoder<'_, D>,
10804            offset: usize,
10805            _depth: fidl::encoding::Depth,
10806        ) -> fidl::Result<()> {
10807            decoder.debug_check_bounds::<Self>(offset);
10808            // Verify that padding bytes are zero.
10809            fidl::decode!(
10810                fidl::encoding::UnboundedVector<InterfaceAddresses>,
10811                D,
10812                &mut self.interfaces,
10813                decoder,
10814                offset + 0,
10815                _depth
10816            )?;
10817            Ok(())
10818        }
10819    }
10820
10821    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameRequest {
10822        type Borrowed<'a> = &'a Self;
10823        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10824            value
10825        }
10826    }
10827
10828    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameRequest {
10829        type Owned = Self;
10830
10831        #[inline(always)]
10832        fn inline_align(_context: fidl::encoding::Context) -> usize {
10833            8
10834        }
10835
10836        #[inline(always)]
10837        fn inline_size(_context: fidl::encoding::Context) -> usize {
10838            8
10839        }
10840        #[inline(always)]
10841        fn encode_is_copy() -> bool {
10842            true
10843        }
10844
10845        #[inline(always)]
10846        fn decode_is_copy() -> bool {
10847            true
10848        }
10849    }
10850
10851    unsafe impl<D: fidl::encoding::ResourceDialect>
10852        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D>
10853        for &ProviderInterfaceIndexToNameRequest
10854    {
10855        #[inline]
10856        unsafe fn encode(
10857            self,
10858            encoder: &mut fidl::encoding::Encoder<'_, D>,
10859            offset: usize,
10860            _depth: fidl::encoding::Depth,
10861        ) -> fidl::Result<()> {
10862            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10863            unsafe {
10864                // Copy the object into the buffer.
10865                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10866                (buf_ptr as *mut ProviderInterfaceIndexToNameRequest)
10867                    .write_unaligned((self as *const ProviderInterfaceIndexToNameRequest).read());
10868                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10869                // done second because the memcpy will write garbage to these bytes.
10870            }
10871            Ok(())
10872        }
10873    }
10874    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
10875        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D> for (T0,)
10876    {
10877        #[inline]
10878        unsafe fn encode(
10879            self,
10880            encoder: &mut fidl::encoding::Encoder<'_, D>,
10881            offset: usize,
10882            depth: fidl::encoding::Depth,
10883        ) -> fidl::Result<()> {
10884            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10885            // Zero out padding regions. There's no need to apply masks
10886            // because the unmasked parts will be overwritten by fields.
10887            // Write the fields.
10888            self.0.encode(encoder, offset + 0, depth)?;
10889            Ok(())
10890        }
10891    }
10892
10893    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10894        for ProviderInterfaceIndexToNameRequest
10895    {
10896        #[inline(always)]
10897        fn new_empty() -> Self {
10898            Self { index: fidl::new_empty!(u64, D) }
10899        }
10900
10901        #[inline]
10902        unsafe fn decode(
10903            &mut self,
10904            decoder: &mut fidl::encoding::Decoder<'_, D>,
10905            offset: usize,
10906            _depth: fidl::encoding::Depth,
10907        ) -> fidl::Result<()> {
10908            decoder.debug_check_bounds::<Self>(offset);
10909            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10910            // Verify that padding bytes are zero.
10911            // Copy from the buffer into the object.
10912            unsafe {
10913                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10914            }
10915            Ok(())
10916        }
10917    }
10918
10919    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsRequest {
10920        type Borrowed<'a> = &'a Self;
10921        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10922            value
10923        }
10924    }
10925
10926    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsRequest {
10927        type Owned = Self;
10928
10929        #[inline(always)]
10930        fn inline_align(_context: fidl::encoding::Context) -> usize {
10931            8
10932        }
10933
10934        #[inline(always)]
10935        fn inline_size(_context: fidl::encoding::Context) -> usize {
10936            16
10937        }
10938    }
10939
10940    unsafe impl<D: fidl::encoding::ResourceDialect>
10941        fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D>
10942        for &ProviderInterfaceNameToFlagsRequest
10943    {
10944        #[inline]
10945        unsafe fn encode(
10946            self,
10947            encoder: &mut fidl::encoding::Encoder<'_, D>,
10948            offset: usize,
10949            _depth: fidl::encoding::Depth,
10950        ) -> fidl::Result<()> {
10951            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10952            // Delegate to tuple encoding.
10953            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsRequest, D>::encode(
10954                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10955                    &self.name,
10956                ),),
10957                encoder,
10958                offset,
10959                _depth,
10960            )
10961        }
10962    }
10963    unsafe impl<
10964            D: fidl::encoding::ResourceDialect,
10965            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10966        > fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D> for (T0,)
10967    {
10968        #[inline]
10969        unsafe fn encode(
10970            self,
10971            encoder: &mut fidl::encoding::Encoder<'_, D>,
10972            offset: usize,
10973            depth: fidl::encoding::Depth,
10974        ) -> fidl::Result<()> {
10975            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10976            // Zero out padding regions. There's no need to apply masks
10977            // because the unmasked parts will be overwritten by fields.
10978            // Write the fields.
10979            self.0.encode(encoder, offset + 0, depth)?;
10980            Ok(())
10981        }
10982    }
10983
10984    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10985        for ProviderInterfaceNameToFlagsRequest
10986    {
10987        #[inline(always)]
10988        fn new_empty() -> Self {
10989            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10990        }
10991
10992        #[inline]
10993        unsafe fn decode(
10994            &mut self,
10995            decoder: &mut fidl::encoding::Decoder<'_, D>,
10996            offset: usize,
10997            _depth: fidl::encoding::Depth,
10998        ) -> fidl::Result<()> {
10999            decoder.debug_check_bounds::<Self>(offset);
11000            // Verify that padding bytes are zero.
11001            fidl::decode!(
11002                fidl::encoding::BoundedString<15>,
11003                D,
11004                &mut self.name,
11005                decoder,
11006                offset + 0,
11007                _depth
11008            )?;
11009            Ok(())
11010        }
11011    }
11012
11013    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexRequest {
11014        type Borrowed<'a> = &'a Self;
11015        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11016            value
11017        }
11018    }
11019
11020    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexRequest {
11021        type Owned = Self;
11022
11023        #[inline(always)]
11024        fn inline_align(_context: fidl::encoding::Context) -> usize {
11025            8
11026        }
11027
11028        #[inline(always)]
11029        fn inline_size(_context: fidl::encoding::Context) -> usize {
11030            16
11031        }
11032    }
11033
11034    unsafe impl<D: fidl::encoding::ResourceDialect>
11035        fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D>
11036        for &ProviderInterfaceNameToIndexRequest
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::<ProviderInterfaceNameToIndexRequest>(offset);
11046            // Delegate to tuple encoding.
11047            fidl::encoding::Encode::<ProviderInterfaceNameToIndexRequest, D>::encode(
11048                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
11049                    &self.name,
11050                ),),
11051                encoder,
11052                offset,
11053                _depth,
11054            )
11055        }
11056    }
11057    unsafe impl<
11058            D: fidl::encoding::ResourceDialect,
11059            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
11060        > fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D> for (T0,)
11061    {
11062        #[inline]
11063        unsafe fn encode(
11064            self,
11065            encoder: &mut fidl::encoding::Encoder<'_, D>,
11066            offset: usize,
11067            depth: fidl::encoding::Depth,
11068        ) -> fidl::Result<()> {
11069            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
11070            // Zero out padding regions. There's no need to apply masks
11071            // because the unmasked parts will be overwritten by fields.
11072            // Write the fields.
11073            self.0.encode(encoder, offset + 0, depth)?;
11074            Ok(())
11075        }
11076    }
11077
11078    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11079        for ProviderInterfaceNameToIndexRequest
11080    {
11081        #[inline(always)]
11082        fn new_empty() -> Self {
11083            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
11084        }
11085
11086        #[inline]
11087        unsafe fn decode(
11088            &mut self,
11089            decoder: &mut fidl::encoding::Decoder<'_, D>,
11090            offset: usize,
11091            _depth: fidl::encoding::Depth,
11092        ) -> fidl::Result<()> {
11093            decoder.debug_check_bounds::<Self>(offset);
11094            // Verify that padding bytes are zero.
11095            fidl::decode!(
11096                fidl::encoding::BoundedString<15>,
11097                D,
11098                &mut self.name,
11099                decoder,
11100                offset + 0,
11101                _depth
11102            )?;
11103            Ok(())
11104        }
11105    }
11106
11107    impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketRequest {
11108        type Borrowed<'a> = &'a Self;
11109        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11110            value
11111        }
11112    }
11113
11114    unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketRequest {
11115        type Owned = Self;
11116
11117        #[inline(always)]
11118        fn inline_align(_context: fidl::encoding::Context) -> usize {
11119            4
11120        }
11121
11122        #[inline(always)]
11123        fn inline_size(_context: fidl::encoding::Context) -> usize {
11124            8
11125        }
11126    }
11127
11128    unsafe impl<D: fidl::encoding::ResourceDialect>
11129        fidl::encoding::Encode<ProviderStreamSocketRequest, D> for &ProviderStreamSocketRequest
11130    {
11131        #[inline]
11132        unsafe fn encode(
11133            self,
11134            encoder: &mut fidl::encoding::Encoder<'_, D>,
11135            offset: usize,
11136            _depth: fidl::encoding::Depth,
11137        ) -> fidl::Result<()> {
11138            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
11139            // Delegate to tuple encoding.
11140            fidl::encoding::Encode::<ProviderStreamSocketRequest, D>::encode(
11141                (
11142                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
11143                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
11144                ),
11145                encoder,
11146                offset,
11147                _depth,
11148            )
11149        }
11150    }
11151    unsafe impl<
11152            D: fidl::encoding::ResourceDialect,
11153            T0: fidl::encoding::Encode<Domain, D>,
11154            T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
11155        > fidl::encoding::Encode<ProviderStreamSocketRequest, D> for (T0, T1)
11156    {
11157        #[inline]
11158        unsafe fn encode(
11159            self,
11160            encoder: &mut fidl::encoding::Encoder<'_, D>,
11161            offset: usize,
11162            depth: fidl::encoding::Depth,
11163        ) -> fidl::Result<()> {
11164            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
11165            // Zero out padding regions. There's no need to apply masks
11166            // because the unmasked parts will be overwritten by fields.
11167            unsafe {
11168                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11169                (ptr as *mut u32).write_unaligned(0);
11170            }
11171            // Write the fields.
11172            self.0.encode(encoder, offset + 0, depth)?;
11173            self.1.encode(encoder, offset + 4, depth)?;
11174            Ok(())
11175        }
11176    }
11177
11178    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11179        for ProviderStreamSocketRequest
11180    {
11181        #[inline(always)]
11182        fn new_empty() -> Self {
11183            Self {
11184                domain: fidl::new_empty!(Domain, D),
11185                proto: fidl::new_empty!(StreamSocketProtocol, D),
11186            }
11187        }
11188
11189        #[inline]
11190        unsafe fn decode(
11191            &mut self,
11192            decoder: &mut fidl::encoding::Decoder<'_, D>,
11193            offset: usize,
11194            _depth: fidl::encoding::Depth,
11195        ) -> fidl::Result<()> {
11196            decoder.debug_check_bounds::<Self>(offset);
11197            // Verify that padding bytes are zero.
11198            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11199            let padval = unsafe { (ptr as *const u32).read_unaligned() };
11200            let mask = 0xffff0000u32;
11201            let maskedval = padval & mask;
11202            if maskedval != 0 {
11203                return Err(fidl::Error::NonZeroPadding {
11204                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11205                });
11206            }
11207            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
11208            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
11209            Ok(())
11210        }
11211    }
11212
11213    impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketWithOptionsRequest {
11214        type Borrowed<'a> = &'a Self;
11215        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11216            value
11217        }
11218    }
11219
11220    unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketWithOptionsRequest {
11221        type Owned = Self;
11222
11223        #[inline(always)]
11224        fn inline_align(_context: fidl::encoding::Context) -> usize {
11225            8
11226        }
11227
11228        #[inline(always)]
11229        fn inline_size(_context: fidl::encoding::Context) -> usize {
11230            24
11231        }
11232    }
11233
11234    unsafe impl<D: fidl::encoding::ResourceDialect>
11235        fidl::encoding::Encode<ProviderStreamSocketWithOptionsRequest, D>
11236        for &ProviderStreamSocketWithOptionsRequest
11237    {
11238        #[inline]
11239        unsafe fn encode(
11240            self,
11241            encoder: &mut fidl::encoding::Encoder<'_, D>,
11242            offset: usize,
11243            _depth: fidl::encoding::Depth,
11244        ) -> fidl::Result<()> {
11245            encoder.debug_check_bounds::<ProviderStreamSocketWithOptionsRequest>(offset);
11246            // Delegate to tuple encoding.
11247            fidl::encoding::Encode::<ProviderStreamSocketWithOptionsRequest, D>::encode(
11248                (
11249                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
11250                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
11251                    <SocketCreationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.opts),
11252                ),
11253                encoder,
11254                offset,
11255                _depth,
11256            )
11257        }
11258    }
11259    unsafe impl<
11260            D: fidl::encoding::ResourceDialect,
11261            T0: fidl::encoding::Encode<Domain, D>,
11262            T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
11263            T2: fidl::encoding::Encode<SocketCreationOptions, D>,
11264        > fidl::encoding::Encode<ProviderStreamSocketWithOptionsRequest, D> for (T0, T1, T2)
11265    {
11266        #[inline]
11267        unsafe fn encode(
11268            self,
11269            encoder: &mut fidl::encoding::Encoder<'_, D>,
11270            offset: usize,
11271            depth: fidl::encoding::Depth,
11272        ) -> fidl::Result<()> {
11273            encoder.debug_check_bounds::<ProviderStreamSocketWithOptionsRequest>(offset);
11274            // Zero out padding regions. There's no need to apply masks
11275            // because the unmasked parts will be overwritten by fields.
11276            unsafe {
11277                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11278                (ptr as *mut u64).write_unaligned(0);
11279            }
11280            // Write the fields.
11281            self.0.encode(encoder, offset + 0, depth)?;
11282            self.1.encode(encoder, offset + 4, depth)?;
11283            self.2.encode(encoder, offset + 8, depth)?;
11284            Ok(())
11285        }
11286    }
11287
11288    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11289        for ProviderStreamSocketWithOptionsRequest
11290    {
11291        #[inline(always)]
11292        fn new_empty() -> Self {
11293            Self {
11294                domain: fidl::new_empty!(Domain, D),
11295                proto: fidl::new_empty!(StreamSocketProtocol, D),
11296                opts: fidl::new_empty!(SocketCreationOptions, D),
11297            }
11298        }
11299
11300        #[inline]
11301        unsafe fn decode(
11302            &mut self,
11303            decoder: &mut fidl::encoding::Decoder<'_, D>,
11304            offset: usize,
11305            _depth: fidl::encoding::Depth,
11306        ) -> fidl::Result<()> {
11307            decoder.debug_check_bounds::<Self>(offset);
11308            // Verify that padding bytes are zero.
11309            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11310            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11311            let mask = 0xffff0000u64;
11312            let maskedval = padval & mask;
11313            if maskedval != 0 {
11314                return Err(fidl::Error::NonZeroPadding {
11315                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11316                });
11317            }
11318            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
11319            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
11320            fidl::decode!(SocketCreationOptions, D, &mut self.opts, decoder, offset + 8, _depth)?;
11321            Ok(())
11322        }
11323    }
11324
11325    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameResponse {
11326        type Borrowed<'a> = &'a Self;
11327        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11328            value
11329        }
11330    }
11331
11332    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameResponse {
11333        type Owned = Self;
11334
11335        #[inline(always)]
11336        fn inline_align(_context: fidl::encoding::Context) -> usize {
11337            8
11338        }
11339
11340        #[inline(always)]
11341        fn inline_size(_context: fidl::encoding::Context) -> usize {
11342            16
11343        }
11344    }
11345
11346    unsafe impl<D: fidl::encoding::ResourceDialect>
11347        fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D>
11348        for &ProviderInterfaceIndexToNameResponse
11349    {
11350        #[inline]
11351        unsafe fn encode(
11352            self,
11353            encoder: &mut fidl::encoding::Encoder<'_, D>,
11354            offset: usize,
11355            _depth: fidl::encoding::Depth,
11356        ) -> fidl::Result<()> {
11357            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
11358            // Delegate to tuple encoding.
11359            fidl::encoding::Encode::<ProviderInterfaceIndexToNameResponse, D>::encode(
11360                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
11361                    &self.name,
11362                ),),
11363                encoder,
11364                offset,
11365                _depth,
11366            )
11367        }
11368    }
11369    unsafe impl<
11370            D: fidl::encoding::ResourceDialect,
11371            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
11372        > fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D> for (T0,)
11373    {
11374        #[inline]
11375        unsafe fn encode(
11376            self,
11377            encoder: &mut fidl::encoding::Encoder<'_, D>,
11378            offset: usize,
11379            depth: fidl::encoding::Depth,
11380        ) -> fidl::Result<()> {
11381            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
11382            // Zero out padding regions. There's no need to apply masks
11383            // because the unmasked parts will be overwritten by fields.
11384            // Write the fields.
11385            self.0.encode(encoder, offset + 0, depth)?;
11386            Ok(())
11387        }
11388    }
11389
11390    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11391        for ProviderInterfaceIndexToNameResponse
11392    {
11393        #[inline(always)]
11394        fn new_empty() -> Self {
11395            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
11396        }
11397
11398        #[inline]
11399        unsafe fn decode(
11400            &mut self,
11401            decoder: &mut fidl::encoding::Decoder<'_, D>,
11402            offset: usize,
11403            _depth: fidl::encoding::Depth,
11404        ) -> fidl::Result<()> {
11405            decoder.debug_check_bounds::<Self>(offset);
11406            // Verify that padding bytes are zero.
11407            fidl::decode!(
11408                fidl::encoding::BoundedString<15>,
11409                D,
11410                &mut self.name,
11411                decoder,
11412                offset + 0,
11413                _depth
11414            )?;
11415            Ok(())
11416        }
11417    }
11418
11419    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsResponse {
11420        type Borrowed<'a> = &'a Self;
11421        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11422            value
11423        }
11424    }
11425
11426    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsResponse {
11427        type Owned = Self;
11428
11429        #[inline(always)]
11430        fn inline_align(_context: fidl::encoding::Context) -> usize {
11431            2
11432        }
11433
11434        #[inline(always)]
11435        fn inline_size(_context: fidl::encoding::Context) -> usize {
11436            2
11437        }
11438    }
11439
11440    unsafe impl<D: fidl::encoding::ResourceDialect>
11441        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D>
11442        for &ProviderInterfaceNameToFlagsResponse
11443    {
11444        #[inline]
11445        unsafe fn encode(
11446            self,
11447            encoder: &mut fidl::encoding::Encoder<'_, D>,
11448            offset: usize,
11449            _depth: fidl::encoding::Depth,
11450        ) -> fidl::Result<()> {
11451            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11452            // Delegate to tuple encoding.
11453            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsResponse, D>::encode(
11454                (<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
11455                encoder,
11456                offset,
11457                _depth,
11458            )
11459        }
11460    }
11461    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<InterfaceFlags, D>>
11462        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D> for (T0,)
11463    {
11464        #[inline]
11465        unsafe fn encode(
11466            self,
11467            encoder: &mut fidl::encoding::Encoder<'_, D>,
11468            offset: usize,
11469            depth: fidl::encoding::Depth,
11470        ) -> fidl::Result<()> {
11471            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11472            // Zero out padding regions. There's no need to apply masks
11473            // because the unmasked parts will be overwritten by fields.
11474            // Write the fields.
11475            self.0.encode(encoder, offset + 0, depth)?;
11476            Ok(())
11477        }
11478    }
11479
11480    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11481        for ProviderInterfaceNameToFlagsResponse
11482    {
11483        #[inline(always)]
11484        fn new_empty() -> Self {
11485            Self { flags: fidl::new_empty!(InterfaceFlags, D) }
11486        }
11487
11488        #[inline]
11489        unsafe fn decode(
11490            &mut self,
11491            decoder: &mut fidl::encoding::Decoder<'_, D>,
11492            offset: usize,
11493            _depth: fidl::encoding::Depth,
11494        ) -> fidl::Result<()> {
11495            decoder.debug_check_bounds::<Self>(offset);
11496            // Verify that padding bytes are zero.
11497            fidl::decode!(InterfaceFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
11498            Ok(())
11499        }
11500    }
11501
11502    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexResponse {
11503        type Borrowed<'a> = &'a Self;
11504        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11505            value
11506        }
11507    }
11508
11509    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexResponse {
11510        type Owned = Self;
11511
11512        #[inline(always)]
11513        fn inline_align(_context: fidl::encoding::Context) -> usize {
11514            8
11515        }
11516
11517        #[inline(always)]
11518        fn inline_size(_context: fidl::encoding::Context) -> usize {
11519            8
11520        }
11521        #[inline(always)]
11522        fn encode_is_copy() -> bool {
11523            true
11524        }
11525
11526        #[inline(always)]
11527        fn decode_is_copy() -> bool {
11528            true
11529        }
11530    }
11531
11532    unsafe impl<D: fidl::encoding::ResourceDialect>
11533        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D>
11534        for &ProviderInterfaceNameToIndexResponse
11535    {
11536        #[inline]
11537        unsafe fn encode(
11538            self,
11539            encoder: &mut fidl::encoding::Encoder<'_, D>,
11540            offset: usize,
11541            _depth: fidl::encoding::Depth,
11542        ) -> fidl::Result<()> {
11543            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11544            unsafe {
11545                // Copy the object into the buffer.
11546                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11547                (buf_ptr as *mut ProviderInterfaceNameToIndexResponse)
11548                    .write_unaligned((self as *const ProviderInterfaceNameToIndexResponse).read());
11549                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11550                // done second because the memcpy will write garbage to these bytes.
11551            }
11552            Ok(())
11553        }
11554    }
11555    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11556        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D> for (T0,)
11557    {
11558        #[inline]
11559        unsafe fn encode(
11560            self,
11561            encoder: &mut fidl::encoding::Encoder<'_, D>,
11562            offset: usize,
11563            depth: fidl::encoding::Depth,
11564        ) -> fidl::Result<()> {
11565            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11566            // Zero out padding regions. There's no need to apply masks
11567            // because the unmasked parts will be overwritten by fields.
11568            // Write the fields.
11569            self.0.encode(encoder, offset + 0, depth)?;
11570            Ok(())
11571        }
11572    }
11573
11574    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11575        for ProviderInterfaceNameToIndexResponse
11576    {
11577        #[inline(always)]
11578        fn new_empty() -> Self {
11579            Self { index: fidl::new_empty!(u64, D) }
11580        }
11581
11582        #[inline]
11583        unsafe fn decode(
11584            &mut self,
11585            decoder: &mut fidl::encoding::Decoder<'_, D>,
11586            offset: usize,
11587            _depth: fidl::encoding::Depth,
11588        ) -> fidl::Result<()> {
11589            decoder.debug_check_bounds::<Self>(offset);
11590            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11591            // Verify that padding bytes are zero.
11592            // Copy from the buffer into the object.
11593            unsafe {
11594                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11595            }
11596            Ok(())
11597        }
11598    }
11599
11600    impl fidl::encoding::ValueTypeMarker for StreamSocketAcceptRequest {
11601        type Borrowed<'a> = &'a Self;
11602        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11603            value
11604        }
11605    }
11606
11607    unsafe impl fidl::encoding::TypeMarker for StreamSocketAcceptRequest {
11608        type Owned = Self;
11609
11610        #[inline(always)]
11611        fn inline_align(_context: fidl::encoding::Context) -> usize {
11612            1
11613        }
11614
11615        #[inline(always)]
11616        fn inline_size(_context: fidl::encoding::Context) -> usize {
11617            1
11618        }
11619    }
11620
11621    unsafe impl<D: fidl::encoding::ResourceDialect>
11622        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for &StreamSocketAcceptRequest
11623    {
11624        #[inline]
11625        unsafe fn encode(
11626            self,
11627            encoder: &mut fidl::encoding::Encoder<'_, D>,
11628            offset: usize,
11629            _depth: fidl::encoding::Depth,
11630        ) -> fidl::Result<()> {
11631            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11632            // Delegate to tuple encoding.
11633            fidl::encoding::Encode::<StreamSocketAcceptRequest, D>::encode(
11634                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),),
11635                encoder,
11636                offset,
11637                _depth,
11638            )
11639        }
11640    }
11641    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11642        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for (T0,)
11643    {
11644        #[inline]
11645        unsafe fn encode(
11646            self,
11647            encoder: &mut fidl::encoding::Encoder<'_, D>,
11648            offset: usize,
11649            depth: fidl::encoding::Depth,
11650        ) -> fidl::Result<()> {
11651            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11652            // Zero out padding regions. There's no need to apply masks
11653            // because the unmasked parts will be overwritten by fields.
11654            // Write the fields.
11655            self.0.encode(encoder, offset + 0, depth)?;
11656            Ok(())
11657        }
11658    }
11659
11660    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11661        for StreamSocketAcceptRequest
11662    {
11663        #[inline(always)]
11664        fn new_empty() -> Self {
11665            Self { want_addr: fidl::new_empty!(bool, D) }
11666        }
11667
11668        #[inline]
11669        unsafe fn decode(
11670            &mut self,
11671            decoder: &mut fidl::encoding::Decoder<'_, D>,
11672            offset: usize,
11673            _depth: fidl::encoding::Depth,
11674        ) -> fidl::Result<()> {
11675            decoder.debug_check_bounds::<Self>(offset);
11676            // Verify that padding bytes are zero.
11677            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
11678            Ok(())
11679        }
11680    }
11681
11682    impl fidl::encoding::ValueTypeMarker for StreamSocketListenRequest {
11683        type Borrowed<'a> = &'a Self;
11684        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11685            value
11686        }
11687    }
11688
11689    unsafe impl fidl::encoding::TypeMarker for StreamSocketListenRequest {
11690        type Owned = Self;
11691
11692        #[inline(always)]
11693        fn inline_align(_context: fidl::encoding::Context) -> usize {
11694            2
11695        }
11696
11697        #[inline(always)]
11698        fn inline_size(_context: fidl::encoding::Context) -> usize {
11699            2
11700        }
11701        #[inline(always)]
11702        fn encode_is_copy() -> bool {
11703            true
11704        }
11705
11706        #[inline(always)]
11707        fn decode_is_copy() -> bool {
11708            true
11709        }
11710    }
11711
11712    unsafe impl<D: fidl::encoding::ResourceDialect>
11713        fidl::encoding::Encode<StreamSocketListenRequest, D> for &StreamSocketListenRequest
11714    {
11715        #[inline]
11716        unsafe fn encode(
11717            self,
11718            encoder: &mut fidl::encoding::Encoder<'_, D>,
11719            offset: usize,
11720            _depth: fidl::encoding::Depth,
11721        ) -> fidl::Result<()> {
11722            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11723            unsafe {
11724                // Copy the object into the buffer.
11725                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11726                (buf_ptr as *mut StreamSocketListenRequest)
11727                    .write_unaligned((self as *const StreamSocketListenRequest).read());
11728                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11729                // done second because the memcpy will write garbage to these bytes.
11730            }
11731            Ok(())
11732        }
11733    }
11734    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i16, D>>
11735        fidl::encoding::Encode<StreamSocketListenRequest, D> for (T0,)
11736    {
11737        #[inline]
11738        unsafe fn encode(
11739            self,
11740            encoder: &mut fidl::encoding::Encoder<'_, D>,
11741            offset: usize,
11742            depth: fidl::encoding::Depth,
11743        ) -> fidl::Result<()> {
11744            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11745            // Zero out padding regions. There's no need to apply masks
11746            // because the unmasked parts will be overwritten by fields.
11747            // Write the fields.
11748            self.0.encode(encoder, offset + 0, depth)?;
11749            Ok(())
11750        }
11751    }
11752
11753    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11754        for StreamSocketListenRequest
11755    {
11756        #[inline(always)]
11757        fn new_empty() -> Self {
11758            Self { backlog: fidl::new_empty!(i16, D) }
11759        }
11760
11761        #[inline]
11762        unsafe fn decode(
11763            &mut self,
11764            decoder: &mut fidl::encoding::Decoder<'_, D>,
11765            offset: usize,
11766            _depth: fidl::encoding::Depth,
11767        ) -> fidl::Result<()> {
11768            decoder.debug_check_bounds::<Self>(offset);
11769            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11770            // Verify that padding bytes are zero.
11771            // Copy from the buffer into the object.
11772            unsafe {
11773                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
11774            }
11775            Ok(())
11776        }
11777    }
11778
11779    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCongestionRequest {
11780        type Borrowed<'a> = &'a Self;
11781        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11782            value
11783        }
11784    }
11785
11786    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCongestionRequest {
11787        type Owned = Self;
11788
11789        #[inline(always)]
11790        fn inline_align(_context: fidl::encoding::Context) -> usize {
11791            4
11792        }
11793
11794        #[inline(always)]
11795        fn inline_size(_context: fidl::encoding::Context) -> usize {
11796            4
11797        }
11798    }
11799
11800    unsafe impl<D: fidl::encoding::ResourceDialect>
11801        fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D>
11802        for &StreamSocketSetTcpCongestionRequest
11803    {
11804        #[inline]
11805        unsafe fn encode(
11806            self,
11807            encoder: &mut fidl::encoding::Encoder<'_, D>,
11808            offset: usize,
11809            _depth: fidl::encoding::Depth,
11810        ) -> fidl::Result<()> {
11811            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11812            // Delegate to tuple encoding.
11813            fidl::encoding::Encode::<StreamSocketSetTcpCongestionRequest, D>::encode(
11814                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11815                encoder,
11816                offset,
11817                _depth,
11818            )
11819        }
11820    }
11821    unsafe impl<
11822            D: fidl::encoding::ResourceDialect,
11823            T0: fidl::encoding::Encode<TcpCongestionControl, D>,
11824        > fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D> for (T0,)
11825    {
11826        #[inline]
11827        unsafe fn encode(
11828            self,
11829            encoder: &mut fidl::encoding::Encoder<'_, D>,
11830            offset: usize,
11831            depth: fidl::encoding::Depth,
11832        ) -> fidl::Result<()> {
11833            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11834            // Zero out padding regions. There's no need to apply masks
11835            // because the unmasked parts will be overwritten by fields.
11836            // Write the fields.
11837            self.0.encode(encoder, offset + 0, depth)?;
11838            Ok(())
11839        }
11840    }
11841
11842    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11843        for StreamSocketSetTcpCongestionRequest
11844    {
11845        #[inline(always)]
11846        fn new_empty() -> Self {
11847            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
11848        }
11849
11850        #[inline]
11851        unsafe fn decode(
11852            &mut self,
11853            decoder: &mut fidl::encoding::Decoder<'_, D>,
11854            offset: usize,
11855            _depth: fidl::encoding::Depth,
11856        ) -> fidl::Result<()> {
11857            decoder.debug_check_bounds::<Self>(offset);
11858            // Verify that padding bytes are zero.
11859            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
11860            Ok(())
11861        }
11862    }
11863
11864    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCorkRequest {
11865        type Borrowed<'a> = &'a Self;
11866        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11867            value
11868        }
11869    }
11870
11871    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCorkRequest {
11872        type Owned = Self;
11873
11874        #[inline(always)]
11875        fn inline_align(_context: fidl::encoding::Context) -> usize {
11876            1
11877        }
11878
11879        #[inline(always)]
11880        fn inline_size(_context: fidl::encoding::Context) -> usize {
11881            1
11882        }
11883    }
11884
11885    unsafe impl<D: fidl::encoding::ResourceDialect>
11886        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D>
11887        for &StreamSocketSetTcpCorkRequest
11888    {
11889        #[inline]
11890        unsafe fn encode(
11891            self,
11892            encoder: &mut fidl::encoding::Encoder<'_, D>,
11893            offset: usize,
11894            _depth: fidl::encoding::Depth,
11895        ) -> fidl::Result<()> {
11896            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11897            // Delegate to tuple encoding.
11898            fidl::encoding::Encode::<StreamSocketSetTcpCorkRequest, D>::encode(
11899                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11900                encoder,
11901                offset,
11902                _depth,
11903            )
11904        }
11905    }
11906    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11907        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D> for (T0,)
11908    {
11909        #[inline]
11910        unsafe fn encode(
11911            self,
11912            encoder: &mut fidl::encoding::Encoder<'_, D>,
11913            offset: usize,
11914            depth: fidl::encoding::Depth,
11915        ) -> fidl::Result<()> {
11916            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11917            // Zero out padding regions. There's no need to apply masks
11918            // because the unmasked parts will be overwritten by fields.
11919            // Write the fields.
11920            self.0.encode(encoder, offset + 0, depth)?;
11921            Ok(())
11922        }
11923    }
11924
11925    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11926        for StreamSocketSetTcpCorkRequest
11927    {
11928        #[inline(always)]
11929        fn new_empty() -> Self {
11930            Self { value: fidl::new_empty!(bool, D) }
11931        }
11932
11933        #[inline]
11934        unsafe fn decode(
11935            &mut self,
11936            decoder: &mut fidl::encoding::Decoder<'_, D>,
11937            offset: usize,
11938            _depth: fidl::encoding::Depth,
11939        ) -> fidl::Result<()> {
11940            decoder.debug_check_bounds::<Self>(offset);
11941            // Verify that padding bytes are zero.
11942            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
11943            Ok(())
11944        }
11945    }
11946
11947    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11948        type Borrowed<'a> = &'a Self;
11949        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11950            value
11951        }
11952    }
11953
11954    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11955        type Owned = Self;
11956
11957        #[inline(always)]
11958        fn inline_align(_context: fidl::encoding::Context) -> usize {
11959            4
11960        }
11961
11962        #[inline(always)]
11963        fn inline_size(_context: fidl::encoding::Context) -> usize {
11964            4
11965        }
11966        #[inline(always)]
11967        fn encode_is_copy() -> bool {
11968            true
11969        }
11970
11971        #[inline(always)]
11972        fn decode_is_copy() -> bool {
11973            true
11974        }
11975    }
11976
11977    unsafe impl<D: fidl::encoding::ResourceDialect>
11978        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D>
11979        for &StreamSocketSetTcpDeferAcceptRequest
11980    {
11981        #[inline]
11982        unsafe fn encode(
11983            self,
11984            encoder: &mut fidl::encoding::Encoder<'_, D>,
11985            offset: usize,
11986            _depth: fidl::encoding::Depth,
11987        ) -> fidl::Result<()> {
11988            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11989            unsafe {
11990                // Copy the object into the buffer.
11991                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11992                (buf_ptr as *mut StreamSocketSetTcpDeferAcceptRequest)
11993                    .write_unaligned((self as *const StreamSocketSetTcpDeferAcceptRequest).read());
11994                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11995                // done second because the memcpy will write garbage to these bytes.
11996            }
11997            Ok(())
11998        }
11999    }
12000    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12001        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D> for (T0,)
12002    {
12003        #[inline]
12004        unsafe fn encode(
12005            self,
12006            encoder: &mut fidl::encoding::Encoder<'_, D>,
12007            offset: usize,
12008            depth: fidl::encoding::Depth,
12009        ) -> fidl::Result<()> {
12010            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
12011            // Zero out padding regions. There's no need to apply masks
12012            // because the unmasked parts will be overwritten by fields.
12013            // Write the fields.
12014            self.0.encode(encoder, offset + 0, depth)?;
12015            Ok(())
12016        }
12017    }
12018
12019    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12020        for StreamSocketSetTcpDeferAcceptRequest
12021    {
12022        #[inline(always)]
12023        fn new_empty() -> Self {
12024            Self { value_secs: fidl::new_empty!(u32, D) }
12025        }
12026
12027        #[inline]
12028        unsafe fn decode(
12029            &mut self,
12030            decoder: &mut fidl::encoding::Decoder<'_, D>,
12031            offset: usize,
12032            _depth: fidl::encoding::Depth,
12033        ) -> fidl::Result<()> {
12034            decoder.debug_check_bounds::<Self>(offset);
12035            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12036            // Verify that padding bytes are zero.
12037            // Copy from the buffer into the object.
12038            unsafe {
12039                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12040            }
12041            Ok(())
12042        }
12043    }
12044
12045    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
12046        type Borrowed<'a> = &'a Self;
12047        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12048            value
12049        }
12050    }
12051
12052    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
12053        type Owned = Self;
12054
12055        #[inline(always)]
12056        fn inline_align(_context: fidl::encoding::Context) -> usize {
12057            4
12058        }
12059
12060        #[inline(always)]
12061        fn inline_size(_context: fidl::encoding::Context) -> usize {
12062            4
12063        }
12064        #[inline(always)]
12065        fn encode_is_copy() -> bool {
12066            true
12067        }
12068
12069        #[inline(always)]
12070        fn decode_is_copy() -> bool {
12071            true
12072        }
12073    }
12074
12075    unsafe impl<D: fidl::encoding::ResourceDialect>
12076        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D>
12077        for &StreamSocketSetTcpKeepAliveCountRequest
12078    {
12079        #[inline]
12080        unsafe fn encode(
12081            self,
12082            encoder: &mut fidl::encoding::Encoder<'_, D>,
12083            offset: usize,
12084            _depth: fidl::encoding::Depth,
12085        ) -> fidl::Result<()> {
12086            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
12087            unsafe {
12088                // Copy the object into the buffer.
12089                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12090                (buf_ptr as *mut StreamSocketSetTcpKeepAliveCountRequest).write_unaligned(
12091                    (self as *const StreamSocketSetTcpKeepAliveCountRequest).read(),
12092                );
12093                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12094                // done second because the memcpy will write garbage to these bytes.
12095            }
12096            Ok(())
12097        }
12098    }
12099    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12100        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D> for (T0,)
12101    {
12102        #[inline]
12103        unsafe fn encode(
12104            self,
12105            encoder: &mut fidl::encoding::Encoder<'_, D>,
12106            offset: usize,
12107            depth: fidl::encoding::Depth,
12108        ) -> fidl::Result<()> {
12109            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
12110            // Zero out padding regions. There's no need to apply masks
12111            // because the unmasked parts will be overwritten by fields.
12112            // Write the fields.
12113            self.0.encode(encoder, offset + 0, depth)?;
12114            Ok(())
12115        }
12116    }
12117
12118    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12119        for StreamSocketSetTcpKeepAliveCountRequest
12120    {
12121        #[inline(always)]
12122        fn new_empty() -> Self {
12123            Self { value: fidl::new_empty!(u32, D) }
12124        }
12125
12126        #[inline]
12127        unsafe fn decode(
12128            &mut self,
12129            decoder: &mut fidl::encoding::Decoder<'_, D>,
12130            offset: usize,
12131            _depth: fidl::encoding::Depth,
12132        ) -> fidl::Result<()> {
12133            decoder.debug_check_bounds::<Self>(offset);
12134            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12135            // Verify that padding bytes are zero.
12136            // Copy from the buffer into the object.
12137            unsafe {
12138                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12139            }
12140            Ok(())
12141        }
12142    }
12143
12144    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
12145        type Borrowed<'a> = &'a Self;
12146        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12147            value
12148        }
12149    }
12150
12151    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
12152        type Owned = Self;
12153
12154        #[inline(always)]
12155        fn inline_align(_context: fidl::encoding::Context) -> usize {
12156            4
12157        }
12158
12159        #[inline(always)]
12160        fn inline_size(_context: fidl::encoding::Context) -> usize {
12161            4
12162        }
12163        #[inline(always)]
12164        fn encode_is_copy() -> bool {
12165            true
12166        }
12167
12168        #[inline(always)]
12169        fn decode_is_copy() -> bool {
12170            true
12171        }
12172    }
12173
12174    unsafe impl<D: fidl::encoding::ResourceDialect>
12175        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D>
12176        for &StreamSocketSetTcpKeepAliveIdleRequest
12177    {
12178        #[inline]
12179        unsafe fn encode(
12180            self,
12181            encoder: &mut fidl::encoding::Encoder<'_, D>,
12182            offset: usize,
12183            _depth: fidl::encoding::Depth,
12184        ) -> fidl::Result<()> {
12185            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
12186            unsafe {
12187                // Copy the object into the buffer.
12188                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12189                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIdleRequest).write_unaligned(
12190                    (self as *const StreamSocketSetTcpKeepAliveIdleRequest).read(),
12191                );
12192                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12193                // done second because the memcpy will write garbage to these bytes.
12194            }
12195            Ok(())
12196        }
12197    }
12198    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12199        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D> for (T0,)
12200    {
12201        #[inline]
12202        unsafe fn encode(
12203            self,
12204            encoder: &mut fidl::encoding::Encoder<'_, D>,
12205            offset: usize,
12206            depth: fidl::encoding::Depth,
12207        ) -> fidl::Result<()> {
12208            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
12209            // Zero out padding regions. There's no need to apply masks
12210            // because the unmasked parts will be overwritten by fields.
12211            // Write the fields.
12212            self.0.encode(encoder, offset + 0, depth)?;
12213            Ok(())
12214        }
12215    }
12216
12217    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12218        for StreamSocketSetTcpKeepAliveIdleRequest
12219    {
12220        #[inline(always)]
12221        fn new_empty() -> Self {
12222            Self { value_secs: fidl::new_empty!(u32, D) }
12223        }
12224
12225        #[inline]
12226        unsafe fn decode(
12227            &mut self,
12228            decoder: &mut fidl::encoding::Decoder<'_, D>,
12229            offset: usize,
12230            _depth: fidl::encoding::Depth,
12231        ) -> fidl::Result<()> {
12232            decoder.debug_check_bounds::<Self>(offset);
12233            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12234            // Verify that padding bytes are zero.
12235            // Copy from the buffer into the object.
12236            unsafe {
12237                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12238            }
12239            Ok(())
12240        }
12241    }
12242
12243    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
12244        type Borrowed<'a> = &'a Self;
12245        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12246            value
12247        }
12248    }
12249
12250    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
12251        type Owned = Self;
12252
12253        #[inline(always)]
12254        fn inline_align(_context: fidl::encoding::Context) -> usize {
12255            4
12256        }
12257
12258        #[inline(always)]
12259        fn inline_size(_context: fidl::encoding::Context) -> usize {
12260            4
12261        }
12262        #[inline(always)]
12263        fn encode_is_copy() -> bool {
12264            true
12265        }
12266
12267        #[inline(always)]
12268        fn decode_is_copy() -> bool {
12269            true
12270        }
12271    }
12272
12273    unsafe impl<D: fidl::encoding::ResourceDialect>
12274        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D>
12275        for &StreamSocketSetTcpKeepAliveIntervalRequest
12276    {
12277        #[inline]
12278        unsafe fn encode(
12279            self,
12280            encoder: &mut fidl::encoding::Encoder<'_, D>,
12281            offset: usize,
12282            _depth: fidl::encoding::Depth,
12283        ) -> fidl::Result<()> {
12284            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
12285            unsafe {
12286                // Copy the object into the buffer.
12287                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12288                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIntervalRequest).write_unaligned(
12289                    (self as *const StreamSocketSetTcpKeepAliveIntervalRequest).read(),
12290                );
12291                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12292                // done second because the memcpy will write garbage to these bytes.
12293            }
12294            Ok(())
12295        }
12296    }
12297    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12298        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D> for (T0,)
12299    {
12300        #[inline]
12301        unsafe fn encode(
12302            self,
12303            encoder: &mut fidl::encoding::Encoder<'_, D>,
12304            offset: usize,
12305            depth: fidl::encoding::Depth,
12306        ) -> fidl::Result<()> {
12307            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
12308            // Zero out padding regions. There's no need to apply masks
12309            // because the unmasked parts will be overwritten by fields.
12310            // Write the fields.
12311            self.0.encode(encoder, offset + 0, depth)?;
12312            Ok(())
12313        }
12314    }
12315
12316    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12317        for StreamSocketSetTcpKeepAliveIntervalRequest
12318    {
12319        #[inline(always)]
12320        fn new_empty() -> Self {
12321            Self { value_secs: fidl::new_empty!(u32, D) }
12322        }
12323
12324        #[inline]
12325        unsafe fn decode(
12326            &mut self,
12327            decoder: &mut fidl::encoding::Decoder<'_, D>,
12328            offset: usize,
12329            _depth: fidl::encoding::Depth,
12330        ) -> fidl::Result<()> {
12331            decoder.debug_check_bounds::<Self>(offset);
12332            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12333            // Verify that padding bytes are zero.
12334            // Copy from the buffer into the object.
12335            unsafe {
12336                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12337            }
12338            Ok(())
12339        }
12340    }
12341
12342    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpLingerRequest {
12343        type Borrowed<'a> = &'a Self;
12344        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12345            value
12346        }
12347    }
12348
12349    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpLingerRequest {
12350        type Owned = Self;
12351
12352        #[inline(always)]
12353        fn inline_align(_context: fidl::encoding::Context) -> usize {
12354            8
12355        }
12356
12357        #[inline(always)]
12358        fn inline_size(_context: fidl::encoding::Context) -> usize {
12359            16
12360        }
12361    }
12362
12363    unsafe impl<D: fidl::encoding::ResourceDialect>
12364        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D>
12365        for &StreamSocketSetTcpLingerRequest
12366    {
12367        #[inline]
12368        unsafe fn encode(
12369            self,
12370            encoder: &mut fidl::encoding::Encoder<'_, D>,
12371            offset: usize,
12372            _depth: fidl::encoding::Depth,
12373        ) -> fidl::Result<()> {
12374            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12375            // Delegate to tuple encoding.
12376            fidl::encoding::Encode::<StreamSocketSetTcpLingerRequest, D>::encode(
12377                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
12378                encoder,
12379                offset,
12380                _depth,
12381            )
12382        }
12383    }
12384    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
12385        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D> for (T0,)
12386    {
12387        #[inline]
12388        unsafe fn encode(
12389            self,
12390            encoder: &mut fidl::encoding::Encoder<'_, D>,
12391            offset: usize,
12392            depth: fidl::encoding::Depth,
12393        ) -> fidl::Result<()> {
12394            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12395            // Zero out padding regions. There's no need to apply masks
12396            // because the unmasked parts will be overwritten by fields.
12397            // Write the fields.
12398            self.0.encode(encoder, offset + 0, depth)?;
12399            Ok(())
12400        }
12401    }
12402
12403    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12404        for StreamSocketSetTcpLingerRequest
12405    {
12406        #[inline(always)]
12407        fn new_empty() -> Self {
12408            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
12409        }
12410
12411        #[inline]
12412        unsafe fn decode(
12413            &mut self,
12414            decoder: &mut fidl::encoding::Decoder<'_, D>,
12415            offset: usize,
12416            _depth: fidl::encoding::Depth,
12417        ) -> fidl::Result<()> {
12418            decoder.debug_check_bounds::<Self>(offset);
12419            // Verify that padding bytes are zero.
12420            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
12421            Ok(())
12422        }
12423    }
12424
12425    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12426        type Borrowed<'a> = &'a Self;
12427        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12428            value
12429        }
12430    }
12431
12432    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12433        type Owned = Self;
12434
12435        #[inline(always)]
12436        fn inline_align(_context: fidl::encoding::Context) -> usize {
12437            4
12438        }
12439
12440        #[inline(always)]
12441        fn inline_size(_context: fidl::encoding::Context) -> usize {
12442            4
12443        }
12444        #[inline(always)]
12445        fn encode_is_copy() -> bool {
12446            true
12447        }
12448
12449        #[inline(always)]
12450        fn decode_is_copy() -> bool {
12451            true
12452        }
12453    }
12454
12455    unsafe impl<D: fidl::encoding::ResourceDialect>
12456        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D>
12457        for &StreamSocketSetTcpMaxSegmentRequest
12458    {
12459        #[inline]
12460        unsafe fn encode(
12461            self,
12462            encoder: &mut fidl::encoding::Encoder<'_, D>,
12463            offset: usize,
12464            _depth: fidl::encoding::Depth,
12465        ) -> fidl::Result<()> {
12466            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12467            unsafe {
12468                // Copy the object into the buffer.
12469                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12470                (buf_ptr as *mut StreamSocketSetTcpMaxSegmentRequest)
12471                    .write_unaligned((self as *const StreamSocketSetTcpMaxSegmentRequest).read());
12472                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12473                // done second because the memcpy will write garbage to these bytes.
12474            }
12475            Ok(())
12476        }
12477    }
12478    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12479        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D> for (T0,)
12480    {
12481        #[inline]
12482        unsafe fn encode(
12483            self,
12484            encoder: &mut fidl::encoding::Encoder<'_, D>,
12485            offset: usize,
12486            depth: fidl::encoding::Depth,
12487        ) -> fidl::Result<()> {
12488            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12489            // Zero out padding regions. There's no need to apply masks
12490            // because the unmasked parts will be overwritten by fields.
12491            // Write the fields.
12492            self.0.encode(encoder, offset + 0, depth)?;
12493            Ok(())
12494        }
12495    }
12496
12497    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12498        for StreamSocketSetTcpMaxSegmentRequest
12499    {
12500        #[inline(always)]
12501        fn new_empty() -> Self {
12502            Self { value_bytes: fidl::new_empty!(u32, D) }
12503        }
12504
12505        #[inline]
12506        unsafe fn decode(
12507            &mut self,
12508            decoder: &mut fidl::encoding::Decoder<'_, D>,
12509            offset: usize,
12510            _depth: fidl::encoding::Depth,
12511        ) -> fidl::Result<()> {
12512            decoder.debug_check_bounds::<Self>(offset);
12513            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12514            // Verify that padding bytes are zero.
12515            // Copy from the buffer into the object.
12516            unsafe {
12517                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12518            }
12519            Ok(())
12520        }
12521    }
12522
12523    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpNoDelayRequest {
12524        type Borrowed<'a> = &'a Self;
12525        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12526            value
12527        }
12528    }
12529
12530    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpNoDelayRequest {
12531        type Owned = Self;
12532
12533        #[inline(always)]
12534        fn inline_align(_context: fidl::encoding::Context) -> usize {
12535            1
12536        }
12537
12538        #[inline(always)]
12539        fn inline_size(_context: fidl::encoding::Context) -> usize {
12540            1
12541        }
12542    }
12543
12544    unsafe impl<D: fidl::encoding::ResourceDialect>
12545        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D>
12546        for &StreamSocketSetTcpNoDelayRequest
12547    {
12548        #[inline]
12549        unsafe fn encode(
12550            self,
12551            encoder: &mut fidl::encoding::Encoder<'_, D>,
12552            offset: usize,
12553            _depth: fidl::encoding::Depth,
12554        ) -> fidl::Result<()> {
12555            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12556            // Delegate to tuple encoding.
12557            fidl::encoding::Encode::<StreamSocketSetTcpNoDelayRequest, D>::encode(
12558                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12559                encoder,
12560                offset,
12561                _depth,
12562            )
12563        }
12564    }
12565    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12566        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D> for (T0,)
12567    {
12568        #[inline]
12569        unsafe fn encode(
12570            self,
12571            encoder: &mut fidl::encoding::Encoder<'_, D>,
12572            offset: usize,
12573            depth: fidl::encoding::Depth,
12574        ) -> fidl::Result<()> {
12575            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12576            // Zero out padding regions. There's no need to apply masks
12577            // because the unmasked parts will be overwritten by fields.
12578            // Write the fields.
12579            self.0.encode(encoder, offset + 0, depth)?;
12580            Ok(())
12581        }
12582    }
12583
12584    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12585        for StreamSocketSetTcpNoDelayRequest
12586    {
12587        #[inline(always)]
12588        fn new_empty() -> Self {
12589            Self { value: fidl::new_empty!(bool, D) }
12590        }
12591
12592        #[inline]
12593        unsafe fn decode(
12594            &mut self,
12595            decoder: &mut fidl::encoding::Decoder<'_, D>,
12596            offset: usize,
12597            _depth: fidl::encoding::Depth,
12598        ) -> fidl::Result<()> {
12599            decoder.debug_check_bounds::<Self>(offset);
12600            // Verify that padding bytes are zero.
12601            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12602            Ok(())
12603        }
12604    }
12605
12606    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpQuickAckRequest {
12607        type Borrowed<'a> = &'a Self;
12608        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12609            value
12610        }
12611    }
12612
12613    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpQuickAckRequest {
12614        type Owned = Self;
12615
12616        #[inline(always)]
12617        fn inline_align(_context: fidl::encoding::Context) -> usize {
12618            1
12619        }
12620
12621        #[inline(always)]
12622        fn inline_size(_context: fidl::encoding::Context) -> usize {
12623            1
12624        }
12625    }
12626
12627    unsafe impl<D: fidl::encoding::ResourceDialect>
12628        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D>
12629        for &StreamSocketSetTcpQuickAckRequest
12630    {
12631        #[inline]
12632        unsafe fn encode(
12633            self,
12634            encoder: &mut fidl::encoding::Encoder<'_, D>,
12635            offset: usize,
12636            _depth: fidl::encoding::Depth,
12637        ) -> fidl::Result<()> {
12638            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12639            // Delegate to tuple encoding.
12640            fidl::encoding::Encode::<StreamSocketSetTcpQuickAckRequest, D>::encode(
12641                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12642                encoder,
12643                offset,
12644                _depth,
12645            )
12646        }
12647    }
12648    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12649        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D> for (T0,)
12650    {
12651        #[inline]
12652        unsafe fn encode(
12653            self,
12654            encoder: &mut fidl::encoding::Encoder<'_, D>,
12655            offset: usize,
12656            depth: fidl::encoding::Depth,
12657        ) -> fidl::Result<()> {
12658            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12659            // Zero out padding regions. There's no need to apply masks
12660            // because the unmasked parts will be overwritten by fields.
12661            // Write the fields.
12662            self.0.encode(encoder, offset + 0, depth)?;
12663            Ok(())
12664        }
12665    }
12666
12667    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12668        for StreamSocketSetTcpQuickAckRequest
12669    {
12670        #[inline(always)]
12671        fn new_empty() -> Self {
12672            Self { value: fidl::new_empty!(bool, D) }
12673        }
12674
12675        #[inline]
12676        unsafe fn decode(
12677            &mut self,
12678            decoder: &mut fidl::encoding::Decoder<'_, D>,
12679            offset: usize,
12680            _depth: fidl::encoding::Depth,
12681        ) -> fidl::Result<()> {
12682            decoder.debug_check_bounds::<Self>(offset);
12683            // Verify that padding bytes are zero.
12684            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12685            Ok(())
12686        }
12687    }
12688
12689    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpSynCountRequest {
12690        type Borrowed<'a> = &'a Self;
12691        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12692            value
12693        }
12694    }
12695
12696    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpSynCountRequest {
12697        type Owned = Self;
12698
12699        #[inline(always)]
12700        fn inline_align(_context: fidl::encoding::Context) -> usize {
12701            4
12702        }
12703
12704        #[inline(always)]
12705        fn inline_size(_context: fidl::encoding::Context) -> usize {
12706            4
12707        }
12708        #[inline(always)]
12709        fn encode_is_copy() -> bool {
12710            true
12711        }
12712
12713        #[inline(always)]
12714        fn decode_is_copy() -> bool {
12715            true
12716        }
12717    }
12718
12719    unsafe impl<D: fidl::encoding::ResourceDialect>
12720        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D>
12721        for &StreamSocketSetTcpSynCountRequest
12722    {
12723        #[inline]
12724        unsafe fn encode(
12725            self,
12726            encoder: &mut fidl::encoding::Encoder<'_, D>,
12727            offset: usize,
12728            _depth: fidl::encoding::Depth,
12729        ) -> fidl::Result<()> {
12730            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12731            unsafe {
12732                // Copy the object into the buffer.
12733                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12734                (buf_ptr as *mut StreamSocketSetTcpSynCountRequest)
12735                    .write_unaligned((self as *const StreamSocketSetTcpSynCountRequest).read());
12736                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12737                // done second because the memcpy will write garbage to these bytes.
12738            }
12739            Ok(())
12740        }
12741    }
12742    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12743        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D> for (T0,)
12744    {
12745        #[inline]
12746        unsafe fn encode(
12747            self,
12748            encoder: &mut fidl::encoding::Encoder<'_, D>,
12749            offset: usize,
12750            depth: fidl::encoding::Depth,
12751        ) -> fidl::Result<()> {
12752            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12753            // Zero out padding regions. There's no need to apply masks
12754            // because the unmasked parts will be overwritten by fields.
12755            // Write the fields.
12756            self.0.encode(encoder, offset + 0, depth)?;
12757            Ok(())
12758        }
12759    }
12760
12761    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12762        for StreamSocketSetTcpSynCountRequest
12763    {
12764        #[inline(always)]
12765        fn new_empty() -> Self {
12766            Self { value: fidl::new_empty!(u32, D) }
12767        }
12768
12769        #[inline]
12770        unsafe fn decode(
12771            &mut self,
12772            decoder: &mut fidl::encoding::Decoder<'_, D>,
12773            offset: usize,
12774            _depth: fidl::encoding::Depth,
12775        ) -> fidl::Result<()> {
12776            decoder.debug_check_bounds::<Self>(offset);
12777            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12778            // Verify that padding bytes are zero.
12779            // Copy from the buffer into the object.
12780            unsafe {
12781                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12782            }
12783            Ok(())
12784        }
12785    }
12786
12787    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12788        type Borrowed<'a> = &'a Self;
12789        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12790            value
12791        }
12792    }
12793
12794    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12795        type Owned = Self;
12796
12797        #[inline(always)]
12798        fn inline_align(_context: fidl::encoding::Context) -> usize {
12799            4
12800        }
12801
12802        #[inline(always)]
12803        fn inline_size(_context: fidl::encoding::Context) -> usize {
12804            4
12805        }
12806        #[inline(always)]
12807        fn encode_is_copy() -> bool {
12808            true
12809        }
12810
12811        #[inline(always)]
12812        fn decode_is_copy() -> bool {
12813            true
12814        }
12815    }
12816
12817    unsafe impl<D: fidl::encoding::ResourceDialect>
12818        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D>
12819        for &StreamSocketSetTcpUserTimeoutRequest
12820    {
12821        #[inline]
12822        unsafe fn encode(
12823            self,
12824            encoder: &mut fidl::encoding::Encoder<'_, D>,
12825            offset: usize,
12826            _depth: fidl::encoding::Depth,
12827        ) -> fidl::Result<()> {
12828            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12829            unsafe {
12830                // Copy the object into the buffer.
12831                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12832                (buf_ptr as *mut StreamSocketSetTcpUserTimeoutRequest)
12833                    .write_unaligned((self as *const StreamSocketSetTcpUserTimeoutRequest).read());
12834                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12835                // done second because the memcpy will write garbage to these bytes.
12836            }
12837            Ok(())
12838        }
12839    }
12840    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12841        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D> for (T0,)
12842    {
12843        #[inline]
12844        unsafe fn encode(
12845            self,
12846            encoder: &mut fidl::encoding::Encoder<'_, D>,
12847            offset: usize,
12848            depth: fidl::encoding::Depth,
12849        ) -> fidl::Result<()> {
12850            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12851            // Zero out padding regions. There's no need to apply masks
12852            // because the unmasked parts will be overwritten by fields.
12853            // Write the fields.
12854            self.0.encode(encoder, offset + 0, depth)?;
12855            Ok(())
12856        }
12857    }
12858
12859    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12860        for StreamSocketSetTcpUserTimeoutRequest
12861    {
12862        #[inline(always)]
12863        fn new_empty() -> Self {
12864            Self { value_millis: fidl::new_empty!(u32, D) }
12865        }
12866
12867        #[inline]
12868        unsafe fn decode(
12869            &mut self,
12870            decoder: &mut fidl::encoding::Decoder<'_, D>,
12871            offset: usize,
12872            _depth: fidl::encoding::Depth,
12873        ) -> fidl::Result<()> {
12874            decoder.debug_check_bounds::<Self>(offset);
12875            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12876            // Verify that padding bytes are zero.
12877            // Copy from the buffer into the object.
12878            unsafe {
12879                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12880            }
12881            Ok(())
12882        }
12883    }
12884
12885    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpWindowClampRequest {
12886        type Borrowed<'a> = &'a Self;
12887        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12888            value
12889        }
12890    }
12891
12892    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpWindowClampRequest {
12893        type Owned = Self;
12894
12895        #[inline(always)]
12896        fn inline_align(_context: fidl::encoding::Context) -> usize {
12897            4
12898        }
12899
12900        #[inline(always)]
12901        fn inline_size(_context: fidl::encoding::Context) -> usize {
12902            4
12903        }
12904        #[inline(always)]
12905        fn encode_is_copy() -> bool {
12906            true
12907        }
12908
12909        #[inline(always)]
12910        fn decode_is_copy() -> bool {
12911            true
12912        }
12913    }
12914
12915    unsafe impl<D: fidl::encoding::ResourceDialect>
12916        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D>
12917        for &StreamSocketSetTcpWindowClampRequest
12918    {
12919        #[inline]
12920        unsafe fn encode(
12921            self,
12922            encoder: &mut fidl::encoding::Encoder<'_, D>,
12923            offset: usize,
12924            _depth: fidl::encoding::Depth,
12925        ) -> fidl::Result<()> {
12926            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12927            unsafe {
12928                // Copy the object into the buffer.
12929                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12930                (buf_ptr as *mut StreamSocketSetTcpWindowClampRequest)
12931                    .write_unaligned((self as *const StreamSocketSetTcpWindowClampRequest).read());
12932                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12933                // done second because the memcpy will write garbage to these bytes.
12934            }
12935            Ok(())
12936        }
12937    }
12938    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12939        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D> for (T0,)
12940    {
12941        #[inline]
12942        unsafe fn encode(
12943            self,
12944            encoder: &mut fidl::encoding::Encoder<'_, D>,
12945            offset: usize,
12946            depth: fidl::encoding::Depth,
12947        ) -> fidl::Result<()> {
12948            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12949            // Zero out padding regions. There's no need to apply masks
12950            // because the unmasked parts will be overwritten by fields.
12951            // Write the fields.
12952            self.0.encode(encoder, offset + 0, depth)?;
12953            Ok(())
12954        }
12955    }
12956
12957    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12958        for StreamSocketSetTcpWindowClampRequest
12959    {
12960        #[inline(always)]
12961        fn new_empty() -> Self {
12962            Self { value: fidl::new_empty!(u32, D) }
12963        }
12964
12965        #[inline]
12966        unsafe fn decode(
12967            &mut self,
12968            decoder: &mut fidl::encoding::Decoder<'_, D>,
12969            offset: usize,
12970            _depth: fidl::encoding::Depth,
12971        ) -> fidl::Result<()> {
12972            decoder.debug_check_bounds::<Self>(offset);
12973            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12974            // Verify that padding bytes are zero.
12975            // Copy from the buffer into the object.
12976            unsafe {
12977                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12978            }
12979            Ok(())
12980        }
12981    }
12982
12983    impl fidl::encoding::ValueTypeMarker for StreamSocketGetInfoResponse {
12984        type Borrowed<'a> = &'a Self;
12985        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12986            value
12987        }
12988    }
12989
12990    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetInfoResponse {
12991        type Owned = Self;
12992
12993        #[inline(always)]
12994        fn inline_align(_context: fidl::encoding::Context) -> usize {
12995            4
12996        }
12997
12998        #[inline(always)]
12999        fn inline_size(_context: fidl::encoding::Context) -> usize {
13000            8
13001        }
13002    }
13003
13004    unsafe impl<D: fidl::encoding::ResourceDialect>
13005        fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for &StreamSocketGetInfoResponse
13006    {
13007        #[inline]
13008        unsafe fn encode(
13009            self,
13010            encoder: &mut fidl::encoding::Encoder<'_, D>,
13011            offset: usize,
13012            _depth: fidl::encoding::Depth,
13013        ) -> fidl::Result<()> {
13014            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
13015            // Delegate to tuple encoding.
13016            fidl::encoding::Encode::<StreamSocketGetInfoResponse, D>::encode(
13017                (
13018                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
13019                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
13020                ),
13021                encoder,
13022                offset,
13023                _depth,
13024            )
13025        }
13026    }
13027    unsafe impl<
13028            D: fidl::encoding::ResourceDialect,
13029            T0: fidl::encoding::Encode<Domain, D>,
13030            T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
13031        > fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for (T0, T1)
13032    {
13033        #[inline]
13034        unsafe fn encode(
13035            self,
13036            encoder: &mut fidl::encoding::Encoder<'_, D>,
13037            offset: usize,
13038            depth: fidl::encoding::Depth,
13039        ) -> fidl::Result<()> {
13040            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
13041            // Zero out padding regions. There's no need to apply masks
13042            // because the unmasked parts will be overwritten by fields.
13043            unsafe {
13044                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
13045                (ptr as *mut u32).write_unaligned(0);
13046            }
13047            // Write the fields.
13048            self.0.encode(encoder, offset + 0, depth)?;
13049            self.1.encode(encoder, offset + 4, depth)?;
13050            Ok(())
13051        }
13052    }
13053
13054    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13055        for StreamSocketGetInfoResponse
13056    {
13057        #[inline(always)]
13058        fn new_empty() -> Self {
13059            Self {
13060                domain: fidl::new_empty!(Domain, D),
13061                proto: fidl::new_empty!(StreamSocketProtocol, D),
13062            }
13063        }
13064
13065        #[inline]
13066        unsafe fn decode(
13067            &mut self,
13068            decoder: &mut fidl::encoding::Decoder<'_, D>,
13069            offset: usize,
13070            _depth: fidl::encoding::Depth,
13071        ) -> fidl::Result<()> {
13072            decoder.debug_check_bounds::<Self>(offset);
13073            // Verify that padding bytes are zero.
13074            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
13075            let padval = unsafe { (ptr as *const u32).read_unaligned() };
13076            let mask = 0xffff0000u32;
13077            let maskedval = padval & mask;
13078            if maskedval != 0 {
13079                return Err(fidl::Error::NonZeroPadding {
13080                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
13081                });
13082            }
13083            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
13084            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
13085            Ok(())
13086        }
13087    }
13088
13089    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCongestionResponse {
13090        type Borrowed<'a> = &'a Self;
13091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13092            value
13093        }
13094    }
13095
13096    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCongestionResponse {
13097        type Owned = Self;
13098
13099        #[inline(always)]
13100        fn inline_align(_context: fidl::encoding::Context) -> usize {
13101            4
13102        }
13103
13104        #[inline(always)]
13105        fn inline_size(_context: fidl::encoding::Context) -> usize {
13106            4
13107        }
13108    }
13109
13110    unsafe impl<D: fidl::encoding::ResourceDialect>
13111        fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D>
13112        for &StreamSocketGetTcpCongestionResponse
13113    {
13114        #[inline]
13115        unsafe fn encode(
13116            self,
13117            encoder: &mut fidl::encoding::Encoder<'_, D>,
13118            offset: usize,
13119            _depth: fidl::encoding::Depth,
13120        ) -> fidl::Result<()> {
13121            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
13122            // Delegate to tuple encoding.
13123            fidl::encoding::Encode::<StreamSocketGetTcpCongestionResponse, D>::encode(
13124                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13125                encoder,
13126                offset,
13127                _depth,
13128            )
13129        }
13130    }
13131    unsafe impl<
13132            D: fidl::encoding::ResourceDialect,
13133            T0: fidl::encoding::Encode<TcpCongestionControl, D>,
13134        > fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D> for (T0,)
13135    {
13136        #[inline]
13137        unsafe fn encode(
13138            self,
13139            encoder: &mut fidl::encoding::Encoder<'_, D>,
13140            offset: usize,
13141            depth: fidl::encoding::Depth,
13142        ) -> fidl::Result<()> {
13143            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
13144            // Zero out padding regions. There's no need to apply masks
13145            // because the unmasked parts will be overwritten by fields.
13146            // Write the fields.
13147            self.0.encode(encoder, offset + 0, depth)?;
13148            Ok(())
13149        }
13150    }
13151
13152    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13153        for StreamSocketGetTcpCongestionResponse
13154    {
13155        #[inline(always)]
13156        fn new_empty() -> Self {
13157            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
13158        }
13159
13160        #[inline]
13161        unsafe fn decode(
13162            &mut self,
13163            decoder: &mut fidl::encoding::Decoder<'_, D>,
13164            offset: usize,
13165            _depth: fidl::encoding::Depth,
13166        ) -> fidl::Result<()> {
13167            decoder.debug_check_bounds::<Self>(offset);
13168            // Verify that padding bytes are zero.
13169            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
13170            Ok(())
13171        }
13172    }
13173
13174    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCorkResponse {
13175        type Borrowed<'a> = &'a Self;
13176        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13177            value
13178        }
13179    }
13180
13181    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCorkResponse {
13182        type Owned = Self;
13183
13184        #[inline(always)]
13185        fn inline_align(_context: fidl::encoding::Context) -> usize {
13186            1
13187        }
13188
13189        #[inline(always)]
13190        fn inline_size(_context: fidl::encoding::Context) -> usize {
13191            1
13192        }
13193    }
13194
13195    unsafe impl<D: fidl::encoding::ResourceDialect>
13196        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D>
13197        for &StreamSocketGetTcpCorkResponse
13198    {
13199        #[inline]
13200        unsafe fn encode(
13201            self,
13202            encoder: &mut fidl::encoding::Encoder<'_, D>,
13203            offset: usize,
13204            _depth: fidl::encoding::Depth,
13205        ) -> fidl::Result<()> {
13206            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
13207            // Delegate to tuple encoding.
13208            fidl::encoding::Encode::<StreamSocketGetTcpCorkResponse, D>::encode(
13209                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13210                encoder,
13211                offset,
13212                _depth,
13213            )
13214        }
13215    }
13216    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13217        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D> for (T0,)
13218    {
13219        #[inline]
13220        unsafe fn encode(
13221            self,
13222            encoder: &mut fidl::encoding::Encoder<'_, D>,
13223            offset: usize,
13224            depth: fidl::encoding::Depth,
13225        ) -> fidl::Result<()> {
13226            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
13227            // Zero out padding regions. There's no need to apply masks
13228            // because the unmasked parts will be overwritten by fields.
13229            // Write the fields.
13230            self.0.encode(encoder, offset + 0, depth)?;
13231            Ok(())
13232        }
13233    }
13234
13235    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13236        for StreamSocketGetTcpCorkResponse
13237    {
13238        #[inline(always)]
13239        fn new_empty() -> Self {
13240            Self { value: fidl::new_empty!(bool, D) }
13241        }
13242
13243        #[inline]
13244        unsafe fn decode(
13245            &mut self,
13246            decoder: &mut fidl::encoding::Decoder<'_, D>,
13247            offset: usize,
13248            _depth: fidl::encoding::Depth,
13249        ) -> fidl::Result<()> {
13250            decoder.debug_check_bounds::<Self>(offset);
13251            // Verify that padding bytes are zero.
13252            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13253            Ok(())
13254        }
13255    }
13256
13257    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpDeferAcceptResponse {
13258        type Borrowed<'a> = &'a Self;
13259        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13260            value
13261        }
13262    }
13263
13264    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpDeferAcceptResponse {
13265        type Owned = Self;
13266
13267        #[inline(always)]
13268        fn inline_align(_context: fidl::encoding::Context) -> usize {
13269            4
13270        }
13271
13272        #[inline(always)]
13273        fn inline_size(_context: fidl::encoding::Context) -> usize {
13274            4
13275        }
13276        #[inline(always)]
13277        fn encode_is_copy() -> bool {
13278            true
13279        }
13280
13281        #[inline(always)]
13282        fn decode_is_copy() -> bool {
13283            true
13284        }
13285    }
13286
13287    unsafe impl<D: fidl::encoding::ResourceDialect>
13288        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D>
13289        for &StreamSocketGetTcpDeferAcceptResponse
13290    {
13291        #[inline]
13292        unsafe fn encode(
13293            self,
13294            encoder: &mut fidl::encoding::Encoder<'_, D>,
13295            offset: usize,
13296            _depth: fidl::encoding::Depth,
13297        ) -> fidl::Result<()> {
13298            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
13299            unsafe {
13300                // Copy the object into the buffer.
13301                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13302                (buf_ptr as *mut StreamSocketGetTcpDeferAcceptResponse)
13303                    .write_unaligned((self as *const StreamSocketGetTcpDeferAcceptResponse).read());
13304                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13305                // done second because the memcpy will write garbage to these bytes.
13306            }
13307            Ok(())
13308        }
13309    }
13310    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13311        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D> for (T0,)
13312    {
13313        #[inline]
13314        unsafe fn encode(
13315            self,
13316            encoder: &mut fidl::encoding::Encoder<'_, D>,
13317            offset: usize,
13318            depth: fidl::encoding::Depth,
13319        ) -> fidl::Result<()> {
13320            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
13321            // Zero out padding regions. There's no need to apply masks
13322            // because the unmasked parts will be overwritten by fields.
13323            // Write the fields.
13324            self.0.encode(encoder, offset + 0, depth)?;
13325            Ok(())
13326        }
13327    }
13328
13329    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13330        for StreamSocketGetTcpDeferAcceptResponse
13331    {
13332        #[inline(always)]
13333        fn new_empty() -> Self {
13334            Self { value_secs: fidl::new_empty!(u32, D) }
13335        }
13336
13337        #[inline]
13338        unsafe fn decode(
13339            &mut self,
13340            decoder: &mut fidl::encoding::Decoder<'_, D>,
13341            offset: usize,
13342            _depth: fidl::encoding::Depth,
13343        ) -> fidl::Result<()> {
13344            decoder.debug_check_bounds::<Self>(offset);
13345            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13346            // Verify that padding bytes are zero.
13347            // Copy from the buffer into the object.
13348            unsafe {
13349                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13350            }
13351            Ok(())
13352        }
13353    }
13354
13355    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpInfoResponse {
13356        type Borrowed<'a> = &'a Self;
13357        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13358            value
13359        }
13360    }
13361
13362    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpInfoResponse {
13363        type Owned = Self;
13364
13365        #[inline(always)]
13366        fn inline_align(_context: fidl::encoding::Context) -> usize {
13367            8
13368        }
13369
13370        #[inline(always)]
13371        fn inline_size(_context: fidl::encoding::Context) -> usize {
13372            16
13373        }
13374    }
13375
13376    unsafe impl<D: fidl::encoding::ResourceDialect>
13377        fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D>
13378        for &StreamSocketGetTcpInfoResponse
13379    {
13380        #[inline]
13381        unsafe fn encode(
13382            self,
13383            encoder: &mut fidl::encoding::Encoder<'_, D>,
13384            offset: usize,
13385            _depth: fidl::encoding::Depth,
13386        ) -> fidl::Result<()> {
13387            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13388            // Delegate to tuple encoding.
13389            fidl::encoding::Encode::<StreamSocketGetTcpInfoResponse, D>::encode(
13390                (<TcpInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
13391                encoder,
13392                offset,
13393                _depth,
13394            )
13395        }
13396    }
13397    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TcpInfo, D>>
13398        fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D> for (T0,)
13399    {
13400        #[inline]
13401        unsafe fn encode(
13402            self,
13403            encoder: &mut fidl::encoding::Encoder<'_, D>,
13404            offset: usize,
13405            depth: fidl::encoding::Depth,
13406        ) -> fidl::Result<()> {
13407            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13408            // Zero out padding regions. There's no need to apply masks
13409            // because the unmasked parts will be overwritten by fields.
13410            // Write the fields.
13411            self.0.encode(encoder, offset + 0, depth)?;
13412            Ok(())
13413        }
13414    }
13415
13416    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13417        for StreamSocketGetTcpInfoResponse
13418    {
13419        #[inline(always)]
13420        fn new_empty() -> Self {
13421            Self { info: fidl::new_empty!(TcpInfo, D) }
13422        }
13423
13424        #[inline]
13425        unsafe fn decode(
13426            &mut self,
13427            decoder: &mut fidl::encoding::Decoder<'_, D>,
13428            offset: usize,
13429            _depth: fidl::encoding::Depth,
13430        ) -> fidl::Result<()> {
13431            decoder.debug_check_bounds::<Self>(offset);
13432            // Verify that padding bytes are zero.
13433            fidl::decode!(TcpInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
13434            Ok(())
13435        }
13436    }
13437
13438    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13439        type Borrowed<'a> = &'a Self;
13440        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13441            value
13442        }
13443    }
13444
13445    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13446        type Owned = Self;
13447
13448        #[inline(always)]
13449        fn inline_align(_context: fidl::encoding::Context) -> usize {
13450            4
13451        }
13452
13453        #[inline(always)]
13454        fn inline_size(_context: fidl::encoding::Context) -> usize {
13455            4
13456        }
13457        #[inline(always)]
13458        fn encode_is_copy() -> bool {
13459            true
13460        }
13461
13462        #[inline(always)]
13463        fn decode_is_copy() -> bool {
13464            true
13465        }
13466    }
13467
13468    unsafe impl<D: fidl::encoding::ResourceDialect>
13469        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D>
13470        for &StreamSocketGetTcpKeepAliveCountResponse
13471    {
13472        #[inline]
13473        unsafe fn encode(
13474            self,
13475            encoder: &mut fidl::encoding::Encoder<'_, D>,
13476            offset: usize,
13477            _depth: fidl::encoding::Depth,
13478        ) -> fidl::Result<()> {
13479            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13480            unsafe {
13481                // Copy the object into the buffer.
13482                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13483                (buf_ptr as *mut StreamSocketGetTcpKeepAliveCountResponse).write_unaligned(
13484                    (self as *const StreamSocketGetTcpKeepAliveCountResponse).read(),
13485                );
13486                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13487                // done second because the memcpy will write garbage to these bytes.
13488            }
13489            Ok(())
13490        }
13491    }
13492    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13493        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D> for (T0,)
13494    {
13495        #[inline]
13496        unsafe fn encode(
13497            self,
13498            encoder: &mut fidl::encoding::Encoder<'_, D>,
13499            offset: usize,
13500            depth: fidl::encoding::Depth,
13501        ) -> fidl::Result<()> {
13502            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13503            // Zero out padding regions. There's no need to apply masks
13504            // because the unmasked parts will be overwritten by fields.
13505            // Write the fields.
13506            self.0.encode(encoder, offset + 0, depth)?;
13507            Ok(())
13508        }
13509    }
13510
13511    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13512        for StreamSocketGetTcpKeepAliveCountResponse
13513    {
13514        #[inline(always)]
13515        fn new_empty() -> Self {
13516            Self { value: fidl::new_empty!(u32, D) }
13517        }
13518
13519        #[inline]
13520        unsafe fn decode(
13521            &mut self,
13522            decoder: &mut fidl::encoding::Decoder<'_, D>,
13523            offset: usize,
13524            _depth: fidl::encoding::Depth,
13525        ) -> fidl::Result<()> {
13526            decoder.debug_check_bounds::<Self>(offset);
13527            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13528            // Verify that padding bytes are zero.
13529            // Copy from the buffer into the object.
13530            unsafe {
13531                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13532            }
13533            Ok(())
13534        }
13535    }
13536
13537    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13538        type Borrowed<'a> = &'a Self;
13539        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13540            value
13541        }
13542    }
13543
13544    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13545        type Owned = Self;
13546
13547        #[inline(always)]
13548        fn inline_align(_context: fidl::encoding::Context) -> usize {
13549            4
13550        }
13551
13552        #[inline(always)]
13553        fn inline_size(_context: fidl::encoding::Context) -> usize {
13554            4
13555        }
13556        #[inline(always)]
13557        fn encode_is_copy() -> bool {
13558            true
13559        }
13560
13561        #[inline(always)]
13562        fn decode_is_copy() -> bool {
13563            true
13564        }
13565    }
13566
13567    unsafe impl<D: fidl::encoding::ResourceDialect>
13568        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D>
13569        for &StreamSocketGetTcpKeepAliveIdleResponse
13570    {
13571        #[inline]
13572        unsafe fn encode(
13573            self,
13574            encoder: &mut fidl::encoding::Encoder<'_, D>,
13575            offset: usize,
13576            _depth: fidl::encoding::Depth,
13577        ) -> fidl::Result<()> {
13578            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13579            unsafe {
13580                // Copy the object into the buffer.
13581                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13582                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIdleResponse).write_unaligned(
13583                    (self as *const StreamSocketGetTcpKeepAliveIdleResponse).read(),
13584                );
13585                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13586                // done second because the memcpy will write garbage to these bytes.
13587            }
13588            Ok(())
13589        }
13590    }
13591    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13592        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D> for (T0,)
13593    {
13594        #[inline]
13595        unsafe fn encode(
13596            self,
13597            encoder: &mut fidl::encoding::Encoder<'_, D>,
13598            offset: usize,
13599            depth: fidl::encoding::Depth,
13600        ) -> fidl::Result<()> {
13601            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13602            // Zero out padding regions. There's no need to apply masks
13603            // because the unmasked parts will be overwritten by fields.
13604            // Write the fields.
13605            self.0.encode(encoder, offset + 0, depth)?;
13606            Ok(())
13607        }
13608    }
13609
13610    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13611        for StreamSocketGetTcpKeepAliveIdleResponse
13612    {
13613        #[inline(always)]
13614        fn new_empty() -> Self {
13615            Self { value_secs: fidl::new_empty!(u32, D) }
13616        }
13617
13618        #[inline]
13619        unsafe fn decode(
13620            &mut self,
13621            decoder: &mut fidl::encoding::Decoder<'_, D>,
13622            offset: usize,
13623            _depth: fidl::encoding::Depth,
13624        ) -> fidl::Result<()> {
13625            decoder.debug_check_bounds::<Self>(offset);
13626            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13627            // Verify that padding bytes are zero.
13628            // Copy from the buffer into the object.
13629            unsafe {
13630                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13631            }
13632            Ok(())
13633        }
13634    }
13635
13636    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13637        type Borrowed<'a> = &'a Self;
13638        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13639            value
13640        }
13641    }
13642
13643    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13644        type Owned = Self;
13645
13646        #[inline(always)]
13647        fn inline_align(_context: fidl::encoding::Context) -> usize {
13648            4
13649        }
13650
13651        #[inline(always)]
13652        fn inline_size(_context: fidl::encoding::Context) -> usize {
13653            4
13654        }
13655        #[inline(always)]
13656        fn encode_is_copy() -> bool {
13657            true
13658        }
13659
13660        #[inline(always)]
13661        fn decode_is_copy() -> bool {
13662            true
13663        }
13664    }
13665
13666    unsafe impl<D: fidl::encoding::ResourceDialect>
13667        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D>
13668        for &StreamSocketGetTcpKeepAliveIntervalResponse
13669    {
13670        #[inline]
13671        unsafe fn encode(
13672            self,
13673            encoder: &mut fidl::encoding::Encoder<'_, D>,
13674            offset: usize,
13675            _depth: fidl::encoding::Depth,
13676        ) -> fidl::Result<()> {
13677            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13678            unsafe {
13679                // Copy the object into the buffer.
13680                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13681                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIntervalResponse).write_unaligned(
13682                    (self as *const StreamSocketGetTcpKeepAliveIntervalResponse).read(),
13683                );
13684                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13685                // done second because the memcpy will write garbage to these bytes.
13686            }
13687            Ok(())
13688        }
13689    }
13690    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13691        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D> for (T0,)
13692    {
13693        #[inline]
13694        unsafe fn encode(
13695            self,
13696            encoder: &mut fidl::encoding::Encoder<'_, D>,
13697            offset: usize,
13698            depth: fidl::encoding::Depth,
13699        ) -> fidl::Result<()> {
13700            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13701            // Zero out padding regions. There's no need to apply masks
13702            // because the unmasked parts will be overwritten by fields.
13703            // Write the fields.
13704            self.0.encode(encoder, offset + 0, depth)?;
13705            Ok(())
13706        }
13707    }
13708
13709    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13710        for StreamSocketGetTcpKeepAliveIntervalResponse
13711    {
13712        #[inline(always)]
13713        fn new_empty() -> Self {
13714            Self { value_secs: fidl::new_empty!(u32, D) }
13715        }
13716
13717        #[inline]
13718        unsafe fn decode(
13719            &mut self,
13720            decoder: &mut fidl::encoding::Decoder<'_, D>,
13721            offset: usize,
13722            _depth: fidl::encoding::Depth,
13723        ) -> fidl::Result<()> {
13724            decoder.debug_check_bounds::<Self>(offset);
13725            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13726            // Verify that padding bytes are zero.
13727            // Copy from the buffer into the object.
13728            unsafe {
13729                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13730            }
13731            Ok(())
13732        }
13733    }
13734
13735    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpLingerResponse {
13736        type Borrowed<'a> = &'a Self;
13737        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13738            value
13739        }
13740    }
13741
13742    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpLingerResponse {
13743        type Owned = Self;
13744
13745        #[inline(always)]
13746        fn inline_align(_context: fidl::encoding::Context) -> usize {
13747            8
13748        }
13749
13750        #[inline(always)]
13751        fn inline_size(_context: fidl::encoding::Context) -> usize {
13752            16
13753        }
13754    }
13755
13756    unsafe impl<D: fidl::encoding::ResourceDialect>
13757        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D>
13758        for &StreamSocketGetTcpLingerResponse
13759    {
13760        #[inline]
13761        unsafe fn encode(
13762            self,
13763            encoder: &mut fidl::encoding::Encoder<'_, D>,
13764            offset: usize,
13765            _depth: fidl::encoding::Depth,
13766        ) -> fidl::Result<()> {
13767            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13768            // Delegate to tuple encoding.
13769            fidl::encoding::Encode::<StreamSocketGetTcpLingerResponse, D>::encode(
13770                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
13771                encoder,
13772                offset,
13773                _depth,
13774            )
13775        }
13776    }
13777    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
13778        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D> for (T0,)
13779    {
13780        #[inline]
13781        unsafe fn encode(
13782            self,
13783            encoder: &mut fidl::encoding::Encoder<'_, D>,
13784            offset: usize,
13785            depth: fidl::encoding::Depth,
13786        ) -> fidl::Result<()> {
13787            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13788            // Zero out padding regions. There's no need to apply masks
13789            // because the unmasked parts will be overwritten by fields.
13790            // Write the fields.
13791            self.0.encode(encoder, offset + 0, depth)?;
13792            Ok(())
13793        }
13794    }
13795
13796    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13797        for StreamSocketGetTcpLingerResponse
13798    {
13799        #[inline(always)]
13800        fn new_empty() -> Self {
13801            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
13802        }
13803
13804        #[inline]
13805        unsafe fn decode(
13806            &mut self,
13807            decoder: &mut fidl::encoding::Decoder<'_, D>,
13808            offset: usize,
13809            _depth: fidl::encoding::Depth,
13810        ) -> fidl::Result<()> {
13811            decoder.debug_check_bounds::<Self>(offset);
13812            // Verify that padding bytes are zero.
13813            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
13814            Ok(())
13815        }
13816    }
13817
13818    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13819        type Borrowed<'a> = &'a Self;
13820        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13821            value
13822        }
13823    }
13824
13825    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13826        type Owned = Self;
13827
13828        #[inline(always)]
13829        fn inline_align(_context: fidl::encoding::Context) -> usize {
13830            4
13831        }
13832
13833        #[inline(always)]
13834        fn inline_size(_context: fidl::encoding::Context) -> usize {
13835            4
13836        }
13837        #[inline(always)]
13838        fn encode_is_copy() -> bool {
13839            true
13840        }
13841
13842        #[inline(always)]
13843        fn decode_is_copy() -> bool {
13844            true
13845        }
13846    }
13847
13848    unsafe impl<D: fidl::encoding::ResourceDialect>
13849        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D>
13850        for &StreamSocketGetTcpMaxSegmentResponse
13851    {
13852        #[inline]
13853        unsafe fn encode(
13854            self,
13855            encoder: &mut fidl::encoding::Encoder<'_, D>,
13856            offset: usize,
13857            _depth: fidl::encoding::Depth,
13858        ) -> fidl::Result<()> {
13859            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13860            unsafe {
13861                // Copy the object into the buffer.
13862                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13863                (buf_ptr as *mut StreamSocketGetTcpMaxSegmentResponse)
13864                    .write_unaligned((self as *const StreamSocketGetTcpMaxSegmentResponse).read());
13865                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13866                // done second because the memcpy will write garbage to these bytes.
13867            }
13868            Ok(())
13869        }
13870    }
13871    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13872        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D> for (T0,)
13873    {
13874        #[inline]
13875        unsafe fn encode(
13876            self,
13877            encoder: &mut fidl::encoding::Encoder<'_, D>,
13878            offset: usize,
13879            depth: fidl::encoding::Depth,
13880        ) -> fidl::Result<()> {
13881            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13882            // Zero out padding regions. There's no need to apply masks
13883            // because the unmasked parts will be overwritten by fields.
13884            // Write the fields.
13885            self.0.encode(encoder, offset + 0, depth)?;
13886            Ok(())
13887        }
13888    }
13889
13890    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13891        for StreamSocketGetTcpMaxSegmentResponse
13892    {
13893        #[inline(always)]
13894        fn new_empty() -> Self {
13895            Self { value_bytes: fidl::new_empty!(u32, D) }
13896        }
13897
13898        #[inline]
13899        unsafe fn decode(
13900            &mut self,
13901            decoder: &mut fidl::encoding::Decoder<'_, D>,
13902            offset: usize,
13903            _depth: fidl::encoding::Depth,
13904        ) -> fidl::Result<()> {
13905            decoder.debug_check_bounds::<Self>(offset);
13906            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13907            // Verify that padding bytes are zero.
13908            // Copy from the buffer into the object.
13909            unsafe {
13910                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13911            }
13912            Ok(())
13913        }
13914    }
13915
13916    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpNoDelayResponse {
13917        type Borrowed<'a> = &'a Self;
13918        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13919            value
13920        }
13921    }
13922
13923    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpNoDelayResponse {
13924        type Owned = Self;
13925
13926        #[inline(always)]
13927        fn inline_align(_context: fidl::encoding::Context) -> usize {
13928            1
13929        }
13930
13931        #[inline(always)]
13932        fn inline_size(_context: fidl::encoding::Context) -> usize {
13933            1
13934        }
13935    }
13936
13937    unsafe impl<D: fidl::encoding::ResourceDialect>
13938        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D>
13939        for &StreamSocketGetTcpNoDelayResponse
13940    {
13941        #[inline]
13942        unsafe fn encode(
13943            self,
13944            encoder: &mut fidl::encoding::Encoder<'_, D>,
13945            offset: usize,
13946            _depth: fidl::encoding::Depth,
13947        ) -> fidl::Result<()> {
13948            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13949            // Delegate to tuple encoding.
13950            fidl::encoding::Encode::<StreamSocketGetTcpNoDelayResponse, D>::encode(
13951                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13952                encoder,
13953                offset,
13954                _depth,
13955            )
13956        }
13957    }
13958    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13959        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D> for (T0,)
13960    {
13961        #[inline]
13962        unsafe fn encode(
13963            self,
13964            encoder: &mut fidl::encoding::Encoder<'_, D>,
13965            offset: usize,
13966            depth: fidl::encoding::Depth,
13967        ) -> fidl::Result<()> {
13968            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13969            // Zero out padding regions. There's no need to apply masks
13970            // because the unmasked parts will be overwritten by fields.
13971            // Write the fields.
13972            self.0.encode(encoder, offset + 0, depth)?;
13973            Ok(())
13974        }
13975    }
13976
13977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13978        for StreamSocketGetTcpNoDelayResponse
13979    {
13980        #[inline(always)]
13981        fn new_empty() -> Self {
13982            Self { value: fidl::new_empty!(bool, D) }
13983        }
13984
13985        #[inline]
13986        unsafe fn decode(
13987            &mut self,
13988            decoder: &mut fidl::encoding::Decoder<'_, D>,
13989            offset: usize,
13990            _depth: fidl::encoding::Depth,
13991        ) -> fidl::Result<()> {
13992            decoder.debug_check_bounds::<Self>(offset);
13993            // Verify that padding bytes are zero.
13994            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13995            Ok(())
13996        }
13997    }
13998
13999    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpQuickAckResponse {
14000        type Borrowed<'a> = &'a Self;
14001        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14002            value
14003        }
14004    }
14005
14006    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpQuickAckResponse {
14007        type Owned = Self;
14008
14009        #[inline(always)]
14010        fn inline_align(_context: fidl::encoding::Context) -> usize {
14011            1
14012        }
14013
14014        #[inline(always)]
14015        fn inline_size(_context: fidl::encoding::Context) -> usize {
14016            1
14017        }
14018    }
14019
14020    unsafe impl<D: fidl::encoding::ResourceDialect>
14021        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D>
14022        for &StreamSocketGetTcpQuickAckResponse
14023    {
14024        #[inline]
14025        unsafe fn encode(
14026            self,
14027            encoder: &mut fidl::encoding::Encoder<'_, D>,
14028            offset: usize,
14029            _depth: fidl::encoding::Depth,
14030        ) -> fidl::Result<()> {
14031            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
14032            // Delegate to tuple encoding.
14033            fidl::encoding::Encode::<StreamSocketGetTcpQuickAckResponse, D>::encode(
14034                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
14035                encoder,
14036                offset,
14037                _depth,
14038            )
14039        }
14040    }
14041    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
14042        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D> for (T0,)
14043    {
14044        #[inline]
14045        unsafe fn encode(
14046            self,
14047            encoder: &mut fidl::encoding::Encoder<'_, D>,
14048            offset: usize,
14049            depth: fidl::encoding::Depth,
14050        ) -> fidl::Result<()> {
14051            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
14052            // Zero out padding regions. There's no need to apply masks
14053            // because the unmasked parts will be overwritten by fields.
14054            // Write the fields.
14055            self.0.encode(encoder, offset + 0, depth)?;
14056            Ok(())
14057        }
14058    }
14059
14060    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14061        for StreamSocketGetTcpQuickAckResponse
14062    {
14063        #[inline(always)]
14064        fn new_empty() -> Self {
14065            Self { value: fidl::new_empty!(bool, D) }
14066        }
14067
14068        #[inline]
14069        unsafe fn decode(
14070            &mut self,
14071            decoder: &mut fidl::encoding::Decoder<'_, D>,
14072            offset: usize,
14073            _depth: fidl::encoding::Depth,
14074        ) -> fidl::Result<()> {
14075            decoder.debug_check_bounds::<Self>(offset);
14076            // Verify that padding bytes are zero.
14077            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
14078            Ok(())
14079        }
14080    }
14081
14082    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpSynCountResponse {
14083        type Borrowed<'a> = &'a Self;
14084        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14085            value
14086        }
14087    }
14088
14089    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpSynCountResponse {
14090        type Owned = Self;
14091
14092        #[inline(always)]
14093        fn inline_align(_context: fidl::encoding::Context) -> usize {
14094            4
14095        }
14096
14097        #[inline(always)]
14098        fn inline_size(_context: fidl::encoding::Context) -> usize {
14099            4
14100        }
14101        #[inline(always)]
14102        fn encode_is_copy() -> bool {
14103            true
14104        }
14105
14106        #[inline(always)]
14107        fn decode_is_copy() -> bool {
14108            true
14109        }
14110    }
14111
14112    unsafe impl<D: fidl::encoding::ResourceDialect>
14113        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D>
14114        for &StreamSocketGetTcpSynCountResponse
14115    {
14116        #[inline]
14117        unsafe fn encode(
14118            self,
14119            encoder: &mut fidl::encoding::Encoder<'_, D>,
14120            offset: usize,
14121            _depth: fidl::encoding::Depth,
14122        ) -> fidl::Result<()> {
14123            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
14124            unsafe {
14125                // Copy the object into the buffer.
14126                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14127                (buf_ptr as *mut StreamSocketGetTcpSynCountResponse)
14128                    .write_unaligned((self as *const StreamSocketGetTcpSynCountResponse).read());
14129                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14130                // done second because the memcpy will write garbage to these bytes.
14131            }
14132            Ok(())
14133        }
14134    }
14135    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14136        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D> for (T0,)
14137    {
14138        #[inline]
14139        unsafe fn encode(
14140            self,
14141            encoder: &mut fidl::encoding::Encoder<'_, D>,
14142            offset: usize,
14143            depth: fidl::encoding::Depth,
14144        ) -> fidl::Result<()> {
14145            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
14146            // Zero out padding regions. There's no need to apply masks
14147            // because the unmasked parts will be overwritten by fields.
14148            // Write the fields.
14149            self.0.encode(encoder, offset + 0, depth)?;
14150            Ok(())
14151        }
14152    }
14153
14154    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14155        for StreamSocketGetTcpSynCountResponse
14156    {
14157        #[inline(always)]
14158        fn new_empty() -> Self {
14159            Self { value: fidl::new_empty!(u32, D) }
14160        }
14161
14162        #[inline]
14163        unsafe fn decode(
14164            &mut self,
14165            decoder: &mut fidl::encoding::Decoder<'_, D>,
14166            offset: usize,
14167            _depth: fidl::encoding::Depth,
14168        ) -> fidl::Result<()> {
14169            decoder.debug_check_bounds::<Self>(offset);
14170            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14171            // Verify that padding bytes are zero.
14172            // Copy from the buffer into the object.
14173            unsafe {
14174                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14175            }
14176            Ok(())
14177        }
14178    }
14179
14180    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpUserTimeoutResponse {
14181        type Borrowed<'a> = &'a Self;
14182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14183            value
14184        }
14185    }
14186
14187    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpUserTimeoutResponse {
14188        type Owned = Self;
14189
14190        #[inline(always)]
14191        fn inline_align(_context: fidl::encoding::Context) -> usize {
14192            4
14193        }
14194
14195        #[inline(always)]
14196        fn inline_size(_context: fidl::encoding::Context) -> usize {
14197            4
14198        }
14199        #[inline(always)]
14200        fn encode_is_copy() -> bool {
14201            true
14202        }
14203
14204        #[inline(always)]
14205        fn decode_is_copy() -> bool {
14206            true
14207        }
14208    }
14209
14210    unsafe impl<D: fidl::encoding::ResourceDialect>
14211        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D>
14212        for &StreamSocketGetTcpUserTimeoutResponse
14213    {
14214        #[inline]
14215        unsafe fn encode(
14216            self,
14217            encoder: &mut fidl::encoding::Encoder<'_, D>,
14218            offset: usize,
14219            _depth: fidl::encoding::Depth,
14220        ) -> fidl::Result<()> {
14221            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
14222            unsafe {
14223                // Copy the object into the buffer.
14224                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14225                (buf_ptr as *mut StreamSocketGetTcpUserTimeoutResponse)
14226                    .write_unaligned((self as *const StreamSocketGetTcpUserTimeoutResponse).read());
14227                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14228                // done second because the memcpy will write garbage to these bytes.
14229            }
14230            Ok(())
14231        }
14232    }
14233    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14234        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D> for (T0,)
14235    {
14236        #[inline]
14237        unsafe fn encode(
14238            self,
14239            encoder: &mut fidl::encoding::Encoder<'_, D>,
14240            offset: usize,
14241            depth: fidl::encoding::Depth,
14242        ) -> fidl::Result<()> {
14243            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
14244            // Zero out padding regions. There's no need to apply masks
14245            // because the unmasked parts will be overwritten by fields.
14246            // Write the fields.
14247            self.0.encode(encoder, offset + 0, depth)?;
14248            Ok(())
14249        }
14250    }
14251
14252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14253        for StreamSocketGetTcpUserTimeoutResponse
14254    {
14255        #[inline(always)]
14256        fn new_empty() -> Self {
14257            Self { value_millis: fidl::new_empty!(u32, D) }
14258        }
14259
14260        #[inline]
14261        unsafe fn decode(
14262            &mut self,
14263            decoder: &mut fidl::encoding::Decoder<'_, D>,
14264            offset: usize,
14265            _depth: fidl::encoding::Depth,
14266        ) -> fidl::Result<()> {
14267            decoder.debug_check_bounds::<Self>(offset);
14268            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14269            // Verify that padding bytes are zero.
14270            // Copy from the buffer into the object.
14271            unsafe {
14272                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14273            }
14274            Ok(())
14275        }
14276    }
14277
14278    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpWindowClampResponse {
14279        type Borrowed<'a> = &'a Self;
14280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14281            value
14282        }
14283    }
14284
14285    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpWindowClampResponse {
14286        type Owned = Self;
14287
14288        #[inline(always)]
14289        fn inline_align(_context: fidl::encoding::Context) -> usize {
14290            4
14291        }
14292
14293        #[inline(always)]
14294        fn inline_size(_context: fidl::encoding::Context) -> usize {
14295            4
14296        }
14297        #[inline(always)]
14298        fn encode_is_copy() -> bool {
14299            true
14300        }
14301
14302        #[inline(always)]
14303        fn decode_is_copy() -> bool {
14304            true
14305        }
14306    }
14307
14308    unsafe impl<D: fidl::encoding::ResourceDialect>
14309        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D>
14310        for &StreamSocketGetTcpWindowClampResponse
14311    {
14312        #[inline]
14313        unsafe fn encode(
14314            self,
14315            encoder: &mut fidl::encoding::Encoder<'_, D>,
14316            offset: usize,
14317            _depth: fidl::encoding::Depth,
14318        ) -> fidl::Result<()> {
14319            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
14320            unsafe {
14321                // Copy the object into the buffer.
14322                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14323                (buf_ptr as *mut StreamSocketGetTcpWindowClampResponse)
14324                    .write_unaligned((self as *const StreamSocketGetTcpWindowClampResponse).read());
14325                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14326                // done second because the memcpy will write garbage to these bytes.
14327            }
14328            Ok(())
14329        }
14330    }
14331    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14332        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D> for (T0,)
14333    {
14334        #[inline]
14335        unsafe fn encode(
14336            self,
14337            encoder: &mut fidl::encoding::Encoder<'_, D>,
14338            offset: usize,
14339            depth: fidl::encoding::Depth,
14340        ) -> fidl::Result<()> {
14341            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
14342            // Zero out padding regions. There's no need to apply masks
14343            // because the unmasked parts will be overwritten by fields.
14344            // Write the fields.
14345            self.0.encode(encoder, offset + 0, depth)?;
14346            Ok(())
14347        }
14348    }
14349
14350    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14351        for StreamSocketGetTcpWindowClampResponse
14352    {
14353        #[inline(always)]
14354        fn new_empty() -> Self {
14355            Self { value: fidl::new_empty!(u32, D) }
14356        }
14357
14358        #[inline]
14359        unsafe fn decode(
14360            &mut self,
14361            decoder: &mut fidl::encoding::Decoder<'_, D>,
14362            offset: usize,
14363            _depth: fidl::encoding::Depth,
14364        ) -> fidl::Result<()> {
14365            decoder.debug_check_bounds::<Self>(offset);
14366            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14367            // Verify that padding bytes are zero.
14368            // Copy from the buffer into the object.
14369            unsafe {
14370                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14371            }
14372            Ok(())
14373        }
14374    }
14375
14376    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14377        type Borrowed<'a> = &'a Self;
14378        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14379            value
14380        }
14381    }
14382
14383    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14384        type Owned = Self;
14385
14386        #[inline(always)]
14387        fn inline_align(_context: fidl::encoding::Context) -> usize {
14388            4
14389        }
14390
14391        #[inline(always)]
14392        fn inline_size(_context: fidl::encoding::Context) -> usize {
14393            12
14394        }
14395    }
14396
14397    unsafe impl<D: fidl::encoding::ResourceDialect>
14398        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D>
14399        for &SynchronousDatagramSocketRecvMsgRequest
14400    {
14401        #[inline]
14402        unsafe fn encode(
14403            self,
14404            encoder: &mut fidl::encoding::Encoder<'_, D>,
14405            offset: usize,
14406            _depth: fidl::encoding::Depth,
14407        ) -> fidl::Result<()> {
14408            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14409            // Delegate to tuple encoding.
14410            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgRequest, D>::encode(
14411                (
14412                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),
14413                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_len),
14414                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_control),
14415                    <RecvMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14416                ),
14417                encoder,
14418                offset,
14419                _depth,
14420            )
14421        }
14422    }
14423    unsafe impl<
14424            D: fidl::encoding::ResourceDialect,
14425            T0: fidl::encoding::Encode<bool, D>,
14426            T1: fidl::encoding::Encode<u32, D>,
14427            T2: fidl::encoding::Encode<bool, D>,
14428            T3: fidl::encoding::Encode<RecvMsgFlags, D>,
14429        > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D> for (T0, T1, T2, T3)
14430    {
14431        #[inline]
14432        unsafe fn encode(
14433            self,
14434            encoder: &mut fidl::encoding::Encoder<'_, D>,
14435            offset: usize,
14436            depth: fidl::encoding::Depth,
14437        ) -> fidl::Result<()> {
14438            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14439            // Zero out padding regions. There's no need to apply masks
14440            // because the unmasked parts will be overwritten by fields.
14441            unsafe {
14442                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14443                (ptr as *mut u32).write_unaligned(0);
14444            }
14445            unsafe {
14446                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14447                (ptr as *mut u32).write_unaligned(0);
14448            }
14449            // Write the fields.
14450            self.0.encode(encoder, offset + 0, depth)?;
14451            self.1.encode(encoder, offset + 4, depth)?;
14452            self.2.encode(encoder, offset + 8, depth)?;
14453            self.3.encode(encoder, offset + 10, depth)?;
14454            Ok(())
14455        }
14456    }
14457
14458    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14459        for SynchronousDatagramSocketRecvMsgRequest
14460    {
14461        #[inline(always)]
14462        fn new_empty() -> Self {
14463            Self {
14464                want_addr: fidl::new_empty!(bool, D),
14465                data_len: fidl::new_empty!(u32, D),
14466                want_control: fidl::new_empty!(bool, D),
14467                flags: fidl::new_empty!(RecvMsgFlags, D),
14468            }
14469        }
14470
14471        #[inline]
14472        unsafe fn decode(
14473            &mut self,
14474            decoder: &mut fidl::encoding::Decoder<'_, D>,
14475            offset: usize,
14476            _depth: fidl::encoding::Depth,
14477        ) -> fidl::Result<()> {
14478            decoder.debug_check_bounds::<Self>(offset);
14479            // Verify that padding bytes are zero.
14480            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14481            let padval = unsafe { (ptr as *const u32).read_unaligned() };
14482            let mask = 0xffffff00u32;
14483            let maskedval = padval & mask;
14484            if maskedval != 0 {
14485                return Err(fidl::Error::NonZeroPadding {
14486                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14487                });
14488            }
14489            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14490            let padval = unsafe { (ptr as *const u32).read_unaligned() };
14491            let mask = 0xff00u32;
14492            let maskedval = padval & mask;
14493            if maskedval != 0 {
14494                return Err(fidl::Error::NonZeroPadding {
14495                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14496                });
14497            }
14498            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
14499            fidl::decode!(u32, D, &mut self.data_len, decoder, offset + 4, _depth)?;
14500            fidl::decode!(bool, D, &mut self.want_control, decoder, offset + 8, _depth)?;
14501            fidl::decode!(RecvMsgFlags, D, &mut self.flags, decoder, offset + 10, _depth)?;
14502            Ok(())
14503        }
14504    }
14505
14506    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgRequest {
14507        type Borrowed<'a> = &'a Self;
14508        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14509            value
14510        }
14511    }
14512
14513    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgRequest {
14514        type Owned = Self;
14515
14516        #[inline(always)]
14517        fn inline_align(_context: fidl::encoding::Context) -> usize {
14518            8
14519        }
14520
14521        #[inline(always)]
14522        fn inline_size(_context: fidl::encoding::Context) -> usize {
14523            56
14524        }
14525    }
14526
14527    unsafe impl<D: fidl::encoding::ResourceDialect>
14528        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D>
14529        for &SynchronousDatagramSocketSendMsgRequest
14530    {
14531        #[inline]
14532        unsafe fn encode(
14533            self,
14534            encoder: &mut fidl::encoding::Encoder<'_, D>,
14535            offset: usize,
14536            _depth: fidl::encoding::Depth,
14537        ) -> fidl::Result<()> {
14538            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14539            // Delegate to tuple encoding.
14540            fidl::encoding::Encode::<SynchronousDatagramSocketSendMsgRequest, D>::encode(
14541                (
14542                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14543                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14544                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14545                    <SendMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14546                ),
14547                encoder, offset, _depth
14548            )
14549        }
14550    }
14551    unsafe impl<
14552            D: fidl::encoding::ResourceDialect,
14553            T0: fidl::encoding::Encode<
14554                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14555                D,
14556            >,
14557            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14558            T2: fidl::encoding::Encode<DatagramSocketSendControlData, D>,
14559            T3: fidl::encoding::Encode<SendMsgFlags, D>,
14560        > fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D> for (T0, T1, T2, T3)
14561    {
14562        #[inline]
14563        unsafe fn encode(
14564            self,
14565            encoder: &mut fidl::encoding::Encoder<'_, D>,
14566            offset: usize,
14567            depth: fidl::encoding::Depth,
14568        ) -> fidl::Result<()> {
14569            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14570            // Zero out padding regions. There's no need to apply masks
14571            // because the unmasked parts will be overwritten by fields.
14572            unsafe {
14573                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14574                (ptr as *mut u64).write_unaligned(0);
14575            }
14576            // Write the fields.
14577            self.0.encode(encoder, offset + 0, depth)?;
14578            self.1.encode(encoder, offset + 16, depth)?;
14579            self.2.encode(encoder, offset + 32, depth)?;
14580            self.3.encode(encoder, offset + 48, depth)?;
14581            Ok(())
14582        }
14583    }
14584
14585    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14586        for SynchronousDatagramSocketSendMsgRequest
14587    {
14588        #[inline(always)]
14589        fn new_empty() -> Self {
14590            Self {
14591                addr: fidl::new_empty!(
14592                    fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14593                    D
14594                ),
14595                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14596                control: fidl::new_empty!(DatagramSocketSendControlData, D),
14597                flags: fidl::new_empty!(SendMsgFlags, D),
14598            }
14599        }
14600
14601        #[inline]
14602        unsafe fn decode(
14603            &mut self,
14604            decoder: &mut fidl::encoding::Decoder<'_, D>,
14605            offset: usize,
14606            _depth: fidl::encoding::Depth,
14607        ) -> fidl::Result<()> {
14608            decoder.debug_check_bounds::<Self>(offset);
14609            // Verify that padding bytes are zero.
14610            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14611            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14612            let mask = 0xffffffffffff0000u64;
14613            let maskedval = padval & mask;
14614            if maskedval != 0 {
14615                return Err(fidl::Error::NonZeroPadding {
14616                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14617                });
14618            }
14619            fidl::decode!(
14620                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14621                D,
14622                &mut self.addr,
14623                decoder,
14624                offset + 0,
14625                _depth
14626            )?;
14627            fidl::decode!(
14628                fidl::encoding::UnboundedVector<u8>,
14629                D,
14630                &mut self.data,
14631                decoder,
14632                offset + 16,
14633                _depth
14634            )?;
14635            fidl::decode!(
14636                DatagramSocketSendControlData,
14637                D,
14638                &mut self.control,
14639                decoder,
14640                offset + 32,
14641                _depth
14642            )?;
14643            fidl::decode!(SendMsgFlags, D, &mut self.flags, decoder, offset + 48, _depth)?;
14644            Ok(())
14645        }
14646    }
14647
14648    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14649        type Borrowed<'a> = &'a Self;
14650        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14651            value
14652        }
14653    }
14654
14655    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14656        type Owned = Self;
14657
14658        #[inline(always)]
14659        fn inline_align(_context: fidl::encoding::Context) -> usize {
14660            8
14661        }
14662
14663        #[inline(always)]
14664        fn inline_size(_context: fidl::encoding::Context) -> usize {
14665            56
14666        }
14667    }
14668
14669    unsafe impl<D: fidl::encoding::ResourceDialect>
14670        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D>
14671        for &SynchronousDatagramSocketRecvMsgResponse
14672    {
14673        #[inline]
14674        unsafe fn encode(
14675            self,
14676            encoder: &mut fidl::encoding::Encoder<'_, D>,
14677            offset: usize,
14678            _depth: fidl::encoding::Depth,
14679        ) -> fidl::Result<()> {
14680            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14681            // Delegate to tuple encoding.
14682            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgResponse, D>::encode(
14683                (
14684                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14685                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14686                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14687                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.truncated),
14688                ),
14689                encoder, offset, _depth
14690            )
14691        }
14692    }
14693    unsafe impl<
14694            D: fidl::encoding::ResourceDialect,
14695            T0: fidl::encoding::Encode<
14696                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14697                D,
14698            >,
14699            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14700            T2: fidl::encoding::Encode<DatagramSocketRecvControlData, D>,
14701            T3: fidl::encoding::Encode<u32, D>,
14702        > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D> for (T0, T1, T2, T3)
14703    {
14704        #[inline]
14705        unsafe fn encode(
14706            self,
14707            encoder: &mut fidl::encoding::Encoder<'_, D>,
14708            offset: usize,
14709            depth: fidl::encoding::Depth,
14710        ) -> fidl::Result<()> {
14711            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14712            // Zero out padding regions. There's no need to apply masks
14713            // because the unmasked parts will be overwritten by fields.
14714            unsafe {
14715                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14716                (ptr as *mut u64).write_unaligned(0);
14717            }
14718            // Write the fields.
14719            self.0.encode(encoder, offset + 0, depth)?;
14720            self.1.encode(encoder, offset + 16, depth)?;
14721            self.2.encode(encoder, offset + 32, depth)?;
14722            self.3.encode(encoder, offset + 48, depth)?;
14723            Ok(())
14724        }
14725    }
14726
14727    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14728        for SynchronousDatagramSocketRecvMsgResponse
14729    {
14730        #[inline(always)]
14731        fn new_empty() -> Self {
14732            Self {
14733                addr: fidl::new_empty!(
14734                    fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14735                    D
14736                ),
14737                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14738                control: fidl::new_empty!(DatagramSocketRecvControlData, D),
14739                truncated: fidl::new_empty!(u32, D),
14740            }
14741        }
14742
14743        #[inline]
14744        unsafe fn decode(
14745            &mut self,
14746            decoder: &mut fidl::encoding::Decoder<'_, D>,
14747            offset: usize,
14748            _depth: fidl::encoding::Depth,
14749        ) -> fidl::Result<()> {
14750            decoder.debug_check_bounds::<Self>(offset);
14751            // Verify that padding bytes are zero.
14752            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14753            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14754            let mask = 0xffffffff00000000u64;
14755            let maskedval = padval & mask;
14756            if maskedval != 0 {
14757                return Err(fidl::Error::NonZeroPadding {
14758                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14759                });
14760            }
14761            fidl::decode!(
14762                fidl::encoding::OptionalUnion<fidl_fuchsia_net__common::SocketAddress>,
14763                D,
14764                &mut self.addr,
14765                decoder,
14766                offset + 0,
14767                _depth
14768            )?;
14769            fidl::decode!(
14770                fidl::encoding::UnboundedVector<u8>,
14771                D,
14772                &mut self.data,
14773                decoder,
14774                offset + 16,
14775                _depth
14776            )?;
14777            fidl::decode!(
14778                DatagramSocketRecvControlData,
14779                D,
14780                &mut self.control,
14781                decoder,
14782                offset + 32,
14783                _depth
14784            )?;
14785            fidl::decode!(u32, D, &mut self.truncated, decoder, offset + 48, _depth)?;
14786            Ok(())
14787        }
14788    }
14789
14790    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgResponse {
14791        type Borrowed<'a> = &'a Self;
14792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14793            value
14794        }
14795    }
14796
14797    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgResponse {
14798        type Owned = Self;
14799
14800        #[inline(always)]
14801        fn inline_align(_context: fidl::encoding::Context) -> usize {
14802            8
14803        }
14804
14805        #[inline(always)]
14806        fn inline_size(_context: fidl::encoding::Context) -> usize {
14807            8
14808        }
14809        #[inline(always)]
14810        fn encode_is_copy() -> bool {
14811            true
14812        }
14813
14814        #[inline(always)]
14815        fn decode_is_copy() -> bool {
14816            true
14817        }
14818    }
14819
14820    unsafe impl<D: fidl::encoding::ResourceDialect>
14821        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D>
14822        for &SynchronousDatagramSocketSendMsgResponse
14823    {
14824        #[inline]
14825        unsafe fn encode(
14826            self,
14827            encoder: &mut fidl::encoding::Encoder<'_, D>,
14828            offset: usize,
14829            _depth: fidl::encoding::Depth,
14830        ) -> fidl::Result<()> {
14831            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14832            unsafe {
14833                // Copy the object into the buffer.
14834                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14835                (buf_ptr as *mut SynchronousDatagramSocketSendMsgResponse).write_unaligned(
14836                    (self as *const SynchronousDatagramSocketSendMsgResponse).read(),
14837                );
14838                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14839                // done second because the memcpy will write garbage to these bytes.
14840            }
14841            Ok(())
14842        }
14843    }
14844    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
14845        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D> for (T0,)
14846    {
14847        #[inline]
14848        unsafe fn encode(
14849            self,
14850            encoder: &mut fidl::encoding::Encoder<'_, D>,
14851            offset: usize,
14852            depth: fidl::encoding::Depth,
14853        ) -> fidl::Result<()> {
14854            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14855            // Zero out padding regions. There's no need to apply masks
14856            // because the unmasked parts will be overwritten by fields.
14857            // Write the fields.
14858            self.0.encode(encoder, offset + 0, depth)?;
14859            Ok(())
14860        }
14861    }
14862
14863    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14864        for SynchronousDatagramSocketSendMsgResponse
14865    {
14866        #[inline(always)]
14867        fn new_empty() -> Self {
14868            Self { len: fidl::new_empty!(i64, D) }
14869        }
14870
14871        #[inline]
14872        unsafe fn decode(
14873            &mut self,
14874            decoder: &mut fidl::encoding::Decoder<'_, D>,
14875            offset: usize,
14876            _depth: fidl::encoding::Depth,
14877        ) -> fidl::Result<()> {
14878            decoder.debug_check_bounds::<Self>(offset);
14879            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14880            // Verify that padding bytes are zero.
14881            // Copy from the buffer into the object.
14882            unsafe {
14883                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
14884            }
14885            Ok(())
14886        }
14887    }
14888
14889    impl fidl::encoding::ValueTypeMarker for Timestamp {
14890        type Borrowed<'a> = &'a Self;
14891        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14892            value
14893        }
14894    }
14895
14896    unsafe impl fidl::encoding::TypeMarker for Timestamp {
14897        type Owned = Self;
14898
14899        #[inline(always)]
14900        fn inline_align(_context: fidl::encoding::Context) -> usize {
14901            8
14902        }
14903
14904        #[inline(always)]
14905        fn inline_size(_context: fidl::encoding::Context) -> usize {
14906            16
14907        }
14908    }
14909
14910    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Timestamp, D>
14911        for &Timestamp
14912    {
14913        #[inline]
14914        unsafe fn encode(
14915            self,
14916            encoder: &mut fidl::encoding::Encoder<'_, D>,
14917            offset: usize,
14918            _depth: fidl::encoding::Depth,
14919        ) -> fidl::Result<()> {
14920            encoder.debug_check_bounds::<Timestamp>(offset);
14921            // Delegate to tuple encoding.
14922            fidl::encoding::Encode::<Timestamp, D>::encode(
14923                (
14924                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.nanoseconds),
14925                    <TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.requested),
14926                ),
14927                encoder,
14928                offset,
14929                _depth,
14930            )
14931        }
14932    }
14933    unsafe impl<
14934            D: fidl::encoding::ResourceDialect,
14935            T0: fidl::encoding::Encode<i64, D>,
14936            T1: fidl::encoding::Encode<TimestampOption, D>,
14937        > fidl::encoding::Encode<Timestamp, D> for (T0, T1)
14938    {
14939        #[inline]
14940        unsafe fn encode(
14941            self,
14942            encoder: &mut fidl::encoding::Encoder<'_, D>,
14943            offset: usize,
14944            depth: fidl::encoding::Depth,
14945        ) -> fidl::Result<()> {
14946            encoder.debug_check_bounds::<Timestamp>(offset);
14947            // Zero out padding regions. There's no need to apply masks
14948            // because the unmasked parts will be overwritten by fields.
14949            unsafe {
14950                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14951                (ptr as *mut u64).write_unaligned(0);
14952            }
14953            // Write the fields.
14954            self.0.encode(encoder, offset + 0, depth)?;
14955            self.1.encode(encoder, offset + 8, depth)?;
14956            Ok(())
14957        }
14958    }
14959
14960    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Timestamp {
14961        #[inline(always)]
14962        fn new_empty() -> Self {
14963            Self {
14964                nanoseconds: fidl::new_empty!(i64, D),
14965                requested: fidl::new_empty!(TimestampOption, D),
14966            }
14967        }
14968
14969        #[inline]
14970        unsafe fn decode(
14971            &mut self,
14972            decoder: &mut fidl::encoding::Decoder<'_, D>,
14973            offset: usize,
14974            _depth: fidl::encoding::Depth,
14975        ) -> fidl::Result<()> {
14976            decoder.debug_check_bounds::<Self>(offset);
14977            // Verify that padding bytes are zero.
14978            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14979            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14980            let mask = 0xffffffff00000000u64;
14981            let maskedval = padval & mask;
14982            if maskedval != 0 {
14983                return Err(fidl::Error::NonZeroPadding {
14984                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14985                });
14986            }
14987            fidl::decode!(i64, D, &mut self.nanoseconds, decoder, offset + 0, _depth)?;
14988            fidl::decode!(TimestampOption, D, &mut self.requested, decoder, offset + 8, _depth)?;
14989            Ok(())
14990        }
14991    }
14992
14993    impl DatagramSocketRecvControlData {
14994        #[inline(always)]
14995        fn max_ordinal_present(&self) -> u64 {
14996            if let Some(_) = self.network {
14997                return 1;
14998            }
14999            0
15000        }
15001    }
15002
15003    impl fidl::encoding::ValueTypeMarker for DatagramSocketRecvControlData {
15004        type Borrowed<'a> = &'a Self;
15005        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15006            value
15007        }
15008    }
15009
15010    unsafe impl fidl::encoding::TypeMarker for DatagramSocketRecvControlData {
15011        type Owned = Self;
15012
15013        #[inline(always)]
15014        fn inline_align(_context: fidl::encoding::Context) -> usize {
15015            8
15016        }
15017
15018        #[inline(always)]
15019        fn inline_size(_context: fidl::encoding::Context) -> usize {
15020            16
15021        }
15022    }
15023
15024    unsafe impl<D: fidl::encoding::ResourceDialect>
15025        fidl::encoding::Encode<DatagramSocketRecvControlData, D>
15026        for &DatagramSocketRecvControlData
15027    {
15028        unsafe fn encode(
15029            self,
15030            encoder: &mut fidl::encoding::Encoder<'_, D>,
15031            offset: usize,
15032            mut depth: fidl::encoding::Depth,
15033        ) -> fidl::Result<()> {
15034            encoder.debug_check_bounds::<DatagramSocketRecvControlData>(offset);
15035            // Vector header
15036            let max_ordinal: u64 = self.max_ordinal_present();
15037            encoder.write_num(max_ordinal, offset);
15038            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15039            // Calling encoder.out_of_line_offset(0) is not allowed.
15040            if max_ordinal == 0 {
15041                return Ok(());
15042            }
15043            depth.increment()?;
15044            let envelope_size = 8;
15045            let bytes_len = max_ordinal as usize * envelope_size;
15046            #[allow(unused_variables)]
15047            let offset = encoder.out_of_line_offset(bytes_len);
15048            let mut _prev_end_offset: usize = 0;
15049            if 1 > max_ordinal {
15050                return Ok(());
15051            }
15052
15053            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15054            // are envelope_size bytes.
15055            let cur_offset: usize = (1 - 1) * envelope_size;
15056
15057            // Zero reserved fields.
15058            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15059
15060            // Safety:
15061            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15062            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15063            //   envelope_size bytes, there is always sufficient room.
15064            fidl::encoding::encode_in_envelope_optional::<NetworkSocketRecvControlData, D>(
15065                self.network
15066                    .as_ref()
15067                    .map(<NetworkSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
15068                encoder,
15069                offset + cur_offset,
15070                depth,
15071            )?;
15072
15073            _prev_end_offset = cur_offset + envelope_size;
15074
15075            Ok(())
15076        }
15077    }
15078
15079    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15080        for DatagramSocketRecvControlData
15081    {
15082        #[inline(always)]
15083        fn new_empty() -> Self {
15084            Self::default()
15085        }
15086
15087        unsafe fn decode(
15088            &mut self,
15089            decoder: &mut fidl::encoding::Decoder<'_, D>,
15090            offset: usize,
15091            mut depth: fidl::encoding::Depth,
15092        ) -> fidl::Result<()> {
15093            decoder.debug_check_bounds::<Self>(offset);
15094            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15095                None => return Err(fidl::Error::NotNullable),
15096                Some(len) => len,
15097            };
15098            // Calling decoder.out_of_line_offset(0) is not allowed.
15099            if len == 0 {
15100                return Ok(());
15101            };
15102            depth.increment()?;
15103            let envelope_size = 8;
15104            let bytes_len = len * envelope_size;
15105            let offset = decoder.out_of_line_offset(bytes_len)?;
15106            // Decode the envelope for each type.
15107            let mut _next_ordinal_to_read = 0;
15108            let mut next_offset = offset;
15109            let end_offset = offset + bytes_len;
15110            _next_ordinal_to_read += 1;
15111            if next_offset >= end_offset {
15112                return Ok(());
15113            }
15114
15115            // Decode unknown envelopes for gaps in ordinals.
15116            while _next_ordinal_to_read < 1 {
15117                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15118                _next_ordinal_to_read += 1;
15119                next_offset += envelope_size;
15120            }
15121
15122            let next_out_of_line = decoder.next_out_of_line();
15123            let handles_before = decoder.remaining_handles();
15124            if let Some((inlined, num_bytes, num_handles)) =
15125                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15126            {
15127                let member_inline_size =
15128                    <NetworkSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
15129                        decoder.context,
15130                    );
15131                if inlined != (member_inline_size <= 4) {
15132                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15133                }
15134                let inner_offset;
15135                let mut inner_depth = depth.clone();
15136                if inlined {
15137                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15138                    inner_offset = next_offset;
15139                } else {
15140                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15141                    inner_depth.increment()?;
15142                }
15143                let val_ref = self
15144                    .network
15145                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketRecvControlData, D));
15146                fidl::decode!(
15147                    NetworkSocketRecvControlData,
15148                    D,
15149                    val_ref,
15150                    decoder,
15151                    inner_offset,
15152                    inner_depth
15153                )?;
15154                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15155                {
15156                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15157                }
15158                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15159                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15160                }
15161            }
15162
15163            next_offset += envelope_size;
15164
15165            // Decode the remaining unknown envelopes.
15166            while next_offset < end_offset {
15167                _next_ordinal_to_read += 1;
15168                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15169                next_offset += envelope_size;
15170            }
15171
15172            Ok(())
15173        }
15174    }
15175
15176    impl DatagramSocketSendControlData {
15177        #[inline(always)]
15178        fn max_ordinal_present(&self) -> u64 {
15179            if let Some(_) = self.network {
15180                return 1;
15181            }
15182            0
15183        }
15184    }
15185
15186    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendControlData {
15187        type Borrowed<'a> = &'a Self;
15188        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15189            value
15190        }
15191    }
15192
15193    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendControlData {
15194        type Owned = Self;
15195
15196        #[inline(always)]
15197        fn inline_align(_context: fidl::encoding::Context) -> usize {
15198            8
15199        }
15200
15201        #[inline(always)]
15202        fn inline_size(_context: fidl::encoding::Context) -> usize {
15203            16
15204        }
15205    }
15206
15207    unsafe impl<D: fidl::encoding::ResourceDialect>
15208        fidl::encoding::Encode<DatagramSocketSendControlData, D>
15209        for &DatagramSocketSendControlData
15210    {
15211        unsafe fn encode(
15212            self,
15213            encoder: &mut fidl::encoding::Encoder<'_, D>,
15214            offset: usize,
15215            mut depth: fidl::encoding::Depth,
15216        ) -> fidl::Result<()> {
15217            encoder.debug_check_bounds::<DatagramSocketSendControlData>(offset);
15218            // Vector header
15219            let max_ordinal: u64 = self.max_ordinal_present();
15220            encoder.write_num(max_ordinal, offset);
15221            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15222            // Calling encoder.out_of_line_offset(0) is not allowed.
15223            if max_ordinal == 0 {
15224                return Ok(());
15225            }
15226            depth.increment()?;
15227            let envelope_size = 8;
15228            let bytes_len = max_ordinal as usize * envelope_size;
15229            #[allow(unused_variables)]
15230            let offset = encoder.out_of_line_offset(bytes_len);
15231            let mut _prev_end_offset: usize = 0;
15232            if 1 > max_ordinal {
15233                return Ok(());
15234            }
15235
15236            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15237            // are envelope_size bytes.
15238            let cur_offset: usize = (1 - 1) * envelope_size;
15239
15240            // Zero reserved fields.
15241            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15242
15243            // Safety:
15244            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15245            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15246            //   envelope_size bytes, there is always sufficient room.
15247            fidl::encoding::encode_in_envelope_optional::<NetworkSocketSendControlData, D>(
15248                self.network
15249                    .as_ref()
15250                    .map(<NetworkSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15251                encoder,
15252                offset + cur_offset,
15253                depth,
15254            )?;
15255
15256            _prev_end_offset = cur_offset + envelope_size;
15257
15258            Ok(())
15259        }
15260    }
15261
15262    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15263        for DatagramSocketSendControlData
15264    {
15265        #[inline(always)]
15266        fn new_empty() -> Self {
15267            Self::default()
15268        }
15269
15270        unsafe fn decode(
15271            &mut self,
15272            decoder: &mut fidl::encoding::Decoder<'_, D>,
15273            offset: usize,
15274            mut depth: fidl::encoding::Depth,
15275        ) -> fidl::Result<()> {
15276            decoder.debug_check_bounds::<Self>(offset);
15277            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15278                None => return Err(fidl::Error::NotNullable),
15279                Some(len) => len,
15280            };
15281            // Calling decoder.out_of_line_offset(0) is not allowed.
15282            if len == 0 {
15283                return Ok(());
15284            };
15285            depth.increment()?;
15286            let envelope_size = 8;
15287            let bytes_len = len * envelope_size;
15288            let offset = decoder.out_of_line_offset(bytes_len)?;
15289            // Decode the envelope for each type.
15290            let mut _next_ordinal_to_read = 0;
15291            let mut next_offset = offset;
15292            let end_offset = offset + bytes_len;
15293            _next_ordinal_to_read += 1;
15294            if next_offset >= end_offset {
15295                return Ok(());
15296            }
15297
15298            // Decode unknown envelopes for gaps in ordinals.
15299            while _next_ordinal_to_read < 1 {
15300                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15301                _next_ordinal_to_read += 1;
15302                next_offset += envelope_size;
15303            }
15304
15305            let next_out_of_line = decoder.next_out_of_line();
15306            let handles_before = decoder.remaining_handles();
15307            if let Some((inlined, num_bytes, num_handles)) =
15308                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15309            {
15310                let member_inline_size =
15311                    <NetworkSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
15312                        decoder.context,
15313                    );
15314                if inlined != (member_inline_size <= 4) {
15315                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15316                }
15317                let inner_offset;
15318                let mut inner_depth = depth.clone();
15319                if inlined {
15320                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15321                    inner_offset = next_offset;
15322                } else {
15323                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15324                    inner_depth.increment()?;
15325                }
15326                let val_ref = self
15327                    .network
15328                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketSendControlData, D));
15329                fidl::decode!(
15330                    NetworkSocketSendControlData,
15331                    D,
15332                    val_ref,
15333                    decoder,
15334                    inner_offset,
15335                    inner_depth
15336                )?;
15337                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15338                {
15339                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15340                }
15341                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15342                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15343                }
15344            }
15345
15346            next_offset += envelope_size;
15347
15348            // Decode the remaining unknown envelopes.
15349            while next_offset < end_offset {
15350                _next_ordinal_to_read += 1;
15351                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15352                next_offset += envelope_size;
15353            }
15354
15355            Ok(())
15356        }
15357    }
15358
15359    impl DatagramSocketSendMsgPreflightRequest {
15360        #[inline(always)]
15361        fn max_ordinal_present(&self) -> u64 {
15362            if let Some(_) = self.ipv6_pktinfo {
15363                return 2;
15364            }
15365            if let Some(_) = self.to {
15366                return 1;
15367            }
15368            0
15369        }
15370    }
15371
15372    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendMsgPreflightRequest {
15373        type Borrowed<'a> = &'a Self;
15374        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15375            value
15376        }
15377    }
15378
15379    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendMsgPreflightRequest {
15380        type Owned = Self;
15381
15382        #[inline(always)]
15383        fn inline_align(_context: fidl::encoding::Context) -> usize {
15384            8
15385        }
15386
15387        #[inline(always)]
15388        fn inline_size(_context: fidl::encoding::Context) -> usize {
15389            16
15390        }
15391    }
15392
15393    unsafe impl<D: fidl::encoding::ResourceDialect>
15394        fidl::encoding::Encode<DatagramSocketSendMsgPreflightRequest, D>
15395        for &DatagramSocketSendMsgPreflightRequest
15396    {
15397        unsafe fn encode(
15398            self,
15399            encoder: &mut fidl::encoding::Encoder<'_, D>,
15400            offset: usize,
15401            mut depth: fidl::encoding::Depth,
15402        ) -> fidl::Result<()> {
15403            encoder.debug_check_bounds::<DatagramSocketSendMsgPreflightRequest>(offset);
15404            // Vector header
15405            let max_ordinal: u64 = self.max_ordinal_present();
15406            encoder.write_num(max_ordinal, offset);
15407            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15408            // Calling encoder.out_of_line_offset(0) is not allowed.
15409            if max_ordinal == 0 {
15410                return Ok(());
15411            }
15412            depth.increment()?;
15413            let envelope_size = 8;
15414            let bytes_len = max_ordinal as usize * envelope_size;
15415            #[allow(unused_variables)]
15416            let offset = encoder.out_of_line_offset(bytes_len);
15417            let mut _prev_end_offset: usize = 0;
15418            if 1 > max_ordinal {
15419                return Ok(());
15420            }
15421
15422            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15423            // are envelope_size bytes.
15424            let cur_offset: usize = (1 - 1) * envelope_size;
15425
15426            // Zero reserved fields.
15427            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15428
15429            // Safety:
15430            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15431            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15432            //   envelope_size bytes, there is always sufficient room.
15433            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
15434            self.to.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
15435            encoder, offset + cur_offset, depth
15436        )?;
15437
15438            _prev_end_offset = cur_offset + envelope_size;
15439            if 2 > max_ordinal {
15440                return Ok(());
15441            }
15442
15443            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15444            // are envelope_size bytes.
15445            let cur_offset: usize = (2 - 1) * envelope_size;
15446
15447            // Zero reserved fields.
15448            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15449
15450            // Safety:
15451            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15452            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15453            //   envelope_size bytes, there is always sufficient room.
15454            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
15455                self.ipv6_pktinfo
15456                    .as_ref()
15457                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15458                encoder,
15459                offset + cur_offset,
15460                depth,
15461            )?;
15462
15463            _prev_end_offset = cur_offset + envelope_size;
15464
15465            Ok(())
15466        }
15467    }
15468
15469    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15470        for DatagramSocketSendMsgPreflightRequest
15471    {
15472        #[inline(always)]
15473        fn new_empty() -> Self {
15474            Self::default()
15475        }
15476
15477        unsafe fn decode(
15478            &mut self,
15479            decoder: &mut fidl::encoding::Decoder<'_, D>,
15480            offset: usize,
15481            mut depth: fidl::encoding::Depth,
15482        ) -> fidl::Result<()> {
15483            decoder.debug_check_bounds::<Self>(offset);
15484            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15485                None => return Err(fidl::Error::NotNullable),
15486                Some(len) => len,
15487            };
15488            // Calling decoder.out_of_line_offset(0) is not allowed.
15489            if len == 0 {
15490                return Ok(());
15491            };
15492            depth.increment()?;
15493            let envelope_size = 8;
15494            let bytes_len = len * envelope_size;
15495            let offset = decoder.out_of_line_offset(bytes_len)?;
15496            // Decode the envelope for each type.
15497            let mut _next_ordinal_to_read = 0;
15498            let mut next_offset = offset;
15499            let end_offset = offset + bytes_len;
15500            _next_ordinal_to_read += 1;
15501            if next_offset >= end_offset {
15502                return Ok(());
15503            }
15504
15505            // Decode unknown envelopes for gaps in ordinals.
15506            while _next_ordinal_to_read < 1 {
15507                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15508                _next_ordinal_to_read += 1;
15509                next_offset += envelope_size;
15510            }
15511
15512            let next_out_of_line = decoder.next_out_of_line();
15513            let handles_before = decoder.remaining_handles();
15514            if let Some((inlined, num_bytes, num_handles)) =
15515                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15516            {
15517                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15518                if inlined != (member_inline_size <= 4) {
15519                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15520                }
15521                let inner_offset;
15522                let mut inner_depth = depth.clone();
15523                if inlined {
15524                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15525                    inner_offset = next_offset;
15526                } else {
15527                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15528                    inner_depth.increment()?;
15529                }
15530                let val_ref = self.to.get_or_insert_with(|| {
15531                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
15532                });
15533                fidl::decode!(
15534                    fidl_fuchsia_net__common::SocketAddress,
15535                    D,
15536                    val_ref,
15537                    decoder,
15538                    inner_offset,
15539                    inner_depth
15540                )?;
15541                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15542                {
15543                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15544                }
15545                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15546                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15547                }
15548            }
15549
15550            next_offset += envelope_size;
15551            _next_ordinal_to_read += 1;
15552            if next_offset >= end_offset {
15553                return Ok(());
15554            }
15555
15556            // Decode unknown envelopes for gaps in ordinals.
15557            while _next_ordinal_to_read < 2 {
15558                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15559                _next_ordinal_to_read += 1;
15560                next_offset += envelope_size;
15561            }
15562
15563            let next_out_of_line = decoder.next_out_of_line();
15564            let handles_before = decoder.remaining_handles();
15565            if let Some((inlined, num_bytes, num_handles)) =
15566                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15567            {
15568                let member_inline_size =
15569                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
15570                        decoder.context,
15571                    );
15572                if inlined != (member_inline_size <= 4) {
15573                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15574                }
15575                let inner_offset;
15576                let mut inner_depth = depth.clone();
15577                if inlined {
15578                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15579                    inner_offset = next_offset;
15580                } else {
15581                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15582                    inner_depth.increment()?;
15583                }
15584                let val_ref = self
15585                    .ipv6_pktinfo
15586                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
15587                fidl::decode!(
15588                    Ipv6PktInfoSendControlData,
15589                    D,
15590                    val_ref,
15591                    decoder,
15592                    inner_offset,
15593                    inner_depth
15594                )?;
15595                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15596                {
15597                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15598                }
15599                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15600                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15601                }
15602            }
15603
15604            next_offset += envelope_size;
15605
15606            // Decode the remaining unknown envelopes.
15607            while next_offset < end_offset {
15608                _next_ordinal_to_read += 1;
15609                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15610                next_offset += envelope_size;
15611            }
15612
15613            Ok(())
15614        }
15615    }
15616
15617    impl InterfaceAddresses {
15618        #[inline(always)]
15619        fn max_ordinal_present(&self) -> u64 {
15620            if let Some(_) = self.interface_flags {
15621                return 5;
15622            }
15623            if let Some(_) = self.addresses {
15624                return 4;
15625            }
15626            if let Some(_) = self.name {
15627                return 2;
15628            }
15629            if let Some(_) = self.id {
15630                return 1;
15631            }
15632            0
15633        }
15634    }
15635
15636    impl fidl::encoding::ValueTypeMarker for InterfaceAddresses {
15637        type Borrowed<'a> = &'a Self;
15638        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15639            value
15640        }
15641    }
15642
15643    unsafe impl fidl::encoding::TypeMarker for InterfaceAddresses {
15644        type Owned = Self;
15645
15646        #[inline(always)]
15647        fn inline_align(_context: fidl::encoding::Context) -> usize {
15648            8
15649        }
15650
15651        #[inline(always)]
15652        fn inline_size(_context: fidl::encoding::Context) -> usize {
15653            16
15654        }
15655    }
15656
15657    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterfaceAddresses, D>
15658        for &InterfaceAddresses
15659    {
15660        unsafe fn encode(
15661            self,
15662            encoder: &mut fidl::encoding::Encoder<'_, D>,
15663            offset: usize,
15664            mut depth: fidl::encoding::Depth,
15665        ) -> fidl::Result<()> {
15666            encoder.debug_check_bounds::<InterfaceAddresses>(offset);
15667            // Vector header
15668            let max_ordinal: u64 = self.max_ordinal_present();
15669            encoder.write_num(max_ordinal, offset);
15670            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15671            // Calling encoder.out_of_line_offset(0) is not allowed.
15672            if max_ordinal == 0 {
15673                return Ok(());
15674            }
15675            depth.increment()?;
15676            let envelope_size = 8;
15677            let bytes_len = max_ordinal as usize * envelope_size;
15678            #[allow(unused_variables)]
15679            let offset = encoder.out_of_line_offset(bytes_len);
15680            let mut _prev_end_offset: usize = 0;
15681            if 1 > max_ordinal {
15682                return Ok(());
15683            }
15684
15685            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15686            // are envelope_size bytes.
15687            let cur_offset: usize = (1 - 1) * envelope_size;
15688
15689            // Zero reserved fields.
15690            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15691
15692            // Safety:
15693            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15694            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15695            //   envelope_size bytes, there is always sufficient room.
15696            fidl::encoding::encode_in_envelope_optional::<u64, D>(
15697                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15698                encoder,
15699                offset + cur_offset,
15700                depth,
15701            )?;
15702
15703            _prev_end_offset = cur_offset + envelope_size;
15704            if 2 > max_ordinal {
15705                return Ok(());
15706            }
15707
15708            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15709            // are envelope_size bytes.
15710            let cur_offset: usize = (2 - 1) * envelope_size;
15711
15712            // Zero reserved fields.
15713            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15714
15715            // Safety:
15716            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15717            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15718            //   envelope_size bytes, there is always sufficient room.
15719            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
15720                self.name.as_ref().map(
15721                    <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow,
15722                ),
15723                encoder,
15724                offset + cur_offset,
15725                depth,
15726            )?;
15727
15728            _prev_end_offset = cur_offset + envelope_size;
15729            if 4 > max_ordinal {
15730                return Ok(());
15731            }
15732
15733            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15734            // are envelope_size bytes.
15735            let cur_offset: usize = (4 - 1) * envelope_size;
15736
15737            // Zero reserved fields.
15738            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15739
15740            // Safety:
15741            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15742            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15743            //   envelope_size bytes, there is always sufficient room.
15744            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet>, D>(
15745            self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
15746            encoder, offset + cur_offset, depth
15747        )?;
15748
15749            _prev_end_offset = cur_offset + envelope_size;
15750            if 5 > max_ordinal {
15751                return Ok(());
15752            }
15753
15754            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15755            // are envelope_size bytes.
15756            let cur_offset: usize = (5 - 1) * envelope_size;
15757
15758            // Zero reserved fields.
15759            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15760
15761            // Safety:
15762            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15763            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15764            //   envelope_size bytes, there is always sufficient room.
15765            fidl::encoding::encode_in_envelope_optional::<InterfaceFlags, D>(
15766                self.interface_flags
15767                    .as_ref()
15768                    .map(<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow),
15769                encoder,
15770                offset + cur_offset,
15771                depth,
15772            )?;
15773
15774            _prev_end_offset = cur_offset + envelope_size;
15775
15776            Ok(())
15777        }
15778    }
15779
15780    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceAddresses {
15781        #[inline(always)]
15782        fn new_empty() -> Self {
15783            Self::default()
15784        }
15785
15786        unsafe fn decode(
15787            &mut self,
15788            decoder: &mut fidl::encoding::Decoder<'_, D>,
15789            offset: usize,
15790            mut depth: fidl::encoding::Depth,
15791        ) -> fidl::Result<()> {
15792            decoder.debug_check_bounds::<Self>(offset);
15793            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15794                None => return Err(fidl::Error::NotNullable),
15795                Some(len) => len,
15796            };
15797            // Calling decoder.out_of_line_offset(0) is not allowed.
15798            if len == 0 {
15799                return Ok(());
15800            };
15801            depth.increment()?;
15802            let envelope_size = 8;
15803            let bytes_len = len * envelope_size;
15804            let offset = decoder.out_of_line_offset(bytes_len)?;
15805            // Decode the envelope for each type.
15806            let mut _next_ordinal_to_read = 0;
15807            let mut next_offset = offset;
15808            let end_offset = offset + bytes_len;
15809            _next_ordinal_to_read += 1;
15810            if next_offset >= end_offset {
15811                return Ok(());
15812            }
15813
15814            // Decode unknown envelopes for gaps in ordinals.
15815            while _next_ordinal_to_read < 1 {
15816                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15817                _next_ordinal_to_read += 1;
15818                next_offset += envelope_size;
15819            }
15820
15821            let next_out_of_line = decoder.next_out_of_line();
15822            let handles_before = decoder.remaining_handles();
15823            if let Some((inlined, num_bytes, num_handles)) =
15824                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15825            {
15826                let member_inline_size =
15827                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15828                if inlined != (member_inline_size <= 4) {
15829                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15830                }
15831                let inner_offset;
15832                let mut inner_depth = depth.clone();
15833                if inlined {
15834                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15835                    inner_offset = next_offset;
15836                } else {
15837                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15838                    inner_depth.increment()?;
15839                }
15840                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
15841                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15842                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15843                {
15844                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15845                }
15846                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15847                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15848                }
15849            }
15850
15851            next_offset += envelope_size;
15852            _next_ordinal_to_read += 1;
15853            if next_offset >= end_offset {
15854                return Ok(());
15855            }
15856
15857            // Decode unknown envelopes for gaps in ordinals.
15858            while _next_ordinal_to_read < 2 {
15859                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15860                _next_ordinal_to_read += 1;
15861                next_offset += envelope_size;
15862            }
15863
15864            let next_out_of_line = decoder.next_out_of_line();
15865            let handles_before = decoder.remaining_handles();
15866            if let Some((inlined, num_bytes, num_handles)) =
15867                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15868            {
15869                let member_inline_size =
15870                    <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
15871                        decoder.context,
15872                    );
15873                if inlined != (member_inline_size <= 4) {
15874                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15875                }
15876                let inner_offset;
15877                let mut inner_depth = depth.clone();
15878                if inlined {
15879                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15880                    inner_offset = next_offset;
15881                } else {
15882                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15883                    inner_depth.increment()?;
15884                }
15885                let val_ref = self
15886                    .name
15887                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
15888                fidl::decode!(
15889                    fidl::encoding::BoundedString<15>,
15890                    D,
15891                    val_ref,
15892                    decoder,
15893                    inner_offset,
15894                    inner_depth
15895                )?;
15896                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15897                {
15898                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15899                }
15900                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15901                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15902                }
15903            }
15904
15905            next_offset += envelope_size;
15906            _next_ordinal_to_read += 1;
15907            if next_offset >= end_offset {
15908                return Ok(());
15909            }
15910
15911            // Decode unknown envelopes for gaps in ordinals.
15912            while _next_ordinal_to_read < 4 {
15913                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15914                _next_ordinal_to_read += 1;
15915                next_offset += envelope_size;
15916            }
15917
15918            let next_out_of_line = decoder.next_out_of_line();
15919            let handles_before = decoder.remaining_handles();
15920            if let Some((inlined, num_bytes, num_handles)) =
15921                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15922            {
15923                let member_inline_size = <fidl::encoding::UnboundedVector<
15924                    fidl_fuchsia_net__common::Subnet,
15925                > as fidl::encoding::TypeMarker>::inline_size(
15926                    decoder.context
15927                );
15928                if inlined != (member_inline_size <= 4) {
15929                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15930                }
15931                let inner_offset;
15932                let mut inner_depth = depth.clone();
15933                if inlined {
15934                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15935                    inner_offset = next_offset;
15936                } else {
15937                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15938                    inner_depth.increment()?;
15939                }
15940                let val_ref = self.addresses.get_or_insert_with(|| {
15941                    fidl::new_empty!(
15942                        fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet>,
15943                        D
15944                    )
15945                });
15946                fidl::decode!(
15947                    fidl::encoding::UnboundedVector<fidl_fuchsia_net__common::Subnet>,
15948                    D,
15949                    val_ref,
15950                    decoder,
15951                    inner_offset,
15952                    inner_depth
15953                )?;
15954                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15955                {
15956                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15957                }
15958                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15959                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15960                }
15961            }
15962
15963            next_offset += envelope_size;
15964            _next_ordinal_to_read += 1;
15965            if next_offset >= end_offset {
15966                return Ok(());
15967            }
15968
15969            // Decode unknown envelopes for gaps in ordinals.
15970            while _next_ordinal_to_read < 5 {
15971                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15972                _next_ordinal_to_read += 1;
15973                next_offset += envelope_size;
15974            }
15975
15976            let next_out_of_line = decoder.next_out_of_line();
15977            let handles_before = decoder.remaining_handles();
15978            if let Some((inlined, num_bytes, num_handles)) =
15979                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15980            {
15981                let member_inline_size =
15982                    <InterfaceFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15983                if inlined != (member_inline_size <= 4) {
15984                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15985                }
15986                let inner_offset;
15987                let mut inner_depth = depth.clone();
15988                if inlined {
15989                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15990                    inner_offset = next_offset;
15991                } else {
15992                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15993                    inner_depth.increment()?;
15994                }
15995                let val_ref =
15996                    self.interface_flags.get_or_insert_with(|| fidl::new_empty!(InterfaceFlags, D));
15997                fidl::decode!(InterfaceFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
15998                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15999                {
16000                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16001                }
16002                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16003                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16004                }
16005            }
16006
16007            next_offset += envelope_size;
16008
16009            // Decode the remaining unknown envelopes.
16010            while next_offset < end_offset {
16011                _next_ordinal_to_read += 1;
16012                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16013                next_offset += envelope_size;
16014            }
16015
16016            Ok(())
16017        }
16018    }
16019
16020    impl IpRecvControlData {
16021        #[inline(always)]
16022        fn max_ordinal_present(&self) -> u64 {
16023            if let Some(_) = self.original_destination_address {
16024                return 3;
16025            }
16026            if let Some(_) = self.ttl {
16027                return 2;
16028            }
16029            if let Some(_) = self.tos {
16030                return 1;
16031            }
16032            0
16033        }
16034    }
16035
16036    impl fidl::encoding::ValueTypeMarker for IpRecvControlData {
16037        type Borrowed<'a> = &'a Self;
16038        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16039            value
16040        }
16041    }
16042
16043    unsafe impl fidl::encoding::TypeMarker for IpRecvControlData {
16044        type Owned = Self;
16045
16046        #[inline(always)]
16047        fn inline_align(_context: fidl::encoding::Context) -> usize {
16048            8
16049        }
16050
16051        #[inline(always)]
16052        fn inline_size(_context: fidl::encoding::Context) -> usize {
16053            16
16054        }
16055    }
16056
16057    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpRecvControlData, D>
16058        for &IpRecvControlData
16059    {
16060        unsafe fn encode(
16061            self,
16062            encoder: &mut fidl::encoding::Encoder<'_, D>,
16063            offset: usize,
16064            mut depth: fidl::encoding::Depth,
16065        ) -> fidl::Result<()> {
16066            encoder.debug_check_bounds::<IpRecvControlData>(offset);
16067            // Vector header
16068            let max_ordinal: u64 = self.max_ordinal_present();
16069            encoder.write_num(max_ordinal, offset);
16070            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16071            // Calling encoder.out_of_line_offset(0) is not allowed.
16072            if max_ordinal == 0 {
16073                return Ok(());
16074            }
16075            depth.increment()?;
16076            let envelope_size = 8;
16077            let bytes_len = max_ordinal as usize * envelope_size;
16078            #[allow(unused_variables)]
16079            let offset = encoder.out_of_line_offset(bytes_len);
16080            let mut _prev_end_offset: usize = 0;
16081            if 1 > max_ordinal {
16082                return Ok(());
16083            }
16084
16085            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16086            // are envelope_size bytes.
16087            let cur_offset: usize = (1 - 1) * envelope_size;
16088
16089            // Zero reserved fields.
16090            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16091
16092            // Safety:
16093            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16094            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16095            //   envelope_size bytes, there is always sufficient room.
16096            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16097                self.tos.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16098                encoder,
16099                offset + cur_offset,
16100                depth,
16101            )?;
16102
16103            _prev_end_offset = cur_offset + envelope_size;
16104            if 2 > max_ordinal {
16105                return Ok(());
16106            }
16107
16108            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16109            // are envelope_size bytes.
16110            let cur_offset: usize = (2 - 1) * envelope_size;
16111
16112            // Zero reserved fields.
16113            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16114
16115            // Safety:
16116            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16117            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16118            //   envelope_size bytes, there is always sufficient room.
16119            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16120                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16121                encoder,
16122                offset + cur_offset,
16123                depth,
16124            )?;
16125
16126            _prev_end_offset = cur_offset + envelope_size;
16127            if 3 > max_ordinal {
16128                return Ok(());
16129            }
16130
16131            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16132            // are envelope_size bytes.
16133            let cur_offset: usize = (3 - 1) * envelope_size;
16134
16135            // Zero reserved fields.
16136            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16137
16138            // Safety:
16139            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16140            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16141            //   envelope_size bytes, there is always sufficient room.
16142            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
16143            self.original_destination_address.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
16144            encoder, offset + cur_offset, depth
16145        )?;
16146
16147            _prev_end_offset = cur_offset + envelope_size;
16148
16149            Ok(())
16150        }
16151    }
16152
16153    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpRecvControlData {
16154        #[inline(always)]
16155        fn new_empty() -> Self {
16156            Self::default()
16157        }
16158
16159        unsafe fn decode(
16160            &mut self,
16161            decoder: &mut fidl::encoding::Decoder<'_, D>,
16162            offset: usize,
16163            mut depth: fidl::encoding::Depth,
16164        ) -> fidl::Result<()> {
16165            decoder.debug_check_bounds::<Self>(offset);
16166            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16167                None => return Err(fidl::Error::NotNullable),
16168                Some(len) => len,
16169            };
16170            // Calling decoder.out_of_line_offset(0) is not allowed.
16171            if len == 0 {
16172                return Ok(());
16173            };
16174            depth.increment()?;
16175            let envelope_size = 8;
16176            let bytes_len = len * envelope_size;
16177            let offset = decoder.out_of_line_offset(bytes_len)?;
16178            // Decode the envelope for each type.
16179            let mut _next_ordinal_to_read = 0;
16180            let mut next_offset = offset;
16181            let end_offset = offset + bytes_len;
16182            _next_ordinal_to_read += 1;
16183            if next_offset >= end_offset {
16184                return Ok(());
16185            }
16186
16187            // Decode unknown envelopes for gaps in ordinals.
16188            while _next_ordinal_to_read < 1 {
16189                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16190                _next_ordinal_to_read += 1;
16191                next_offset += envelope_size;
16192            }
16193
16194            let next_out_of_line = decoder.next_out_of_line();
16195            let handles_before = decoder.remaining_handles();
16196            if let Some((inlined, num_bytes, num_handles)) =
16197                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16198            {
16199                let member_inline_size =
16200                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16201                if inlined != (member_inline_size <= 4) {
16202                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16203                }
16204                let inner_offset;
16205                let mut inner_depth = depth.clone();
16206                if inlined {
16207                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16208                    inner_offset = next_offset;
16209                } else {
16210                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16211                    inner_depth.increment()?;
16212                }
16213                let val_ref = self.tos.get_or_insert_with(|| fidl::new_empty!(u8, D));
16214                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16215                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16216                {
16217                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16218                }
16219                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16220                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16221                }
16222            }
16223
16224            next_offset += envelope_size;
16225            _next_ordinal_to_read += 1;
16226            if next_offset >= end_offset {
16227                return Ok(());
16228            }
16229
16230            // Decode unknown envelopes for gaps in ordinals.
16231            while _next_ordinal_to_read < 2 {
16232                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16233                _next_ordinal_to_read += 1;
16234                next_offset += envelope_size;
16235            }
16236
16237            let next_out_of_line = decoder.next_out_of_line();
16238            let handles_before = decoder.remaining_handles();
16239            if let Some((inlined, num_bytes, num_handles)) =
16240                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16241            {
16242                let member_inline_size =
16243                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16244                if inlined != (member_inline_size <= 4) {
16245                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16246                }
16247                let inner_offset;
16248                let mut inner_depth = depth.clone();
16249                if inlined {
16250                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16251                    inner_offset = next_offset;
16252                } else {
16253                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16254                    inner_depth.increment()?;
16255                }
16256                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16257                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16258                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16259                {
16260                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16261                }
16262                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16263                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16264                }
16265            }
16266
16267            next_offset += envelope_size;
16268            _next_ordinal_to_read += 1;
16269            if next_offset >= end_offset {
16270                return Ok(());
16271            }
16272
16273            // Decode unknown envelopes for gaps in ordinals.
16274            while _next_ordinal_to_read < 3 {
16275                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16276                _next_ordinal_to_read += 1;
16277                next_offset += envelope_size;
16278            }
16279
16280            let next_out_of_line = decoder.next_out_of_line();
16281            let handles_before = decoder.remaining_handles();
16282            if let Some((inlined, num_bytes, num_handles)) =
16283                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16284            {
16285                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16286                if inlined != (member_inline_size <= 4) {
16287                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16288                }
16289                let inner_offset;
16290                let mut inner_depth = depth.clone();
16291                if inlined {
16292                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16293                    inner_offset = next_offset;
16294                } else {
16295                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16296                    inner_depth.increment()?;
16297                }
16298                let val_ref = self.original_destination_address.get_or_insert_with(|| {
16299                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
16300                });
16301                fidl::decode!(
16302                    fidl_fuchsia_net__common::SocketAddress,
16303                    D,
16304                    val_ref,
16305                    decoder,
16306                    inner_offset,
16307                    inner_depth
16308                )?;
16309                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16310                {
16311                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16312                }
16313                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16314                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16315                }
16316            }
16317
16318            next_offset += envelope_size;
16319
16320            // Decode the remaining unknown envelopes.
16321            while next_offset < end_offset {
16322                _next_ordinal_to_read += 1;
16323                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16324                next_offset += envelope_size;
16325            }
16326
16327            Ok(())
16328        }
16329    }
16330
16331    impl IpSendControlData {
16332        #[inline(always)]
16333        fn max_ordinal_present(&self) -> u64 {
16334            if let Some(_) = self.ttl {
16335                return 2;
16336            }
16337            0
16338        }
16339    }
16340
16341    impl fidl::encoding::ValueTypeMarker for IpSendControlData {
16342        type Borrowed<'a> = &'a Self;
16343        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16344            value
16345        }
16346    }
16347
16348    unsafe impl fidl::encoding::TypeMarker for IpSendControlData {
16349        type Owned = Self;
16350
16351        #[inline(always)]
16352        fn inline_align(_context: fidl::encoding::Context) -> usize {
16353            8
16354        }
16355
16356        #[inline(always)]
16357        fn inline_size(_context: fidl::encoding::Context) -> usize {
16358            16
16359        }
16360    }
16361
16362    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpSendControlData, D>
16363        for &IpSendControlData
16364    {
16365        unsafe fn encode(
16366            self,
16367            encoder: &mut fidl::encoding::Encoder<'_, D>,
16368            offset: usize,
16369            mut depth: fidl::encoding::Depth,
16370        ) -> fidl::Result<()> {
16371            encoder.debug_check_bounds::<IpSendControlData>(offset);
16372            // Vector header
16373            let max_ordinal: u64 = self.max_ordinal_present();
16374            encoder.write_num(max_ordinal, offset);
16375            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16376            // Calling encoder.out_of_line_offset(0) is not allowed.
16377            if max_ordinal == 0 {
16378                return Ok(());
16379            }
16380            depth.increment()?;
16381            let envelope_size = 8;
16382            let bytes_len = max_ordinal as usize * envelope_size;
16383            #[allow(unused_variables)]
16384            let offset = encoder.out_of_line_offset(bytes_len);
16385            let mut _prev_end_offset: usize = 0;
16386            if 2 > max_ordinal {
16387                return Ok(());
16388            }
16389
16390            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16391            // are envelope_size bytes.
16392            let cur_offset: usize = (2 - 1) * envelope_size;
16393
16394            // Zero reserved fields.
16395            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16396
16397            // Safety:
16398            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16399            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16400            //   envelope_size bytes, there is always sufficient room.
16401            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16402                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16403                encoder,
16404                offset + cur_offset,
16405                depth,
16406            )?;
16407
16408            _prev_end_offset = cur_offset + envelope_size;
16409
16410            Ok(())
16411        }
16412    }
16413
16414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpSendControlData {
16415        #[inline(always)]
16416        fn new_empty() -> Self {
16417            Self::default()
16418        }
16419
16420        unsafe fn decode(
16421            &mut self,
16422            decoder: &mut fidl::encoding::Decoder<'_, D>,
16423            offset: usize,
16424            mut depth: fidl::encoding::Depth,
16425        ) -> fidl::Result<()> {
16426            decoder.debug_check_bounds::<Self>(offset);
16427            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16428                None => return Err(fidl::Error::NotNullable),
16429                Some(len) => len,
16430            };
16431            // Calling decoder.out_of_line_offset(0) is not allowed.
16432            if len == 0 {
16433                return Ok(());
16434            };
16435            depth.increment()?;
16436            let envelope_size = 8;
16437            let bytes_len = len * envelope_size;
16438            let offset = decoder.out_of_line_offset(bytes_len)?;
16439            // Decode the envelope for each type.
16440            let mut _next_ordinal_to_read = 0;
16441            let mut next_offset = offset;
16442            let end_offset = offset + bytes_len;
16443            _next_ordinal_to_read += 1;
16444            if next_offset >= end_offset {
16445                return Ok(());
16446            }
16447
16448            // Decode unknown envelopes for gaps in ordinals.
16449            while _next_ordinal_to_read < 2 {
16450                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16451                _next_ordinal_to_read += 1;
16452                next_offset += envelope_size;
16453            }
16454
16455            let next_out_of_line = decoder.next_out_of_line();
16456            let handles_before = decoder.remaining_handles();
16457            if let Some((inlined, num_bytes, num_handles)) =
16458                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16459            {
16460                let member_inline_size =
16461                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16462                if inlined != (member_inline_size <= 4) {
16463                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16464                }
16465                let inner_offset;
16466                let mut inner_depth = depth.clone();
16467                if inlined {
16468                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16469                    inner_offset = next_offset;
16470                } else {
16471                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16472                    inner_depth.increment()?;
16473                }
16474                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16475                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16476                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16477                {
16478                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16479                }
16480                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16481                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16482                }
16483            }
16484
16485            next_offset += envelope_size;
16486
16487            // Decode the remaining unknown envelopes.
16488            while next_offset < end_offset {
16489                _next_ordinal_to_read += 1;
16490                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16491                next_offset += envelope_size;
16492            }
16493
16494            Ok(())
16495        }
16496    }
16497
16498    impl Ipv6RecvControlData {
16499        #[inline(always)]
16500        fn max_ordinal_present(&self) -> u64 {
16501            if let Some(_) = self.pktinfo {
16502                return 3;
16503            }
16504            if let Some(_) = self.hoplimit {
16505                return 2;
16506            }
16507            if let Some(_) = self.tclass {
16508                return 1;
16509            }
16510            0
16511        }
16512    }
16513
16514    impl fidl::encoding::ValueTypeMarker for Ipv6RecvControlData {
16515        type Borrowed<'a> = &'a Self;
16516        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16517            value
16518        }
16519    }
16520
16521    unsafe impl fidl::encoding::TypeMarker for Ipv6RecvControlData {
16522        type Owned = Self;
16523
16524        #[inline(always)]
16525        fn inline_align(_context: fidl::encoding::Context) -> usize {
16526            8
16527        }
16528
16529        #[inline(always)]
16530        fn inline_size(_context: fidl::encoding::Context) -> usize {
16531            16
16532        }
16533    }
16534
16535    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6RecvControlData, D>
16536        for &Ipv6RecvControlData
16537    {
16538        unsafe fn encode(
16539            self,
16540            encoder: &mut fidl::encoding::Encoder<'_, D>,
16541            offset: usize,
16542            mut depth: fidl::encoding::Depth,
16543        ) -> fidl::Result<()> {
16544            encoder.debug_check_bounds::<Ipv6RecvControlData>(offset);
16545            // Vector header
16546            let max_ordinal: u64 = self.max_ordinal_present();
16547            encoder.write_num(max_ordinal, offset);
16548            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16549            // Calling encoder.out_of_line_offset(0) is not allowed.
16550            if max_ordinal == 0 {
16551                return Ok(());
16552            }
16553            depth.increment()?;
16554            let envelope_size = 8;
16555            let bytes_len = max_ordinal as usize * envelope_size;
16556            #[allow(unused_variables)]
16557            let offset = encoder.out_of_line_offset(bytes_len);
16558            let mut _prev_end_offset: usize = 0;
16559            if 1 > max_ordinal {
16560                return Ok(());
16561            }
16562
16563            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16564            // are envelope_size bytes.
16565            let cur_offset: usize = (1 - 1) * envelope_size;
16566
16567            // Zero reserved fields.
16568            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16569
16570            // Safety:
16571            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16572            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16573            //   envelope_size bytes, there is always sufficient room.
16574            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16575                self.tclass.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16576                encoder,
16577                offset + cur_offset,
16578                depth,
16579            )?;
16580
16581            _prev_end_offset = cur_offset + envelope_size;
16582            if 2 > max_ordinal {
16583                return Ok(());
16584            }
16585
16586            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16587            // are envelope_size bytes.
16588            let cur_offset: usize = (2 - 1) * envelope_size;
16589
16590            // Zero reserved fields.
16591            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16592
16593            // Safety:
16594            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16595            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16596            //   envelope_size bytes, there is always sufficient room.
16597            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16598                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16599                encoder,
16600                offset + cur_offset,
16601                depth,
16602            )?;
16603
16604            _prev_end_offset = cur_offset + envelope_size;
16605            if 3 > max_ordinal {
16606                return Ok(());
16607            }
16608
16609            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16610            // are envelope_size bytes.
16611            let cur_offset: usize = (3 - 1) * envelope_size;
16612
16613            // Zero reserved fields.
16614            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16615
16616            // Safety:
16617            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16618            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16619            //   envelope_size bytes, there is always sufficient room.
16620            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoRecvControlData, D>(
16621                self.pktinfo
16622                    .as_ref()
16623                    .map(<Ipv6PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16624                encoder,
16625                offset + cur_offset,
16626                depth,
16627            )?;
16628
16629            _prev_end_offset = cur_offset + envelope_size;
16630
16631            Ok(())
16632        }
16633    }
16634
16635    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6RecvControlData {
16636        #[inline(always)]
16637        fn new_empty() -> Self {
16638            Self::default()
16639        }
16640
16641        unsafe fn decode(
16642            &mut self,
16643            decoder: &mut fidl::encoding::Decoder<'_, D>,
16644            offset: usize,
16645            mut depth: fidl::encoding::Depth,
16646        ) -> fidl::Result<()> {
16647            decoder.debug_check_bounds::<Self>(offset);
16648            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16649                None => return Err(fidl::Error::NotNullable),
16650                Some(len) => len,
16651            };
16652            // Calling decoder.out_of_line_offset(0) is not allowed.
16653            if len == 0 {
16654                return Ok(());
16655            };
16656            depth.increment()?;
16657            let envelope_size = 8;
16658            let bytes_len = len * envelope_size;
16659            let offset = decoder.out_of_line_offset(bytes_len)?;
16660            // Decode the envelope for each type.
16661            let mut _next_ordinal_to_read = 0;
16662            let mut next_offset = offset;
16663            let end_offset = offset + bytes_len;
16664            _next_ordinal_to_read += 1;
16665            if next_offset >= end_offset {
16666                return Ok(());
16667            }
16668
16669            // Decode unknown envelopes for gaps in ordinals.
16670            while _next_ordinal_to_read < 1 {
16671                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16672                _next_ordinal_to_read += 1;
16673                next_offset += envelope_size;
16674            }
16675
16676            let next_out_of_line = decoder.next_out_of_line();
16677            let handles_before = decoder.remaining_handles();
16678            if let Some((inlined, num_bytes, num_handles)) =
16679                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16680            {
16681                let member_inline_size =
16682                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16683                if inlined != (member_inline_size <= 4) {
16684                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16685                }
16686                let inner_offset;
16687                let mut inner_depth = depth.clone();
16688                if inlined {
16689                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16690                    inner_offset = next_offset;
16691                } else {
16692                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16693                    inner_depth.increment()?;
16694                }
16695                let val_ref = self.tclass.get_or_insert_with(|| fidl::new_empty!(u8, D));
16696                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16697                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16698                {
16699                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16700                }
16701                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16702                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16703                }
16704            }
16705
16706            next_offset += envelope_size;
16707            _next_ordinal_to_read += 1;
16708            if next_offset >= end_offset {
16709                return Ok(());
16710            }
16711
16712            // Decode unknown envelopes for gaps in ordinals.
16713            while _next_ordinal_to_read < 2 {
16714                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16715                _next_ordinal_to_read += 1;
16716                next_offset += envelope_size;
16717            }
16718
16719            let next_out_of_line = decoder.next_out_of_line();
16720            let handles_before = decoder.remaining_handles();
16721            if let Some((inlined, num_bytes, num_handles)) =
16722                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16723            {
16724                let member_inline_size =
16725                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16726                if inlined != (member_inline_size <= 4) {
16727                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16728                }
16729                let inner_offset;
16730                let mut inner_depth = depth.clone();
16731                if inlined {
16732                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16733                    inner_offset = next_offset;
16734                } else {
16735                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16736                    inner_depth.increment()?;
16737                }
16738                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16739                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16740                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16741                {
16742                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16743                }
16744                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16745                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16746                }
16747            }
16748
16749            next_offset += envelope_size;
16750            _next_ordinal_to_read += 1;
16751            if next_offset >= end_offset {
16752                return Ok(());
16753            }
16754
16755            // Decode unknown envelopes for gaps in ordinals.
16756            while _next_ordinal_to_read < 3 {
16757                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16758                _next_ordinal_to_read += 1;
16759                next_offset += envelope_size;
16760            }
16761
16762            let next_out_of_line = decoder.next_out_of_line();
16763            let handles_before = decoder.remaining_handles();
16764            if let Some((inlined, num_bytes, num_handles)) =
16765                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16766            {
16767                let member_inline_size =
16768                    <Ipv6PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16769                        decoder.context,
16770                    );
16771                if inlined != (member_inline_size <= 4) {
16772                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16773                }
16774                let inner_offset;
16775                let mut inner_depth = depth.clone();
16776                if inlined {
16777                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16778                    inner_offset = next_offset;
16779                } else {
16780                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16781                    inner_depth.increment()?;
16782                }
16783                let val_ref = self
16784                    .pktinfo
16785                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoRecvControlData, D));
16786                fidl::decode!(
16787                    Ipv6PktInfoRecvControlData,
16788                    D,
16789                    val_ref,
16790                    decoder,
16791                    inner_offset,
16792                    inner_depth
16793                )?;
16794                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16795                {
16796                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16797                }
16798                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16799                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16800                }
16801            }
16802
16803            next_offset += envelope_size;
16804
16805            // Decode the remaining unknown envelopes.
16806            while next_offset < end_offset {
16807                _next_ordinal_to_read += 1;
16808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16809                next_offset += envelope_size;
16810            }
16811
16812            Ok(())
16813        }
16814    }
16815
16816    impl Ipv6SendControlData {
16817        #[inline(always)]
16818        fn max_ordinal_present(&self) -> u64 {
16819            if let Some(_) = self.pktinfo {
16820                return 3;
16821            }
16822            if let Some(_) = self.hoplimit {
16823                return 2;
16824            }
16825            0
16826        }
16827    }
16828
16829    impl fidl::encoding::ValueTypeMarker for Ipv6SendControlData {
16830        type Borrowed<'a> = &'a Self;
16831        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16832            value
16833        }
16834    }
16835
16836    unsafe impl fidl::encoding::TypeMarker for Ipv6SendControlData {
16837        type Owned = Self;
16838
16839        #[inline(always)]
16840        fn inline_align(_context: fidl::encoding::Context) -> usize {
16841            8
16842        }
16843
16844        #[inline(always)]
16845        fn inline_size(_context: fidl::encoding::Context) -> usize {
16846            16
16847        }
16848    }
16849
16850    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6SendControlData, D>
16851        for &Ipv6SendControlData
16852    {
16853        unsafe fn encode(
16854            self,
16855            encoder: &mut fidl::encoding::Encoder<'_, D>,
16856            offset: usize,
16857            mut depth: fidl::encoding::Depth,
16858        ) -> fidl::Result<()> {
16859            encoder.debug_check_bounds::<Ipv6SendControlData>(offset);
16860            // Vector header
16861            let max_ordinal: u64 = self.max_ordinal_present();
16862            encoder.write_num(max_ordinal, offset);
16863            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16864            // Calling encoder.out_of_line_offset(0) is not allowed.
16865            if max_ordinal == 0 {
16866                return Ok(());
16867            }
16868            depth.increment()?;
16869            let envelope_size = 8;
16870            let bytes_len = max_ordinal as usize * envelope_size;
16871            #[allow(unused_variables)]
16872            let offset = encoder.out_of_line_offset(bytes_len);
16873            let mut _prev_end_offset: usize = 0;
16874            if 2 > max_ordinal {
16875                return Ok(());
16876            }
16877
16878            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16879            // are envelope_size bytes.
16880            let cur_offset: usize = (2 - 1) * envelope_size;
16881
16882            // Zero reserved fields.
16883            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16884
16885            // Safety:
16886            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16887            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16888            //   envelope_size bytes, there is always sufficient room.
16889            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16890                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16891                encoder,
16892                offset + cur_offset,
16893                depth,
16894            )?;
16895
16896            _prev_end_offset = cur_offset + envelope_size;
16897            if 3 > max_ordinal {
16898                return Ok(());
16899            }
16900
16901            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16902            // are envelope_size bytes.
16903            let cur_offset: usize = (3 - 1) * envelope_size;
16904
16905            // Zero reserved fields.
16906            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16907
16908            // Safety:
16909            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16910            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16911            //   envelope_size bytes, there is always sufficient room.
16912            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
16913                self.pktinfo
16914                    .as_ref()
16915                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16916                encoder,
16917                offset + cur_offset,
16918                depth,
16919            )?;
16920
16921            _prev_end_offset = cur_offset + envelope_size;
16922
16923            Ok(())
16924        }
16925    }
16926
16927    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6SendControlData {
16928        #[inline(always)]
16929        fn new_empty() -> Self {
16930            Self::default()
16931        }
16932
16933        unsafe fn decode(
16934            &mut self,
16935            decoder: &mut fidl::encoding::Decoder<'_, D>,
16936            offset: usize,
16937            mut depth: fidl::encoding::Depth,
16938        ) -> fidl::Result<()> {
16939            decoder.debug_check_bounds::<Self>(offset);
16940            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16941                None => return Err(fidl::Error::NotNullable),
16942                Some(len) => len,
16943            };
16944            // Calling decoder.out_of_line_offset(0) is not allowed.
16945            if len == 0 {
16946                return Ok(());
16947            };
16948            depth.increment()?;
16949            let envelope_size = 8;
16950            let bytes_len = len * envelope_size;
16951            let offset = decoder.out_of_line_offset(bytes_len)?;
16952            // Decode the envelope for each type.
16953            let mut _next_ordinal_to_read = 0;
16954            let mut next_offset = offset;
16955            let end_offset = offset + bytes_len;
16956            _next_ordinal_to_read += 1;
16957            if next_offset >= end_offset {
16958                return Ok(());
16959            }
16960
16961            // Decode unknown envelopes for gaps in ordinals.
16962            while _next_ordinal_to_read < 2 {
16963                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16964                _next_ordinal_to_read += 1;
16965                next_offset += envelope_size;
16966            }
16967
16968            let next_out_of_line = decoder.next_out_of_line();
16969            let handles_before = decoder.remaining_handles();
16970            if let Some((inlined, num_bytes, num_handles)) =
16971                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16972            {
16973                let member_inline_size =
16974                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16975                if inlined != (member_inline_size <= 4) {
16976                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16977                }
16978                let inner_offset;
16979                let mut inner_depth = depth.clone();
16980                if inlined {
16981                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16982                    inner_offset = next_offset;
16983                } else {
16984                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16985                    inner_depth.increment()?;
16986                }
16987                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16988                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16989                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16990                {
16991                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16992                }
16993                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16994                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16995                }
16996            }
16997
16998            next_offset += envelope_size;
16999            _next_ordinal_to_read += 1;
17000            if next_offset >= end_offset {
17001                return Ok(());
17002            }
17003
17004            // Decode unknown envelopes for gaps in ordinals.
17005            while _next_ordinal_to_read < 3 {
17006                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17007                _next_ordinal_to_read += 1;
17008                next_offset += envelope_size;
17009            }
17010
17011            let next_out_of_line = decoder.next_out_of_line();
17012            let handles_before = decoder.remaining_handles();
17013            if let Some((inlined, num_bytes, num_handles)) =
17014                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17015            {
17016                let member_inline_size =
17017                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
17018                        decoder.context,
17019                    );
17020                if inlined != (member_inline_size <= 4) {
17021                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17022                }
17023                let inner_offset;
17024                let mut inner_depth = depth.clone();
17025                if inlined {
17026                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17027                    inner_offset = next_offset;
17028                } else {
17029                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17030                    inner_depth.increment()?;
17031                }
17032                let val_ref = self
17033                    .pktinfo
17034                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
17035                fidl::decode!(
17036                    Ipv6PktInfoSendControlData,
17037                    D,
17038                    val_ref,
17039                    decoder,
17040                    inner_offset,
17041                    inner_depth
17042                )?;
17043                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17044                {
17045                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17046                }
17047                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17048                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17049                }
17050            }
17051
17052            next_offset += envelope_size;
17053
17054            // Decode the remaining unknown envelopes.
17055            while next_offset < end_offset {
17056                _next_ordinal_to_read += 1;
17057                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17058                next_offset += envelope_size;
17059            }
17060
17061            Ok(())
17062        }
17063    }
17064
17065    impl NetworkSocketRecvControlData {
17066        #[inline(always)]
17067        fn max_ordinal_present(&self) -> u64 {
17068            if let Some(_) = self.ipv6 {
17069                return 3;
17070            }
17071            if let Some(_) = self.ip {
17072                return 2;
17073            }
17074            if let Some(_) = self.socket {
17075                return 1;
17076            }
17077            0
17078        }
17079    }
17080
17081    impl fidl::encoding::ValueTypeMarker for NetworkSocketRecvControlData {
17082        type Borrowed<'a> = &'a Self;
17083        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17084            value
17085        }
17086    }
17087
17088    unsafe impl fidl::encoding::TypeMarker for NetworkSocketRecvControlData {
17089        type Owned = Self;
17090
17091        #[inline(always)]
17092        fn inline_align(_context: fidl::encoding::Context) -> usize {
17093            8
17094        }
17095
17096        #[inline(always)]
17097        fn inline_size(_context: fidl::encoding::Context) -> usize {
17098            16
17099        }
17100    }
17101
17102    unsafe impl<D: fidl::encoding::ResourceDialect>
17103        fidl::encoding::Encode<NetworkSocketRecvControlData, D> for &NetworkSocketRecvControlData
17104    {
17105        unsafe fn encode(
17106            self,
17107            encoder: &mut fidl::encoding::Encoder<'_, D>,
17108            offset: usize,
17109            mut depth: fidl::encoding::Depth,
17110        ) -> fidl::Result<()> {
17111            encoder.debug_check_bounds::<NetworkSocketRecvControlData>(offset);
17112            // Vector header
17113            let max_ordinal: u64 = self.max_ordinal_present();
17114            encoder.write_num(max_ordinal, offset);
17115            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17116            // Calling encoder.out_of_line_offset(0) is not allowed.
17117            if max_ordinal == 0 {
17118                return Ok(());
17119            }
17120            depth.increment()?;
17121            let envelope_size = 8;
17122            let bytes_len = max_ordinal as usize * envelope_size;
17123            #[allow(unused_variables)]
17124            let offset = encoder.out_of_line_offset(bytes_len);
17125            let mut _prev_end_offset: usize = 0;
17126            if 1 > max_ordinal {
17127                return Ok(());
17128            }
17129
17130            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17131            // are envelope_size bytes.
17132            let cur_offset: usize = (1 - 1) * envelope_size;
17133
17134            // Zero reserved fields.
17135            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17136
17137            // Safety:
17138            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17139            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17140            //   envelope_size bytes, there is always sufficient room.
17141            fidl::encoding::encode_in_envelope_optional::<SocketRecvControlData, D>(
17142                self.socket
17143                    .as_ref()
17144                    .map(<SocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17145                encoder,
17146                offset + cur_offset,
17147                depth,
17148            )?;
17149
17150            _prev_end_offset = cur_offset + envelope_size;
17151            if 2 > max_ordinal {
17152                return Ok(());
17153            }
17154
17155            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17156            // are envelope_size bytes.
17157            let cur_offset: usize = (2 - 1) * envelope_size;
17158
17159            // Zero reserved fields.
17160            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17161
17162            // Safety:
17163            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17164            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17165            //   envelope_size bytes, there is always sufficient room.
17166            fidl::encoding::encode_in_envelope_optional::<IpRecvControlData, D>(
17167                self.ip
17168                    .as_ref()
17169                    .map(<IpRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17170                encoder,
17171                offset + cur_offset,
17172                depth,
17173            )?;
17174
17175            _prev_end_offset = cur_offset + envelope_size;
17176            if 3 > max_ordinal {
17177                return Ok(());
17178            }
17179
17180            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17181            // are envelope_size bytes.
17182            let cur_offset: usize = (3 - 1) * envelope_size;
17183
17184            // Zero reserved fields.
17185            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17186
17187            // Safety:
17188            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17189            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17190            //   envelope_size bytes, there is always sufficient room.
17191            fidl::encoding::encode_in_envelope_optional::<Ipv6RecvControlData, D>(
17192                self.ipv6
17193                    .as_ref()
17194                    .map(<Ipv6RecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17195                encoder,
17196                offset + cur_offset,
17197                depth,
17198            )?;
17199
17200            _prev_end_offset = cur_offset + envelope_size;
17201
17202            Ok(())
17203        }
17204    }
17205
17206    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17207        for NetworkSocketRecvControlData
17208    {
17209        #[inline(always)]
17210        fn new_empty() -> Self {
17211            Self::default()
17212        }
17213
17214        unsafe fn decode(
17215            &mut self,
17216            decoder: &mut fidl::encoding::Decoder<'_, D>,
17217            offset: usize,
17218            mut depth: fidl::encoding::Depth,
17219        ) -> fidl::Result<()> {
17220            decoder.debug_check_bounds::<Self>(offset);
17221            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17222                None => return Err(fidl::Error::NotNullable),
17223                Some(len) => len,
17224            };
17225            // Calling decoder.out_of_line_offset(0) is not allowed.
17226            if len == 0 {
17227                return Ok(());
17228            };
17229            depth.increment()?;
17230            let envelope_size = 8;
17231            let bytes_len = len * envelope_size;
17232            let offset = decoder.out_of_line_offset(bytes_len)?;
17233            // Decode the envelope for each type.
17234            let mut _next_ordinal_to_read = 0;
17235            let mut next_offset = offset;
17236            let end_offset = offset + bytes_len;
17237            _next_ordinal_to_read += 1;
17238            if next_offset >= end_offset {
17239                return Ok(());
17240            }
17241
17242            // Decode unknown envelopes for gaps in ordinals.
17243            while _next_ordinal_to_read < 1 {
17244                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17245                _next_ordinal_to_read += 1;
17246                next_offset += envelope_size;
17247            }
17248
17249            let next_out_of_line = decoder.next_out_of_line();
17250            let handles_before = decoder.remaining_handles();
17251            if let Some((inlined, num_bytes, num_handles)) =
17252                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17253            {
17254                let member_inline_size =
17255                    <SocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17256                        decoder.context,
17257                    );
17258                if inlined != (member_inline_size <= 4) {
17259                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17260                }
17261                let inner_offset;
17262                let mut inner_depth = depth.clone();
17263                if inlined {
17264                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17265                    inner_offset = next_offset;
17266                } else {
17267                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17268                    inner_depth.increment()?;
17269                }
17270                let val_ref =
17271                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketRecvControlData, D));
17272                fidl::decode!(
17273                    SocketRecvControlData,
17274                    D,
17275                    val_ref,
17276                    decoder,
17277                    inner_offset,
17278                    inner_depth
17279                )?;
17280                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17281                {
17282                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17283                }
17284                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17285                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17286                }
17287            }
17288
17289            next_offset += envelope_size;
17290            _next_ordinal_to_read += 1;
17291            if next_offset >= end_offset {
17292                return Ok(());
17293            }
17294
17295            // Decode unknown envelopes for gaps in ordinals.
17296            while _next_ordinal_to_read < 2 {
17297                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17298                _next_ordinal_to_read += 1;
17299                next_offset += envelope_size;
17300            }
17301
17302            let next_out_of_line = decoder.next_out_of_line();
17303            let handles_before = decoder.remaining_handles();
17304            if let Some((inlined, num_bytes, num_handles)) =
17305                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17306            {
17307                let member_inline_size =
17308                    <IpRecvControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17309                if inlined != (member_inline_size <= 4) {
17310                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17311                }
17312                let inner_offset;
17313                let mut inner_depth = depth.clone();
17314                if inlined {
17315                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17316                    inner_offset = next_offset;
17317                } else {
17318                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17319                    inner_depth.increment()?;
17320                }
17321                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpRecvControlData, D));
17322                fidl::decode!(IpRecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17323                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17324                {
17325                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17326                }
17327                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17328                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17329                }
17330            }
17331
17332            next_offset += envelope_size;
17333            _next_ordinal_to_read += 1;
17334            if next_offset >= end_offset {
17335                return Ok(());
17336            }
17337
17338            // Decode unknown envelopes for gaps in ordinals.
17339            while _next_ordinal_to_read < 3 {
17340                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17341                _next_ordinal_to_read += 1;
17342                next_offset += envelope_size;
17343            }
17344
17345            let next_out_of_line = decoder.next_out_of_line();
17346            let handles_before = decoder.remaining_handles();
17347            if let Some((inlined, num_bytes, num_handles)) =
17348                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17349            {
17350                let member_inline_size =
17351                    <Ipv6RecvControlData as fidl::encoding::TypeMarker>::inline_size(
17352                        decoder.context,
17353                    );
17354                if inlined != (member_inline_size <= 4) {
17355                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17356                }
17357                let inner_offset;
17358                let mut inner_depth = depth.clone();
17359                if inlined {
17360                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17361                    inner_offset = next_offset;
17362                } else {
17363                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17364                    inner_depth.increment()?;
17365                }
17366                let val_ref =
17367                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6RecvControlData, D));
17368                fidl::decode!(Ipv6RecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17369                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17370                {
17371                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17372                }
17373                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17374                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17375                }
17376            }
17377
17378            next_offset += envelope_size;
17379
17380            // Decode the remaining unknown envelopes.
17381            while next_offset < end_offset {
17382                _next_ordinal_to_read += 1;
17383                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17384                next_offset += envelope_size;
17385            }
17386
17387            Ok(())
17388        }
17389    }
17390
17391    impl NetworkSocketSendControlData {
17392        #[inline(always)]
17393        fn max_ordinal_present(&self) -> u64 {
17394            if let Some(_) = self.ipv6 {
17395                return 3;
17396            }
17397            if let Some(_) = self.ip {
17398                return 2;
17399            }
17400            if let Some(_) = self.socket {
17401                return 1;
17402            }
17403            0
17404        }
17405    }
17406
17407    impl fidl::encoding::ValueTypeMarker for NetworkSocketSendControlData {
17408        type Borrowed<'a> = &'a Self;
17409        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17410            value
17411        }
17412    }
17413
17414    unsafe impl fidl::encoding::TypeMarker for NetworkSocketSendControlData {
17415        type Owned = Self;
17416
17417        #[inline(always)]
17418        fn inline_align(_context: fidl::encoding::Context) -> usize {
17419            8
17420        }
17421
17422        #[inline(always)]
17423        fn inline_size(_context: fidl::encoding::Context) -> usize {
17424            16
17425        }
17426    }
17427
17428    unsafe impl<D: fidl::encoding::ResourceDialect>
17429        fidl::encoding::Encode<NetworkSocketSendControlData, D> for &NetworkSocketSendControlData
17430    {
17431        unsafe fn encode(
17432            self,
17433            encoder: &mut fidl::encoding::Encoder<'_, D>,
17434            offset: usize,
17435            mut depth: fidl::encoding::Depth,
17436        ) -> fidl::Result<()> {
17437            encoder.debug_check_bounds::<NetworkSocketSendControlData>(offset);
17438            // Vector header
17439            let max_ordinal: u64 = self.max_ordinal_present();
17440            encoder.write_num(max_ordinal, offset);
17441            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17442            // Calling encoder.out_of_line_offset(0) is not allowed.
17443            if max_ordinal == 0 {
17444                return Ok(());
17445            }
17446            depth.increment()?;
17447            let envelope_size = 8;
17448            let bytes_len = max_ordinal as usize * envelope_size;
17449            #[allow(unused_variables)]
17450            let offset = encoder.out_of_line_offset(bytes_len);
17451            let mut _prev_end_offset: usize = 0;
17452            if 1 > max_ordinal {
17453                return Ok(());
17454            }
17455
17456            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17457            // are envelope_size bytes.
17458            let cur_offset: usize = (1 - 1) * envelope_size;
17459
17460            // Zero reserved fields.
17461            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17462
17463            // Safety:
17464            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17465            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17466            //   envelope_size bytes, there is always sufficient room.
17467            fidl::encoding::encode_in_envelope_optional::<SocketSendControlData, D>(
17468                self.socket
17469                    .as_ref()
17470                    .map(<SocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17471                encoder,
17472                offset + cur_offset,
17473                depth,
17474            )?;
17475
17476            _prev_end_offset = cur_offset + envelope_size;
17477            if 2 > max_ordinal {
17478                return Ok(());
17479            }
17480
17481            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17482            // are envelope_size bytes.
17483            let cur_offset: usize = (2 - 1) * envelope_size;
17484
17485            // Zero reserved fields.
17486            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17487
17488            // Safety:
17489            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17490            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17491            //   envelope_size bytes, there is always sufficient room.
17492            fidl::encoding::encode_in_envelope_optional::<IpSendControlData, D>(
17493                self.ip
17494                    .as_ref()
17495                    .map(<IpSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17496                encoder,
17497                offset + cur_offset,
17498                depth,
17499            )?;
17500
17501            _prev_end_offset = cur_offset + envelope_size;
17502            if 3 > max_ordinal {
17503                return Ok(());
17504            }
17505
17506            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17507            // are envelope_size bytes.
17508            let cur_offset: usize = (3 - 1) * envelope_size;
17509
17510            // Zero reserved fields.
17511            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17512
17513            // Safety:
17514            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17515            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17516            //   envelope_size bytes, there is always sufficient room.
17517            fidl::encoding::encode_in_envelope_optional::<Ipv6SendControlData, D>(
17518                self.ipv6
17519                    .as_ref()
17520                    .map(<Ipv6SendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17521                encoder,
17522                offset + cur_offset,
17523                depth,
17524            )?;
17525
17526            _prev_end_offset = cur_offset + envelope_size;
17527
17528            Ok(())
17529        }
17530    }
17531
17532    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17533        for NetworkSocketSendControlData
17534    {
17535        #[inline(always)]
17536        fn new_empty() -> Self {
17537            Self::default()
17538        }
17539
17540        unsafe fn decode(
17541            &mut self,
17542            decoder: &mut fidl::encoding::Decoder<'_, D>,
17543            offset: usize,
17544            mut depth: fidl::encoding::Depth,
17545        ) -> fidl::Result<()> {
17546            decoder.debug_check_bounds::<Self>(offset);
17547            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17548                None => return Err(fidl::Error::NotNullable),
17549                Some(len) => len,
17550            };
17551            // Calling decoder.out_of_line_offset(0) is not allowed.
17552            if len == 0 {
17553                return Ok(());
17554            };
17555            depth.increment()?;
17556            let envelope_size = 8;
17557            let bytes_len = len * envelope_size;
17558            let offset = decoder.out_of_line_offset(bytes_len)?;
17559            // Decode the envelope for each type.
17560            let mut _next_ordinal_to_read = 0;
17561            let mut next_offset = offset;
17562            let end_offset = offset + bytes_len;
17563            _next_ordinal_to_read += 1;
17564            if next_offset >= end_offset {
17565                return Ok(());
17566            }
17567
17568            // Decode unknown envelopes for gaps in ordinals.
17569            while _next_ordinal_to_read < 1 {
17570                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17571                _next_ordinal_to_read += 1;
17572                next_offset += envelope_size;
17573            }
17574
17575            let next_out_of_line = decoder.next_out_of_line();
17576            let handles_before = decoder.remaining_handles();
17577            if let Some((inlined, num_bytes, num_handles)) =
17578                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17579            {
17580                let member_inline_size =
17581                    <SocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17582                        decoder.context,
17583                    );
17584                if inlined != (member_inline_size <= 4) {
17585                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17586                }
17587                let inner_offset;
17588                let mut inner_depth = depth.clone();
17589                if inlined {
17590                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17591                    inner_offset = next_offset;
17592                } else {
17593                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17594                    inner_depth.increment()?;
17595                }
17596                let val_ref =
17597                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketSendControlData, D));
17598                fidl::decode!(
17599                    SocketSendControlData,
17600                    D,
17601                    val_ref,
17602                    decoder,
17603                    inner_offset,
17604                    inner_depth
17605                )?;
17606                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17607                {
17608                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17609                }
17610                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17611                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17612                }
17613            }
17614
17615            next_offset += envelope_size;
17616            _next_ordinal_to_read += 1;
17617            if next_offset >= end_offset {
17618                return Ok(());
17619            }
17620
17621            // Decode unknown envelopes for gaps in ordinals.
17622            while _next_ordinal_to_read < 2 {
17623                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17624                _next_ordinal_to_read += 1;
17625                next_offset += envelope_size;
17626            }
17627
17628            let next_out_of_line = decoder.next_out_of_line();
17629            let handles_before = decoder.remaining_handles();
17630            if let Some((inlined, num_bytes, num_handles)) =
17631                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17632            {
17633                let member_inline_size =
17634                    <IpSendControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17635                if inlined != (member_inline_size <= 4) {
17636                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17637                }
17638                let inner_offset;
17639                let mut inner_depth = depth.clone();
17640                if inlined {
17641                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17642                    inner_offset = next_offset;
17643                } else {
17644                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17645                    inner_depth.increment()?;
17646                }
17647                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpSendControlData, D));
17648                fidl::decode!(IpSendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17649                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17650                {
17651                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17652                }
17653                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17654                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17655                }
17656            }
17657
17658            next_offset += envelope_size;
17659            _next_ordinal_to_read += 1;
17660            if next_offset >= end_offset {
17661                return Ok(());
17662            }
17663
17664            // Decode unknown envelopes for gaps in ordinals.
17665            while _next_ordinal_to_read < 3 {
17666                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17667                _next_ordinal_to_read += 1;
17668                next_offset += envelope_size;
17669            }
17670
17671            let next_out_of_line = decoder.next_out_of_line();
17672            let handles_before = decoder.remaining_handles();
17673            if let Some((inlined, num_bytes, num_handles)) =
17674                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17675            {
17676                let member_inline_size =
17677                    <Ipv6SendControlData as fidl::encoding::TypeMarker>::inline_size(
17678                        decoder.context,
17679                    );
17680                if inlined != (member_inline_size <= 4) {
17681                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17682                }
17683                let inner_offset;
17684                let mut inner_depth = depth.clone();
17685                if inlined {
17686                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17687                    inner_offset = next_offset;
17688                } else {
17689                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17690                    inner_depth.increment()?;
17691                }
17692                let val_ref =
17693                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6SendControlData, D));
17694                fidl::decode!(Ipv6SendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17695                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17696                {
17697                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17698                }
17699                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17700                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17701                }
17702            }
17703
17704            next_offset += envelope_size;
17705
17706            // Decode the remaining unknown envelopes.
17707            while next_offset < end_offset {
17708                _next_ordinal_to_read += 1;
17709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17710                next_offset += envelope_size;
17711            }
17712
17713            Ok(())
17714        }
17715    }
17716
17717    impl RecvMsgMeta {
17718        #[inline(always)]
17719        fn max_ordinal_present(&self) -> u64 {
17720            if let Some(_) = self.payload_len {
17721                return 3;
17722            }
17723            if let Some(_) = self.control {
17724                return 2;
17725            }
17726            if let Some(_) = self.from {
17727                return 1;
17728            }
17729            0
17730        }
17731    }
17732
17733    impl fidl::encoding::ValueTypeMarker for RecvMsgMeta {
17734        type Borrowed<'a> = &'a Self;
17735        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17736            value
17737        }
17738    }
17739
17740    unsafe impl fidl::encoding::TypeMarker for RecvMsgMeta {
17741        type Owned = Self;
17742
17743        #[inline(always)]
17744        fn inline_align(_context: fidl::encoding::Context) -> usize {
17745            8
17746        }
17747
17748        #[inline(always)]
17749        fn inline_size(_context: fidl::encoding::Context) -> usize {
17750            16
17751        }
17752    }
17753
17754    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecvMsgMeta, D>
17755        for &RecvMsgMeta
17756    {
17757        unsafe fn encode(
17758            self,
17759            encoder: &mut fidl::encoding::Encoder<'_, D>,
17760            offset: usize,
17761            mut depth: fidl::encoding::Depth,
17762        ) -> fidl::Result<()> {
17763            encoder.debug_check_bounds::<RecvMsgMeta>(offset);
17764            // Vector header
17765            let max_ordinal: u64 = self.max_ordinal_present();
17766            encoder.write_num(max_ordinal, offset);
17767            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17768            // Calling encoder.out_of_line_offset(0) is not allowed.
17769            if max_ordinal == 0 {
17770                return Ok(());
17771            }
17772            depth.increment()?;
17773            let envelope_size = 8;
17774            let bytes_len = max_ordinal as usize * envelope_size;
17775            #[allow(unused_variables)]
17776            let offset = encoder.out_of_line_offset(bytes_len);
17777            let mut _prev_end_offset: usize = 0;
17778            if 1 > max_ordinal {
17779                return Ok(());
17780            }
17781
17782            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17783            // are envelope_size bytes.
17784            let cur_offset: usize = (1 - 1) * envelope_size;
17785
17786            // Zero reserved fields.
17787            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17788
17789            // Safety:
17790            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17791            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17792            //   envelope_size bytes, there is always sufficient room.
17793            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
17794            self.from.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17795            encoder, offset + cur_offset, depth
17796        )?;
17797
17798            _prev_end_offset = cur_offset + envelope_size;
17799            if 2 > max_ordinal {
17800                return Ok(());
17801            }
17802
17803            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17804            // are envelope_size bytes.
17805            let cur_offset: usize = (2 - 1) * envelope_size;
17806
17807            // Zero reserved fields.
17808            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17809
17810            // Safety:
17811            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17812            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17813            //   envelope_size bytes, there is always sufficient room.
17814            fidl::encoding::encode_in_envelope_optional::<DatagramSocketRecvControlData, D>(
17815                self.control.as_ref().map(
17816                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow,
17817                ),
17818                encoder,
17819                offset + cur_offset,
17820                depth,
17821            )?;
17822
17823            _prev_end_offset = cur_offset + envelope_size;
17824            if 3 > max_ordinal {
17825                return Ok(());
17826            }
17827
17828            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17829            // are envelope_size bytes.
17830            let cur_offset: usize = (3 - 1) * envelope_size;
17831
17832            // Zero reserved fields.
17833            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17834
17835            // Safety:
17836            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17837            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17838            //   envelope_size bytes, there is always sufficient room.
17839            fidl::encoding::encode_in_envelope_optional::<u16, D>(
17840                self.payload_len.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17841                encoder,
17842                offset + cur_offset,
17843                depth,
17844            )?;
17845
17846            _prev_end_offset = cur_offset + envelope_size;
17847
17848            Ok(())
17849        }
17850    }
17851
17852    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgMeta {
17853        #[inline(always)]
17854        fn new_empty() -> Self {
17855            Self::default()
17856        }
17857
17858        unsafe fn decode(
17859            &mut self,
17860            decoder: &mut fidl::encoding::Decoder<'_, D>,
17861            offset: usize,
17862            mut depth: fidl::encoding::Depth,
17863        ) -> fidl::Result<()> {
17864            decoder.debug_check_bounds::<Self>(offset);
17865            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17866                None => return Err(fidl::Error::NotNullable),
17867                Some(len) => len,
17868            };
17869            // Calling decoder.out_of_line_offset(0) is not allowed.
17870            if len == 0 {
17871                return Ok(());
17872            };
17873            depth.increment()?;
17874            let envelope_size = 8;
17875            let bytes_len = len * envelope_size;
17876            let offset = decoder.out_of_line_offset(bytes_len)?;
17877            // Decode the envelope for each type.
17878            let mut _next_ordinal_to_read = 0;
17879            let mut next_offset = offset;
17880            let end_offset = offset + bytes_len;
17881            _next_ordinal_to_read += 1;
17882            if next_offset >= end_offset {
17883                return Ok(());
17884            }
17885
17886            // Decode unknown envelopes for gaps in ordinals.
17887            while _next_ordinal_to_read < 1 {
17888                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17889                _next_ordinal_to_read += 1;
17890                next_offset += envelope_size;
17891            }
17892
17893            let next_out_of_line = decoder.next_out_of_line();
17894            let handles_before = decoder.remaining_handles();
17895            if let Some((inlined, num_bytes, num_handles)) =
17896                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17897            {
17898                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17899                if inlined != (member_inline_size <= 4) {
17900                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17901                }
17902                let inner_offset;
17903                let mut inner_depth = depth.clone();
17904                if inlined {
17905                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17906                    inner_offset = next_offset;
17907                } else {
17908                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17909                    inner_depth.increment()?;
17910                }
17911                let val_ref = self.from.get_or_insert_with(|| {
17912                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
17913                });
17914                fidl::decode!(
17915                    fidl_fuchsia_net__common::SocketAddress,
17916                    D,
17917                    val_ref,
17918                    decoder,
17919                    inner_offset,
17920                    inner_depth
17921                )?;
17922                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17923                {
17924                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17925                }
17926                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17927                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17928                }
17929            }
17930
17931            next_offset += envelope_size;
17932            _next_ordinal_to_read += 1;
17933            if next_offset >= end_offset {
17934                return Ok(());
17935            }
17936
17937            // Decode unknown envelopes for gaps in ordinals.
17938            while _next_ordinal_to_read < 2 {
17939                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17940                _next_ordinal_to_read += 1;
17941                next_offset += envelope_size;
17942            }
17943
17944            let next_out_of_line = decoder.next_out_of_line();
17945            let handles_before = decoder.remaining_handles();
17946            if let Some((inlined, num_bytes, num_handles)) =
17947                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17948            {
17949                let member_inline_size =
17950                    <DatagramSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17951                        decoder.context,
17952                    );
17953                if inlined != (member_inline_size <= 4) {
17954                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17955                }
17956                let inner_offset;
17957                let mut inner_depth = depth.clone();
17958                if inlined {
17959                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17960                    inner_offset = next_offset;
17961                } else {
17962                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17963                    inner_depth.increment()?;
17964                }
17965                let val_ref = self
17966                    .control
17967                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketRecvControlData, D));
17968                fidl::decode!(
17969                    DatagramSocketRecvControlData,
17970                    D,
17971                    val_ref,
17972                    decoder,
17973                    inner_offset,
17974                    inner_depth
17975                )?;
17976                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17977                {
17978                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17979                }
17980                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17981                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17982                }
17983            }
17984
17985            next_offset += envelope_size;
17986            _next_ordinal_to_read += 1;
17987            if next_offset >= end_offset {
17988                return Ok(());
17989            }
17990
17991            // Decode unknown envelopes for gaps in ordinals.
17992            while _next_ordinal_to_read < 3 {
17993                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17994                _next_ordinal_to_read += 1;
17995                next_offset += envelope_size;
17996            }
17997
17998            let next_out_of_line = decoder.next_out_of_line();
17999            let handles_before = decoder.remaining_handles();
18000            if let Some((inlined, num_bytes, num_handles)) =
18001                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18002            {
18003                let member_inline_size =
18004                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18005                if inlined != (member_inline_size <= 4) {
18006                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18007                }
18008                let inner_offset;
18009                let mut inner_depth = depth.clone();
18010                if inlined {
18011                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18012                    inner_offset = next_offset;
18013                } else {
18014                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18015                    inner_depth.increment()?;
18016                }
18017                let val_ref = self.payload_len.get_or_insert_with(|| fidl::new_empty!(u16, D));
18018                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
18019                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18020                {
18021                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18022                }
18023                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18024                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18025                }
18026            }
18027
18028            next_offset += envelope_size;
18029
18030            // Decode the remaining unknown envelopes.
18031            while next_offset < end_offset {
18032                _next_ordinal_to_read += 1;
18033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18034                next_offset += envelope_size;
18035            }
18036
18037            Ok(())
18038        }
18039    }
18040
18041    impl SendMsgMeta {
18042        #[inline(always)]
18043        fn max_ordinal_present(&self) -> u64 {
18044            if let Some(_) = self.control {
18045                return 2;
18046            }
18047            if let Some(_) = self.to {
18048                return 1;
18049            }
18050            0
18051        }
18052    }
18053
18054    impl fidl::encoding::ValueTypeMarker for SendMsgMeta {
18055        type Borrowed<'a> = &'a Self;
18056        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18057            value
18058        }
18059    }
18060
18061    unsafe impl fidl::encoding::TypeMarker for SendMsgMeta {
18062        type Owned = Self;
18063
18064        #[inline(always)]
18065        fn inline_align(_context: fidl::encoding::Context) -> usize {
18066            8
18067        }
18068
18069        #[inline(always)]
18070        fn inline_size(_context: fidl::encoding::Context) -> usize {
18071            16
18072        }
18073    }
18074
18075    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SendMsgMeta, D>
18076        for &SendMsgMeta
18077    {
18078        unsafe fn encode(
18079            self,
18080            encoder: &mut fidl::encoding::Encoder<'_, D>,
18081            offset: usize,
18082            mut depth: fidl::encoding::Depth,
18083        ) -> fidl::Result<()> {
18084            encoder.debug_check_bounds::<SendMsgMeta>(offset);
18085            // Vector header
18086            let max_ordinal: u64 = self.max_ordinal_present();
18087            encoder.write_num(max_ordinal, offset);
18088            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18089            // Calling encoder.out_of_line_offset(0) is not allowed.
18090            if max_ordinal == 0 {
18091                return Ok(());
18092            }
18093            depth.increment()?;
18094            let envelope_size = 8;
18095            let bytes_len = max_ordinal as usize * envelope_size;
18096            #[allow(unused_variables)]
18097            let offset = encoder.out_of_line_offset(bytes_len);
18098            let mut _prev_end_offset: usize = 0;
18099            if 1 > max_ordinal {
18100                return Ok(());
18101            }
18102
18103            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18104            // are envelope_size bytes.
18105            let cur_offset: usize = (1 - 1) * envelope_size;
18106
18107            // Zero reserved fields.
18108            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18109
18110            // Safety:
18111            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18112            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18113            //   envelope_size bytes, there is always sufficient room.
18114            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::SocketAddress, D>(
18115            self.to.as_ref().map(<fidl_fuchsia_net__common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
18116            encoder, offset + cur_offset, depth
18117        )?;
18118
18119            _prev_end_offset = cur_offset + envelope_size;
18120            if 2 > max_ordinal {
18121                return Ok(());
18122            }
18123
18124            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18125            // are envelope_size bytes.
18126            let cur_offset: usize = (2 - 1) * envelope_size;
18127
18128            // Zero reserved fields.
18129            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18130
18131            // Safety:
18132            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18133            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18134            //   envelope_size bytes, there is always sufficient room.
18135            fidl::encoding::encode_in_envelope_optional::<DatagramSocketSendControlData, D>(
18136                self.control.as_ref().map(
18137                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow,
18138                ),
18139                encoder,
18140                offset + cur_offset,
18141                depth,
18142            )?;
18143
18144            _prev_end_offset = cur_offset + envelope_size;
18145
18146            Ok(())
18147        }
18148    }
18149
18150    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgMeta {
18151        #[inline(always)]
18152        fn new_empty() -> Self {
18153            Self::default()
18154        }
18155
18156        unsafe fn decode(
18157            &mut self,
18158            decoder: &mut fidl::encoding::Decoder<'_, D>,
18159            offset: usize,
18160            mut depth: fidl::encoding::Depth,
18161        ) -> fidl::Result<()> {
18162            decoder.debug_check_bounds::<Self>(offset);
18163            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18164                None => return Err(fidl::Error::NotNullable),
18165                Some(len) => len,
18166            };
18167            // Calling decoder.out_of_line_offset(0) is not allowed.
18168            if len == 0 {
18169                return Ok(());
18170            };
18171            depth.increment()?;
18172            let envelope_size = 8;
18173            let bytes_len = len * envelope_size;
18174            let offset = decoder.out_of_line_offset(bytes_len)?;
18175            // Decode the envelope for each type.
18176            let mut _next_ordinal_to_read = 0;
18177            let mut next_offset = offset;
18178            let end_offset = offset + bytes_len;
18179            _next_ordinal_to_read += 1;
18180            if next_offset >= end_offset {
18181                return Ok(());
18182            }
18183
18184            // Decode unknown envelopes for gaps in ordinals.
18185            while _next_ordinal_to_read < 1 {
18186                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18187                _next_ordinal_to_read += 1;
18188                next_offset += envelope_size;
18189            }
18190
18191            let next_out_of_line = decoder.next_out_of_line();
18192            let handles_before = decoder.remaining_handles();
18193            if let Some((inlined, num_bytes, num_handles)) =
18194                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18195            {
18196                let member_inline_size = <fidl_fuchsia_net__common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18197                if inlined != (member_inline_size <= 4) {
18198                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18199                }
18200                let inner_offset;
18201                let mut inner_depth = depth.clone();
18202                if inlined {
18203                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18204                    inner_offset = next_offset;
18205                } else {
18206                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18207                    inner_depth.increment()?;
18208                }
18209                let val_ref = self.to.get_or_insert_with(|| {
18210                    fidl::new_empty!(fidl_fuchsia_net__common::SocketAddress, D)
18211                });
18212                fidl::decode!(
18213                    fidl_fuchsia_net__common::SocketAddress,
18214                    D,
18215                    val_ref,
18216                    decoder,
18217                    inner_offset,
18218                    inner_depth
18219                )?;
18220                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18221                {
18222                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18223                }
18224                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18225                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18226                }
18227            }
18228
18229            next_offset += envelope_size;
18230            _next_ordinal_to_read += 1;
18231            if next_offset >= end_offset {
18232                return Ok(());
18233            }
18234
18235            // Decode unknown envelopes for gaps in ordinals.
18236            while _next_ordinal_to_read < 2 {
18237                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18238                _next_ordinal_to_read += 1;
18239                next_offset += envelope_size;
18240            }
18241
18242            let next_out_of_line = decoder.next_out_of_line();
18243            let handles_before = decoder.remaining_handles();
18244            if let Some((inlined, num_bytes, num_handles)) =
18245                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18246            {
18247                let member_inline_size =
18248                    <DatagramSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
18249                        decoder.context,
18250                    );
18251                if inlined != (member_inline_size <= 4) {
18252                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18253                }
18254                let inner_offset;
18255                let mut inner_depth = depth.clone();
18256                if inlined {
18257                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18258                    inner_offset = next_offset;
18259                } else {
18260                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18261                    inner_depth.increment()?;
18262                }
18263                let val_ref = self
18264                    .control
18265                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketSendControlData, D));
18266                fidl::decode!(
18267                    DatagramSocketSendControlData,
18268                    D,
18269                    val_ref,
18270                    decoder,
18271                    inner_offset,
18272                    inner_depth
18273                )?;
18274                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18275                {
18276                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18277                }
18278                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18279                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18280                }
18281            }
18282
18283            next_offset += envelope_size;
18284
18285            // Decode the remaining unknown envelopes.
18286            while next_offset < end_offset {
18287                _next_ordinal_to_read += 1;
18288                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18289                next_offset += envelope_size;
18290            }
18291
18292            Ok(())
18293        }
18294    }
18295
18296    impl SocketCreationOptions {
18297        #[inline(always)]
18298        fn max_ordinal_present(&self) -> u64 {
18299            if let Some(_) = self.marks {
18300                return 1;
18301            }
18302            0
18303        }
18304    }
18305
18306    impl fidl::encoding::ValueTypeMarker for SocketCreationOptions {
18307        type Borrowed<'a> = &'a Self;
18308        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18309            value
18310        }
18311    }
18312
18313    unsafe impl fidl::encoding::TypeMarker for SocketCreationOptions {
18314        type Owned = Self;
18315
18316        #[inline(always)]
18317        fn inline_align(_context: fidl::encoding::Context) -> usize {
18318            8
18319        }
18320
18321        #[inline(always)]
18322        fn inline_size(_context: fidl::encoding::Context) -> usize {
18323            16
18324        }
18325    }
18326
18327    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketCreationOptions, D>
18328        for &SocketCreationOptions
18329    {
18330        unsafe fn encode(
18331            self,
18332            encoder: &mut fidl::encoding::Encoder<'_, D>,
18333            offset: usize,
18334            mut depth: fidl::encoding::Depth,
18335        ) -> fidl::Result<()> {
18336            encoder.debug_check_bounds::<SocketCreationOptions>(offset);
18337            // Vector header
18338            let max_ordinal: u64 = self.max_ordinal_present();
18339            encoder.write_num(max_ordinal, offset);
18340            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18341            // Calling encoder.out_of_line_offset(0) is not allowed.
18342            if max_ordinal == 0 {
18343                return Ok(());
18344            }
18345            depth.increment()?;
18346            let envelope_size = 8;
18347            let bytes_len = max_ordinal as usize * envelope_size;
18348            #[allow(unused_variables)]
18349            let offset = encoder.out_of_line_offset(bytes_len);
18350            let mut _prev_end_offset: usize = 0;
18351            if 1 > max_ordinal {
18352                return Ok(());
18353            }
18354
18355            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18356            // are envelope_size bytes.
18357            let cur_offset: usize = (1 - 1) * envelope_size;
18358
18359            // Zero reserved fields.
18360            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18361
18362            // Safety:
18363            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18364            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18365            //   envelope_size bytes, there is always sufficient room.
18366            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::Marks, D>(
18367                self.marks.as_ref().map(
18368                    <fidl_fuchsia_net__common::Marks as fidl::encoding::ValueTypeMarker>::borrow,
18369                ),
18370                encoder,
18371                offset + cur_offset,
18372                depth,
18373            )?;
18374
18375            _prev_end_offset = cur_offset + envelope_size;
18376
18377            Ok(())
18378        }
18379    }
18380
18381    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketCreationOptions {
18382        #[inline(always)]
18383        fn new_empty() -> Self {
18384            Self::default()
18385        }
18386
18387        unsafe fn decode(
18388            &mut self,
18389            decoder: &mut fidl::encoding::Decoder<'_, D>,
18390            offset: usize,
18391            mut depth: fidl::encoding::Depth,
18392        ) -> fidl::Result<()> {
18393            decoder.debug_check_bounds::<Self>(offset);
18394            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18395                None => return Err(fidl::Error::NotNullable),
18396                Some(len) => len,
18397            };
18398            // Calling decoder.out_of_line_offset(0) is not allowed.
18399            if len == 0 {
18400                return Ok(());
18401            };
18402            depth.increment()?;
18403            let envelope_size = 8;
18404            let bytes_len = len * envelope_size;
18405            let offset = decoder.out_of_line_offset(bytes_len)?;
18406            // Decode the envelope for each type.
18407            let mut _next_ordinal_to_read = 0;
18408            let mut next_offset = offset;
18409            let end_offset = offset + bytes_len;
18410            _next_ordinal_to_read += 1;
18411            if next_offset >= end_offset {
18412                return Ok(());
18413            }
18414
18415            // Decode unknown envelopes for gaps in ordinals.
18416            while _next_ordinal_to_read < 1 {
18417                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18418                _next_ordinal_to_read += 1;
18419                next_offset += envelope_size;
18420            }
18421
18422            let next_out_of_line = decoder.next_out_of_line();
18423            let handles_before = decoder.remaining_handles();
18424            if let Some((inlined, num_bytes, num_handles)) =
18425                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18426            {
18427                let member_inline_size =
18428                    <fidl_fuchsia_net__common::Marks as fidl::encoding::TypeMarker>::inline_size(
18429                        decoder.context,
18430                    );
18431                if inlined != (member_inline_size <= 4) {
18432                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18433                }
18434                let inner_offset;
18435                let mut inner_depth = depth.clone();
18436                if inlined {
18437                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18438                    inner_offset = next_offset;
18439                } else {
18440                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18441                    inner_depth.increment()?;
18442                }
18443                let val_ref = self
18444                    .marks
18445                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net__common::Marks, D));
18446                fidl::decode!(
18447                    fidl_fuchsia_net__common::Marks,
18448                    D,
18449                    val_ref,
18450                    decoder,
18451                    inner_offset,
18452                    inner_depth
18453                )?;
18454                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18455                {
18456                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18457                }
18458                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18459                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18460                }
18461            }
18462
18463            next_offset += envelope_size;
18464
18465            // Decode the remaining unknown envelopes.
18466            while next_offset < end_offset {
18467                _next_ordinal_to_read += 1;
18468                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18469                next_offset += envelope_size;
18470            }
18471
18472            Ok(())
18473        }
18474    }
18475
18476    impl SocketRecvControlData {
18477        #[inline(always)]
18478        fn max_ordinal_present(&self) -> u64 {
18479            if let Some(_) = self.timestamp {
18480                return 3;
18481            }
18482            0
18483        }
18484    }
18485
18486    impl fidl::encoding::ValueTypeMarker for SocketRecvControlData {
18487        type Borrowed<'a> = &'a Self;
18488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18489            value
18490        }
18491    }
18492
18493    unsafe impl fidl::encoding::TypeMarker for SocketRecvControlData {
18494        type Owned = Self;
18495
18496        #[inline(always)]
18497        fn inline_align(_context: fidl::encoding::Context) -> usize {
18498            8
18499        }
18500
18501        #[inline(always)]
18502        fn inline_size(_context: fidl::encoding::Context) -> usize {
18503            16
18504        }
18505    }
18506
18507    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketRecvControlData, D>
18508        for &SocketRecvControlData
18509    {
18510        unsafe fn encode(
18511            self,
18512            encoder: &mut fidl::encoding::Encoder<'_, D>,
18513            offset: usize,
18514            mut depth: fidl::encoding::Depth,
18515        ) -> fidl::Result<()> {
18516            encoder.debug_check_bounds::<SocketRecvControlData>(offset);
18517            // Vector header
18518            let max_ordinal: u64 = self.max_ordinal_present();
18519            encoder.write_num(max_ordinal, offset);
18520            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18521            // Calling encoder.out_of_line_offset(0) is not allowed.
18522            if max_ordinal == 0 {
18523                return Ok(());
18524            }
18525            depth.increment()?;
18526            let envelope_size = 8;
18527            let bytes_len = max_ordinal as usize * envelope_size;
18528            #[allow(unused_variables)]
18529            let offset = encoder.out_of_line_offset(bytes_len);
18530            let mut _prev_end_offset: usize = 0;
18531            if 3 > max_ordinal {
18532                return Ok(());
18533            }
18534
18535            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18536            // are envelope_size bytes.
18537            let cur_offset: usize = (3 - 1) * envelope_size;
18538
18539            // Zero reserved fields.
18540            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18541
18542            // Safety:
18543            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18544            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18545            //   envelope_size bytes, there is always sufficient room.
18546            fidl::encoding::encode_in_envelope_optional::<Timestamp, D>(
18547                self.timestamp.as_ref().map(<Timestamp as fidl::encoding::ValueTypeMarker>::borrow),
18548                encoder,
18549                offset + cur_offset,
18550                depth,
18551            )?;
18552
18553            _prev_end_offset = cur_offset + envelope_size;
18554
18555            Ok(())
18556        }
18557    }
18558
18559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketRecvControlData {
18560        #[inline(always)]
18561        fn new_empty() -> Self {
18562            Self::default()
18563        }
18564
18565        unsafe fn decode(
18566            &mut self,
18567            decoder: &mut fidl::encoding::Decoder<'_, D>,
18568            offset: usize,
18569            mut depth: fidl::encoding::Depth,
18570        ) -> fidl::Result<()> {
18571            decoder.debug_check_bounds::<Self>(offset);
18572            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18573                None => return Err(fidl::Error::NotNullable),
18574                Some(len) => len,
18575            };
18576            // Calling decoder.out_of_line_offset(0) is not allowed.
18577            if len == 0 {
18578                return Ok(());
18579            };
18580            depth.increment()?;
18581            let envelope_size = 8;
18582            let bytes_len = len * envelope_size;
18583            let offset = decoder.out_of_line_offset(bytes_len)?;
18584            // Decode the envelope for each type.
18585            let mut _next_ordinal_to_read = 0;
18586            let mut next_offset = offset;
18587            let end_offset = offset + bytes_len;
18588            _next_ordinal_to_read += 1;
18589            if next_offset >= end_offset {
18590                return Ok(());
18591            }
18592
18593            // Decode unknown envelopes for gaps in ordinals.
18594            while _next_ordinal_to_read < 3 {
18595                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18596                _next_ordinal_to_read += 1;
18597                next_offset += envelope_size;
18598            }
18599
18600            let next_out_of_line = decoder.next_out_of_line();
18601            let handles_before = decoder.remaining_handles();
18602            if let Some((inlined, num_bytes, num_handles)) =
18603                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18604            {
18605                let member_inline_size =
18606                    <Timestamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18607                if inlined != (member_inline_size <= 4) {
18608                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18609                }
18610                let inner_offset;
18611                let mut inner_depth = depth.clone();
18612                if inlined {
18613                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18614                    inner_offset = next_offset;
18615                } else {
18616                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18617                    inner_depth.increment()?;
18618                }
18619                let val_ref = self.timestamp.get_or_insert_with(|| fidl::new_empty!(Timestamp, D));
18620                fidl::decode!(Timestamp, D, val_ref, decoder, inner_offset, inner_depth)?;
18621                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18622                {
18623                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18624                }
18625                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18626                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18627                }
18628            }
18629
18630            next_offset += envelope_size;
18631
18632            // Decode the remaining unknown envelopes.
18633            while next_offset < end_offset {
18634                _next_ordinal_to_read += 1;
18635                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18636                next_offset += envelope_size;
18637            }
18638
18639            Ok(())
18640        }
18641    }
18642
18643    impl SocketSendControlData {
18644        #[inline(always)]
18645        fn max_ordinal_present(&self) -> u64 {
18646            0
18647        }
18648    }
18649
18650    impl fidl::encoding::ValueTypeMarker for SocketSendControlData {
18651        type Borrowed<'a> = &'a Self;
18652        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18653            value
18654        }
18655    }
18656
18657    unsafe impl fidl::encoding::TypeMarker for SocketSendControlData {
18658        type Owned = Self;
18659
18660        #[inline(always)]
18661        fn inline_align(_context: fidl::encoding::Context) -> usize {
18662            8
18663        }
18664
18665        #[inline(always)]
18666        fn inline_size(_context: fidl::encoding::Context) -> usize {
18667            16
18668        }
18669    }
18670
18671    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketSendControlData, D>
18672        for &SocketSendControlData
18673    {
18674        unsafe fn encode(
18675            self,
18676            encoder: &mut fidl::encoding::Encoder<'_, D>,
18677            offset: usize,
18678            mut depth: fidl::encoding::Depth,
18679        ) -> fidl::Result<()> {
18680            encoder.debug_check_bounds::<SocketSendControlData>(offset);
18681            // Vector header
18682            let max_ordinal: u64 = self.max_ordinal_present();
18683            encoder.write_num(max_ordinal, offset);
18684            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18685            // Calling encoder.out_of_line_offset(0) is not allowed.
18686            if max_ordinal == 0 {
18687                return Ok(());
18688            }
18689            depth.increment()?;
18690            let envelope_size = 8;
18691            let bytes_len = max_ordinal as usize * envelope_size;
18692            #[allow(unused_variables)]
18693            let offset = encoder.out_of_line_offset(bytes_len);
18694            let mut _prev_end_offset: usize = 0;
18695
18696            Ok(())
18697        }
18698    }
18699
18700    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketSendControlData {
18701        #[inline(always)]
18702        fn new_empty() -> Self {
18703            Self::default()
18704        }
18705
18706        unsafe fn decode(
18707            &mut self,
18708            decoder: &mut fidl::encoding::Decoder<'_, D>,
18709            offset: usize,
18710            mut depth: fidl::encoding::Depth,
18711        ) -> fidl::Result<()> {
18712            decoder.debug_check_bounds::<Self>(offset);
18713            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18714                None => return Err(fidl::Error::NotNullable),
18715                Some(len) => len,
18716            };
18717            // Calling decoder.out_of_line_offset(0) is not allowed.
18718            if len == 0 {
18719                return Ok(());
18720            };
18721            depth.increment()?;
18722            let envelope_size = 8;
18723            let bytes_len = len * envelope_size;
18724            let offset = decoder.out_of_line_offset(bytes_len)?;
18725            // Decode the envelope for each type.
18726            let mut _next_ordinal_to_read = 0;
18727            let mut next_offset = offset;
18728            let end_offset = offset + bytes_len;
18729
18730            // Decode the remaining unknown envelopes.
18731            while next_offset < end_offset {
18732                _next_ordinal_to_read += 1;
18733                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18734                next_offset += envelope_size;
18735            }
18736
18737            Ok(())
18738        }
18739    }
18740
18741    impl TcpInfo {
18742        #[inline(always)]
18743        fn max_ordinal_present(&self) -> u64 {
18744            if let Some(_) = self.reorder_seen {
18745                return 54;
18746            }
18747            if let Some(_) = self.snd_cwnd {
18748                return 29;
18749            }
18750            if let Some(_) = self.snd_ssthresh {
18751                return 28;
18752            }
18753            if let Some(_) = self.rtt_var_usec {
18754                return 27;
18755            }
18756            if let Some(_) = self.rtt_usec {
18757                return 26;
18758            }
18759            if let Some(_) = self.rto_usec {
18760                return 11;
18761            }
18762            if let Some(_) = self.ca_state {
18763                return 2;
18764            }
18765            if let Some(_) = self.state {
18766                return 1;
18767            }
18768            0
18769        }
18770    }
18771
18772    impl fidl::encoding::ValueTypeMarker for TcpInfo {
18773        type Borrowed<'a> = &'a Self;
18774        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18775            value
18776        }
18777    }
18778
18779    unsafe impl fidl::encoding::TypeMarker for TcpInfo {
18780        type Owned = Self;
18781
18782        #[inline(always)]
18783        fn inline_align(_context: fidl::encoding::Context) -> usize {
18784            8
18785        }
18786
18787        #[inline(always)]
18788        fn inline_size(_context: fidl::encoding::Context) -> usize {
18789            16
18790        }
18791    }
18792
18793    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TcpInfo, D> for &TcpInfo {
18794        unsafe fn encode(
18795            self,
18796            encoder: &mut fidl::encoding::Encoder<'_, D>,
18797            offset: usize,
18798            mut depth: fidl::encoding::Depth,
18799        ) -> fidl::Result<()> {
18800            encoder.debug_check_bounds::<TcpInfo>(offset);
18801            // Vector header
18802            let max_ordinal: u64 = self.max_ordinal_present();
18803            encoder.write_num(max_ordinal, offset);
18804            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18805            // Calling encoder.out_of_line_offset(0) is not allowed.
18806            if max_ordinal == 0 {
18807                return Ok(());
18808            }
18809            depth.increment()?;
18810            let envelope_size = 8;
18811            let bytes_len = max_ordinal as usize * envelope_size;
18812            #[allow(unused_variables)]
18813            let offset = encoder.out_of_line_offset(bytes_len);
18814            let mut _prev_end_offset: usize = 0;
18815            if 1 > max_ordinal {
18816                return Ok(());
18817            }
18818
18819            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18820            // are envelope_size bytes.
18821            let cur_offset: usize = (1 - 1) * envelope_size;
18822
18823            // Zero reserved fields.
18824            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18825
18826            // Safety:
18827            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18828            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18829            //   envelope_size bytes, there is always sufficient room.
18830            fidl::encoding::encode_in_envelope_optional::<TcpState, D>(
18831                self.state.as_ref().map(<TcpState as fidl::encoding::ValueTypeMarker>::borrow),
18832                encoder,
18833                offset + cur_offset,
18834                depth,
18835            )?;
18836
18837            _prev_end_offset = cur_offset + envelope_size;
18838            if 2 > max_ordinal {
18839                return Ok(());
18840            }
18841
18842            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18843            // are envelope_size bytes.
18844            let cur_offset: usize = (2 - 1) * envelope_size;
18845
18846            // Zero reserved fields.
18847            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18848
18849            // Safety:
18850            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18851            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18852            //   envelope_size bytes, there is always sufficient room.
18853            fidl::encoding::encode_in_envelope_optional::<TcpCongestionControlState, D>(
18854                self.ca_state
18855                    .as_ref()
18856                    .map(<TcpCongestionControlState as fidl::encoding::ValueTypeMarker>::borrow),
18857                encoder,
18858                offset + cur_offset,
18859                depth,
18860            )?;
18861
18862            _prev_end_offset = cur_offset + envelope_size;
18863            if 11 > max_ordinal {
18864                return Ok(());
18865            }
18866
18867            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18868            // are envelope_size bytes.
18869            let cur_offset: usize = (11 - 1) * envelope_size;
18870
18871            // Zero reserved fields.
18872            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18873
18874            // Safety:
18875            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18876            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18877            //   envelope_size bytes, there is always sufficient room.
18878            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18879                self.rto_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18880                encoder,
18881                offset + cur_offset,
18882                depth,
18883            )?;
18884
18885            _prev_end_offset = cur_offset + envelope_size;
18886            if 26 > max_ordinal {
18887                return Ok(());
18888            }
18889
18890            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18891            // are envelope_size bytes.
18892            let cur_offset: usize = (26 - 1) * envelope_size;
18893
18894            // Zero reserved fields.
18895            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18896
18897            // Safety:
18898            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18899            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18900            //   envelope_size bytes, there is always sufficient room.
18901            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18902                self.rtt_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18903                encoder,
18904                offset + cur_offset,
18905                depth,
18906            )?;
18907
18908            _prev_end_offset = cur_offset + envelope_size;
18909            if 27 > max_ordinal {
18910                return Ok(());
18911            }
18912
18913            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18914            // are envelope_size bytes.
18915            let cur_offset: usize = (27 - 1) * envelope_size;
18916
18917            // Zero reserved fields.
18918            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18919
18920            // Safety:
18921            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18922            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18923            //   envelope_size bytes, there is always sufficient room.
18924            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18925                self.rtt_var_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18926                encoder,
18927                offset + cur_offset,
18928                depth,
18929            )?;
18930
18931            _prev_end_offset = cur_offset + envelope_size;
18932            if 28 > max_ordinal {
18933                return Ok(());
18934            }
18935
18936            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18937            // are envelope_size bytes.
18938            let cur_offset: usize = (28 - 1) * envelope_size;
18939
18940            // Zero reserved fields.
18941            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18942
18943            // Safety:
18944            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18945            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18946            //   envelope_size bytes, there is always sufficient room.
18947            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18948                self.snd_ssthresh.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18949                encoder,
18950                offset + cur_offset,
18951                depth,
18952            )?;
18953
18954            _prev_end_offset = cur_offset + envelope_size;
18955            if 29 > max_ordinal {
18956                return Ok(());
18957            }
18958
18959            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18960            // are envelope_size bytes.
18961            let cur_offset: usize = (29 - 1) * envelope_size;
18962
18963            // Zero reserved fields.
18964            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18965
18966            // Safety:
18967            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18968            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18969            //   envelope_size bytes, there is always sufficient room.
18970            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18971                self.snd_cwnd.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18972                encoder,
18973                offset + cur_offset,
18974                depth,
18975            )?;
18976
18977            _prev_end_offset = cur_offset + envelope_size;
18978            if 54 > max_ordinal {
18979                return Ok(());
18980            }
18981
18982            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18983            // are envelope_size bytes.
18984            let cur_offset: usize = (54 - 1) * envelope_size;
18985
18986            // Zero reserved fields.
18987            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18988
18989            // Safety:
18990            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18991            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18992            //   envelope_size bytes, there is always sufficient room.
18993            fidl::encoding::encode_in_envelope_optional::<bool, D>(
18994                self.reorder_seen.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
18995                encoder,
18996                offset + cur_offset,
18997                depth,
18998            )?;
18999
19000            _prev_end_offset = cur_offset + envelope_size;
19001
19002            Ok(())
19003        }
19004    }
19005
19006    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpInfo {
19007        #[inline(always)]
19008        fn new_empty() -> Self {
19009            Self::default()
19010        }
19011
19012        unsafe fn decode(
19013            &mut self,
19014            decoder: &mut fidl::encoding::Decoder<'_, D>,
19015            offset: usize,
19016            mut depth: fidl::encoding::Depth,
19017        ) -> fidl::Result<()> {
19018            decoder.debug_check_bounds::<Self>(offset);
19019            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19020                None => return Err(fidl::Error::NotNullable),
19021                Some(len) => len,
19022            };
19023            // Calling decoder.out_of_line_offset(0) is not allowed.
19024            if len == 0 {
19025                return Ok(());
19026            };
19027            depth.increment()?;
19028            let envelope_size = 8;
19029            let bytes_len = len * envelope_size;
19030            let offset = decoder.out_of_line_offset(bytes_len)?;
19031            // Decode the envelope for each type.
19032            let mut _next_ordinal_to_read = 0;
19033            let mut next_offset = offset;
19034            let end_offset = offset + bytes_len;
19035            _next_ordinal_to_read += 1;
19036            if next_offset >= end_offset {
19037                return Ok(());
19038            }
19039
19040            // Decode unknown envelopes for gaps in ordinals.
19041            while _next_ordinal_to_read < 1 {
19042                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19043                _next_ordinal_to_read += 1;
19044                next_offset += envelope_size;
19045            }
19046
19047            let next_out_of_line = decoder.next_out_of_line();
19048            let handles_before = decoder.remaining_handles();
19049            if let Some((inlined, num_bytes, num_handles)) =
19050                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19051            {
19052                let member_inline_size =
19053                    <TcpState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19054                if inlined != (member_inline_size <= 4) {
19055                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19056                }
19057                let inner_offset;
19058                let mut inner_depth = depth.clone();
19059                if inlined {
19060                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19061                    inner_offset = next_offset;
19062                } else {
19063                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19064                    inner_depth.increment()?;
19065                }
19066                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(TcpState, D));
19067                fidl::decode!(TcpState, D, val_ref, decoder, inner_offset, inner_depth)?;
19068                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19069                {
19070                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19071                }
19072                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19073                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19074                }
19075            }
19076
19077            next_offset += envelope_size;
19078            _next_ordinal_to_read += 1;
19079            if next_offset >= end_offset {
19080                return Ok(());
19081            }
19082
19083            // Decode unknown envelopes for gaps in ordinals.
19084            while _next_ordinal_to_read < 2 {
19085                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19086                _next_ordinal_to_read += 1;
19087                next_offset += envelope_size;
19088            }
19089
19090            let next_out_of_line = decoder.next_out_of_line();
19091            let handles_before = decoder.remaining_handles();
19092            if let Some((inlined, num_bytes, num_handles)) =
19093                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19094            {
19095                let member_inline_size =
19096                    <TcpCongestionControlState as fidl::encoding::TypeMarker>::inline_size(
19097                        decoder.context,
19098                    );
19099                if inlined != (member_inline_size <= 4) {
19100                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19101                }
19102                let inner_offset;
19103                let mut inner_depth = depth.clone();
19104                if inlined {
19105                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19106                    inner_offset = next_offset;
19107                } else {
19108                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19109                    inner_depth.increment()?;
19110                }
19111                let val_ref = self
19112                    .ca_state
19113                    .get_or_insert_with(|| fidl::new_empty!(TcpCongestionControlState, D));
19114                fidl::decode!(
19115                    TcpCongestionControlState,
19116                    D,
19117                    val_ref,
19118                    decoder,
19119                    inner_offset,
19120                    inner_depth
19121                )?;
19122                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19123                {
19124                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19125                }
19126                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19127                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19128                }
19129            }
19130
19131            next_offset += envelope_size;
19132            _next_ordinal_to_read += 1;
19133            if next_offset >= end_offset {
19134                return Ok(());
19135            }
19136
19137            // Decode unknown envelopes for gaps in ordinals.
19138            while _next_ordinal_to_read < 11 {
19139                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19140                _next_ordinal_to_read += 1;
19141                next_offset += envelope_size;
19142            }
19143
19144            let next_out_of_line = decoder.next_out_of_line();
19145            let handles_before = decoder.remaining_handles();
19146            if let Some((inlined, num_bytes, num_handles)) =
19147                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19148            {
19149                let member_inline_size =
19150                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19151                if inlined != (member_inline_size <= 4) {
19152                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19153                }
19154                let inner_offset;
19155                let mut inner_depth = depth.clone();
19156                if inlined {
19157                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19158                    inner_offset = next_offset;
19159                } else {
19160                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19161                    inner_depth.increment()?;
19162                }
19163                let val_ref = self.rto_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
19164                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19165                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19166                {
19167                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19168                }
19169                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19170                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19171                }
19172            }
19173
19174            next_offset += envelope_size;
19175            _next_ordinal_to_read += 1;
19176            if next_offset >= end_offset {
19177                return Ok(());
19178            }
19179
19180            // Decode unknown envelopes for gaps in ordinals.
19181            while _next_ordinal_to_read < 26 {
19182                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19183                _next_ordinal_to_read += 1;
19184                next_offset += envelope_size;
19185            }
19186
19187            let next_out_of_line = decoder.next_out_of_line();
19188            let handles_before = decoder.remaining_handles();
19189            if let Some((inlined, num_bytes, num_handles)) =
19190                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19191            {
19192                let member_inline_size =
19193                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19194                if inlined != (member_inline_size <= 4) {
19195                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19196                }
19197                let inner_offset;
19198                let mut inner_depth = depth.clone();
19199                if inlined {
19200                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19201                    inner_offset = next_offset;
19202                } else {
19203                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19204                    inner_depth.increment()?;
19205                }
19206                let val_ref = self.rtt_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
19207                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19208                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19209                {
19210                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19211                }
19212                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19213                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19214                }
19215            }
19216
19217            next_offset += envelope_size;
19218            _next_ordinal_to_read += 1;
19219            if next_offset >= end_offset {
19220                return Ok(());
19221            }
19222
19223            // Decode unknown envelopes for gaps in ordinals.
19224            while _next_ordinal_to_read < 27 {
19225                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19226                _next_ordinal_to_read += 1;
19227                next_offset += envelope_size;
19228            }
19229
19230            let next_out_of_line = decoder.next_out_of_line();
19231            let handles_before = decoder.remaining_handles();
19232            if let Some((inlined, num_bytes, num_handles)) =
19233                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19234            {
19235                let member_inline_size =
19236                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19237                if inlined != (member_inline_size <= 4) {
19238                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19239                }
19240                let inner_offset;
19241                let mut inner_depth = depth.clone();
19242                if inlined {
19243                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19244                    inner_offset = next_offset;
19245                } else {
19246                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19247                    inner_depth.increment()?;
19248                }
19249                let val_ref = self.rtt_var_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
19250                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19251                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19252                {
19253                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19254                }
19255                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19256                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19257                }
19258            }
19259
19260            next_offset += envelope_size;
19261            _next_ordinal_to_read += 1;
19262            if next_offset >= end_offset {
19263                return Ok(());
19264            }
19265
19266            // Decode unknown envelopes for gaps in ordinals.
19267            while _next_ordinal_to_read < 28 {
19268                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19269                _next_ordinal_to_read += 1;
19270                next_offset += envelope_size;
19271            }
19272
19273            let next_out_of_line = decoder.next_out_of_line();
19274            let handles_before = decoder.remaining_handles();
19275            if let Some((inlined, num_bytes, num_handles)) =
19276                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19277            {
19278                let member_inline_size =
19279                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19280                if inlined != (member_inline_size <= 4) {
19281                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19282                }
19283                let inner_offset;
19284                let mut inner_depth = depth.clone();
19285                if inlined {
19286                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19287                    inner_offset = next_offset;
19288                } else {
19289                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19290                    inner_depth.increment()?;
19291                }
19292                let val_ref = self.snd_ssthresh.get_or_insert_with(|| fidl::new_empty!(u32, D));
19293                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19294                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19295                {
19296                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19297                }
19298                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19299                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19300                }
19301            }
19302
19303            next_offset += envelope_size;
19304            _next_ordinal_to_read += 1;
19305            if next_offset >= end_offset {
19306                return Ok(());
19307            }
19308
19309            // Decode unknown envelopes for gaps in ordinals.
19310            while _next_ordinal_to_read < 29 {
19311                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19312                _next_ordinal_to_read += 1;
19313                next_offset += envelope_size;
19314            }
19315
19316            let next_out_of_line = decoder.next_out_of_line();
19317            let handles_before = decoder.remaining_handles();
19318            if let Some((inlined, num_bytes, num_handles)) =
19319                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19320            {
19321                let member_inline_size =
19322                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19323                if inlined != (member_inline_size <= 4) {
19324                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19325                }
19326                let inner_offset;
19327                let mut inner_depth = depth.clone();
19328                if inlined {
19329                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19330                    inner_offset = next_offset;
19331                } else {
19332                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19333                    inner_depth.increment()?;
19334                }
19335                let val_ref = self.snd_cwnd.get_or_insert_with(|| fidl::new_empty!(u32, D));
19336                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19337                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19338                {
19339                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19340                }
19341                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19342                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19343                }
19344            }
19345
19346            next_offset += envelope_size;
19347            _next_ordinal_to_read += 1;
19348            if next_offset >= end_offset {
19349                return Ok(());
19350            }
19351
19352            // Decode unknown envelopes for gaps in ordinals.
19353            while _next_ordinal_to_read < 54 {
19354                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19355                _next_ordinal_to_read += 1;
19356                next_offset += envelope_size;
19357            }
19358
19359            let next_out_of_line = decoder.next_out_of_line();
19360            let handles_before = decoder.remaining_handles();
19361            if let Some((inlined, num_bytes, num_handles)) =
19362                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19363            {
19364                let member_inline_size =
19365                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19366                if inlined != (member_inline_size <= 4) {
19367                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19368                }
19369                let inner_offset;
19370                let mut inner_depth = depth.clone();
19371                if inlined {
19372                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19373                    inner_offset = next_offset;
19374                } else {
19375                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19376                    inner_depth.increment()?;
19377                }
19378                let val_ref = self.reorder_seen.get_or_insert_with(|| fidl::new_empty!(bool, D));
19379                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
19380                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19381                {
19382                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19383                }
19384                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19385                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19386                }
19387            }
19388
19389            next_offset += envelope_size;
19390
19391            // Decode the remaining unknown envelopes.
19392            while next_offset < end_offset {
19393                _next_ordinal_to_read += 1;
19394                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19395                next_offset += envelope_size;
19396            }
19397
19398            Ok(())
19399        }
19400    }
19401
19402    impl fidl::encoding::ValueTypeMarker for OptionalUint32 {
19403        type Borrowed<'a> = &'a Self;
19404        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19405            value
19406        }
19407    }
19408
19409    unsafe impl fidl::encoding::TypeMarker for OptionalUint32 {
19410        type Owned = Self;
19411
19412        #[inline(always)]
19413        fn inline_align(_context: fidl::encoding::Context) -> usize {
19414            8
19415        }
19416
19417        #[inline(always)]
19418        fn inline_size(_context: fidl::encoding::Context) -> usize {
19419            16
19420        }
19421    }
19422
19423    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint32, D>
19424        for &OptionalUint32
19425    {
19426        #[inline]
19427        unsafe fn encode(
19428            self,
19429            encoder: &mut fidl::encoding::Encoder<'_, D>,
19430            offset: usize,
19431            _depth: fidl::encoding::Depth,
19432        ) -> fidl::Result<()> {
19433            encoder.debug_check_bounds::<OptionalUint32>(offset);
19434            encoder.write_num::<u64>(self.ordinal(), offset);
19435            match self {
19436                OptionalUint32::Value(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
19437                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
19438                    encoder,
19439                    offset + 8,
19440                    _depth,
19441                ),
19442                OptionalUint32::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
19443                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
19444                    encoder,
19445                    offset + 8,
19446                    _depth,
19447                ),
19448            }
19449        }
19450    }
19451
19452    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint32 {
19453        #[inline(always)]
19454        fn new_empty() -> Self {
19455            Self::Value(fidl::new_empty!(u32, D))
19456        }
19457
19458        #[inline]
19459        unsafe fn decode(
19460            &mut self,
19461            decoder: &mut fidl::encoding::Decoder<'_, D>,
19462            offset: usize,
19463            mut depth: fidl::encoding::Depth,
19464        ) -> fidl::Result<()> {
19465            decoder.debug_check_bounds::<Self>(offset);
19466            #[allow(unused_variables)]
19467            let next_out_of_line = decoder.next_out_of_line();
19468            let handles_before = decoder.remaining_handles();
19469            let (ordinal, inlined, num_bytes, num_handles) =
19470                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19471
19472            let member_inline_size = match ordinal {
19473                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19474                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19475                _ => return Err(fidl::Error::UnknownUnionTag),
19476            };
19477
19478            if inlined != (member_inline_size <= 4) {
19479                return Err(fidl::Error::InvalidInlineBitInEnvelope);
19480            }
19481            let _inner_offset;
19482            if inlined {
19483                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19484                _inner_offset = offset + 8;
19485            } else {
19486                depth.increment()?;
19487                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19488            }
19489            match ordinal {
19490                1 => {
19491                    #[allow(irrefutable_let_patterns)]
19492                    if let OptionalUint32::Value(_) = self {
19493                        // Do nothing, read the value into the object
19494                    } else {
19495                        // Initialize `self` to the right variant
19496                        *self = OptionalUint32::Value(fidl::new_empty!(u32, D));
19497                    }
19498                    #[allow(irrefutable_let_patterns)]
19499                    if let OptionalUint32::Value(ref mut val) = self {
19500                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
19501                    } else {
19502                        unreachable!()
19503                    }
19504                }
19505                2 => {
19506                    #[allow(irrefutable_let_patterns)]
19507                    if let OptionalUint32::Unset(_) = self {
19508                        // Do nothing, read the value into the object
19509                    } else {
19510                        // Initialize `self` to the right variant
19511                        *self = OptionalUint32::Unset(fidl::new_empty!(Empty, D));
19512                    }
19513                    #[allow(irrefutable_let_patterns)]
19514                    if let OptionalUint32::Unset(ref mut val) = self {
19515                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
19516                    } else {
19517                        unreachable!()
19518                    }
19519                }
19520                ordinal => panic!("unexpected ordinal {:?}", ordinal),
19521            }
19522            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19523                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19524            }
19525            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19526                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19527            }
19528            Ok(())
19529        }
19530    }
19531
19532    impl fidl::encoding::ValueTypeMarker for OptionalUint8 {
19533        type Borrowed<'a> = &'a Self;
19534        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19535            value
19536        }
19537    }
19538
19539    unsafe impl fidl::encoding::TypeMarker for OptionalUint8 {
19540        type Owned = Self;
19541
19542        #[inline(always)]
19543        fn inline_align(_context: fidl::encoding::Context) -> usize {
19544            8
19545        }
19546
19547        #[inline(always)]
19548        fn inline_size(_context: fidl::encoding::Context) -> usize {
19549            16
19550        }
19551    }
19552
19553    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint8, D>
19554        for &OptionalUint8
19555    {
19556        #[inline]
19557        unsafe fn encode(
19558            self,
19559            encoder: &mut fidl::encoding::Encoder<'_, D>,
19560            offset: usize,
19561            _depth: fidl::encoding::Depth,
19562        ) -> fidl::Result<()> {
19563            encoder.debug_check_bounds::<OptionalUint8>(offset);
19564            encoder.write_num::<u64>(self.ordinal(), offset);
19565            match self {
19566                OptionalUint8::Value(ref val) => fidl::encoding::encode_in_envelope::<u8, D>(
19567                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
19568                    encoder,
19569                    offset + 8,
19570                    _depth,
19571                ),
19572                OptionalUint8::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
19573                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
19574                    encoder,
19575                    offset + 8,
19576                    _depth,
19577                ),
19578            }
19579        }
19580    }
19581
19582    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint8 {
19583        #[inline(always)]
19584        fn new_empty() -> Self {
19585            Self::Value(fidl::new_empty!(u8, D))
19586        }
19587
19588        #[inline]
19589        unsafe fn decode(
19590            &mut self,
19591            decoder: &mut fidl::encoding::Decoder<'_, D>,
19592            offset: usize,
19593            mut depth: fidl::encoding::Depth,
19594        ) -> fidl::Result<()> {
19595            decoder.debug_check_bounds::<Self>(offset);
19596            #[allow(unused_variables)]
19597            let next_out_of_line = decoder.next_out_of_line();
19598            let handles_before = decoder.remaining_handles();
19599            let (ordinal, inlined, num_bytes, num_handles) =
19600                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19601
19602            let member_inline_size = match ordinal {
19603                1 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19604                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19605                _ => return Err(fidl::Error::UnknownUnionTag),
19606            };
19607
19608            if inlined != (member_inline_size <= 4) {
19609                return Err(fidl::Error::InvalidInlineBitInEnvelope);
19610            }
19611            let _inner_offset;
19612            if inlined {
19613                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19614                _inner_offset = offset + 8;
19615            } else {
19616                depth.increment()?;
19617                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19618            }
19619            match ordinal {
19620                1 => {
19621                    #[allow(irrefutable_let_patterns)]
19622                    if let OptionalUint8::Value(_) = self {
19623                        // Do nothing, read the value into the object
19624                    } else {
19625                        // Initialize `self` to the right variant
19626                        *self = OptionalUint8::Value(fidl::new_empty!(u8, D));
19627                    }
19628                    #[allow(irrefutable_let_patterns)]
19629                    if let OptionalUint8::Value(ref mut val) = self {
19630                        fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
19631                    } else {
19632                        unreachable!()
19633                    }
19634                }
19635                2 => {
19636                    #[allow(irrefutable_let_patterns)]
19637                    if let OptionalUint8::Unset(_) = self {
19638                        // Do nothing, read the value into the object
19639                    } else {
19640                        // Initialize `self` to the right variant
19641                        *self = OptionalUint8::Unset(fidl::new_empty!(Empty, D));
19642                    }
19643                    #[allow(irrefutable_let_patterns)]
19644                    if let OptionalUint8::Unset(ref mut val) = self {
19645                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
19646                    } else {
19647                        unreachable!()
19648                    }
19649                }
19650                ordinal => panic!("unexpected ordinal {:?}", ordinal),
19651            }
19652            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19653                return Err(fidl::Error::InvalidNumBytesInEnvelope);
19654            }
19655            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19656                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19657            }
19658            Ok(())
19659        }
19660    }
19661}