Skip to main content

fidl_fuchsia_posix_socket_common/
fidl_fuchsia_posix_socket_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// TCP congestion control state machine state.
12pub type TcpCongestionControlState = fidl_fuchsia_net_tcp_common::CongestionControlState;
13
14/// TCP protocol state.
15pub type TcpInfo = fidl_fuchsia_net_tcp_common::Info;
16
17/// TCP state machine state.
18pub type TcpState = fidl_fuchsia_net_tcp_common::State;
19
20/// Legacy protocol name. Use the generated discoverable protocol name instead.
21pub const DATAGRAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/DatagramSocket";
22
23/// Constant bounding the number of eventpairs returned by Netstack to clients
24/// of the fast protocol.
25///
26/// Set equal to `ZX_WAIT_MANY_MAXIMUM_ITEMS` - 1, where `ZX_WAIT_MANY_MAXIMUM_ITEMS`
27/// is defined in `//zircon/system/public/zircon/types.h` and bounds the number of eventpairs
28/// in a single call to `zx_object_wait_many`. The bias leaves room to allow clients to wait
29/// for errors on the zircon socket in the same call.
30pub const FAST_UDP_WAIT_MANY_MAXIMUM_ITEMS: u32 = 63;
31
32pub const SIGNAL_DATAGRAM_ERROR: u32 = USER_SIGNAL_2 as u32;
33
34pub const SIGNAL_DATAGRAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
35
36pub const SIGNAL_DATAGRAM_OUTGOING: u32 = USER_SIGNAL_1 as u32;
37
38pub const SIGNAL_DATAGRAM_SHUTDOWN_READ: u32 = USER_SIGNAL_4 as u32;
39
40pub const SIGNAL_DATAGRAM_SHUTDOWN_WRITE: u32 = USER_SIGNAL_5 as u32;
41
42pub const SIGNAL_STREAM_CONNECTED: u32 = USER_SIGNAL_3 as u32;
43
44pub const SIGNAL_STREAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
45
46/// Legacy protocol name. Use the generated discoverable protocol name instead.
47pub const STREAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/StreamSocket";
48
49/// Legacy protocol name. Use the generated discoverable protocol name instead.
50pub const SYNCHRONOUS_DATAGRAM_SOCKET_PROTOCOL_NAME: &str =
51    "fuchsia.posix.socket/SynchronousDatagramSocket";
52
53pub const USER_SIGNAL_0: u32 = 16777216;
54
55pub const USER_SIGNAL_1: u32 = 33554432;
56
57pub const USER_SIGNAL_2: u32 = 67108864;
58
59pub const USER_SIGNAL_3: u32 = 134217728;
60
61pub const USER_SIGNAL_4: u32 = 268435456;
62
63pub const USER_SIGNAL_5: u32 = 536870912;
64
65bitflags! {
66    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
67    pub struct CmsgRequests: u32 {
68        /// Identifies whether the `IP_RECVTOS` control message is requested.
69        const IP_TOS = 1;
70        /// Identifies whether the `IP_RECVTTL` control message is requested.
71        const IP_TTL = 2;
72        /// Identifies whether the `IPV6_RECVTCLASS` control message is requested.
73        const IPV6_TCLASS = 4;
74        /// Identifies whether the `IPV6_RECVHOPLIMIT` control message is requested.
75        const IPV6_HOPLIMIT = 8;
76        /// Identifies whether the `IPV6_RECVPKTINFO` control message is requested.
77        const IPV6_PKTINFO = 16;
78        /// Identifies whether the `IP_RECVORIGDSTADDR` control message is requested.
79        const IP_RECVORIGDSTADDR = 32;
80        /// Identifies whether the `IP_PKTINFO` control message is requested.
81        const IP_PKTINFO = 64;
82    }
83}
84
85impl CmsgRequests {
86    #[inline(always)]
87    pub fn from_bits_allow_unknown(bits: u32) -> Self {
88        Self::from_bits_retain(bits)
89    }
90
91    #[inline(always)]
92    pub fn has_unknown_bits(&self) -> bool {
93        self.get_unknown_bits() != 0
94    }
95
96    #[inline(always)]
97    pub fn get_unknown_bits(&self) -> u32 {
98        self.bits() & !Self::all().bits()
99    }
100}
101
102bitflags! {
103    /// Bits representing the interface flags as returned by the SIOCGIFFLAGS ioctl
104    /// operation. These bitmasks are intended to track the C API definition. For
105    /// example, `InterfaceFlags.UP` corresponds to `IFF_UP`, etc.
106    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
107    pub struct InterfaceFlags: u16 {
108        const UP = 1;
109        const BROADCAST = 2;
110        const DEBUG = 4;
111        const LOOPBACK = 8;
112        const POINTTOPOINT = 16;
113        const NOTRAILERS = 32;
114        const RUNNING = 64;
115        const NOARP = 128;
116        const PROMISC = 256;
117        const ALLMULTI = 512;
118        const LEADER = 1024;
119        const FOLLOWER = 2048;
120        const MULTICAST = 4096;
121        const PORTSEL = 8192;
122        const AUTOMEDIA = 16384;
123        const DYNAMIC = 32768;
124    }
125}
126
127impl InterfaceFlags {}
128
129bitflags! {
130    /// Flags controlling RecvMsg behavior.
131    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
132    pub struct RecvMsgFlags: u16 {
133        /// Returns data from the receive queue without removing from it.
134        ///
135        /// Equivalent to `MSG_PEEK`.
136        const PEEK = 2;
137    }
138}
139
140impl RecvMsgFlags {}
141
142bitflags! {
143    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
144    pub struct SendMsgFlags: u16 {
145        const RESERVED = 32768;
146    }
147}
148
149impl SendMsgFlags {}
150
151bitflags! {
152    /// Socket shutdown mode.
153    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
154    pub struct ShutdownMode: u16 {
155        /// Shutdown socket read endpoint.
156        const READ = 1;
157        /// Shutdown socket write endpoint.
158        const WRITE = 2;
159    }
160}
161
162impl ShutdownMode {}
163
164/// Protocols supported by [`fuchsia.posix.socket/DatagramSocket`].
165///
166/// `DatagramSocketProtocol` enumerates the protocols supported by the network
167/// stack over datagram sockets.
168#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
169#[repr(u32)]
170pub enum DatagramSocketProtocol {
171    /// UDP (User Datagram Protocol).
172    ///
173    /// A UDP socket is equivalent to the POSIX API of `SOCK_DGRAM` with a
174    /// protocol of 0 or `IPPROTO_UDP`.
175    Udp = 1,
176    /// ICMP (Internet Control Message Protocol) echo.
177    ///
178    /// An ICMP echo socket is equivalent to the POSIX API of `SOCK_DGRAM` with
179    /// a protocol of `IPPROTO_ICMP` `IPPROTO_ICMPV6` (depending on provided
180    /// domain).
181    ///
182    /// Datagrams sent over an ICMP echo socket *must* have a valid ICMP or
183    /// ICMPv6 echo header.
184    IcmpEcho = 2,
185}
186
187impl DatagramSocketProtocol {
188    #[inline]
189    pub fn from_primitive(prim: u32) -> Option<Self> {
190        match prim {
191            1 => Some(Self::Udp),
192            2 => Some(Self::IcmpEcho),
193            _ => None,
194        }
195    }
196
197    #[inline]
198    pub const fn into_primitive(self) -> u32 {
199        self as u32
200    }
201}
202
203/// A socket's domain.
204///
205/// Determines the addressing domain for a socket.
206#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
207#[repr(i16)]
208pub enum Domain {
209    /// An IPv4 socket. Equivalent to `AF_INET`.
210    Ipv4 = 0,
211    /// An IPv6 socket. Equivalent to `AF_INET6`.
212    Ipv6 = 1,
213}
214
215impl Domain {
216    #[inline]
217    pub fn from_primitive(prim: i16) -> Option<Self> {
218        match prim {
219            0 => Some(Self::Ipv4),
220            1 => Some(Self::Ipv6),
221            _ => None,
222        }
223    }
224
225    #[inline]
226    pub const fn into_primitive(self) -> i16 {
227        self as i16
228    }
229}
230
231/// Protocols supported by [`fuchsia.posix.socket/StreamSocket`].
232///
233/// `StreamSocketProtocol` enumerates the protocols supported by the network
234/// stack over stream sockets.
235#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
236#[repr(u32)]
237pub enum StreamSocketProtocol {
238    /// TCP (Transmission Control Protocol).
239    ///
240    /// A TCP socket is equivalent to the POSIX API of `SOCK_STREAM` with a
241    /// protocol of 0 or `IPPROTO_TCP`.
242    Tcp = 0,
243}
244
245impl StreamSocketProtocol {
246    #[inline]
247    pub fn from_primitive(prim: u32) -> Option<Self> {
248        match prim {
249            0 => Some(Self::Tcp),
250            _ => None,
251        }
252    }
253
254    #[inline]
255    pub const fn into_primitive(self) -> u32 {
256        self as u32
257    }
258}
259
260/// TCP congestion control modes.
261#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
262#[repr(u32)]
263pub enum TcpCongestionControl {
264    Reno = 1,
265    Cubic = 2,
266}
267
268impl TcpCongestionControl {
269    #[inline]
270    pub fn from_primitive(prim: u32) -> Option<Self> {
271        match prim {
272            1 => Some(Self::Reno),
273            2 => Some(Self::Cubic),
274            _ => None,
275        }
276    }
277
278    #[inline]
279    pub const fn into_primitive(self) -> u32 {
280        self as u32
281    }
282}
283
284/// Packet timestamp reporting precision options.
285#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
286#[repr(u32)]
287pub enum TimestampOption {
288    /// Do not report timestamp.
289    Disabled = 0,
290    /// Report timestamp with nanosecond precision.
291    Nanosecond = 1,
292    /// Report timestamp with microsecond precision.
293    Microsecond = 2,
294}
295
296impl TimestampOption {
297    #[inline]
298    pub fn from_primitive(prim: u32) -> Option<Self> {
299        match prim {
300            0 => Some(Self::Disabled),
301            1 => Some(Self::Nanosecond),
302            2 => Some(Self::Microsecond),
303            _ => None,
304        }
305    }
306
307    #[inline]
308    pub const fn into_primitive(self) -> u32 {
309        self as u32
310    }
311}
312
313#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
314pub enum UdpMetadataEncodingProtocolVersion {
315    Zero,
316    #[doc(hidden)]
317    __SourceBreaking {
318        unknown_ordinal: u16,
319    },
320}
321
322/// Pattern that matches an unknown `UdpMetadataEncodingProtocolVersion` member.
323#[macro_export]
324macro_rules! UdpMetadataEncodingProtocolVersionUnknown {
325    () => {
326        _
327    };
328}
329
330impl UdpMetadataEncodingProtocolVersion {
331    #[inline]
332    pub fn from_primitive(prim: u16) -> Option<Self> {
333        match prim {
334            0 => Some(Self::Zero),
335            _ => None,
336        }
337    }
338
339    #[inline]
340    pub fn from_primitive_allow_unknown(prim: u16) -> Self {
341        match prim {
342            0 => Self::Zero,
343            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
344        }
345    }
346
347    #[inline]
348    pub fn unknown() -> Self {
349        Self::__SourceBreaking { unknown_ordinal: 0xffff }
350    }
351
352    #[inline]
353    pub const fn into_primitive(self) -> u16 {
354        match self {
355            Self::Zero => 0,
356            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
357        }
358    }
359
360    #[inline]
361    pub fn is_unknown(&self) -> bool {
362        match self {
363            Self::__SourceBreaking { unknown_ordinal: _ } => true,
364            _ => false,
365        }
366    }
367}
368
369#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
370pub struct BaseDatagramSocketGetInfoResponse {
371    pub domain: Domain,
372    pub proto: DatagramSocketProtocol,
373}
374
375impl fidl::Persistable for BaseDatagramSocketGetInfoResponse {}
376
377#[derive(Clone, Debug, PartialEq)]
378pub struct BaseNetworkSocketAddIpMembershipRequest {
379    pub membership: IpMulticastMembership,
380}
381
382impl fidl::Persistable for BaseNetworkSocketAddIpMembershipRequest {}
383
384#[derive(Clone, Debug, PartialEq)]
385pub struct BaseNetworkSocketAddIpv6MembershipRequest {
386    pub membership: Ipv6MulticastMembership,
387}
388
389impl fidl::Persistable for BaseNetworkSocketAddIpv6MembershipRequest {}
390
391#[derive(Clone, Debug, PartialEq)]
392pub struct BaseNetworkSocketBindRequest {
393    pub addr: fidl_fuchsia_net_common::SocketAddress,
394}
395
396impl fidl::Persistable for BaseNetworkSocketBindRequest {}
397
398#[derive(Clone, Debug, PartialEq)]
399pub struct BaseNetworkSocketConnectRequest {
400    pub addr: fidl_fuchsia_net_common::SocketAddress,
401}
402
403impl fidl::Persistable for BaseNetworkSocketConnectRequest {}
404
405#[derive(Clone, Debug, PartialEq)]
406pub struct BaseNetworkSocketDropIpMembershipRequest {
407    pub membership: IpMulticastMembership,
408}
409
410impl fidl::Persistable for BaseNetworkSocketDropIpMembershipRequest {}
411
412#[derive(Clone, Debug, PartialEq)]
413pub struct BaseNetworkSocketDropIpv6MembershipRequest {
414    pub membership: Ipv6MulticastMembership,
415}
416
417impl fidl::Persistable for BaseNetworkSocketDropIpv6MembershipRequest {}
418
419#[derive(Clone, Debug, PartialEq)]
420pub struct BaseNetworkSocketSetIpMulticastInterfaceRequest {
421    pub iface: u64,
422    pub address: fidl_fuchsia_net_common::Ipv4Address,
423}
424
425impl fidl::Persistable for BaseNetworkSocketSetIpMulticastInterfaceRequest {}
426
427#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
428pub struct BaseNetworkSocketSetIpMulticastLoopbackRequest {
429    pub value: bool,
430}
431
432impl fidl::Persistable for BaseNetworkSocketSetIpMulticastLoopbackRequest {}
433
434#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
435pub struct BaseNetworkSocketSetIpMulticastTtlRequest {
436    pub value: OptionalUint8,
437}
438
439impl fidl::Persistable for BaseNetworkSocketSetIpMulticastTtlRequest {}
440
441#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
442pub struct BaseNetworkSocketSetIpPacketInfoRequest {
443    pub value: bool,
444}
445
446impl fidl::Persistable for BaseNetworkSocketSetIpPacketInfoRequest {}
447
448#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
449pub struct BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {
450    pub value: bool,
451}
452
453impl fidl::Persistable for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {}
454
455#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
456pub struct BaseNetworkSocketSetIpReceiveTtlRequest {
457    pub value: bool,
458}
459
460impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTtlRequest {}
461
462#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
463pub struct BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
464    pub value: bool,
465}
466
467impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {}
468
469#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
470pub struct BaseNetworkSocketSetIpTransparentRequest {
471    pub value: bool,
472}
473
474impl fidl::Persistable for BaseNetworkSocketSetIpTransparentRequest {}
475
476#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
477pub struct BaseNetworkSocketSetIpTtlRequest {
478    pub value: OptionalUint8,
479}
480
481impl fidl::Persistable for BaseNetworkSocketSetIpTtlRequest {}
482
483#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
484#[repr(C)]
485pub struct BaseNetworkSocketSetIpTypeOfServiceRequest {
486    pub value: u8,
487}
488
489impl fidl::Persistable for BaseNetworkSocketSetIpTypeOfServiceRequest {}
490
491#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
492pub struct BaseNetworkSocketSetIpv6MulticastHopsRequest {
493    pub value: OptionalUint8,
494}
495
496impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastHopsRequest {}
497
498#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
499#[repr(C)]
500pub struct BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
501    pub value: u64,
502}
503
504impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {}
505
506#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
507pub struct BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
508    pub value: bool,
509}
510
511impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {}
512
513#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
514pub struct BaseNetworkSocketSetIpv6OnlyRequest {
515    pub value: bool,
516}
517
518impl fidl::Persistable for BaseNetworkSocketSetIpv6OnlyRequest {}
519
520#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
521pub struct BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
522    pub value: bool,
523}
524
525impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {}
526
527#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
528pub struct BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
529    pub value: bool,
530}
531
532impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {}
533
534#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
535pub struct BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
536    pub value: bool,
537}
538
539impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {}
540
541#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
542pub struct BaseNetworkSocketSetIpv6TrafficClassRequest {
543    pub value: OptionalUint8,
544}
545
546impl fidl::Persistable for BaseNetworkSocketSetIpv6TrafficClassRequest {}
547
548#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
549pub struct BaseNetworkSocketSetIpv6UnicastHopsRequest {
550    pub value: OptionalUint8,
551}
552
553impl fidl::Persistable for BaseNetworkSocketSetIpv6UnicastHopsRequest {}
554
555#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
556pub struct BaseNetworkSocketShutdownRequest {
557    pub mode: ShutdownMode,
558}
559
560impl fidl::Persistable for BaseNetworkSocketShutdownRequest {}
561
562#[derive(Clone, Debug, PartialEq)]
563pub struct BaseNetworkSocketGetIpMulticastInterfaceResponse {
564    pub value: fidl_fuchsia_net_common::Ipv4Address,
565}
566
567impl fidl::Persistable for BaseNetworkSocketGetIpMulticastInterfaceResponse {}
568
569#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
570pub struct BaseNetworkSocketGetIpMulticastLoopbackResponse {
571    pub value: bool,
572}
573
574impl fidl::Persistable for BaseNetworkSocketGetIpMulticastLoopbackResponse {}
575
576#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
577#[repr(C)]
578pub struct BaseNetworkSocketGetIpMulticastTtlResponse {
579    pub value: u8,
580}
581
582impl fidl::Persistable for BaseNetworkSocketGetIpMulticastTtlResponse {}
583
584#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
585pub struct BaseNetworkSocketGetIpPacketInfoResponse {
586    pub value: bool,
587}
588
589impl fidl::Persistable for BaseNetworkSocketGetIpPacketInfoResponse {}
590
591#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
592pub struct BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {
593    pub value: bool,
594}
595
596impl fidl::Persistable for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {}
597
598#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
599pub struct BaseNetworkSocketGetIpReceiveTtlResponse {
600    pub value: bool,
601}
602
603impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTtlResponse {}
604
605#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
606pub struct BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
607    pub value: bool,
608}
609
610impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {}
611
612#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
613pub struct BaseNetworkSocketGetIpTransparentResponse {
614    pub value: bool,
615}
616
617impl fidl::Persistable for BaseNetworkSocketGetIpTransparentResponse {}
618
619#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
620#[repr(C)]
621pub struct BaseNetworkSocketGetIpTtlResponse {
622    pub value: u8,
623}
624
625impl fidl::Persistable for BaseNetworkSocketGetIpTtlResponse {}
626
627#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
628#[repr(C)]
629pub struct BaseNetworkSocketGetIpTypeOfServiceResponse {
630    pub value: u8,
631}
632
633impl fidl::Persistable for BaseNetworkSocketGetIpTypeOfServiceResponse {}
634
635#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
636#[repr(C)]
637pub struct BaseNetworkSocketGetIpv6MulticastHopsResponse {
638    pub value: u8,
639}
640
641impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastHopsResponse {}
642
643#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
644#[repr(C)]
645pub struct BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
646    pub value: u64,
647}
648
649impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {}
650
651#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
652pub struct BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
653    pub value: bool,
654}
655
656impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {}
657
658#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
659pub struct BaseNetworkSocketGetIpv6OnlyResponse {
660    pub value: bool,
661}
662
663impl fidl::Persistable for BaseNetworkSocketGetIpv6OnlyResponse {}
664
665#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
666pub struct BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
667    pub value: bool,
668}
669
670impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {}
671
672#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
673pub struct BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
674    pub value: bool,
675}
676
677impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {}
678
679#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
680pub struct BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
681    pub value: bool,
682}
683
684impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {}
685
686#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
687#[repr(C)]
688pub struct BaseNetworkSocketGetIpv6TrafficClassResponse {
689    pub value: u8,
690}
691
692impl fidl::Persistable for BaseNetworkSocketGetIpv6TrafficClassResponse {}
693
694#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
695#[repr(C)]
696pub struct BaseNetworkSocketGetIpv6UnicastHopsResponse {
697    pub value: u8,
698}
699
700impl fidl::Persistable for BaseNetworkSocketGetIpv6UnicastHopsResponse {}
701
702#[derive(Clone, Debug, PartialEq)]
703pub struct BaseNetworkSocketGetOriginalDestinationResponse {
704    pub value: fidl_fuchsia_net_common::SocketAddress,
705}
706
707impl fidl::Persistable for BaseNetworkSocketGetOriginalDestinationResponse {}
708
709#[derive(Clone, Debug, PartialEq)]
710pub struct BaseNetworkSocketGetPeerNameResponse {
711    pub addr: fidl_fuchsia_net_common::SocketAddress,
712}
713
714impl fidl::Persistable for BaseNetworkSocketGetPeerNameResponse {}
715
716#[derive(Clone, Debug, PartialEq)]
717pub struct BaseNetworkSocketGetSockNameResponse {
718    pub addr: fidl_fuchsia_net_common::SocketAddress,
719}
720
721impl fidl::Persistable for BaseNetworkSocketGetSockNameResponse {}
722
723#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
724pub struct BaseSocketGetMarkRequest {
725    pub domain: fidl_fuchsia_net_common::MarkDomain,
726}
727
728impl fidl::Persistable for BaseSocketGetMarkRequest {}
729
730#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
731pub struct BaseSocketSetBindToDeviceRequest {
732    pub value: String,
733}
734
735impl fidl::Persistable for BaseSocketSetBindToDeviceRequest {}
736
737#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
738#[repr(C)]
739pub struct BaseSocketSetBindToInterfaceIndexRequest {
740    pub value: u64,
741}
742
743impl fidl::Persistable for BaseSocketSetBindToInterfaceIndexRequest {}
744
745#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
746pub struct BaseSocketSetBroadcastRequest {
747    pub value: bool,
748}
749
750impl fidl::Persistable for BaseSocketSetBroadcastRequest {}
751
752#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
753pub struct BaseSocketSetKeepAliveRequest {
754    pub value: bool,
755}
756
757impl fidl::Persistable for BaseSocketSetKeepAliveRequest {}
758
759#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
760pub struct BaseSocketSetLingerRequest {
761    pub linger: bool,
762    pub length_secs: u32,
763}
764
765impl fidl::Persistable for BaseSocketSetLingerRequest {}
766
767#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
768pub struct BaseSocketSetMarkRequest {
769    pub domain: fidl_fuchsia_net_common::MarkDomain,
770    pub mark: OptionalUint32,
771}
772
773impl fidl::Persistable for BaseSocketSetMarkRequest {}
774
775#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
776pub struct BaseSocketSetNoCheckRequest {
777    pub value: bool,
778}
779
780impl fidl::Persistable for BaseSocketSetNoCheckRequest {}
781
782#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
783pub struct BaseSocketSetOutOfBandInlineRequest {
784    pub value: bool,
785}
786
787impl fidl::Persistable for BaseSocketSetOutOfBandInlineRequest {}
788
789#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
790#[repr(C)]
791pub struct BaseSocketSetReceiveBufferRequest {
792    pub value_bytes: u64,
793}
794
795impl fidl::Persistable for BaseSocketSetReceiveBufferRequest {}
796
797#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
798pub struct BaseSocketSetReuseAddressRequest {
799    pub value: bool,
800}
801
802impl fidl::Persistable for BaseSocketSetReuseAddressRequest {}
803
804#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
805pub struct BaseSocketSetReusePortDeprecatedRequest {
806    pub value: bool,
807}
808
809impl fidl::Persistable for BaseSocketSetReusePortDeprecatedRequest {}
810
811#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
812#[repr(C)]
813pub struct BaseSocketSetSendBufferRequest {
814    pub value_bytes: u64,
815}
816
817impl fidl::Persistable for BaseSocketSetSendBufferRequest {}
818
819#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
820pub struct BaseSocketSetTimestampRequest {
821    pub value: TimestampOption,
822}
823
824impl fidl::Persistable for BaseSocketSetTimestampRequest {}
825
826#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
827pub struct BaseSocketGetAcceptConnResponse {
828    pub value: bool,
829}
830
831impl fidl::Persistable for BaseSocketGetAcceptConnResponse {}
832
833#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
834pub struct BaseSocketGetBindToDeviceResponse {
835    pub value: String,
836}
837
838impl fidl::Persistable for BaseSocketGetBindToDeviceResponse {}
839
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841#[repr(C)]
842pub struct BaseSocketGetBindToInterfaceIndexResponse {
843    pub value: u64,
844}
845
846impl fidl::Persistable for BaseSocketGetBindToInterfaceIndexResponse {}
847
848#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
849pub struct BaseSocketGetBroadcastResponse {
850    pub value: bool,
851}
852
853impl fidl::Persistable for BaseSocketGetBroadcastResponse {}
854
855#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
856#[repr(C)]
857pub struct BaseSocketGetCookieResponse {
858    pub value: u64,
859}
860
861impl fidl::Persistable for BaseSocketGetCookieResponse {}
862
863#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
864pub struct BaseSocketGetKeepAliveResponse {
865    pub value: bool,
866}
867
868impl fidl::Persistable for BaseSocketGetKeepAliveResponse {}
869
870#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
871pub struct BaseSocketGetLingerResponse {
872    pub linger: bool,
873    pub length_secs: u32,
874}
875
876impl fidl::Persistable for BaseSocketGetLingerResponse {}
877
878#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
879pub struct BaseSocketGetMarkResponse {
880    pub mark: OptionalUint32,
881}
882
883impl fidl::Persistable for BaseSocketGetMarkResponse {}
884
885#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
886pub struct BaseSocketGetNoCheckResponse {
887    pub value: bool,
888}
889
890impl fidl::Persistable for BaseSocketGetNoCheckResponse {}
891
892#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
893pub struct BaseSocketGetOutOfBandInlineResponse {
894    pub value: bool,
895}
896
897impl fidl::Persistable for BaseSocketGetOutOfBandInlineResponse {}
898
899#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
900#[repr(C)]
901pub struct BaseSocketGetReceiveBufferResponse {
902    pub value_bytes: u64,
903}
904
905impl fidl::Persistable for BaseSocketGetReceiveBufferResponse {}
906
907#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
908pub struct BaseSocketGetReuseAddressResponse {
909    pub value: bool,
910}
911
912impl fidl::Persistable for BaseSocketGetReuseAddressResponse {}
913
914#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
915pub struct BaseSocketGetReusePortResponse {
916    pub value: bool,
917}
918
919impl fidl::Persistable for BaseSocketGetReusePortResponse {}
920
921#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
922#[repr(C)]
923pub struct BaseSocketGetSendBufferResponse {
924    pub value_bytes: u64,
925}
926
927impl fidl::Persistable for BaseSocketGetSendBufferResponse {}
928
929#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
930pub struct BaseSocketGetTimestampResponse {
931    pub value: TimestampOption,
932}
933
934impl fidl::Persistable for BaseSocketGetTimestampResponse {}
935
936#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
937pub struct Empty;
938
939impl fidl::Persistable for Empty {}
940
941/// IPv4 multicast membership options.
942#[derive(Clone, Debug, PartialEq)]
943pub struct IpMulticastMembership {
944    /// Interface index for membership.
945    pub iface: u64,
946    /// Local interface address requesting or relinquishing ownership.
947    pub local_addr: fidl_fuchsia_net_common::Ipv4Address,
948    /// Address of the multicast group the membership refers to.
949    pub mcast_addr: fidl_fuchsia_net_common::Ipv4Address,
950}
951
952impl fidl::Persistable for IpMulticastMembership {}
953
954#[derive(Clone, Debug, PartialEq)]
955pub struct Ipv4PktInfoRecvControlData {
956    /// The index of the interface on which the IP packet was received.
957    pub iface: u64,
958    /// The local address of the interface on which the packet was received.
959    pub local_addr: fidl_fuchsia_net_common::Ipv4Address,
960    /// The destination address specified in the received packet's IP
961    /// header.
962    pub header_destination_addr: fidl_fuchsia_net_common::Ipv4Address,
963}
964
965impl fidl::Persistable for Ipv4PktInfoRecvControlData {}
966
967/// IPv6 multicast membership options.
968#[derive(Clone, Debug, PartialEq)]
969pub struct Ipv6MulticastMembership {
970    /// Interface index for membership.
971    pub iface: u64,
972    /// Address of the multicast group the membership refers to.
973    pub mcast_addr: fidl_fuchsia_net_common::Ipv6Address,
974}
975
976impl fidl::Persistable for Ipv6MulticastMembership {}
977
978#[derive(Clone, Debug, PartialEq)]
979pub struct Ipv6PktInfoRecvControlData {
980    /// The index of the interface on which the IP packet was received.
981    pub iface: u64,
982    /// The destination address specified in the received packet's IP
983    /// header.
984    pub header_destination_addr: fidl_fuchsia_net_common::Ipv6Address,
985}
986
987impl fidl::Persistable for Ipv6PktInfoRecvControlData {}
988
989/// IPv6-specific disposition of sent data.
990///
991/// This is currently a struct instead of a table as it is meant to match
992/// `in6_pktinfo` which is not expected to grow.
993#[derive(Clone, Debug, PartialEq)]
994pub struct Ipv6PktInfoSendControlData {
995    /// The interface index from which the IPv6 packet should be sent.
996    ///
997    /// 0 indicates that the local interface is unspecified and the
998    /// stack may choose an appropriate interface.
999    pub iface: u64,
1000    /// The source address from which the IPv6 packet should be sent.
1001    ///
1002    /// All zeroes indicates that the local address is unspecified and
1003    /// the stack may choose an appropriate address (i.e. the local
1004    /// address to which the socket is bound).
1005    pub local_addr: fidl_fuchsia_net_common::Ipv6Address,
1006}
1007
1008impl fidl::Persistable for Ipv6PktInfoSendControlData {}
1009
1010#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1011pub struct ProviderDatagramSocketDeprecatedRequest {
1012    pub domain: Domain,
1013    pub proto: DatagramSocketProtocol,
1014}
1015
1016impl fidl::Persistable for ProviderDatagramSocketDeprecatedRequest {}
1017
1018#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1019pub struct ProviderDatagramSocketRequest {
1020    pub domain: Domain,
1021    pub proto: DatagramSocketProtocol,
1022}
1023
1024impl fidl::Persistable for ProviderDatagramSocketRequest {}
1025
1026#[derive(Clone, Debug, PartialEq)]
1027pub struct ProviderGetInterfaceAddressesResponse {
1028    pub interfaces: Vec<InterfaceAddresses>,
1029}
1030
1031impl fidl::Persistable for ProviderGetInterfaceAddressesResponse {}
1032
1033#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1034#[repr(C)]
1035pub struct ProviderInterfaceIndexToNameRequest {
1036    pub index: u64,
1037}
1038
1039impl fidl::Persistable for ProviderInterfaceIndexToNameRequest {}
1040
1041#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1042pub struct ProviderInterfaceNameToFlagsRequest {
1043    pub name: String,
1044}
1045
1046impl fidl::Persistable for ProviderInterfaceNameToFlagsRequest {}
1047
1048#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1049pub struct ProviderInterfaceNameToIndexRequest {
1050    pub name: String,
1051}
1052
1053impl fidl::Persistable for ProviderInterfaceNameToIndexRequest {}
1054
1055#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1056pub struct ProviderStreamSocketRequest {
1057    pub domain: Domain,
1058    pub proto: StreamSocketProtocol,
1059}
1060
1061impl fidl::Persistable for ProviderStreamSocketRequest {}
1062
1063#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1064pub struct ProviderInterfaceIndexToNameResponse {
1065    pub name: String,
1066}
1067
1068impl fidl::Persistable for ProviderInterfaceIndexToNameResponse {}
1069
1070#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1071pub struct ProviderInterfaceNameToFlagsResponse {
1072    pub flags: InterfaceFlags,
1073}
1074
1075impl fidl::Persistable for ProviderInterfaceNameToFlagsResponse {}
1076
1077#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1078#[repr(C)]
1079pub struct ProviderInterfaceNameToIndexResponse {
1080    pub index: u64,
1081}
1082
1083impl fidl::Persistable for ProviderInterfaceNameToIndexResponse {}
1084
1085#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1086pub struct StreamSocketAcceptRequest {
1087    pub want_addr: bool,
1088}
1089
1090impl fidl::Persistable for StreamSocketAcceptRequest {}
1091
1092#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1093#[repr(C)]
1094pub struct StreamSocketListenRequest {
1095    pub backlog: i16,
1096}
1097
1098impl fidl::Persistable for StreamSocketListenRequest {}
1099
1100#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1101pub struct StreamSocketSetTcpCongestionRequest {
1102    pub value: TcpCongestionControl,
1103}
1104
1105impl fidl::Persistable for StreamSocketSetTcpCongestionRequest {}
1106
1107#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1108pub struct StreamSocketSetTcpCorkRequest {
1109    pub value: bool,
1110}
1111
1112impl fidl::Persistable for StreamSocketSetTcpCorkRequest {}
1113
1114#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1115#[repr(C)]
1116pub struct StreamSocketSetTcpDeferAcceptRequest {
1117    pub value_secs: u32,
1118}
1119
1120impl fidl::Persistable for StreamSocketSetTcpDeferAcceptRequest {}
1121
1122#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1123#[repr(C)]
1124pub struct StreamSocketSetTcpKeepAliveCountRequest {
1125    pub value: u32,
1126}
1127
1128impl fidl::Persistable for StreamSocketSetTcpKeepAliveCountRequest {}
1129
1130#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1131#[repr(C)]
1132pub struct StreamSocketSetTcpKeepAliveIdleRequest {
1133    pub value_secs: u32,
1134}
1135
1136impl fidl::Persistable for StreamSocketSetTcpKeepAliveIdleRequest {}
1137
1138#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1139#[repr(C)]
1140pub struct StreamSocketSetTcpKeepAliveIntervalRequest {
1141    pub value_secs: u32,
1142}
1143
1144impl fidl::Persistable for StreamSocketSetTcpKeepAliveIntervalRequest {}
1145
1146#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1147pub struct StreamSocketSetTcpLingerRequest {
1148    pub value_secs: OptionalUint32,
1149}
1150
1151impl fidl::Persistable for StreamSocketSetTcpLingerRequest {}
1152
1153#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1154#[repr(C)]
1155pub struct StreamSocketSetTcpMaxSegmentRequest {
1156    pub value_bytes: u32,
1157}
1158
1159impl fidl::Persistable for StreamSocketSetTcpMaxSegmentRequest {}
1160
1161#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1162pub struct StreamSocketSetTcpNoDelayRequest {
1163    pub value: bool,
1164}
1165
1166impl fidl::Persistable for StreamSocketSetTcpNoDelayRequest {}
1167
1168#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1169pub struct StreamSocketSetTcpQuickAckRequest {
1170    pub value: bool,
1171}
1172
1173impl fidl::Persistable for StreamSocketSetTcpQuickAckRequest {}
1174
1175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1176#[repr(C)]
1177pub struct StreamSocketSetTcpSynCountRequest {
1178    pub value: u32,
1179}
1180
1181impl fidl::Persistable for StreamSocketSetTcpSynCountRequest {}
1182
1183#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1184#[repr(C)]
1185pub struct StreamSocketSetTcpUserTimeoutRequest {
1186    pub value_millis: u32,
1187}
1188
1189impl fidl::Persistable for StreamSocketSetTcpUserTimeoutRequest {}
1190
1191#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1192#[repr(C)]
1193pub struct StreamSocketSetTcpWindowClampRequest {
1194    pub value: u32,
1195}
1196
1197impl fidl::Persistable for StreamSocketSetTcpWindowClampRequest {}
1198
1199#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1200pub struct StreamSocketGetInfoResponse {
1201    pub domain: Domain,
1202    pub proto: StreamSocketProtocol,
1203}
1204
1205impl fidl::Persistable for StreamSocketGetInfoResponse {}
1206
1207#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1208pub struct StreamSocketGetTcpCongestionResponse {
1209    pub value: TcpCongestionControl,
1210}
1211
1212impl fidl::Persistable for StreamSocketGetTcpCongestionResponse {}
1213
1214#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1215pub struct StreamSocketGetTcpCorkResponse {
1216    pub value: bool,
1217}
1218
1219impl fidl::Persistable for StreamSocketGetTcpCorkResponse {}
1220
1221#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1222#[repr(C)]
1223pub struct StreamSocketGetTcpDeferAcceptResponse {
1224    pub value_secs: u32,
1225}
1226
1227impl fidl::Persistable for StreamSocketGetTcpDeferAcceptResponse {}
1228
1229#[derive(Clone, Debug, PartialEq)]
1230pub struct StreamSocketGetTcpInfoResponse {
1231    pub info: fidl_fuchsia_net_tcp_common::Info,
1232}
1233
1234impl fidl::Persistable for StreamSocketGetTcpInfoResponse {}
1235
1236#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1237#[repr(C)]
1238pub struct StreamSocketGetTcpKeepAliveCountResponse {
1239    pub value: u32,
1240}
1241
1242impl fidl::Persistable for StreamSocketGetTcpKeepAliveCountResponse {}
1243
1244#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1245#[repr(C)]
1246pub struct StreamSocketGetTcpKeepAliveIdleResponse {
1247    pub value_secs: u32,
1248}
1249
1250impl fidl::Persistable for StreamSocketGetTcpKeepAliveIdleResponse {}
1251
1252#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1253#[repr(C)]
1254pub struct StreamSocketGetTcpKeepAliveIntervalResponse {
1255    pub value_secs: u32,
1256}
1257
1258impl fidl::Persistable for StreamSocketGetTcpKeepAliveIntervalResponse {}
1259
1260#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1261pub struct StreamSocketGetTcpLingerResponse {
1262    pub value_secs: OptionalUint32,
1263}
1264
1265impl fidl::Persistable for StreamSocketGetTcpLingerResponse {}
1266
1267#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1268#[repr(C)]
1269pub struct StreamSocketGetTcpMaxSegmentResponse {
1270    pub value_bytes: u32,
1271}
1272
1273impl fidl::Persistable for StreamSocketGetTcpMaxSegmentResponse {}
1274
1275#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1276pub struct StreamSocketGetTcpNoDelayResponse {
1277    pub value: bool,
1278}
1279
1280impl fidl::Persistable for StreamSocketGetTcpNoDelayResponse {}
1281
1282#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1283pub struct StreamSocketGetTcpQuickAckResponse {
1284    pub value: bool,
1285}
1286
1287impl fidl::Persistable for StreamSocketGetTcpQuickAckResponse {}
1288
1289#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1290#[repr(C)]
1291pub struct StreamSocketGetTcpSynCountResponse {
1292    pub value: u32,
1293}
1294
1295impl fidl::Persistable for StreamSocketGetTcpSynCountResponse {}
1296
1297#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1298#[repr(C)]
1299pub struct StreamSocketGetTcpUserTimeoutResponse {
1300    pub value_millis: u32,
1301}
1302
1303impl fidl::Persistable for StreamSocketGetTcpUserTimeoutResponse {}
1304
1305#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1306#[repr(C)]
1307pub struct StreamSocketGetTcpWindowClampResponse {
1308    pub value: u32,
1309}
1310
1311impl fidl::Persistable for StreamSocketGetTcpWindowClampResponse {}
1312
1313#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1314pub struct SynchronousDatagramSocketRecvMsgRequest {
1315    pub want_addr: bool,
1316    pub data_len: u32,
1317    pub want_control: bool,
1318    pub flags: RecvMsgFlags,
1319}
1320
1321impl fidl::Persistable for SynchronousDatagramSocketRecvMsgRequest {}
1322
1323#[derive(Clone, Debug, PartialEq)]
1324pub struct SynchronousDatagramSocketSendMsgRequest {
1325    pub addr: Option<Box<fidl_fuchsia_net_common::SocketAddress>>,
1326    pub data: Vec<u8>,
1327    pub control: DatagramSocketSendControlData,
1328    pub flags: SendMsgFlags,
1329}
1330
1331impl fidl::Persistable for SynchronousDatagramSocketSendMsgRequest {}
1332
1333#[derive(Clone, Debug, PartialEq)]
1334pub struct SynchronousDatagramSocketRecvMsgResponse {
1335    pub addr: Option<Box<fidl_fuchsia_net_common::SocketAddress>>,
1336    pub data: Vec<u8>,
1337    pub control: DatagramSocketRecvControlData,
1338    pub truncated: u32,
1339}
1340
1341impl fidl::Persistable for SynchronousDatagramSocketRecvMsgResponse {}
1342
1343#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1344#[repr(C)]
1345pub struct SynchronousDatagramSocketSendMsgResponse {
1346    pub len: i64,
1347}
1348
1349impl fidl::Persistable for SynchronousDatagramSocketSendMsgResponse {}
1350
1351#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1352pub struct Timestamp {
1353    /// Time in nanoseconds since epoch (January 1 1970 GMT).
1354    pub nanoseconds: i64,
1355    /// Identifies whether/how the timestamp should be returned to the user.
1356    /// Ignored in the DatagramSocket protocol.
1357    pub requested: TimestampOption,
1358}
1359
1360impl fidl::Persistable for Timestamp {}
1361
1362#[derive(Clone, Debug, Default, PartialEq)]
1363pub struct DatagramSocketRecvControlData {
1364    /// Network socket ancillary data.
1365    pub network: Option<NetworkSocketRecvControlData>,
1366    #[doc(hidden)]
1367    pub __source_breaking: fidl::marker::SourceBreaking,
1368}
1369
1370impl fidl::Persistable for DatagramSocketRecvControlData {}
1371
1372#[derive(Clone, Debug, Default, PartialEq)]
1373pub struct DatagramSocketSendControlData {
1374    /// Network socket ancillary data.
1375    pub network: Option<NetworkSocketSendControlData>,
1376    #[doc(hidden)]
1377    pub __source_breaking: fidl::marker::SourceBreaking,
1378}
1379
1380impl fidl::Persistable for DatagramSocketSendControlData {}
1381
1382#[derive(Clone, Debug, Default, PartialEq)]
1383pub struct DatagramSocketSendMsgPreflightRequest {
1384    /// The destination address.
1385    ///
1386    /// If absent, interpreted as the method receiver's connected address and
1387    /// causes the connected address to be returned.
1388    ///
1389    /// Required if the method receiver is not connected.
1390    pub to: Option<fidl_fuchsia_net_common::SocketAddress>,
1391    /// Information controlling the local interface and/or address used when
1392    /// sending an IPv6 packet.
1393    ///
1394    /// If absent, indicates that the stack is free to choose an appropriate
1395    /// outgoing route.
1396    pub ipv6_pktinfo: Option<Ipv6PktInfoSendControlData>,
1397    #[doc(hidden)]
1398    pub __source_breaking: fidl::marker::SourceBreaking,
1399}
1400
1401impl fidl::Persistable for DatagramSocketSendMsgPreflightRequest {}
1402
1403/// Holds information about an interface and its addresses.
1404#[derive(Clone, Debug, Default, PartialEq)]
1405pub struct InterfaceAddresses {
1406    /// ID of the interface.
1407    pub id: Option<u64>,
1408    /// Name of the interface.
1409    pub name: Option<String>,
1410    /// All addresses currently assigned to the interface.
1411    pub addresses: Option<Vec<fidl_fuchsia_net_common::Subnet>>,
1412    /// Contains the interface flags, as returned by the SIOCGIFFLAGS ioctl
1413    /// operation.
1414    pub interface_flags: Option<InterfaceFlags>,
1415    #[doc(hidden)]
1416    pub __source_breaking: fidl::marker::SourceBreaking,
1417}
1418
1419impl fidl::Persistable for InterfaceAddresses {}
1420
1421#[derive(Clone, Debug, Default, PartialEq)]
1422pub struct IpRecvControlData {
1423    /// The Type of Service value found in a received packet's IPv4 header.
1424    ///
1425    /// Present if the `SOL_IP` -> `IP_RECVTOS` option is enabled.
1426    pub tos: Option<u8>,
1427    /// The Time to Live value found in a received packet's IPv4 header.
1428    ///
1429    /// Present if the `SOL_IP` -> `IP_RECVTTL` option is enabled.
1430    pub ttl: Option<u8>,
1431    /// The original destination address.
1432    ///
1433    /// Present if the `SOL_IP` -> `IP_RECVORIGDSTADDR` option is enabled.
1434    pub original_destination_address: Option<fidl_fuchsia_net_common::SocketAddress>,
1435    /// The packet information of a packet that was received.
1436    ///
1437    /// Present if the `SOL_IP` -> `IP_PKTINFO` option is enabled.
1438    pub pktinfo: Option<Ipv4PktInfoRecvControlData>,
1439    #[doc(hidden)]
1440    pub __source_breaking: fidl::marker::SourceBreaking,
1441}
1442
1443impl fidl::Persistable for IpRecvControlData {}
1444
1445#[derive(Clone, Debug, Default, PartialEq)]
1446pub struct IpSendControlData {
1447    /// The Time to Live value to set in the IPv4 header of an outgoing
1448    /// packet.
1449    pub ttl: Option<u8>,
1450    #[doc(hidden)]
1451    pub __source_breaking: fidl::marker::SourceBreaking,
1452}
1453
1454impl fidl::Persistable for IpSendControlData {}
1455
1456#[derive(Clone, Debug, Default, PartialEq)]
1457pub struct Ipv6RecvControlData {
1458    /// The Traffic Class of a packet that was received.
1459    ///
1460    /// Present if the `SOL_IPV6` -> `IPV6_RECVTCLASS` option is enabled.
1461    pub tclass: Option<u8>,
1462    /// The Hop Limit of a packet that was received.
1463    ///
1464    /// Present if the `SOL_IPV6` -> `IPV6_RECVHOPLIMIT` option is enabled.
1465    pub hoplimit: Option<u8>,
1466    /// The packet information of a packet that was received.
1467    ///
1468    /// Present if the `SOL_IPV6` -> `IPV6_RECVPKTINFO` option is enabled.
1469    pub pktinfo: Option<Ipv6PktInfoRecvControlData>,
1470    #[doc(hidden)]
1471    pub __source_breaking: fidl::marker::SourceBreaking,
1472}
1473
1474impl fidl::Persistable for Ipv6RecvControlData {}
1475
1476#[derive(Clone, Debug, Default, PartialEq)]
1477pub struct Ipv6SendControlData {
1478    /// The Hop Limit value to set in the IPv6 header of an outgoing
1479    /// packet.
1480    pub hoplimit: Option<u8>,
1481    /// Information controlling the local interface and/or address used when
1482    /// sending an IPv6 packet.
1483    pub pktinfo: Option<Ipv6PktInfoSendControlData>,
1484    #[doc(hidden)]
1485    pub __source_breaking: fidl::marker::SourceBreaking,
1486}
1487
1488impl fidl::Persistable for Ipv6SendControlData {}
1489
1490/// Network socket (L3) ancillary data that can be received.
1491#[derive(Clone, Debug, Default, PartialEq)]
1492pub struct NetworkSocketRecvControlData {
1493    /// Socket level ancillary data.
1494    pub socket: Option<SocketRecvControlData>,
1495    /// IPv4 level ancillary data.
1496    ///
1497    /// These match POSIX `SOL_IP` control messages.
1498    pub ip: Option<IpRecvControlData>,
1499    /// IPv6 level ancillary data.
1500    ///
1501    /// These match POSIX `SOL_IPV6` control messages.
1502    pub ipv6: Option<Ipv6RecvControlData>,
1503    #[doc(hidden)]
1504    pub __source_breaking: fidl::marker::SourceBreaking,
1505}
1506
1507impl fidl::Persistable for NetworkSocketRecvControlData {}
1508
1509/// Network socket (L3) ancillary data that can be sent.
1510#[derive(Clone, Debug, Default, PartialEq)]
1511pub struct NetworkSocketSendControlData {
1512    /// Socket level ancillary data.
1513    pub socket: Option<SocketSendControlData>,
1514    /// IPv4 level ancillary data.
1515    ///
1516    /// These match POSIX `SOL_IP` control messages.
1517    pub ip: Option<IpSendControlData>,
1518    /// IPv6 level ancillary data.
1519    ///
1520    /// These match POSIX `SOL_IPV6` control messages.
1521    pub ipv6: Option<Ipv6SendControlData>,
1522    #[doc(hidden)]
1523    pub __source_breaking: fidl::marker::SourceBreaking,
1524}
1525
1526impl fidl::Persistable for NetworkSocketSendControlData {}
1527
1528/// Metadata of a received datagram.
1529#[derive(Clone, Debug, Default, PartialEq)]
1530pub struct RecvMsgMeta {
1531    /// The from address of the datagram.
1532    pub from: Option<fidl_fuchsia_net_common::SocketAddress>,
1533    /// Ancillary control message data describing the datagram.
1534    pub control: Option<DatagramSocketRecvControlData>,
1535    /// The length of the payload, in bytes.
1536    pub payload_len: Option<u16>,
1537    #[doc(hidden)]
1538    pub __source_breaking: fidl::marker::SourceBreaking,
1539}
1540
1541impl fidl::Persistable for RecvMsgMeta {}
1542
1543/// Metadata of a sent datagram.
1544#[derive(Clone, Debug, Default, PartialEq)]
1545pub struct SendMsgMeta {
1546    /// The destination address, if specified.
1547    pub to: Option<fidl_fuchsia_net_common::SocketAddress>,
1548    /// Ancillary control message data used for sending the payload.
1549    pub control: Option<DatagramSocketSendControlData>,
1550    #[doc(hidden)]
1551    pub __source_breaking: fidl::marker::SourceBreaking,
1552}
1553
1554impl fidl::Persistable for SendMsgMeta {}
1555
1556/// Socket level ancillary data that can be received.
1557///
1558/// These match control messages with a `SOL_SOCKET` level.
1559#[derive(Clone, Debug, Default, PartialEq)]
1560pub struct SocketRecvControlData {
1561    /// Data about the time at which the packet was received.
1562    pub timestamp: Option<Timestamp>,
1563    #[doc(hidden)]
1564    pub __source_breaking: fidl::marker::SourceBreaking,
1565}
1566
1567impl fidl::Persistable for SocketRecvControlData {}
1568
1569/// Socket level ancillary data that can be sent.
1570///
1571/// These match the POSIX `SOL_SOCKET` control messages.
1572#[derive(Clone, Debug, Default, PartialEq)]
1573pub struct SocketSendControlData {
1574    #[doc(hidden)]
1575    pub __source_breaking: fidl::marker::SourceBreaking,
1576}
1577
1578impl fidl::Persistable for SocketSendControlData {}
1579
1580/// An optional uint32 value.
1581#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1582pub enum OptionalUint32 {
1583    Value(u32),
1584    Unset(Empty),
1585}
1586
1587impl OptionalUint32 {
1588    #[inline]
1589    pub fn ordinal(&self) -> u64 {
1590        match *self {
1591            Self::Value(_) => 1,
1592            Self::Unset(_) => 2,
1593        }
1594    }
1595}
1596
1597impl fidl::Persistable for OptionalUint32 {}
1598
1599/// An optional byte value.
1600#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1601pub enum OptionalUint8 {
1602    Value(u8),
1603    Unset(Empty),
1604}
1605
1606impl OptionalUint8 {
1607    #[inline]
1608    pub fn ordinal(&self) -> u64 {
1609        match *self {
1610            Self::Value(_) => 1,
1611            Self::Unset(_) => 2,
1612        }
1613    }
1614}
1615
1616impl fidl::Persistable for OptionalUint8 {}
1617
1618pub mod base_datagram_socket_ordinals {
1619    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1620    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1621    pub const QUERY: u64 = 0x2658edee9decfc06;
1622    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1623    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1624    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1625    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1626    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1627    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1628    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1629    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1630    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1631    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1632    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1633    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1634    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1635    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1636    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1637    pub const SET_LINGER: u64 = 0x45386351246e998e;
1638    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1639    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1640    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1641    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1642    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1643    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1644    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1645    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1646    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1647    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1648    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1649    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1650    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1651    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1652    pub const BIND: u64 = 0x4bc6400ae92125d;
1653    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1654    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1655    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1656    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1657    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1658    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1659    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1660    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1661    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1662    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1663    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1664    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1665    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1666    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1667    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1668    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1669    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1670    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1671    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1672    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1673    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1674    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1675    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1676    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1677    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1678    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1679    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1680    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1681    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1682    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1683    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1684    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1685    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1686    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1687    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1688    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1689    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1690    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1691    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1692    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1693    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1694    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1695    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1696    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1697    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1698    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1699    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1700    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1701    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
1702}
1703
1704pub mod base_network_socket_ordinals {
1705    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1706    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1707    pub const QUERY: u64 = 0x2658edee9decfc06;
1708    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1709    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1710    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1711    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1712    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1713    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1714    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1715    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1716    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1717    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1718    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1719    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1720    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1721    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1722    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1723    pub const SET_LINGER: u64 = 0x45386351246e998e;
1724    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1725    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1726    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1727    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1728    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1729    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1730    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1731    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1732    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1733    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1734    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1735    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1736    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1737    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1738    pub const BIND: u64 = 0x4bc6400ae92125d;
1739    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1740    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1741    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1742    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1743    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1744    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1745    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1746    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1747    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1748    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1749    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1750    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1751    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1752    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1753    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1754    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1755    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1756    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1757    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1758    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1759    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1760    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1761    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1762    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1763    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1764    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1765    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1766    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1767    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1768    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1769    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1770    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1771    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1772    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1773    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1774    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1775    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1776    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1777    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1778    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1779    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1780    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1781    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1782    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1783    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1784    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1785    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1786    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1787}
1788
1789pub mod base_socket_ordinals {
1790    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1791    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1792    pub const QUERY: u64 = 0x2658edee9decfc06;
1793    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1794    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1795    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1796    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1797    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1798    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1799    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1800    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1801    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1802    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1803    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1804    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1805    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1806    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1807    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1808    pub const SET_LINGER: u64 = 0x45386351246e998e;
1809    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1810    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1811    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1812    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1813    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1814    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1815    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1816    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1817    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1818    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1819    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1820    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1821    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1822    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1823}
1824
1825pub mod datagram_socket_ordinals {
1826    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1827    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1828    pub const QUERY: u64 = 0x2658edee9decfc06;
1829    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1830    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1831    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1832    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1833    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1834    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1835    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1836    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1837    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1838    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1839    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1840    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1841    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1842    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1843    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1844    pub const SET_LINGER: u64 = 0x45386351246e998e;
1845    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1846    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1847    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1848    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1849    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1850    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1851    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1852    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1853    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1854    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1855    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1856    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1857    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1858    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1859    pub const BIND: u64 = 0x4bc6400ae92125d;
1860    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1861    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1862    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1863    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1864    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1865    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1866    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1867    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1868    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1869    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1870    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1871    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1872    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1873    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1874    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1875    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1876    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1877    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1878    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1879    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1880    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1881    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1882    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1883    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1884    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1885    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1886    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1887    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1888    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1889    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1890    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1891    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1892    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1893    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1894    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1895    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1896    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1897    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1898    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
1899    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
1900    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
1901    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
1902    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
1903    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
1904    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
1905    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
1906    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
1907    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
1908    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
1909    pub const DESCRIBE: u64 = 0xbf1e2f0a86601f3;
1910    pub const SEND_MSG_PREFLIGHT: u64 = 0x5362e668e777248a;
1911    pub const RECV_MSG_POSTFLIGHT: u64 = 0x1a7cdeca5f3eb8e2;
1912}
1913
1914pub mod provider_ordinals {
1915    pub const STREAM_SOCKET_WITH_OPTIONS: u64 = 0x3969bf7eb78386e0;
1916    pub const STREAM_SOCKET: u64 = 0x27c3581da2155545;
1917    pub const DATAGRAM_SOCKET_DEPRECATED: u64 = 0x38876c87cf031cb1;
1918    pub const DATAGRAM_SOCKET: u64 = 0x4021b4fa1b6452f2;
1919    pub const DATAGRAM_SOCKET_WITH_OPTIONS: u64 = 0x4cd0cffbffa39eb1;
1920    pub const INTERFACE_INDEX_TO_NAME: u64 = 0x4d59a64fce98272f;
1921    pub const INTERFACE_NAME_TO_INDEX: u64 = 0x690cd8d2f2d650f8;
1922    pub const INTERFACE_NAME_TO_FLAGS: u64 = 0x25d0efcdb6671a0b;
1923    pub const GET_INTERFACE_ADDRESSES: u64 = 0x2e7b9aaf327c870;
1924}
1925
1926pub mod stream_socket_ordinals {
1927    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1928    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1929    pub const QUERY: u64 = 0x2658edee9decfc06;
1930    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
1931    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
1932    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
1933    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
1934    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
1935    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
1936    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
1937    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
1938    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
1939    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
1940    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
1941    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
1942    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
1943    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
1944    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
1945    pub const SET_LINGER: u64 = 0x45386351246e998e;
1946    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
1947    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
1948    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
1949    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
1950    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
1951    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
1952    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
1953    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
1954    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
1955    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
1956    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
1957    pub const SET_MARK: u64 = 0x6ead6de09f653236;
1958    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
1959    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
1960    pub const BIND: u64 = 0x4bc6400ae92125d;
1961    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
1962    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
1963    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
1964    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
1965    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
1966    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
1967    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
1968    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
1969    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
1970    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
1971    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
1972    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
1973    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
1974    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
1975    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
1976    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
1977    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
1978    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
1979    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
1980    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
1981    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
1982    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
1983    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
1984    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
1985    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
1986    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
1987    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
1988    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
1989    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
1990    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
1991    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
1992    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
1993    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
1994    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
1995    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
1996    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
1997    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
1998    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
1999    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
2000    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
2001    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
2002    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
2003    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
2004    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
2005    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
2006    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
2007    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
2008    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
2009    pub const DESCRIBE: u64 = 0x29e22969a7dadc32;
2010    pub const LISTEN: u64 = 0x3d0a65ced3d10108;
2011    pub const ACCEPT: u64 = 0x5ab7ad620424c163;
2012    pub const GET_INFO: u64 = 0x87cfa55d19f878f;
2013    pub const SET_TCP_NO_DELAY: u64 = 0x5a59b778f7333ada;
2014    pub const GET_TCP_NO_DELAY: u64 = 0xac219a3218b0799;
2015    pub const SET_TCP_MAX_SEGMENT: u64 = 0xb3d30c498266d18;
2016    pub const GET_TCP_MAX_SEGMENT: u64 = 0x637404d1b4b9982c;
2017    pub const SET_TCP_CORK: u64 = 0x62e26891541143a0;
2018    pub const GET_TCP_CORK: u64 = 0x435bb232e0e74f32;
2019    pub const SET_TCP_KEEP_ALIVE_IDLE: u64 = 0x196d053d8363c42;
2020    pub const GET_TCP_KEEP_ALIVE_IDLE: u64 = 0x35ec58564879dac;
2021    pub const SET_TCP_KEEP_ALIVE_INTERVAL: u64 = 0x485ffbc2da1243f2;
2022    pub const GET_TCP_KEEP_ALIVE_INTERVAL: u64 = 0x264eaf46306b284;
2023    pub const SET_TCP_KEEP_ALIVE_COUNT: u64 = 0x2ab2e8c111708421;
2024    pub const GET_TCP_KEEP_ALIVE_COUNT: u64 = 0x2f176ae271fe7a09;
2025    pub const SET_TCP_SYN_COUNT: u64 = 0x4dcd6ab5573c1eb3;
2026    pub const GET_TCP_SYN_COUNT: u64 = 0x7d457cba8f5f3ee6;
2027    pub const SET_TCP_LINGER: u64 = 0xd5cc1e8654d36e4;
2028    pub const GET_TCP_LINGER: u64 = 0xad870d311cf30eb;
2029    pub const SET_TCP_DEFER_ACCEPT: u64 = 0x15092f181e57c404;
2030    pub const GET_TCP_DEFER_ACCEPT: u64 = 0x64589790842cb7c6;
2031    pub const SET_TCP_WINDOW_CLAMP: u64 = 0x4a26ce07d847f1c6;
2032    pub const GET_TCP_WINDOW_CLAMP: u64 = 0x2df6b636bf0a6a4e;
2033    pub const GET_TCP_INFO: u64 = 0x1ffb123d9f03ead2;
2034    pub const SET_TCP_QUICK_ACK: u64 = 0x6fa811be8fde7457;
2035    pub const GET_TCP_QUICK_ACK: u64 = 0x7356a949bef2df32;
2036    pub const SET_TCP_CONGESTION: u64 = 0x7924c6eabde7819e;
2037    pub const GET_TCP_CONGESTION: u64 = 0x11e16397e1b72a47;
2038    pub const SET_TCP_USER_TIMEOUT: u64 = 0x6b459e81c3741a60;
2039    pub const GET_TCP_USER_TIMEOUT: u64 = 0x24bbd5858ad8c380;
2040}
2041
2042pub mod synchronous_datagram_socket_ordinals {
2043    pub const CLONE: u64 = 0x20d8a7aba2168a79;
2044    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
2045    pub const QUERY: u64 = 0x2658edee9decfc06;
2046    pub const SET_REUSE_ADDRESS: u64 = 0x1fd74ee8b9a4a876;
2047    pub const GET_REUSE_ADDRESS: u64 = 0x67b7206b8d1bc0a5;
2048    pub const GET_ERROR: u64 = 0x5aad39b33e5f6ebb;
2049    pub const SET_BROADCAST: u64 = 0x6023e081ce3cd947;
2050    pub const GET_BROADCAST: u64 = 0x68796fc556f9780d;
2051    pub const SET_SEND_BUFFER: u64 = 0x756eac32d73a7a70;
2052    pub const GET_SEND_BUFFER: u64 = 0x78a52fd9c7b2410b;
2053    pub const SET_RECEIVE_BUFFER: u64 = 0x6b0cf2f1919c7001;
2054    pub const GET_RECEIVE_BUFFER: u64 = 0x14c1a4b64f709e5c;
2055    pub const SET_KEEP_ALIVE: u64 = 0x572df8f0b920d2c7;
2056    pub const GET_KEEP_ALIVE: u64 = 0x2dd29d3215f2c9d2;
2057    pub const SET_OUT_OF_BAND_INLINE: u64 = 0x3ecb49968bee439;
2058    pub const GET_OUT_OF_BAND_INLINE: u64 = 0x348c1ab3aeca1745;
2059    pub const SET_NO_CHECK: u64 = 0x6bbf00c53a4c78c2;
2060    pub const GET_NO_CHECK: u64 = 0x2cd4249286417694;
2061    pub const SET_LINGER: u64 = 0x45386351246e998e;
2062    pub const GET_LINGER: u64 = 0x48eb20fc5ccb0e45;
2063    pub const SET_REUSE_PORT: u64 = 0x547dc9cc0455189e;
2064    pub const SET_REUSE_PORT_DEPRECATED: u64 = 0x24dd3e5cb36d9ccb;
2065    pub const GET_REUSE_PORT: u64 = 0x7a112c1ab54ff828;
2066    pub const GET_ACCEPT_CONN: u64 = 0x67ce6db6c2ec8966;
2067    pub const SET_BIND_TO_DEVICE: u64 = 0x2118b483f28aafc4;
2068    pub const GET_BIND_TO_DEVICE: u64 = 0x1ab1fbf0ef7906c8;
2069    pub const SET_BIND_TO_INTERFACE_INDEX: u64 = 0x6e387a0def00821;
2070    pub const GET_BIND_TO_INTERFACE_INDEX: u64 = 0x59c31dd3e3078295;
2071    pub const SET_TIMESTAMP: u64 = 0x285d6516c263d839;
2072    pub const GET_TIMESTAMP: u64 = 0x49f2fffbbcc2bd27;
2073    pub const SET_MARK: u64 = 0x6ead6de09f653236;
2074    pub const GET_MARK: u64 = 0x57a2752c61d93d47;
2075    pub const GET_COOKIE: u64 = 0x2c2f47fd8f924e52;
2076    pub const BIND: u64 = 0x4bc6400ae92125d;
2077    pub const CONNECT: u64 = 0x5f05f19bfdd38871;
2078    pub const DISCONNECT: u64 = 0x74e63b91f7b29b2;
2079    pub const GET_SOCK_NAME: u64 = 0x475f23f84a1a4f85;
2080    pub const GET_PEER_NAME: u64 = 0x1ffecf4bd5b6432e;
2081    pub const SHUTDOWN: u64 = 0x247f38b6db68c336;
2082    pub const SET_IP_TYPE_OF_SERVICE: u64 = 0x995c600475b6d46;
2083    pub const GET_IP_TYPE_OF_SERVICE: u64 = 0x3814a04259f75fcb;
2084    pub const SET_IP_TTL: u64 = 0x29e2424b433ae1ef;
2085    pub const GET_IP_TTL: u64 = 0x47e47fa1f24da471;
2086    pub const SET_IP_PACKET_INFO: u64 = 0x392d16bee20c0e16;
2087    pub const GET_IP_PACKET_INFO: u64 = 0x54b505f242280740;
2088    pub const SET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x6c4f6714995f84ef;
2089    pub const GET_IP_RECEIVE_TYPE_OF_SERVICE: u64 = 0x4158ba7dc2795960;
2090    pub const SET_IP_RECEIVE_TTL: u64 = 0x46f15be0ce0ab82b;
2091    pub const GET_IP_RECEIVE_TTL: u64 = 0x678ddd5a5dfa2eb5;
2092    pub const SET_IP_MULTICAST_INTERFACE: u64 = 0x752fbfa9b12befe;
2093    pub const GET_IP_MULTICAST_INTERFACE: u64 = 0x320bd14c4df046c4;
2094    pub const SET_IP_MULTICAST_TTL: u64 = 0x63134d53772916a1;
2095    pub const GET_IP_MULTICAST_TTL: u64 = 0x4665cd378f39e1a;
2096    pub const SET_IP_MULTICAST_LOOPBACK: u64 = 0x20c55c11f00943ea;
2097    pub const GET_IP_MULTICAST_LOOPBACK: u64 = 0x3b6b26ff558298f2;
2098    pub const ADD_IP_MEMBERSHIP: u64 = 0x76bc7df115a3b4d0;
2099    pub const DROP_IP_MEMBERSHIP: u64 = 0x2888f3099188d03;
2100    pub const SET_IP_TRANSPARENT: u64 = 0x1ae532b0c066e3a0;
2101    pub const GET_IP_TRANSPARENT: u64 = 0x51d43695962ebfb5;
2102    pub const SET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x4722b4ce52f7840;
2103    pub const GET_IP_RECEIVE_ORIGINAL_DESTINATION_ADDRESS: u64 = 0x2a0e7dc5d6bfdfe9;
2104    pub const ADD_IPV6_MEMBERSHIP: u64 = 0x7c94727acb4ea4b3;
2105    pub const DROP_IPV6_MEMBERSHIP: u64 = 0x42104c70ccaba304;
2106    pub const SET_IPV6_MULTICAST_INTERFACE: u64 = 0x135f76db3774ab3b;
2107    pub const GET_IPV6_MULTICAST_INTERFACE: u64 = 0x1f26fcdd348f1882;
2108    pub const SET_IPV6_UNICAST_HOPS: u64 = 0x157d51e98f462859;
2109    pub const GET_IPV6_UNICAST_HOPS: u64 = 0x21f4641cad8bd8d2;
2110    pub const SET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x5c24808ed2e84a1e;
2111    pub const GET_IPV6_RECEIVE_HOP_LIMIT: u64 = 0x341e06689885b4c0;
2112    pub const SET_IPV6_MULTICAST_HOPS: u64 = 0x25b9cd4d181f82c1;
2113    pub const GET_IPV6_MULTICAST_HOPS: u64 = 0x52916948a365012a;
2114    pub const SET_IPV6_MULTICAST_LOOPBACK: u64 = 0x55701c409ff41b40;
2115    pub const GET_IPV6_MULTICAST_LOOPBACK: u64 = 0x4415b701fde319c3;
2116    pub const SET_IPV6_ONLY: u64 = 0x4873f1364758cbba;
2117    pub const GET_IPV6_ONLY: u64 = 0x4aa3340a1a26b89c;
2118    pub const SET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x58f07c8788d099a0;
2119    pub const GET_IPV6_RECEIVE_TRAFFIC_CLASS: u64 = 0x2e334df1da553ffa;
2120    pub const SET_IPV6_TRAFFIC_CLASS: u64 = 0x6af077800c5a0b4f;
2121    pub const GET_IPV6_TRAFFIC_CLASS: u64 = 0x6baf6eed8fc2f04;
2122    pub const SET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x19259775b1a92768;
2123    pub const GET_IPV6_RECEIVE_PACKET_INFO: u64 = 0x7acd4a2775baec75;
2124    pub const GET_ORIGINAL_DESTINATION: u64 = 0x38bf28f0dafdbac0;
2125    pub const GET_INFO: u64 = 0x48aa0a1f6a32d2ed;
2126    pub const DESCRIBE: u64 = 0x585f20b73631070d;
2127    pub const RECV_MSG: u64 = 0x28e494e48fb5dbf3;
2128    pub const SEND_MSG: u64 = 0x12dc2fceab6cefaa;
2129}
2130
2131mod internal {
2132    use super::*;
2133    unsafe impl fidl::encoding::TypeMarker for CmsgRequests {
2134        type Owned = Self;
2135
2136        #[inline(always)]
2137        fn inline_align(_context: fidl::encoding::Context) -> usize {
2138            4
2139        }
2140
2141        #[inline(always)]
2142        fn inline_size(_context: fidl::encoding::Context) -> usize {
2143            4
2144        }
2145    }
2146
2147    impl fidl::encoding::ValueTypeMarker for CmsgRequests {
2148        type Borrowed<'a> = Self;
2149        #[inline(always)]
2150        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2151            *value
2152        }
2153    }
2154
2155    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CmsgRequests {
2156        #[inline]
2157        unsafe fn encode(
2158            self,
2159            encoder: &mut fidl::encoding::Encoder<'_, D>,
2160            offset: usize,
2161            _depth: fidl::encoding::Depth,
2162        ) -> fidl::Result<()> {
2163            encoder.debug_check_bounds::<Self>(offset);
2164            encoder.write_num(self.bits(), offset);
2165            Ok(())
2166        }
2167    }
2168
2169    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CmsgRequests {
2170        #[inline(always)]
2171        fn new_empty() -> Self {
2172            Self::empty()
2173        }
2174
2175        #[inline]
2176        unsafe fn decode(
2177            &mut self,
2178            decoder: &mut fidl::encoding::Decoder<'_, D>,
2179            offset: usize,
2180            _depth: fidl::encoding::Depth,
2181        ) -> fidl::Result<()> {
2182            decoder.debug_check_bounds::<Self>(offset);
2183            let prim = decoder.read_num::<u32>(offset);
2184            *self = Self::from_bits_allow_unknown(prim);
2185            Ok(())
2186        }
2187    }
2188    unsafe impl fidl::encoding::TypeMarker for InterfaceFlags {
2189        type Owned = Self;
2190
2191        #[inline(always)]
2192        fn inline_align(_context: fidl::encoding::Context) -> usize {
2193            2
2194        }
2195
2196        #[inline(always)]
2197        fn inline_size(_context: fidl::encoding::Context) -> usize {
2198            2
2199        }
2200    }
2201
2202    impl fidl::encoding::ValueTypeMarker for InterfaceFlags {
2203        type Borrowed<'a> = Self;
2204        #[inline(always)]
2205        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2206            *value
2207        }
2208    }
2209
2210    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for InterfaceFlags {
2211        #[inline]
2212        unsafe fn encode(
2213            self,
2214            encoder: &mut fidl::encoding::Encoder<'_, D>,
2215            offset: usize,
2216            _depth: fidl::encoding::Depth,
2217        ) -> fidl::Result<()> {
2218            encoder.debug_check_bounds::<Self>(offset);
2219            if self.bits() & Self::all().bits() != self.bits() {
2220                return Err(fidl::Error::InvalidBitsValue);
2221            }
2222            encoder.write_num(self.bits(), offset);
2223            Ok(())
2224        }
2225    }
2226
2227    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceFlags {
2228        #[inline(always)]
2229        fn new_empty() -> Self {
2230            Self::empty()
2231        }
2232
2233        #[inline]
2234        unsafe fn decode(
2235            &mut self,
2236            decoder: &mut fidl::encoding::Decoder<'_, D>,
2237            offset: usize,
2238            _depth: fidl::encoding::Depth,
2239        ) -> fidl::Result<()> {
2240            decoder.debug_check_bounds::<Self>(offset);
2241            let prim = decoder.read_num::<u16>(offset);
2242            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2243            Ok(())
2244        }
2245    }
2246    unsafe impl fidl::encoding::TypeMarker for RecvMsgFlags {
2247        type Owned = Self;
2248
2249        #[inline(always)]
2250        fn inline_align(_context: fidl::encoding::Context) -> usize {
2251            2
2252        }
2253
2254        #[inline(always)]
2255        fn inline_size(_context: fidl::encoding::Context) -> usize {
2256            2
2257        }
2258    }
2259
2260    impl fidl::encoding::ValueTypeMarker for RecvMsgFlags {
2261        type Borrowed<'a> = Self;
2262        #[inline(always)]
2263        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2264            *value
2265        }
2266    }
2267
2268    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RecvMsgFlags {
2269        #[inline]
2270        unsafe fn encode(
2271            self,
2272            encoder: &mut fidl::encoding::Encoder<'_, D>,
2273            offset: usize,
2274            _depth: fidl::encoding::Depth,
2275        ) -> fidl::Result<()> {
2276            encoder.debug_check_bounds::<Self>(offset);
2277            if self.bits() & Self::all().bits() != self.bits() {
2278                return Err(fidl::Error::InvalidBitsValue);
2279            }
2280            encoder.write_num(self.bits(), offset);
2281            Ok(())
2282        }
2283    }
2284
2285    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgFlags {
2286        #[inline(always)]
2287        fn new_empty() -> Self {
2288            Self::empty()
2289        }
2290
2291        #[inline]
2292        unsafe fn decode(
2293            &mut self,
2294            decoder: &mut fidl::encoding::Decoder<'_, D>,
2295            offset: usize,
2296            _depth: fidl::encoding::Depth,
2297        ) -> fidl::Result<()> {
2298            decoder.debug_check_bounds::<Self>(offset);
2299            let prim = decoder.read_num::<u16>(offset);
2300            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2301            Ok(())
2302        }
2303    }
2304    unsafe impl fidl::encoding::TypeMarker for SendMsgFlags {
2305        type Owned = Self;
2306
2307        #[inline(always)]
2308        fn inline_align(_context: fidl::encoding::Context) -> usize {
2309            2
2310        }
2311
2312        #[inline(always)]
2313        fn inline_size(_context: fidl::encoding::Context) -> usize {
2314            2
2315        }
2316    }
2317
2318    impl fidl::encoding::ValueTypeMarker for SendMsgFlags {
2319        type Borrowed<'a> = Self;
2320        #[inline(always)]
2321        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2322            *value
2323        }
2324    }
2325
2326    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SendMsgFlags {
2327        #[inline]
2328        unsafe fn encode(
2329            self,
2330            encoder: &mut fidl::encoding::Encoder<'_, D>,
2331            offset: usize,
2332            _depth: fidl::encoding::Depth,
2333        ) -> fidl::Result<()> {
2334            encoder.debug_check_bounds::<Self>(offset);
2335            if self.bits() & Self::all().bits() != self.bits() {
2336                return Err(fidl::Error::InvalidBitsValue);
2337            }
2338            encoder.write_num(self.bits(), offset);
2339            Ok(())
2340        }
2341    }
2342
2343    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgFlags {
2344        #[inline(always)]
2345        fn new_empty() -> Self {
2346            Self::empty()
2347        }
2348
2349        #[inline]
2350        unsafe fn decode(
2351            &mut self,
2352            decoder: &mut fidl::encoding::Decoder<'_, D>,
2353            offset: usize,
2354            _depth: fidl::encoding::Depth,
2355        ) -> fidl::Result<()> {
2356            decoder.debug_check_bounds::<Self>(offset);
2357            let prim = decoder.read_num::<u16>(offset);
2358            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2359            Ok(())
2360        }
2361    }
2362    unsafe impl fidl::encoding::TypeMarker for ShutdownMode {
2363        type Owned = Self;
2364
2365        #[inline(always)]
2366        fn inline_align(_context: fidl::encoding::Context) -> usize {
2367            2
2368        }
2369
2370        #[inline(always)]
2371        fn inline_size(_context: fidl::encoding::Context) -> usize {
2372            2
2373        }
2374    }
2375
2376    impl fidl::encoding::ValueTypeMarker for ShutdownMode {
2377        type Borrowed<'a> = Self;
2378        #[inline(always)]
2379        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2380            *value
2381        }
2382    }
2383
2384    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShutdownMode {
2385        #[inline]
2386        unsafe fn encode(
2387            self,
2388            encoder: &mut fidl::encoding::Encoder<'_, D>,
2389            offset: usize,
2390            _depth: fidl::encoding::Depth,
2391        ) -> fidl::Result<()> {
2392            encoder.debug_check_bounds::<Self>(offset);
2393            if self.bits() & Self::all().bits() != self.bits() {
2394                return Err(fidl::Error::InvalidBitsValue);
2395            }
2396            encoder.write_num(self.bits(), offset);
2397            Ok(())
2398        }
2399    }
2400
2401    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShutdownMode {
2402        #[inline(always)]
2403        fn new_empty() -> Self {
2404            Self::empty()
2405        }
2406
2407        #[inline]
2408        unsafe fn decode(
2409            &mut self,
2410            decoder: &mut fidl::encoding::Decoder<'_, D>,
2411            offset: usize,
2412            _depth: fidl::encoding::Depth,
2413        ) -> fidl::Result<()> {
2414            decoder.debug_check_bounds::<Self>(offset);
2415            let prim = decoder.read_num::<u16>(offset);
2416            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2417            Ok(())
2418        }
2419    }
2420    unsafe impl fidl::encoding::TypeMarker for DatagramSocketProtocol {
2421        type Owned = Self;
2422
2423        #[inline(always)]
2424        fn inline_align(_context: fidl::encoding::Context) -> usize {
2425            std::mem::align_of::<u32>()
2426        }
2427
2428        #[inline(always)]
2429        fn inline_size(_context: fidl::encoding::Context) -> usize {
2430            std::mem::size_of::<u32>()
2431        }
2432
2433        #[inline(always)]
2434        fn encode_is_copy() -> bool {
2435            true
2436        }
2437
2438        #[inline(always)]
2439        fn decode_is_copy() -> bool {
2440            false
2441        }
2442    }
2443
2444    impl fidl::encoding::ValueTypeMarker for DatagramSocketProtocol {
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>
2453        for DatagramSocketProtocol
2454    {
2455        #[inline]
2456        unsafe fn encode(
2457            self,
2458            encoder: &mut fidl::encoding::Encoder<'_, D>,
2459            offset: usize,
2460            _depth: fidl::encoding::Depth,
2461        ) -> fidl::Result<()> {
2462            encoder.debug_check_bounds::<Self>(offset);
2463            encoder.write_num(self.into_primitive(), offset);
2464            Ok(())
2465        }
2466    }
2467
2468    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2469        for DatagramSocketProtocol
2470    {
2471        #[inline(always)]
2472        fn new_empty() -> Self {
2473            Self::Udp
2474        }
2475
2476        #[inline]
2477        unsafe fn decode(
2478            &mut self,
2479            decoder: &mut fidl::encoding::Decoder<'_, D>,
2480            offset: usize,
2481            _depth: fidl::encoding::Depth,
2482        ) -> fidl::Result<()> {
2483            decoder.debug_check_bounds::<Self>(offset);
2484            let prim = decoder.read_num::<u32>(offset);
2485
2486            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2487            Ok(())
2488        }
2489    }
2490    unsafe impl fidl::encoding::TypeMarker for Domain {
2491        type Owned = Self;
2492
2493        #[inline(always)]
2494        fn inline_align(_context: fidl::encoding::Context) -> usize {
2495            std::mem::align_of::<i16>()
2496        }
2497
2498        #[inline(always)]
2499        fn inline_size(_context: fidl::encoding::Context) -> usize {
2500            std::mem::size_of::<i16>()
2501        }
2502
2503        #[inline(always)]
2504        fn encode_is_copy() -> bool {
2505            true
2506        }
2507
2508        #[inline(always)]
2509        fn decode_is_copy() -> bool {
2510            false
2511        }
2512    }
2513
2514    impl fidl::encoding::ValueTypeMarker for Domain {
2515        type Borrowed<'a> = Self;
2516        #[inline(always)]
2517        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2518            *value
2519        }
2520    }
2521
2522    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Domain {
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> for Domain {
2537        #[inline(always)]
2538        fn new_empty() -> Self {
2539            Self::Ipv4
2540        }
2541
2542        #[inline]
2543        unsafe fn decode(
2544            &mut self,
2545            decoder: &mut fidl::encoding::Decoder<'_, D>,
2546            offset: usize,
2547            _depth: fidl::encoding::Depth,
2548        ) -> fidl::Result<()> {
2549            decoder.debug_check_bounds::<Self>(offset);
2550            let prim = decoder.read_num::<i16>(offset);
2551
2552            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2553            Ok(())
2554        }
2555    }
2556    unsafe impl fidl::encoding::TypeMarker for StreamSocketProtocol {
2557        type Owned = Self;
2558
2559        #[inline(always)]
2560        fn inline_align(_context: fidl::encoding::Context) -> usize {
2561            std::mem::align_of::<u32>()
2562        }
2563
2564        #[inline(always)]
2565        fn inline_size(_context: fidl::encoding::Context) -> usize {
2566            std::mem::size_of::<u32>()
2567        }
2568
2569        #[inline(always)]
2570        fn encode_is_copy() -> bool {
2571            true
2572        }
2573
2574        #[inline(always)]
2575        fn decode_is_copy() -> bool {
2576            false
2577        }
2578    }
2579
2580    impl fidl::encoding::ValueTypeMarker for StreamSocketProtocol {
2581        type Borrowed<'a> = Self;
2582        #[inline(always)]
2583        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2584            *value
2585        }
2586    }
2587
2588    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2589        for StreamSocketProtocol
2590    {
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 StreamSocketProtocol {
2605        #[inline(always)]
2606        fn new_empty() -> Self {
2607            Self::Tcp
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::<u32>(offset);
2619
2620            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2621            Ok(())
2622        }
2623    }
2624    unsafe impl fidl::encoding::TypeMarker for TcpCongestionControl {
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 TcpCongestionControl {
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 TcpCongestionControl
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 TcpCongestionControl {
2673        #[inline(always)]
2674        fn new_empty() -> Self {
2675            Self::Reno
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 TimestampOption {
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 TimestampOption {
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 TimestampOption
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 TimestampOption {
2741        #[inline(always)]
2742        fn new_empty() -> Self {
2743            Self::Disabled
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 UdpMetadataEncodingProtocolVersion {
2761        type Owned = Self;
2762
2763        #[inline(always)]
2764        fn inline_align(_context: fidl::encoding::Context) -> usize {
2765            std::mem::align_of::<u16>()
2766        }
2767
2768        #[inline(always)]
2769        fn inline_size(_context: fidl::encoding::Context) -> usize {
2770            std::mem::size_of::<u16>()
2771        }
2772
2773        #[inline(always)]
2774        fn encode_is_copy() -> bool {
2775            false
2776        }
2777
2778        #[inline(always)]
2779        fn decode_is_copy() -> bool {
2780            false
2781        }
2782    }
2783
2784    impl fidl::encoding::ValueTypeMarker for UdpMetadataEncodingProtocolVersion {
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 UdpMetadataEncodingProtocolVersion
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 UdpMetadataEncodingProtocolVersion
2810    {
2811        #[inline(always)]
2812        fn new_empty() -> Self {
2813            Self::unknown()
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::<u16>(offset);
2825
2826            *self = Self::from_primitive_allow_unknown(prim);
2827            Ok(())
2828        }
2829    }
2830
2831    impl fidl::encoding::ValueTypeMarker for BaseDatagramSocketGetInfoResponse {
2832        type Borrowed<'a> = &'a Self;
2833        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2834            value
2835        }
2836    }
2837
2838    unsafe impl fidl::encoding::TypeMarker for BaseDatagramSocketGetInfoResponse {
2839        type Owned = Self;
2840
2841        #[inline(always)]
2842        fn inline_align(_context: fidl::encoding::Context) -> usize {
2843            4
2844        }
2845
2846        #[inline(always)]
2847        fn inline_size(_context: fidl::encoding::Context) -> usize {
2848            8
2849        }
2850    }
2851
2852    unsafe impl<D: fidl::encoding::ResourceDialect>
2853        fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D>
2854        for &BaseDatagramSocketGetInfoResponse
2855    {
2856        #[inline]
2857        unsafe fn encode(
2858            self,
2859            encoder: &mut fidl::encoding::Encoder<'_, D>,
2860            offset: usize,
2861            _depth: fidl::encoding::Depth,
2862        ) -> fidl::Result<()> {
2863            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2864            // Delegate to tuple encoding.
2865            fidl::encoding::Encode::<BaseDatagramSocketGetInfoResponse, D>::encode(
2866                (
2867                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
2868                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
2869                        &self.proto,
2870                    ),
2871                ),
2872                encoder,
2873                offset,
2874                _depth,
2875            )
2876        }
2877    }
2878    unsafe impl<
2879        D: fidl::encoding::ResourceDialect,
2880        T0: fidl::encoding::Encode<Domain, D>,
2881        T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
2882    > fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D> for (T0, T1)
2883    {
2884        #[inline]
2885        unsafe fn encode(
2886            self,
2887            encoder: &mut fidl::encoding::Encoder<'_, D>,
2888            offset: usize,
2889            depth: fidl::encoding::Depth,
2890        ) -> fidl::Result<()> {
2891            encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2892            // Zero out padding regions. There's no need to apply masks
2893            // because the unmasked parts will be overwritten by fields.
2894            unsafe {
2895                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2896                (ptr as *mut u32).write_unaligned(0);
2897            }
2898            // Write the fields.
2899            self.0.encode(encoder, offset + 0, depth)?;
2900            self.1.encode(encoder, offset + 4, depth)?;
2901            Ok(())
2902        }
2903    }
2904
2905    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2906        for BaseDatagramSocketGetInfoResponse
2907    {
2908        #[inline(always)]
2909        fn new_empty() -> Self {
2910            Self {
2911                domain: fidl::new_empty!(Domain, D),
2912                proto: fidl::new_empty!(DatagramSocketProtocol, D),
2913            }
2914        }
2915
2916        #[inline]
2917        unsafe fn decode(
2918            &mut self,
2919            decoder: &mut fidl::encoding::Decoder<'_, D>,
2920            offset: usize,
2921            _depth: fidl::encoding::Depth,
2922        ) -> fidl::Result<()> {
2923            decoder.debug_check_bounds::<Self>(offset);
2924            // Verify that padding bytes are zero.
2925            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2926            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2927            let mask = 0xffff0000u32;
2928            let maskedval = padval & mask;
2929            if maskedval != 0 {
2930                return Err(fidl::Error::NonZeroPadding {
2931                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2932                });
2933            }
2934            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
2935            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
2936            Ok(())
2937        }
2938    }
2939
2940    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2941        type Borrowed<'a> = &'a Self;
2942        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2943            value
2944        }
2945    }
2946
2947    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2948        type Owned = Self;
2949
2950        #[inline(always)]
2951        fn inline_align(_context: fidl::encoding::Context) -> usize {
2952            8
2953        }
2954
2955        #[inline(always)]
2956        fn inline_size(_context: fidl::encoding::Context) -> usize {
2957            16
2958        }
2959    }
2960
2961    unsafe impl<D: fidl::encoding::ResourceDialect>
2962        fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D>
2963        for &BaseNetworkSocketAddIpMembershipRequest
2964    {
2965        #[inline]
2966        unsafe fn encode(
2967            self,
2968            encoder: &mut fidl::encoding::Encoder<'_, D>,
2969            offset: usize,
2970            _depth: fidl::encoding::Depth,
2971        ) -> fidl::Result<()> {
2972            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2973            // Delegate to tuple encoding.
2974            fidl::encoding::Encode::<BaseNetworkSocketAddIpMembershipRequest, D>::encode(
2975                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
2976                    &self.membership,
2977                ),),
2978                encoder,
2979                offset,
2980                _depth,
2981            )
2982        }
2983    }
2984    unsafe impl<
2985        D: fidl::encoding::ResourceDialect,
2986        T0: fidl::encoding::Encode<IpMulticastMembership, D>,
2987    > fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D> for (T0,)
2988    {
2989        #[inline]
2990        unsafe fn encode(
2991            self,
2992            encoder: &mut fidl::encoding::Encoder<'_, D>,
2993            offset: usize,
2994            depth: fidl::encoding::Depth,
2995        ) -> fidl::Result<()> {
2996            encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2997            // Zero out padding regions. There's no need to apply masks
2998            // because the unmasked parts will be overwritten by fields.
2999            // Write the fields.
3000            self.0.encode(encoder, offset + 0, depth)?;
3001            Ok(())
3002        }
3003    }
3004
3005    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3006        for BaseNetworkSocketAddIpMembershipRequest
3007    {
3008        #[inline(always)]
3009        fn new_empty() -> Self {
3010            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3011        }
3012
3013        #[inline]
3014        unsafe fn decode(
3015            &mut self,
3016            decoder: &mut fidl::encoding::Decoder<'_, D>,
3017            offset: usize,
3018            _depth: fidl::encoding::Depth,
3019        ) -> fidl::Result<()> {
3020            decoder.debug_check_bounds::<Self>(offset);
3021            // Verify that padding bytes are zero.
3022            fidl::decode!(
3023                IpMulticastMembership,
3024                D,
3025                &mut self.membership,
3026                decoder,
3027                offset + 0,
3028                _depth
3029            )?;
3030            Ok(())
3031        }
3032    }
3033
3034    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
3035        type Borrowed<'a> = &'a Self;
3036        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3037            value
3038        }
3039    }
3040
3041    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
3042        type Owned = Self;
3043
3044        #[inline(always)]
3045        fn inline_align(_context: fidl::encoding::Context) -> usize {
3046            8
3047        }
3048
3049        #[inline(always)]
3050        fn inline_size(_context: fidl::encoding::Context) -> usize {
3051            24
3052        }
3053    }
3054
3055    unsafe impl<D: fidl::encoding::ResourceDialect>
3056        fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D>
3057        for &BaseNetworkSocketAddIpv6MembershipRequest
3058    {
3059        #[inline]
3060        unsafe fn encode(
3061            self,
3062            encoder: &mut fidl::encoding::Encoder<'_, D>,
3063            offset: usize,
3064            _depth: fidl::encoding::Depth,
3065        ) -> fidl::Result<()> {
3066            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
3067            // Delegate to tuple encoding.
3068            fidl::encoding::Encode::<BaseNetworkSocketAddIpv6MembershipRequest, D>::encode(
3069                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3070                    &self.membership,
3071                ),),
3072                encoder,
3073                offset,
3074                _depth,
3075            )
3076        }
3077    }
3078    unsafe impl<
3079        D: fidl::encoding::ResourceDialect,
3080        T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3081    > fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D> for (T0,)
3082    {
3083        #[inline]
3084        unsafe fn encode(
3085            self,
3086            encoder: &mut fidl::encoding::Encoder<'_, D>,
3087            offset: usize,
3088            depth: fidl::encoding::Depth,
3089        ) -> fidl::Result<()> {
3090            encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
3091            // Zero out padding regions. There's no need to apply masks
3092            // because the unmasked parts will be overwritten by fields.
3093            // Write the fields.
3094            self.0.encode(encoder, offset + 0, depth)?;
3095            Ok(())
3096        }
3097    }
3098
3099    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3100        for BaseNetworkSocketAddIpv6MembershipRequest
3101    {
3102        #[inline(always)]
3103        fn new_empty() -> Self {
3104            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3105        }
3106
3107        #[inline]
3108        unsafe fn decode(
3109            &mut self,
3110            decoder: &mut fidl::encoding::Decoder<'_, D>,
3111            offset: usize,
3112            _depth: fidl::encoding::Depth,
3113        ) -> fidl::Result<()> {
3114            decoder.debug_check_bounds::<Self>(offset);
3115            // Verify that padding bytes are zero.
3116            fidl::decode!(
3117                Ipv6MulticastMembership,
3118                D,
3119                &mut self.membership,
3120                decoder,
3121                offset + 0,
3122                _depth
3123            )?;
3124            Ok(())
3125        }
3126    }
3127
3128    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketBindRequest {
3129        type Borrowed<'a> = &'a Self;
3130        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3131            value
3132        }
3133    }
3134
3135    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketBindRequest {
3136        type Owned = Self;
3137
3138        #[inline(always)]
3139        fn inline_align(_context: fidl::encoding::Context) -> usize {
3140            8
3141        }
3142
3143        #[inline(always)]
3144        fn inline_size(_context: fidl::encoding::Context) -> usize {
3145            16
3146        }
3147    }
3148
3149    unsafe impl<D: fidl::encoding::ResourceDialect>
3150        fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for &BaseNetworkSocketBindRequest
3151    {
3152        #[inline]
3153        unsafe fn encode(
3154            self,
3155            encoder: &mut fidl::encoding::Encoder<'_, D>,
3156            offset: usize,
3157            _depth: fidl::encoding::Depth,
3158        ) -> fidl::Result<()> {
3159            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
3160            // Delegate to tuple encoding.
3161            fidl::encoding::Encode::<BaseNetworkSocketBindRequest, D>::encode(
3162                (
3163                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
3164                ),
3165                encoder, offset, _depth
3166            )
3167        }
3168    }
3169    unsafe impl<
3170        D: fidl::encoding::ResourceDialect,
3171        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
3172    > fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for (T0,)
3173    {
3174        #[inline]
3175        unsafe fn encode(
3176            self,
3177            encoder: &mut fidl::encoding::Encoder<'_, D>,
3178            offset: usize,
3179            depth: fidl::encoding::Depth,
3180        ) -> fidl::Result<()> {
3181            encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
3182            // Zero out padding regions. There's no need to apply masks
3183            // because the unmasked parts will be overwritten by fields.
3184            // Write the fields.
3185            self.0.encode(encoder, offset + 0, depth)?;
3186            Ok(())
3187        }
3188    }
3189
3190    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3191        for BaseNetworkSocketBindRequest
3192    {
3193        #[inline(always)]
3194        fn new_empty() -> Self {
3195            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
3196        }
3197
3198        #[inline]
3199        unsafe fn decode(
3200            &mut self,
3201            decoder: &mut fidl::encoding::Decoder<'_, D>,
3202            offset: usize,
3203            _depth: fidl::encoding::Depth,
3204        ) -> fidl::Result<()> {
3205            decoder.debug_check_bounds::<Self>(offset);
3206            // Verify that padding bytes are zero.
3207            fidl::decode!(
3208                fidl_fuchsia_net_common::SocketAddress,
3209                D,
3210                &mut self.addr,
3211                decoder,
3212                offset + 0,
3213                _depth
3214            )?;
3215            Ok(())
3216        }
3217    }
3218
3219    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketConnectRequest {
3220        type Borrowed<'a> = &'a Self;
3221        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3222            value
3223        }
3224    }
3225
3226    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketConnectRequest {
3227        type Owned = Self;
3228
3229        #[inline(always)]
3230        fn inline_align(_context: fidl::encoding::Context) -> usize {
3231            8
3232        }
3233
3234        #[inline(always)]
3235        fn inline_size(_context: fidl::encoding::Context) -> usize {
3236            16
3237        }
3238    }
3239
3240    unsafe impl<D: fidl::encoding::ResourceDialect>
3241        fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D>
3242        for &BaseNetworkSocketConnectRequest
3243    {
3244        #[inline]
3245        unsafe fn encode(
3246            self,
3247            encoder: &mut fidl::encoding::Encoder<'_, D>,
3248            offset: usize,
3249            _depth: fidl::encoding::Depth,
3250        ) -> fidl::Result<()> {
3251            encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3252            // Delegate to tuple encoding.
3253            fidl::encoding::Encode::<BaseNetworkSocketConnectRequest, D>::encode(
3254                (
3255                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
3256                ),
3257                encoder, offset, _depth
3258            )
3259        }
3260    }
3261    unsafe impl<
3262        D: fidl::encoding::ResourceDialect,
3263        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
3264    > fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D> for (T0,)
3265    {
3266        #[inline]
3267        unsafe fn encode(
3268            self,
3269            encoder: &mut fidl::encoding::Encoder<'_, D>,
3270            offset: usize,
3271            depth: fidl::encoding::Depth,
3272        ) -> fidl::Result<()> {
3273            encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3274            // Zero out padding regions. There's no need to apply masks
3275            // because the unmasked parts will be overwritten by fields.
3276            // Write the fields.
3277            self.0.encode(encoder, offset + 0, depth)?;
3278            Ok(())
3279        }
3280    }
3281
3282    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3283        for BaseNetworkSocketConnectRequest
3284    {
3285        #[inline(always)]
3286        fn new_empty() -> Self {
3287            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
3288        }
3289
3290        #[inline]
3291        unsafe fn decode(
3292            &mut self,
3293            decoder: &mut fidl::encoding::Decoder<'_, D>,
3294            offset: usize,
3295            _depth: fidl::encoding::Depth,
3296        ) -> fidl::Result<()> {
3297            decoder.debug_check_bounds::<Self>(offset);
3298            // Verify that padding bytes are zero.
3299            fidl::decode!(
3300                fidl_fuchsia_net_common::SocketAddress,
3301                D,
3302                &mut self.addr,
3303                decoder,
3304                offset + 0,
3305                _depth
3306            )?;
3307            Ok(())
3308        }
3309    }
3310
3311    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3312        type Borrowed<'a> = &'a Self;
3313        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3314            value
3315        }
3316    }
3317
3318    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3319        type Owned = Self;
3320
3321        #[inline(always)]
3322        fn inline_align(_context: fidl::encoding::Context) -> usize {
3323            8
3324        }
3325
3326        #[inline(always)]
3327        fn inline_size(_context: fidl::encoding::Context) -> usize {
3328            16
3329        }
3330    }
3331
3332    unsafe impl<D: fidl::encoding::ResourceDialect>
3333        fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D>
3334        for &BaseNetworkSocketDropIpMembershipRequest
3335    {
3336        #[inline]
3337        unsafe fn encode(
3338            self,
3339            encoder: &mut fidl::encoding::Encoder<'_, D>,
3340            offset: usize,
3341            _depth: fidl::encoding::Depth,
3342        ) -> fidl::Result<()> {
3343            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3344            // Delegate to tuple encoding.
3345            fidl::encoding::Encode::<BaseNetworkSocketDropIpMembershipRequest, D>::encode(
3346                (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3347                    &self.membership,
3348                ),),
3349                encoder,
3350                offset,
3351                _depth,
3352            )
3353        }
3354    }
3355    unsafe impl<
3356        D: fidl::encoding::ResourceDialect,
3357        T0: fidl::encoding::Encode<IpMulticastMembership, D>,
3358    > fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D> for (T0,)
3359    {
3360        #[inline]
3361        unsafe fn encode(
3362            self,
3363            encoder: &mut fidl::encoding::Encoder<'_, D>,
3364            offset: usize,
3365            depth: fidl::encoding::Depth,
3366        ) -> fidl::Result<()> {
3367            encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3368            // Zero out padding regions. There's no need to apply masks
3369            // because the unmasked parts will be overwritten by fields.
3370            // Write the fields.
3371            self.0.encode(encoder, offset + 0, depth)?;
3372            Ok(())
3373        }
3374    }
3375
3376    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3377        for BaseNetworkSocketDropIpMembershipRequest
3378    {
3379        #[inline(always)]
3380        fn new_empty() -> Self {
3381            Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3382        }
3383
3384        #[inline]
3385        unsafe fn decode(
3386            &mut self,
3387            decoder: &mut fidl::encoding::Decoder<'_, D>,
3388            offset: usize,
3389            _depth: fidl::encoding::Depth,
3390        ) -> fidl::Result<()> {
3391            decoder.debug_check_bounds::<Self>(offset);
3392            // Verify that padding bytes are zero.
3393            fidl::decode!(
3394                IpMulticastMembership,
3395                D,
3396                &mut self.membership,
3397                decoder,
3398                offset + 0,
3399                _depth
3400            )?;
3401            Ok(())
3402        }
3403    }
3404
3405    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3406        type Borrowed<'a> = &'a Self;
3407        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3408            value
3409        }
3410    }
3411
3412    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3413        type Owned = Self;
3414
3415        #[inline(always)]
3416        fn inline_align(_context: fidl::encoding::Context) -> usize {
3417            8
3418        }
3419
3420        #[inline(always)]
3421        fn inline_size(_context: fidl::encoding::Context) -> usize {
3422            24
3423        }
3424    }
3425
3426    unsafe impl<D: fidl::encoding::ResourceDialect>
3427        fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D>
3428        for &BaseNetworkSocketDropIpv6MembershipRequest
3429    {
3430        #[inline]
3431        unsafe fn encode(
3432            self,
3433            encoder: &mut fidl::encoding::Encoder<'_, D>,
3434            offset: usize,
3435            _depth: fidl::encoding::Depth,
3436        ) -> fidl::Result<()> {
3437            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3438            // Delegate to tuple encoding.
3439            fidl::encoding::Encode::<BaseNetworkSocketDropIpv6MembershipRequest, D>::encode(
3440                (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3441                    &self.membership,
3442                ),),
3443                encoder,
3444                offset,
3445                _depth,
3446            )
3447        }
3448    }
3449    unsafe impl<
3450        D: fidl::encoding::ResourceDialect,
3451        T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3452    > fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D> for (T0,)
3453    {
3454        #[inline]
3455        unsafe fn encode(
3456            self,
3457            encoder: &mut fidl::encoding::Encoder<'_, D>,
3458            offset: usize,
3459            depth: fidl::encoding::Depth,
3460        ) -> fidl::Result<()> {
3461            encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3462            // Zero out padding regions. There's no need to apply masks
3463            // because the unmasked parts will be overwritten by fields.
3464            // Write the fields.
3465            self.0.encode(encoder, offset + 0, depth)?;
3466            Ok(())
3467        }
3468    }
3469
3470    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3471        for BaseNetworkSocketDropIpv6MembershipRequest
3472    {
3473        #[inline(always)]
3474        fn new_empty() -> Self {
3475            Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3476        }
3477
3478        #[inline]
3479        unsafe fn decode(
3480            &mut self,
3481            decoder: &mut fidl::encoding::Decoder<'_, D>,
3482            offset: usize,
3483            _depth: fidl::encoding::Depth,
3484        ) -> fidl::Result<()> {
3485            decoder.debug_check_bounds::<Self>(offset);
3486            // Verify that padding bytes are zero.
3487            fidl::decode!(
3488                Ipv6MulticastMembership,
3489                D,
3490                &mut self.membership,
3491                decoder,
3492                offset + 0,
3493                _depth
3494            )?;
3495            Ok(())
3496        }
3497    }
3498
3499    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3500        type Borrowed<'a> = &'a Self;
3501        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3502            value
3503        }
3504    }
3505
3506    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3507        type Owned = Self;
3508
3509        #[inline(always)]
3510        fn inline_align(_context: fidl::encoding::Context) -> usize {
3511            8
3512        }
3513
3514        #[inline(always)]
3515        fn inline_size(_context: fidl::encoding::Context) -> usize {
3516            16
3517        }
3518    }
3519
3520    unsafe impl<D: fidl::encoding::ResourceDialect>
3521        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>
3522        for &BaseNetworkSocketSetIpMulticastInterfaceRequest
3523    {
3524        #[inline]
3525        unsafe fn encode(
3526            self,
3527            encoder: &mut fidl::encoding::Encoder<'_, D>,
3528            offset: usize,
3529            _depth: fidl::encoding::Depth,
3530        ) -> fidl::Result<()> {
3531            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3532            // Delegate to tuple encoding.
3533            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>::encode(
3534                (
3535                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
3536                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
3537                ),
3538                encoder, offset, _depth
3539            )
3540        }
3541    }
3542    unsafe impl<
3543        D: fidl::encoding::ResourceDialect,
3544        T0: fidl::encoding::Encode<u64, D>,
3545        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
3546    > fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D> for (T0, T1)
3547    {
3548        #[inline]
3549        unsafe fn encode(
3550            self,
3551            encoder: &mut fidl::encoding::Encoder<'_, D>,
3552            offset: usize,
3553            depth: fidl::encoding::Depth,
3554        ) -> fidl::Result<()> {
3555            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3556            // Zero out padding regions. There's no need to apply masks
3557            // because the unmasked parts will be overwritten by fields.
3558            unsafe {
3559                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3560                (ptr as *mut u64).write_unaligned(0);
3561            }
3562            // Write the fields.
3563            self.0.encode(encoder, offset + 0, depth)?;
3564            self.1.encode(encoder, offset + 8, depth)?;
3565            Ok(())
3566        }
3567    }
3568
3569    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3570        for BaseNetworkSocketSetIpMulticastInterfaceRequest
3571    {
3572        #[inline(always)]
3573        fn new_empty() -> Self {
3574            Self {
3575                iface: fidl::new_empty!(u64, D),
3576                address: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
3577            }
3578        }
3579
3580        #[inline]
3581        unsafe fn decode(
3582            &mut self,
3583            decoder: &mut fidl::encoding::Decoder<'_, D>,
3584            offset: usize,
3585            _depth: fidl::encoding::Depth,
3586        ) -> fidl::Result<()> {
3587            decoder.debug_check_bounds::<Self>(offset);
3588            // Verify that padding bytes are zero.
3589            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3590            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3591            let mask = 0xffffffff00000000u64;
3592            let maskedval = padval & mask;
3593            if maskedval != 0 {
3594                return Err(fidl::Error::NonZeroPadding {
3595                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3596                });
3597            }
3598            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
3599            fidl::decode!(
3600                fidl_fuchsia_net_common::Ipv4Address,
3601                D,
3602                &mut self.address,
3603                decoder,
3604                offset + 8,
3605                _depth
3606            )?;
3607            Ok(())
3608        }
3609    }
3610
3611    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3612        type Borrowed<'a> = &'a Self;
3613        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3614            value
3615        }
3616    }
3617
3618    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3619        type Owned = Self;
3620
3621        #[inline(always)]
3622        fn inline_align(_context: fidl::encoding::Context) -> usize {
3623            1
3624        }
3625
3626        #[inline(always)]
3627        fn inline_size(_context: fidl::encoding::Context) -> usize {
3628            1
3629        }
3630    }
3631
3632    unsafe impl<D: fidl::encoding::ResourceDialect>
3633        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>
3634        for &BaseNetworkSocketSetIpMulticastLoopbackRequest
3635    {
3636        #[inline]
3637        unsafe fn encode(
3638            self,
3639            encoder: &mut fidl::encoding::Encoder<'_, D>,
3640            offset: usize,
3641            _depth: fidl::encoding::Depth,
3642        ) -> fidl::Result<()> {
3643            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3644            // Delegate to tuple encoding.
3645            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>::encode(
3646                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3647                encoder,
3648                offset,
3649                _depth,
3650            )
3651        }
3652    }
3653    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3654        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D> for (T0,)
3655    {
3656        #[inline]
3657        unsafe fn encode(
3658            self,
3659            encoder: &mut fidl::encoding::Encoder<'_, D>,
3660            offset: usize,
3661            depth: fidl::encoding::Depth,
3662        ) -> fidl::Result<()> {
3663            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3664            // Zero out padding regions. There's no need to apply masks
3665            // because the unmasked parts will be overwritten by fields.
3666            // Write the fields.
3667            self.0.encode(encoder, offset + 0, depth)?;
3668            Ok(())
3669        }
3670    }
3671
3672    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3673        for BaseNetworkSocketSetIpMulticastLoopbackRequest
3674    {
3675        #[inline(always)]
3676        fn new_empty() -> Self {
3677            Self { value: fidl::new_empty!(bool, D) }
3678        }
3679
3680        #[inline]
3681        unsafe fn decode(
3682            &mut self,
3683            decoder: &mut fidl::encoding::Decoder<'_, D>,
3684            offset: usize,
3685            _depth: fidl::encoding::Depth,
3686        ) -> fidl::Result<()> {
3687            decoder.debug_check_bounds::<Self>(offset);
3688            // Verify that padding bytes are zero.
3689            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3690            Ok(())
3691        }
3692    }
3693
3694    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3695        type Borrowed<'a> = &'a Self;
3696        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3697            value
3698        }
3699    }
3700
3701    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3702        type Owned = Self;
3703
3704        #[inline(always)]
3705        fn inline_align(_context: fidl::encoding::Context) -> usize {
3706            8
3707        }
3708
3709        #[inline(always)]
3710        fn inline_size(_context: fidl::encoding::Context) -> usize {
3711            16
3712        }
3713    }
3714
3715    unsafe impl<D: fidl::encoding::ResourceDialect>
3716        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D>
3717        for &BaseNetworkSocketSetIpMulticastTtlRequest
3718    {
3719        #[inline]
3720        unsafe fn encode(
3721            self,
3722            encoder: &mut fidl::encoding::Encoder<'_, D>,
3723            offset: usize,
3724            _depth: fidl::encoding::Depth,
3725        ) -> fidl::Result<()> {
3726            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3727            // Delegate to tuple encoding.
3728            fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastTtlRequest, D>::encode(
3729                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3730                encoder,
3731                offset,
3732                _depth,
3733            )
3734        }
3735    }
3736    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
3737        fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D> for (T0,)
3738    {
3739        #[inline]
3740        unsafe fn encode(
3741            self,
3742            encoder: &mut fidl::encoding::Encoder<'_, D>,
3743            offset: usize,
3744            depth: fidl::encoding::Depth,
3745        ) -> fidl::Result<()> {
3746            encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3747            // Zero out padding regions. There's no need to apply masks
3748            // because the unmasked parts will be overwritten by fields.
3749            // Write the fields.
3750            self.0.encode(encoder, offset + 0, depth)?;
3751            Ok(())
3752        }
3753    }
3754
3755    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3756        for BaseNetworkSocketSetIpMulticastTtlRequest
3757    {
3758        #[inline(always)]
3759        fn new_empty() -> Self {
3760            Self { value: fidl::new_empty!(OptionalUint8, D) }
3761        }
3762
3763        #[inline]
3764        unsafe fn decode(
3765            &mut self,
3766            decoder: &mut fidl::encoding::Decoder<'_, D>,
3767            offset: usize,
3768            _depth: fidl::encoding::Depth,
3769        ) -> fidl::Result<()> {
3770            decoder.debug_check_bounds::<Self>(offset);
3771            // Verify that padding bytes are zero.
3772            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
3773            Ok(())
3774        }
3775    }
3776
3777    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3778        type Borrowed<'a> = &'a Self;
3779        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3780            value
3781        }
3782    }
3783
3784    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3785        type Owned = Self;
3786
3787        #[inline(always)]
3788        fn inline_align(_context: fidl::encoding::Context) -> usize {
3789            1
3790        }
3791
3792        #[inline(always)]
3793        fn inline_size(_context: fidl::encoding::Context) -> usize {
3794            1
3795        }
3796    }
3797
3798    unsafe impl<D: fidl::encoding::ResourceDialect>
3799        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D>
3800        for &BaseNetworkSocketSetIpPacketInfoRequest
3801    {
3802        #[inline]
3803        unsafe fn encode(
3804            self,
3805            encoder: &mut fidl::encoding::Encoder<'_, D>,
3806            offset: usize,
3807            _depth: fidl::encoding::Depth,
3808        ) -> fidl::Result<()> {
3809            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3810            // Delegate to tuple encoding.
3811            fidl::encoding::Encode::<BaseNetworkSocketSetIpPacketInfoRequest, D>::encode(
3812                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3813                encoder,
3814                offset,
3815                _depth,
3816            )
3817        }
3818    }
3819    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3820        fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D> for (T0,)
3821    {
3822        #[inline]
3823        unsafe fn encode(
3824            self,
3825            encoder: &mut fidl::encoding::Encoder<'_, D>,
3826            offset: usize,
3827            depth: fidl::encoding::Depth,
3828        ) -> fidl::Result<()> {
3829            encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3830            // Zero out padding regions. There's no need to apply masks
3831            // because the unmasked parts will be overwritten by fields.
3832            // Write the fields.
3833            self.0.encode(encoder, offset + 0, depth)?;
3834            Ok(())
3835        }
3836    }
3837
3838    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3839        for BaseNetworkSocketSetIpPacketInfoRequest
3840    {
3841        #[inline(always)]
3842        fn new_empty() -> Self {
3843            Self { value: fidl::new_empty!(bool, D) }
3844        }
3845
3846        #[inline]
3847        unsafe fn decode(
3848            &mut self,
3849            decoder: &mut fidl::encoding::Decoder<'_, D>,
3850            offset: usize,
3851            _depth: fidl::encoding::Depth,
3852        ) -> fidl::Result<()> {
3853            decoder.debug_check_bounds::<Self>(offset);
3854            // Verify that padding bytes are zero.
3855            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3856            Ok(())
3857        }
3858    }
3859
3860    impl fidl::encoding::ValueTypeMarker
3861        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3862    {
3863        type Borrowed<'a> = &'a Self;
3864        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3865            value
3866        }
3867    }
3868
3869    unsafe impl fidl::encoding::TypeMarker
3870        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3871    {
3872        type Owned = Self;
3873
3874        #[inline(always)]
3875        fn inline_align(_context: fidl::encoding::Context) -> usize {
3876            1
3877        }
3878
3879        #[inline(always)]
3880        fn inline_size(_context: fidl::encoding::Context) -> usize {
3881            1
3882        }
3883    }
3884
3885    unsafe impl<D: fidl::encoding::ResourceDialect>
3886        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3887        for &BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3888    {
3889        #[inline]
3890        unsafe fn encode(
3891            self,
3892            encoder: &mut fidl::encoding::Encoder<'_, D>,
3893            offset: usize,
3894            _depth: fidl::encoding::Depth,
3895        ) -> fidl::Result<()> {
3896            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3897            // Delegate to tuple encoding.
3898            fidl::encoding::Encode::<
3899                BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest,
3900                D,
3901            >::encode(
3902                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3903                encoder,
3904                offset,
3905                _depth,
3906            )
3907        }
3908    }
3909    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3910        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3911        for (T0,)
3912    {
3913        #[inline]
3914        unsafe fn encode(
3915            self,
3916            encoder: &mut fidl::encoding::Encoder<'_, D>,
3917            offset: usize,
3918            depth: fidl::encoding::Depth,
3919        ) -> fidl::Result<()> {
3920            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3921            // Zero out padding regions. There's no need to apply masks
3922            // because the unmasked parts will be overwritten by fields.
3923            // Write the fields.
3924            self.0.encode(encoder, offset + 0, depth)?;
3925            Ok(())
3926        }
3927    }
3928
3929    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3930        for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3931    {
3932        #[inline(always)]
3933        fn new_empty() -> Self {
3934            Self { value: fidl::new_empty!(bool, D) }
3935        }
3936
3937        #[inline]
3938        unsafe fn decode(
3939            &mut self,
3940            decoder: &mut fidl::encoding::Decoder<'_, D>,
3941            offset: usize,
3942            _depth: fidl::encoding::Depth,
3943        ) -> fidl::Result<()> {
3944            decoder.debug_check_bounds::<Self>(offset);
3945            // Verify that padding bytes are zero.
3946            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3947            Ok(())
3948        }
3949    }
3950
3951    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3952        type Borrowed<'a> = &'a Self;
3953        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3954            value
3955        }
3956    }
3957
3958    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3959        type Owned = Self;
3960
3961        #[inline(always)]
3962        fn inline_align(_context: fidl::encoding::Context) -> usize {
3963            1
3964        }
3965
3966        #[inline(always)]
3967        fn inline_size(_context: fidl::encoding::Context) -> usize {
3968            1
3969        }
3970    }
3971
3972    unsafe impl<D: fidl::encoding::ResourceDialect>
3973        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D>
3974        for &BaseNetworkSocketSetIpReceiveTtlRequest
3975    {
3976        #[inline]
3977        unsafe fn encode(
3978            self,
3979            encoder: &mut fidl::encoding::Encoder<'_, D>,
3980            offset: usize,
3981            _depth: fidl::encoding::Depth,
3982        ) -> fidl::Result<()> {
3983            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3984            // Delegate to tuple encoding.
3985            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTtlRequest, D>::encode(
3986                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3987                encoder,
3988                offset,
3989                _depth,
3990            )
3991        }
3992    }
3993    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3994        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D> for (T0,)
3995    {
3996        #[inline]
3997        unsafe fn encode(
3998            self,
3999            encoder: &mut fidl::encoding::Encoder<'_, D>,
4000            offset: usize,
4001            depth: fidl::encoding::Depth,
4002        ) -> fidl::Result<()> {
4003            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
4004            // Zero out padding regions. There's no need to apply masks
4005            // because the unmasked parts will be overwritten by fields.
4006            // Write the fields.
4007            self.0.encode(encoder, offset + 0, depth)?;
4008            Ok(())
4009        }
4010    }
4011
4012    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4013        for BaseNetworkSocketSetIpReceiveTtlRequest
4014    {
4015        #[inline(always)]
4016        fn new_empty() -> Self {
4017            Self { value: fidl::new_empty!(bool, D) }
4018        }
4019
4020        #[inline]
4021        unsafe fn decode(
4022            &mut self,
4023            decoder: &mut fidl::encoding::Decoder<'_, D>,
4024            offset: usize,
4025            _depth: fidl::encoding::Depth,
4026        ) -> fidl::Result<()> {
4027            decoder.debug_check_bounds::<Self>(offset);
4028            // Verify that padding bytes are zero.
4029            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4030            Ok(())
4031        }
4032    }
4033
4034    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
4035        type Borrowed<'a> = &'a Self;
4036        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4037            value
4038        }
4039    }
4040
4041    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
4042        type Owned = Self;
4043
4044        #[inline(always)]
4045        fn inline_align(_context: fidl::encoding::Context) -> usize {
4046            1
4047        }
4048
4049        #[inline(always)]
4050        fn inline_size(_context: fidl::encoding::Context) -> usize {
4051            1
4052        }
4053    }
4054
4055    unsafe impl<D: fidl::encoding::ResourceDialect>
4056        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>
4057        for &BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
4058    {
4059        #[inline]
4060        unsafe fn encode(
4061            self,
4062            encoder: &mut fidl::encoding::Encoder<'_, D>,
4063            offset: usize,
4064            _depth: fidl::encoding::Depth,
4065        ) -> fidl::Result<()> {
4066            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
4067            // Delegate to tuple encoding.
4068            fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>::encode(
4069                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4070                encoder,
4071                offset,
4072                _depth,
4073            )
4074        }
4075    }
4076    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4077        fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D> for (T0,)
4078    {
4079        #[inline]
4080        unsafe fn encode(
4081            self,
4082            encoder: &mut fidl::encoding::Encoder<'_, D>,
4083            offset: usize,
4084            depth: fidl::encoding::Depth,
4085        ) -> fidl::Result<()> {
4086            encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
4087            // Zero out padding regions. There's no need to apply masks
4088            // because the unmasked parts will be overwritten by fields.
4089            // Write the fields.
4090            self.0.encode(encoder, offset + 0, depth)?;
4091            Ok(())
4092        }
4093    }
4094
4095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4096        for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
4097    {
4098        #[inline(always)]
4099        fn new_empty() -> Self {
4100            Self { value: fidl::new_empty!(bool, D) }
4101        }
4102
4103        #[inline]
4104        unsafe fn decode(
4105            &mut self,
4106            decoder: &mut fidl::encoding::Decoder<'_, D>,
4107            offset: usize,
4108            _depth: fidl::encoding::Depth,
4109        ) -> fidl::Result<()> {
4110            decoder.debug_check_bounds::<Self>(offset);
4111            // Verify that padding bytes are zero.
4112            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4113            Ok(())
4114        }
4115    }
4116
4117    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTransparentRequest {
4118        type Borrowed<'a> = &'a Self;
4119        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4120            value
4121        }
4122    }
4123
4124    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTransparentRequest {
4125        type Owned = Self;
4126
4127        #[inline(always)]
4128        fn inline_align(_context: fidl::encoding::Context) -> usize {
4129            1
4130        }
4131
4132        #[inline(always)]
4133        fn inline_size(_context: fidl::encoding::Context) -> usize {
4134            1
4135        }
4136    }
4137
4138    unsafe impl<D: fidl::encoding::ResourceDialect>
4139        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D>
4140        for &BaseNetworkSocketSetIpTransparentRequest
4141    {
4142        #[inline]
4143        unsafe fn encode(
4144            self,
4145            encoder: &mut fidl::encoding::Encoder<'_, D>,
4146            offset: usize,
4147            _depth: fidl::encoding::Depth,
4148        ) -> fidl::Result<()> {
4149            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
4150            // Delegate to tuple encoding.
4151            fidl::encoding::Encode::<BaseNetworkSocketSetIpTransparentRequest, D>::encode(
4152                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4153                encoder,
4154                offset,
4155                _depth,
4156            )
4157        }
4158    }
4159    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4160        fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D> for (T0,)
4161    {
4162        #[inline]
4163        unsafe fn encode(
4164            self,
4165            encoder: &mut fidl::encoding::Encoder<'_, D>,
4166            offset: usize,
4167            depth: fidl::encoding::Depth,
4168        ) -> fidl::Result<()> {
4169            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
4170            // Zero out padding regions. There's no need to apply masks
4171            // because the unmasked parts will be overwritten by fields.
4172            // Write the fields.
4173            self.0.encode(encoder, offset + 0, depth)?;
4174            Ok(())
4175        }
4176    }
4177
4178    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4179        for BaseNetworkSocketSetIpTransparentRequest
4180    {
4181        #[inline(always)]
4182        fn new_empty() -> Self {
4183            Self { value: fidl::new_empty!(bool, D) }
4184        }
4185
4186        #[inline]
4187        unsafe fn decode(
4188            &mut self,
4189            decoder: &mut fidl::encoding::Decoder<'_, D>,
4190            offset: usize,
4191            _depth: fidl::encoding::Depth,
4192        ) -> fidl::Result<()> {
4193            decoder.debug_check_bounds::<Self>(offset);
4194            // Verify that padding bytes are zero.
4195            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4196            Ok(())
4197        }
4198    }
4199
4200    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTtlRequest {
4201        type Borrowed<'a> = &'a Self;
4202        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4203            value
4204        }
4205    }
4206
4207    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTtlRequest {
4208        type Owned = Self;
4209
4210        #[inline(always)]
4211        fn inline_align(_context: fidl::encoding::Context) -> usize {
4212            8
4213        }
4214
4215        #[inline(always)]
4216        fn inline_size(_context: fidl::encoding::Context) -> usize {
4217            16
4218        }
4219    }
4220
4221    unsafe impl<D: fidl::encoding::ResourceDialect>
4222        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D>
4223        for &BaseNetworkSocketSetIpTtlRequest
4224    {
4225        #[inline]
4226        unsafe fn encode(
4227            self,
4228            encoder: &mut fidl::encoding::Encoder<'_, D>,
4229            offset: usize,
4230            _depth: fidl::encoding::Depth,
4231        ) -> fidl::Result<()> {
4232            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4233            // Delegate to tuple encoding.
4234            fidl::encoding::Encode::<BaseNetworkSocketSetIpTtlRequest, D>::encode(
4235                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4236                encoder,
4237                offset,
4238                _depth,
4239            )
4240        }
4241    }
4242    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4243        fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D> for (T0,)
4244    {
4245        #[inline]
4246        unsafe fn encode(
4247            self,
4248            encoder: &mut fidl::encoding::Encoder<'_, D>,
4249            offset: usize,
4250            depth: fidl::encoding::Depth,
4251        ) -> fidl::Result<()> {
4252            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4253            // Zero out padding regions. There's no need to apply masks
4254            // because the unmasked parts will be overwritten by fields.
4255            // Write the fields.
4256            self.0.encode(encoder, offset + 0, depth)?;
4257            Ok(())
4258        }
4259    }
4260
4261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4262        for BaseNetworkSocketSetIpTtlRequest
4263    {
4264        #[inline(always)]
4265        fn new_empty() -> Self {
4266            Self { value: fidl::new_empty!(OptionalUint8, D) }
4267        }
4268
4269        #[inline]
4270        unsafe fn decode(
4271            &mut self,
4272            decoder: &mut fidl::encoding::Decoder<'_, D>,
4273            offset: usize,
4274            _depth: fidl::encoding::Depth,
4275        ) -> fidl::Result<()> {
4276            decoder.debug_check_bounds::<Self>(offset);
4277            // Verify that padding bytes are zero.
4278            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4279            Ok(())
4280        }
4281    }
4282
4283    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4284        type Borrowed<'a> = &'a Self;
4285        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4286            value
4287        }
4288    }
4289
4290    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4291        type Owned = Self;
4292
4293        #[inline(always)]
4294        fn inline_align(_context: fidl::encoding::Context) -> usize {
4295            1
4296        }
4297
4298        #[inline(always)]
4299        fn inline_size(_context: fidl::encoding::Context) -> usize {
4300            1
4301        }
4302        #[inline(always)]
4303        fn encode_is_copy() -> bool {
4304            true
4305        }
4306
4307        #[inline(always)]
4308        fn decode_is_copy() -> bool {
4309            true
4310        }
4311    }
4312
4313    unsafe impl<D: fidl::encoding::ResourceDialect>
4314        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D>
4315        for &BaseNetworkSocketSetIpTypeOfServiceRequest
4316    {
4317        #[inline]
4318        unsafe fn encode(
4319            self,
4320            encoder: &mut fidl::encoding::Encoder<'_, D>,
4321            offset: usize,
4322            _depth: fidl::encoding::Depth,
4323        ) -> fidl::Result<()> {
4324            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4325            unsafe {
4326                // Copy the object into the buffer.
4327                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4328                (buf_ptr as *mut BaseNetworkSocketSetIpTypeOfServiceRequest).write_unaligned(
4329                    (self as *const BaseNetworkSocketSetIpTypeOfServiceRequest).read(),
4330                );
4331                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4332                // done second because the memcpy will write garbage to these bytes.
4333            }
4334            Ok(())
4335        }
4336    }
4337    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
4338        fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D> for (T0,)
4339    {
4340        #[inline]
4341        unsafe fn encode(
4342            self,
4343            encoder: &mut fidl::encoding::Encoder<'_, D>,
4344            offset: usize,
4345            depth: fidl::encoding::Depth,
4346        ) -> fidl::Result<()> {
4347            encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4348            // Zero out padding regions. There's no need to apply masks
4349            // because the unmasked parts will be overwritten by fields.
4350            // Write the fields.
4351            self.0.encode(encoder, offset + 0, depth)?;
4352            Ok(())
4353        }
4354    }
4355
4356    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4357        for BaseNetworkSocketSetIpTypeOfServiceRequest
4358    {
4359        #[inline(always)]
4360        fn new_empty() -> Self {
4361            Self { value: fidl::new_empty!(u8, D) }
4362        }
4363
4364        #[inline]
4365        unsafe fn decode(
4366            &mut self,
4367            decoder: &mut fidl::encoding::Decoder<'_, D>,
4368            offset: usize,
4369            _depth: fidl::encoding::Depth,
4370        ) -> fidl::Result<()> {
4371            decoder.debug_check_bounds::<Self>(offset);
4372            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4373            // Verify that padding bytes are zero.
4374            // Copy from the buffer into the object.
4375            unsafe {
4376                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
4377            }
4378            Ok(())
4379        }
4380    }
4381
4382    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4383        type Borrowed<'a> = &'a Self;
4384        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4385            value
4386        }
4387    }
4388
4389    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4390        type Owned = Self;
4391
4392        #[inline(always)]
4393        fn inline_align(_context: fidl::encoding::Context) -> usize {
4394            8
4395        }
4396
4397        #[inline(always)]
4398        fn inline_size(_context: fidl::encoding::Context) -> usize {
4399            16
4400        }
4401    }
4402
4403    unsafe impl<D: fidl::encoding::ResourceDialect>
4404        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>
4405        for &BaseNetworkSocketSetIpv6MulticastHopsRequest
4406    {
4407        #[inline]
4408        unsafe fn encode(
4409            self,
4410            encoder: &mut fidl::encoding::Encoder<'_, D>,
4411            offset: usize,
4412            _depth: fidl::encoding::Depth,
4413        ) -> fidl::Result<()> {
4414            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4415            // Delegate to tuple encoding.
4416            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>::encode(
4417                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4418                encoder,
4419                offset,
4420                _depth,
4421            )
4422        }
4423    }
4424    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4425        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D> for (T0,)
4426    {
4427        #[inline]
4428        unsafe fn encode(
4429            self,
4430            encoder: &mut fidl::encoding::Encoder<'_, D>,
4431            offset: usize,
4432            depth: fidl::encoding::Depth,
4433        ) -> fidl::Result<()> {
4434            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4435            // Zero out padding regions. There's no need to apply masks
4436            // because the unmasked parts will be overwritten by fields.
4437            // Write the fields.
4438            self.0.encode(encoder, offset + 0, depth)?;
4439            Ok(())
4440        }
4441    }
4442
4443    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4444        for BaseNetworkSocketSetIpv6MulticastHopsRequest
4445    {
4446        #[inline(always)]
4447        fn new_empty() -> Self {
4448            Self { value: fidl::new_empty!(OptionalUint8, D) }
4449        }
4450
4451        #[inline]
4452        unsafe fn decode(
4453            &mut self,
4454            decoder: &mut fidl::encoding::Decoder<'_, D>,
4455            offset: usize,
4456            _depth: fidl::encoding::Depth,
4457        ) -> fidl::Result<()> {
4458            decoder.debug_check_bounds::<Self>(offset);
4459            // Verify that padding bytes are zero.
4460            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4461            Ok(())
4462        }
4463    }
4464
4465    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4466        type Borrowed<'a> = &'a Self;
4467        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4468            value
4469        }
4470    }
4471
4472    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4473        type Owned = Self;
4474
4475        #[inline(always)]
4476        fn inline_align(_context: fidl::encoding::Context) -> usize {
4477            8
4478        }
4479
4480        #[inline(always)]
4481        fn inline_size(_context: fidl::encoding::Context) -> usize {
4482            8
4483        }
4484        #[inline(always)]
4485        fn encode_is_copy() -> bool {
4486            true
4487        }
4488
4489        #[inline(always)]
4490        fn decode_is_copy() -> bool {
4491            true
4492        }
4493    }
4494
4495    unsafe impl<D: fidl::encoding::ResourceDialect>
4496        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D>
4497        for &BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4498    {
4499        #[inline]
4500        unsafe fn encode(
4501            self,
4502            encoder: &mut fidl::encoding::Encoder<'_, D>,
4503            offset: usize,
4504            _depth: fidl::encoding::Depth,
4505        ) -> fidl::Result<()> {
4506            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4507            unsafe {
4508                // Copy the object into the buffer.
4509                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4510                (buf_ptr as *mut BaseNetworkSocketSetIpv6MulticastInterfaceRequest)
4511                    .write_unaligned(
4512                        (self as *const BaseNetworkSocketSetIpv6MulticastInterfaceRequest).read(),
4513                    );
4514                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4515                // done second because the memcpy will write garbage to these bytes.
4516            }
4517            Ok(())
4518        }
4519    }
4520    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4521        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D> for (T0,)
4522    {
4523        #[inline]
4524        unsafe fn encode(
4525            self,
4526            encoder: &mut fidl::encoding::Encoder<'_, D>,
4527            offset: usize,
4528            depth: fidl::encoding::Depth,
4529        ) -> fidl::Result<()> {
4530            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4531            // Zero out padding regions. There's no need to apply masks
4532            // because the unmasked parts will be overwritten by fields.
4533            // Write the fields.
4534            self.0.encode(encoder, offset + 0, depth)?;
4535            Ok(())
4536        }
4537    }
4538
4539    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4540        for BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4541    {
4542        #[inline(always)]
4543        fn new_empty() -> Self {
4544            Self { value: fidl::new_empty!(u64, D) }
4545        }
4546
4547        #[inline]
4548        unsafe fn decode(
4549            &mut self,
4550            decoder: &mut fidl::encoding::Decoder<'_, D>,
4551            offset: usize,
4552            _depth: fidl::encoding::Depth,
4553        ) -> fidl::Result<()> {
4554            decoder.debug_check_bounds::<Self>(offset);
4555            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4556            // Verify that padding bytes are zero.
4557            // Copy from the buffer into the object.
4558            unsafe {
4559                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4560            }
4561            Ok(())
4562        }
4563    }
4564
4565    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4566        type Borrowed<'a> = &'a Self;
4567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4568            value
4569        }
4570    }
4571
4572    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4573        type Owned = Self;
4574
4575        #[inline(always)]
4576        fn inline_align(_context: fidl::encoding::Context) -> usize {
4577            1
4578        }
4579
4580        #[inline(always)]
4581        fn inline_size(_context: fidl::encoding::Context) -> usize {
4582            1
4583        }
4584    }
4585
4586    unsafe impl<D: fidl::encoding::ResourceDialect>
4587        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>
4588        for &BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4589    {
4590        #[inline]
4591        unsafe fn encode(
4592            self,
4593            encoder: &mut fidl::encoding::Encoder<'_, D>,
4594            offset: usize,
4595            _depth: fidl::encoding::Depth,
4596        ) -> fidl::Result<()> {
4597            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4598            // Delegate to tuple encoding.
4599            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>::encode(
4600                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4601                encoder,
4602                offset,
4603                _depth,
4604            )
4605        }
4606    }
4607    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4608        fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D> for (T0,)
4609    {
4610        #[inline]
4611        unsafe fn encode(
4612            self,
4613            encoder: &mut fidl::encoding::Encoder<'_, D>,
4614            offset: usize,
4615            depth: fidl::encoding::Depth,
4616        ) -> fidl::Result<()> {
4617            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4618            // Zero out padding regions. There's no need to apply masks
4619            // because the unmasked parts will be overwritten by fields.
4620            // Write the fields.
4621            self.0.encode(encoder, offset + 0, depth)?;
4622            Ok(())
4623        }
4624    }
4625
4626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4627        for BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4628    {
4629        #[inline(always)]
4630        fn new_empty() -> Self {
4631            Self { value: fidl::new_empty!(bool, D) }
4632        }
4633
4634        #[inline]
4635        unsafe fn decode(
4636            &mut self,
4637            decoder: &mut fidl::encoding::Decoder<'_, D>,
4638            offset: usize,
4639            _depth: fidl::encoding::Depth,
4640        ) -> fidl::Result<()> {
4641            decoder.debug_check_bounds::<Self>(offset);
4642            // Verify that padding bytes are zero.
4643            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4644            Ok(())
4645        }
4646    }
4647
4648    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4649        type Borrowed<'a> = &'a Self;
4650        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4651            value
4652        }
4653    }
4654
4655    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4656        type Owned = Self;
4657
4658        #[inline(always)]
4659        fn inline_align(_context: fidl::encoding::Context) -> usize {
4660            1
4661        }
4662
4663        #[inline(always)]
4664        fn inline_size(_context: fidl::encoding::Context) -> usize {
4665            1
4666        }
4667    }
4668
4669    unsafe impl<D: fidl::encoding::ResourceDialect>
4670        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D>
4671        for &BaseNetworkSocketSetIpv6OnlyRequest
4672    {
4673        #[inline]
4674        unsafe fn encode(
4675            self,
4676            encoder: &mut fidl::encoding::Encoder<'_, D>,
4677            offset: usize,
4678            _depth: fidl::encoding::Depth,
4679        ) -> fidl::Result<()> {
4680            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4681            // Delegate to tuple encoding.
4682            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6OnlyRequest, D>::encode(
4683                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4684                encoder,
4685                offset,
4686                _depth,
4687            )
4688        }
4689    }
4690    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4691        fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D> for (T0,)
4692    {
4693        #[inline]
4694        unsafe fn encode(
4695            self,
4696            encoder: &mut fidl::encoding::Encoder<'_, D>,
4697            offset: usize,
4698            depth: fidl::encoding::Depth,
4699        ) -> fidl::Result<()> {
4700            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4701            // Zero out padding regions. There's no need to apply masks
4702            // because the unmasked parts will be overwritten by fields.
4703            // Write the fields.
4704            self.0.encode(encoder, offset + 0, depth)?;
4705            Ok(())
4706        }
4707    }
4708
4709    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4710        for BaseNetworkSocketSetIpv6OnlyRequest
4711    {
4712        #[inline(always)]
4713        fn new_empty() -> Self {
4714            Self { value: fidl::new_empty!(bool, D) }
4715        }
4716
4717        #[inline]
4718        unsafe fn decode(
4719            &mut self,
4720            decoder: &mut fidl::encoding::Decoder<'_, D>,
4721            offset: usize,
4722            _depth: fidl::encoding::Depth,
4723        ) -> fidl::Result<()> {
4724            decoder.debug_check_bounds::<Self>(offset);
4725            // Verify that padding bytes are zero.
4726            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4727            Ok(())
4728        }
4729    }
4730
4731    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4732        type Borrowed<'a> = &'a Self;
4733        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4734            value
4735        }
4736    }
4737
4738    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4739        type Owned = Self;
4740
4741        #[inline(always)]
4742        fn inline_align(_context: fidl::encoding::Context) -> usize {
4743            1
4744        }
4745
4746        #[inline(always)]
4747        fn inline_size(_context: fidl::encoding::Context) -> usize {
4748            1
4749        }
4750    }
4751
4752    unsafe impl<D: fidl::encoding::ResourceDialect>
4753        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>
4754        for &BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4755    {
4756        #[inline]
4757        unsafe fn encode(
4758            self,
4759            encoder: &mut fidl::encoding::Encoder<'_, D>,
4760            offset: usize,
4761            _depth: fidl::encoding::Depth,
4762        ) -> fidl::Result<()> {
4763            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4764            // Delegate to tuple encoding.
4765            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>::encode(
4766                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4767                encoder,
4768                offset,
4769                _depth,
4770            )
4771        }
4772    }
4773    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4774        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D> for (T0,)
4775    {
4776        #[inline]
4777        unsafe fn encode(
4778            self,
4779            encoder: &mut fidl::encoding::Encoder<'_, D>,
4780            offset: usize,
4781            depth: fidl::encoding::Depth,
4782        ) -> fidl::Result<()> {
4783            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4784            // Zero out padding regions. There's no need to apply masks
4785            // because the unmasked parts will be overwritten by fields.
4786            // Write the fields.
4787            self.0.encode(encoder, offset + 0, depth)?;
4788            Ok(())
4789        }
4790    }
4791
4792    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4793        for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4794    {
4795        #[inline(always)]
4796        fn new_empty() -> Self {
4797            Self { value: fidl::new_empty!(bool, D) }
4798        }
4799
4800        #[inline]
4801        unsafe fn decode(
4802            &mut self,
4803            decoder: &mut fidl::encoding::Decoder<'_, D>,
4804            offset: usize,
4805            _depth: fidl::encoding::Depth,
4806        ) -> fidl::Result<()> {
4807            decoder.debug_check_bounds::<Self>(offset);
4808            // Verify that padding bytes are zero.
4809            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4810            Ok(())
4811        }
4812    }
4813
4814    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4815        type Borrowed<'a> = &'a Self;
4816        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4817            value
4818        }
4819    }
4820
4821    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4822        type Owned = Self;
4823
4824        #[inline(always)]
4825        fn inline_align(_context: fidl::encoding::Context) -> usize {
4826            1
4827        }
4828
4829        #[inline(always)]
4830        fn inline_size(_context: fidl::encoding::Context) -> usize {
4831            1
4832        }
4833    }
4834
4835    unsafe impl<D: fidl::encoding::ResourceDialect>
4836        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>
4837        for &BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4838    {
4839        #[inline]
4840        unsafe fn encode(
4841            self,
4842            encoder: &mut fidl::encoding::Encoder<'_, D>,
4843            offset: usize,
4844            _depth: fidl::encoding::Depth,
4845        ) -> fidl::Result<()> {
4846            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4847            // Delegate to tuple encoding.
4848            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>::encode(
4849                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4850                encoder,
4851                offset,
4852                _depth,
4853            )
4854        }
4855    }
4856    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4857        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D> for (T0,)
4858    {
4859        #[inline]
4860        unsafe fn encode(
4861            self,
4862            encoder: &mut fidl::encoding::Encoder<'_, D>,
4863            offset: usize,
4864            depth: fidl::encoding::Depth,
4865        ) -> fidl::Result<()> {
4866            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4867            // Zero out padding regions. There's no need to apply masks
4868            // because the unmasked parts will be overwritten by fields.
4869            // Write the fields.
4870            self.0.encode(encoder, offset + 0, depth)?;
4871            Ok(())
4872        }
4873    }
4874
4875    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4876        for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4877    {
4878        #[inline(always)]
4879        fn new_empty() -> Self {
4880            Self { value: fidl::new_empty!(bool, D) }
4881        }
4882
4883        #[inline]
4884        unsafe fn decode(
4885            &mut self,
4886            decoder: &mut fidl::encoding::Decoder<'_, D>,
4887            offset: usize,
4888            _depth: fidl::encoding::Depth,
4889        ) -> fidl::Result<()> {
4890            decoder.debug_check_bounds::<Self>(offset);
4891            // Verify that padding bytes are zero.
4892            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4893            Ok(())
4894        }
4895    }
4896
4897    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4898        type Borrowed<'a> = &'a Self;
4899        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4900            value
4901        }
4902    }
4903
4904    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4905        type Owned = Self;
4906
4907        #[inline(always)]
4908        fn inline_align(_context: fidl::encoding::Context) -> usize {
4909            1
4910        }
4911
4912        #[inline(always)]
4913        fn inline_size(_context: fidl::encoding::Context) -> usize {
4914            1
4915        }
4916    }
4917
4918    unsafe impl<D: fidl::encoding::ResourceDialect>
4919        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>
4920        for &BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4921    {
4922        #[inline]
4923        unsafe fn encode(
4924            self,
4925            encoder: &mut fidl::encoding::Encoder<'_, D>,
4926            offset: usize,
4927            _depth: fidl::encoding::Depth,
4928        ) -> fidl::Result<()> {
4929            encoder
4930                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4931            // Delegate to tuple encoding.
4932            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>::encode(
4933                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4934                encoder,
4935                offset,
4936                _depth,
4937            )
4938        }
4939    }
4940    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4941        fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D> for (T0,)
4942    {
4943        #[inline]
4944        unsafe fn encode(
4945            self,
4946            encoder: &mut fidl::encoding::Encoder<'_, D>,
4947            offset: usize,
4948            depth: fidl::encoding::Depth,
4949        ) -> fidl::Result<()> {
4950            encoder
4951                .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4952            // Zero out padding regions. There's no need to apply masks
4953            // because the unmasked parts will be overwritten by fields.
4954            // Write the fields.
4955            self.0.encode(encoder, offset + 0, depth)?;
4956            Ok(())
4957        }
4958    }
4959
4960    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4961        for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4962    {
4963        #[inline(always)]
4964        fn new_empty() -> Self {
4965            Self { value: fidl::new_empty!(bool, D) }
4966        }
4967
4968        #[inline]
4969        unsafe fn decode(
4970            &mut self,
4971            decoder: &mut fidl::encoding::Decoder<'_, D>,
4972            offset: usize,
4973            _depth: fidl::encoding::Depth,
4974        ) -> fidl::Result<()> {
4975            decoder.debug_check_bounds::<Self>(offset);
4976            // Verify that padding bytes are zero.
4977            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4978            Ok(())
4979        }
4980    }
4981
4982    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4983        type Borrowed<'a> = &'a Self;
4984        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4985            value
4986        }
4987    }
4988
4989    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4990        type Owned = Self;
4991
4992        #[inline(always)]
4993        fn inline_align(_context: fidl::encoding::Context) -> usize {
4994            8
4995        }
4996
4997        #[inline(always)]
4998        fn inline_size(_context: fidl::encoding::Context) -> usize {
4999            16
5000        }
5001    }
5002
5003    unsafe impl<D: fidl::encoding::ResourceDialect>
5004        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D>
5005        for &BaseNetworkSocketSetIpv6TrafficClassRequest
5006    {
5007        #[inline]
5008        unsafe fn encode(
5009            self,
5010            encoder: &mut fidl::encoding::Encoder<'_, D>,
5011            offset: usize,
5012            _depth: fidl::encoding::Depth,
5013        ) -> fidl::Result<()> {
5014            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
5015            // Delegate to tuple encoding.
5016            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6TrafficClassRequest, D>::encode(
5017                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5018                encoder,
5019                offset,
5020                _depth,
5021            )
5022        }
5023    }
5024    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
5025        fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D> for (T0,)
5026    {
5027        #[inline]
5028        unsafe fn encode(
5029            self,
5030            encoder: &mut fidl::encoding::Encoder<'_, D>,
5031            offset: usize,
5032            depth: fidl::encoding::Depth,
5033        ) -> fidl::Result<()> {
5034            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
5035            // Zero out padding regions. There's no need to apply masks
5036            // because the unmasked parts will be overwritten by fields.
5037            // Write the fields.
5038            self.0.encode(encoder, offset + 0, depth)?;
5039            Ok(())
5040        }
5041    }
5042
5043    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5044        for BaseNetworkSocketSetIpv6TrafficClassRequest
5045    {
5046        #[inline(always)]
5047        fn new_empty() -> Self {
5048            Self { value: fidl::new_empty!(OptionalUint8, D) }
5049        }
5050
5051        #[inline]
5052        unsafe fn decode(
5053            &mut self,
5054            decoder: &mut fidl::encoding::Decoder<'_, D>,
5055            offset: usize,
5056            _depth: fidl::encoding::Depth,
5057        ) -> fidl::Result<()> {
5058            decoder.debug_check_bounds::<Self>(offset);
5059            // Verify that padding bytes are zero.
5060            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
5061            Ok(())
5062        }
5063    }
5064
5065    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
5066        type Borrowed<'a> = &'a Self;
5067        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5068            value
5069        }
5070    }
5071
5072    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
5073        type Owned = Self;
5074
5075        #[inline(always)]
5076        fn inline_align(_context: fidl::encoding::Context) -> usize {
5077            8
5078        }
5079
5080        #[inline(always)]
5081        fn inline_size(_context: fidl::encoding::Context) -> usize {
5082            16
5083        }
5084    }
5085
5086    unsafe impl<D: fidl::encoding::ResourceDialect>
5087        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>
5088        for &BaseNetworkSocketSetIpv6UnicastHopsRequest
5089    {
5090        #[inline]
5091        unsafe fn encode(
5092            self,
5093            encoder: &mut fidl::encoding::Encoder<'_, D>,
5094            offset: usize,
5095            _depth: fidl::encoding::Depth,
5096        ) -> fidl::Result<()> {
5097            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
5098            // Delegate to tuple encoding.
5099            fidl::encoding::Encode::<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>::encode(
5100                (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5101                encoder,
5102                offset,
5103                _depth,
5104            )
5105        }
5106    }
5107    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
5108        fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D> for (T0,)
5109    {
5110        #[inline]
5111        unsafe fn encode(
5112            self,
5113            encoder: &mut fidl::encoding::Encoder<'_, D>,
5114            offset: usize,
5115            depth: fidl::encoding::Depth,
5116        ) -> fidl::Result<()> {
5117            encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
5118            // Zero out padding regions. There's no need to apply masks
5119            // because the unmasked parts will be overwritten by fields.
5120            // Write the fields.
5121            self.0.encode(encoder, offset + 0, depth)?;
5122            Ok(())
5123        }
5124    }
5125
5126    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5127        for BaseNetworkSocketSetIpv6UnicastHopsRequest
5128    {
5129        #[inline(always)]
5130        fn new_empty() -> Self {
5131            Self { value: fidl::new_empty!(OptionalUint8, D) }
5132        }
5133
5134        #[inline]
5135        unsafe fn decode(
5136            &mut self,
5137            decoder: &mut fidl::encoding::Decoder<'_, D>,
5138            offset: usize,
5139            _depth: fidl::encoding::Depth,
5140        ) -> fidl::Result<()> {
5141            decoder.debug_check_bounds::<Self>(offset);
5142            // Verify that padding bytes are zero.
5143            fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
5144            Ok(())
5145        }
5146    }
5147
5148    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketShutdownRequest {
5149        type Borrowed<'a> = &'a Self;
5150        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5151            value
5152        }
5153    }
5154
5155    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketShutdownRequest {
5156        type Owned = Self;
5157
5158        #[inline(always)]
5159        fn inline_align(_context: fidl::encoding::Context) -> usize {
5160            2
5161        }
5162
5163        #[inline(always)]
5164        fn inline_size(_context: fidl::encoding::Context) -> usize {
5165            2
5166        }
5167    }
5168
5169    unsafe impl<D: fidl::encoding::ResourceDialect>
5170        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D>
5171        for &BaseNetworkSocketShutdownRequest
5172    {
5173        #[inline]
5174        unsafe fn encode(
5175            self,
5176            encoder: &mut fidl::encoding::Encoder<'_, D>,
5177            offset: usize,
5178            _depth: fidl::encoding::Depth,
5179        ) -> fidl::Result<()> {
5180            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5181            // Delegate to tuple encoding.
5182            fidl::encoding::Encode::<BaseNetworkSocketShutdownRequest, D>::encode(
5183                (<ShutdownMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
5184                encoder,
5185                offset,
5186                _depth,
5187            )
5188        }
5189    }
5190    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ShutdownMode, D>>
5191        fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D> for (T0,)
5192    {
5193        #[inline]
5194        unsafe fn encode(
5195            self,
5196            encoder: &mut fidl::encoding::Encoder<'_, D>,
5197            offset: usize,
5198            depth: fidl::encoding::Depth,
5199        ) -> fidl::Result<()> {
5200            encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5201            // Zero out padding regions. There's no need to apply masks
5202            // because the unmasked parts will be overwritten by fields.
5203            // Write the fields.
5204            self.0.encode(encoder, offset + 0, depth)?;
5205            Ok(())
5206        }
5207    }
5208
5209    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5210        for BaseNetworkSocketShutdownRequest
5211    {
5212        #[inline(always)]
5213        fn new_empty() -> Self {
5214            Self { mode: fidl::new_empty!(ShutdownMode, D) }
5215        }
5216
5217        #[inline]
5218        unsafe fn decode(
5219            &mut self,
5220            decoder: &mut fidl::encoding::Decoder<'_, D>,
5221            offset: usize,
5222            _depth: fidl::encoding::Depth,
5223        ) -> fidl::Result<()> {
5224            decoder.debug_check_bounds::<Self>(offset);
5225            // Verify that padding bytes are zero.
5226            fidl::decode!(ShutdownMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
5227            Ok(())
5228        }
5229    }
5230
5231    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5232        type Borrowed<'a> = &'a Self;
5233        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5234            value
5235        }
5236    }
5237
5238    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5239        type Owned = Self;
5240
5241        #[inline(always)]
5242        fn inline_align(_context: fidl::encoding::Context) -> usize {
5243            1
5244        }
5245
5246        #[inline(always)]
5247        fn inline_size(_context: fidl::encoding::Context) -> usize {
5248            4
5249        }
5250    }
5251
5252    unsafe impl<D: fidl::encoding::ResourceDialect>
5253        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>
5254        for &BaseNetworkSocketGetIpMulticastInterfaceResponse
5255    {
5256        #[inline]
5257        unsafe fn encode(
5258            self,
5259            encoder: &mut fidl::encoding::Encoder<'_, D>,
5260            offset: usize,
5261            _depth: fidl::encoding::Depth,
5262        ) -> fidl::Result<()> {
5263            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5264            // Delegate to tuple encoding.
5265            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>::encode(
5266                (
5267                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5268                ),
5269                encoder, offset, _depth
5270            )
5271        }
5272    }
5273    unsafe impl<
5274        D: fidl::encoding::ResourceDialect,
5275        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
5276    > fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D> for (T0,)
5277    {
5278        #[inline]
5279        unsafe fn encode(
5280            self,
5281            encoder: &mut fidl::encoding::Encoder<'_, D>,
5282            offset: usize,
5283            depth: fidl::encoding::Depth,
5284        ) -> fidl::Result<()> {
5285            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5286            // Zero out padding regions. There's no need to apply masks
5287            // because the unmasked parts will be overwritten by fields.
5288            // Write the fields.
5289            self.0.encode(encoder, offset + 0, depth)?;
5290            Ok(())
5291        }
5292    }
5293
5294    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5295        for BaseNetworkSocketGetIpMulticastInterfaceResponse
5296    {
5297        #[inline(always)]
5298        fn new_empty() -> Self {
5299            Self { value: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D) }
5300        }
5301
5302        #[inline]
5303        unsafe fn decode(
5304            &mut self,
5305            decoder: &mut fidl::encoding::Decoder<'_, D>,
5306            offset: usize,
5307            _depth: fidl::encoding::Depth,
5308        ) -> fidl::Result<()> {
5309            decoder.debug_check_bounds::<Self>(offset);
5310            // Verify that padding bytes are zero.
5311            fidl::decode!(
5312                fidl_fuchsia_net_common::Ipv4Address,
5313                D,
5314                &mut self.value,
5315                decoder,
5316                offset + 0,
5317                _depth
5318            )?;
5319            Ok(())
5320        }
5321    }
5322
5323    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5324        type Borrowed<'a> = &'a Self;
5325        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5326            value
5327        }
5328    }
5329
5330    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5331        type Owned = Self;
5332
5333        #[inline(always)]
5334        fn inline_align(_context: fidl::encoding::Context) -> usize {
5335            1
5336        }
5337
5338        #[inline(always)]
5339        fn inline_size(_context: fidl::encoding::Context) -> usize {
5340            1
5341        }
5342    }
5343
5344    unsafe impl<D: fidl::encoding::ResourceDialect>
5345        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>
5346        for &BaseNetworkSocketGetIpMulticastLoopbackResponse
5347    {
5348        #[inline]
5349        unsafe fn encode(
5350            self,
5351            encoder: &mut fidl::encoding::Encoder<'_, D>,
5352            offset: usize,
5353            _depth: fidl::encoding::Depth,
5354        ) -> fidl::Result<()> {
5355            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5356            // Delegate to tuple encoding.
5357            fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>::encode(
5358                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5359                encoder,
5360                offset,
5361                _depth,
5362            )
5363        }
5364    }
5365    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5366        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D> for (T0,)
5367    {
5368        #[inline]
5369        unsafe fn encode(
5370            self,
5371            encoder: &mut fidl::encoding::Encoder<'_, D>,
5372            offset: usize,
5373            depth: fidl::encoding::Depth,
5374        ) -> fidl::Result<()> {
5375            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5376            // Zero out padding regions. There's no need to apply masks
5377            // because the unmasked parts will be overwritten by fields.
5378            // Write the fields.
5379            self.0.encode(encoder, offset + 0, depth)?;
5380            Ok(())
5381        }
5382    }
5383
5384    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5385        for BaseNetworkSocketGetIpMulticastLoopbackResponse
5386    {
5387        #[inline(always)]
5388        fn new_empty() -> Self {
5389            Self { value: fidl::new_empty!(bool, D) }
5390        }
5391
5392        #[inline]
5393        unsafe fn decode(
5394            &mut self,
5395            decoder: &mut fidl::encoding::Decoder<'_, D>,
5396            offset: usize,
5397            _depth: fidl::encoding::Depth,
5398        ) -> fidl::Result<()> {
5399            decoder.debug_check_bounds::<Self>(offset);
5400            // Verify that padding bytes are zero.
5401            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5402            Ok(())
5403        }
5404    }
5405
5406    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5407        type Borrowed<'a> = &'a Self;
5408        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5409            value
5410        }
5411    }
5412
5413    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5414        type Owned = Self;
5415
5416        #[inline(always)]
5417        fn inline_align(_context: fidl::encoding::Context) -> usize {
5418            1
5419        }
5420
5421        #[inline(always)]
5422        fn inline_size(_context: fidl::encoding::Context) -> usize {
5423            1
5424        }
5425        #[inline(always)]
5426        fn encode_is_copy() -> bool {
5427            true
5428        }
5429
5430        #[inline(always)]
5431        fn decode_is_copy() -> bool {
5432            true
5433        }
5434    }
5435
5436    unsafe impl<D: fidl::encoding::ResourceDialect>
5437        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D>
5438        for &BaseNetworkSocketGetIpMulticastTtlResponse
5439    {
5440        #[inline]
5441        unsafe fn encode(
5442            self,
5443            encoder: &mut fidl::encoding::Encoder<'_, D>,
5444            offset: usize,
5445            _depth: fidl::encoding::Depth,
5446        ) -> fidl::Result<()> {
5447            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5448            unsafe {
5449                // Copy the object into the buffer.
5450                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5451                (buf_ptr as *mut BaseNetworkSocketGetIpMulticastTtlResponse).write_unaligned(
5452                    (self as *const BaseNetworkSocketGetIpMulticastTtlResponse).read(),
5453                );
5454                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5455                // done second because the memcpy will write garbage to these bytes.
5456            }
5457            Ok(())
5458        }
5459    }
5460    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5461        fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D> for (T0,)
5462    {
5463        #[inline]
5464        unsafe fn encode(
5465            self,
5466            encoder: &mut fidl::encoding::Encoder<'_, D>,
5467            offset: usize,
5468            depth: fidl::encoding::Depth,
5469        ) -> fidl::Result<()> {
5470            encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5471            // Zero out padding regions. There's no need to apply masks
5472            // because the unmasked parts will be overwritten by fields.
5473            // Write the fields.
5474            self.0.encode(encoder, offset + 0, depth)?;
5475            Ok(())
5476        }
5477    }
5478
5479    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5480        for BaseNetworkSocketGetIpMulticastTtlResponse
5481    {
5482        #[inline(always)]
5483        fn new_empty() -> Self {
5484            Self { value: fidl::new_empty!(u8, D) }
5485        }
5486
5487        #[inline]
5488        unsafe fn decode(
5489            &mut self,
5490            decoder: &mut fidl::encoding::Decoder<'_, D>,
5491            offset: usize,
5492            _depth: fidl::encoding::Depth,
5493        ) -> fidl::Result<()> {
5494            decoder.debug_check_bounds::<Self>(offset);
5495            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5496            // Verify that padding bytes are zero.
5497            // Copy from the buffer into the object.
5498            unsafe {
5499                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5500            }
5501            Ok(())
5502        }
5503    }
5504
5505    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5506        type Borrowed<'a> = &'a Self;
5507        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5508            value
5509        }
5510    }
5511
5512    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5513        type Owned = Self;
5514
5515        #[inline(always)]
5516        fn inline_align(_context: fidl::encoding::Context) -> usize {
5517            1
5518        }
5519
5520        #[inline(always)]
5521        fn inline_size(_context: fidl::encoding::Context) -> usize {
5522            1
5523        }
5524    }
5525
5526    unsafe impl<D: fidl::encoding::ResourceDialect>
5527        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D>
5528        for &BaseNetworkSocketGetIpPacketInfoResponse
5529    {
5530        #[inline]
5531        unsafe fn encode(
5532            self,
5533            encoder: &mut fidl::encoding::Encoder<'_, D>,
5534            offset: usize,
5535            _depth: fidl::encoding::Depth,
5536        ) -> fidl::Result<()> {
5537            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5538            // Delegate to tuple encoding.
5539            fidl::encoding::Encode::<BaseNetworkSocketGetIpPacketInfoResponse, D>::encode(
5540                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5541                encoder,
5542                offset,
5543                _depth,
5544            )
5545        }
5546    }
5547    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5548        fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D> for (T0,)
5549    {
5550        #[inline]
5551        unsafe fn encode(
5552            self,
5553            encoder: &mut fidl::encoding::Encoder<'_, D>,
5554            offset: usize,
5555            depth: fidl::encoding::Depth,
5556        ) -> fidl::Result<()> {
5557            encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5558            // Zero out padding regions. There's no need to apply masks
5559            // because the unmasked parts will be overwritten by fields.
5560            // Write the fields.
5561            self.0.encode(encoder, offset + 0, depth)?;
5562            Ok(())
5563        }
5564    }
5565
5566    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5567        for BaseNetworkSocketGetIpPacketInfoResponse
5568    {
5569        #[inline(always)]
5570        fn new_empty() -> Self {
5571            Self { value: fidl::new_empty!(bool, D) }
5572        }
5573
5574        #[inline]
5575        unsafe fn decode(
5576            &mut self,
5577            decoder: &mut fidl::encoding::Decoder<'_, D>,
5578            offset: usize,
5579            _depth: fidl::encoding::Depth,
5580        ) -> fidl::Result<()> {
5581            decoder.debug_check_bounds::<Self>(offset);
5582            // Verify that padding bytes are zero.
5583            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5584            Ok(())
5585        }
5586    }
5587
5588    impl fidl::encoding::ValueTypeMarker
5589        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5590    {
5591        type Borrowed<'a> = &'a Self;
5592        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5593            value
5594        }
5595    }
5596
5597    unsafe impl fidl::encoding::TypeMarker
5598        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5599    {
5600        type Owned = Self;
5601
5602        #[inline(always)]
5603        fn inline_align(_context: fidl::encoding::Context) -> usize {
5604            1
5605        }
5606
5607        #[inline(always)]
5608        fn inline_size(_context: fidl::encoding::Context) -> usize {
5609            1
5610        }
5611    }
5612
5613    unsafe impl<D: fidl::encoding::ResourceDialect>
5614        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5615        for &BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5616    {
5617        #[inline]
5618        unsafe fn encode(
5619            self,
5620            encoder: &mut fidl::encoding::Encoder<'_, D>,
5621            offset: usize,
5622            _depth: fidl::encoding::Depth,
5623        ) -> fidl::Result<()> {
5624            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5625            // Delegate to tuple encoding.
5626            fidl::encoding::Encode::<
5627                BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse,
5628                D,
5629            >::encode(
5630                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5631                encoder,
5632                offset,
5633                _depth,
5634            )
5635        }
5636    }
5637    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5638        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5639        for (T0,)
5640    {
5641        #[inline]
5642        unsafe fn encode(
5643            self,
5644            encoder: &mut fidl::encoding::Encoder<'_, D>,
5645            offset: usize,
5646            depth: fidl::encoding::Depth,
5647        ) -> fidl::Result<()> {
5648            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5649            // Zero out padding regions. There's no need to apply masks
5650            // because the unmasked parts will be overwritten by fields.
5651            // Write the fields.
5652            self.0.encode(encoder, offset + 0, depth)?;
5653            Ok(())
5654        }
5655    }
5656
5657    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5658        for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5659    {
5660        #[inline(always)]
5661        fn new_empty() -> Self {
5662            Self { value: fidl::new_empty!(bool, D) }
5663        }
5664
5665        #[inline]
5666        unsafe fn decode(
5667            &mut self,
5668            decoder: &mut fidl::encoding::Decoder<'_, D>,
5669            offset: usize,
5670            _depth: fidl::encoding::Depth,
5671        ) -> fidl::Result<()> {
5672            decoder.debug_check_bounds::<Self>(offset);
5673            // Verify that padding bytes are zero.
5674            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5675            Ok(())
5676        }
5677    }
5678
5679    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5680        type Borrowed<'a> = &'a Self;
5681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5682            value
5683        }
5684    }
5685
5686    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5687        type Owned = Self;
5688
5689        #[inline(always)]
5690        fn inline_align(_context: fidl::encoding::Context) -> usize {
5691            1
5692        }
5693
5694        #[inline(always)]
5695        fn inline_size(_context: fidl::encoding::Context) -> usize {
5696            1
5697        }
5698    }
5699
5700    unsafe impl<D: fidl::encoding::ResourceDialect>
5701        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D>
5702        for &BaseNetworkSocketGetIpReceiveTtlResponse
5703    {
5704        #[inline]
5705        unsafe fn encode(
5706            self,
5707            encoder: &mut fidl::encoding::Encoder<'_, D>,
5708            offset: usize,
5709            _depth: fidl::encoding::Depth,
5710        ) -> fidl::Result<()> {
5711            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5712            // Delegate to tuple encoding.
5713            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTtlResponse, D>::encode(
5714                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5715                encoder,
5716                offset,
5717                _depth,
5718            )
5719        }
5720    }
5721    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5722        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D> for (T0,)
5723    {
5724        #[inline]
5725        unsafe fn encode(
5726            self,
5727            encoder: &mut fidl::encoding::Encoder<'_, D>,
5728            offset: usize,
5729            depth: fidl::encoding::Depth,
5730        ) -> fidl::Result<()> {
5731            encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5732            // Zero out padding regions. There's no need to apply masks
5733            // because the unmasked parts will be overwritten by fields.
5734            // Write the fields.
5735            self.0.encode(encoder, offset + 0, depth)?;
5736            Ok(())
5737        }
5738    }
5739
5740    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5741        for BaseNetworkSocketGetIpReceiveTtlResponse
5742    {
5743        #[inline(always)]
5744        fn new_empty() -> Self {
5745            Self { value: fidl::new_empty!(bool, D) }
5746        }
5747
5748        #[inline]
5749        unsafe fn decode(
5750            &mut self,
5751            decoder: &mut fidl::encoding::Decoder<'_, D>,
5752            offset: usize,
5753            _depth: fidl::encoding::Depth,
5754        ) -> fidl::Result<()> {
5755            decoder.debug_check_bounds::<Self>(offset);
5756            // Verify that padding bytes are zero.
5757            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5758            Ok(())
5759        }
5760    }
5761
5762    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5763        type Borrowed<'a> = &'a Self;
5764        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5765            value
5766        }
5767    }
5768
5769    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5770        type Owned = Self;
5771
5772        #[inline(always)]
5773        fn inline_align(_context: fidl::encoding::Context) -> usize {
5774            1
5775        }
5776
5777        #[inline(always)]
5778        fn inline_size(_context: fidl::encoding::Context) -> usize {
5779            1
5780        }
5781    }
5782
5783    unsafe impl<D: fidl::encoding::ResourceDialect>
5784        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>
5785        for &BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5786    {
5787        #[inline]
5788        unsafe fn encode(
5789            self,
5790            encoder: &mut fidl::encoding::Encoder<'_, D>,
5791            offset: usize,
5792            _depth: fidl::encoding::Depth,
5793        ) -> fidl::Result<()> {
5794            encoder
5795                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5796            // Delegate to tuple encoding.
5797            fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>::encode(
5798                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5799                encoder,
5800                offset,
5801                _depth,
5802            )
5803        }
5804    }
5805    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5806        fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D> for (T0,)
5807    {
5808        #[inline]
5809        unsafe fn encode(
5810            self,
5811            encoder: &mut fidl::encoding::Encoder<'_, D>,
5812            offset: usize,
5813            depth: fidl::encoding::Depth,
5814        ) -> fidl::Result<()> {
5815            encoder
5816                .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5817            // Zero out padding regions. There's no need to apply masks
5818            // because the unmasked parts will be overwritten by fields.
5819            // Write the fields.
5820            self.0.encode(encoder, offset + 0, depth)?;
5821            Ok(())
5822        }
5823    }
5824
5825    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5826        for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5827    {
5828        #[inline(always)]
5829        fn new_empty() -> Self {
5830            Self { value: fidl::new_empty!(bool, D) }
5831        }
5832
5833        #[inline]
5834        unsafe fn decode(
5835            &mut self,
5836            decoder: &mut fidl::encoding::Decoder<'_, D>,
5837            offset: usize,
5838            _depth: fidl::encoding::Depth,
5839        ) -> fidl::Result<()> {
5840            decoder.debug_check_bounds::<Self>(offset);
5841            // Verify that padding bytes are zero.
5842            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5843            Ok(())
5844        }
5845    }
5846
5847    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5848        type Borrowed<'a> = &'a Self;
5849        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5850            value
5851        }
5852    }
5853
5854    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5855        type Owned = Self;
5856
5857        #[inline(always)]
5858        fn inline_align(_context: fidl::encoding::Context) -> usize {
5859            1
5860        }
5861
5862        #[inline(always)]
5863        fn inline_size(_context: fidl::encoding::Context) -> usize {
5864            1
5865        }
5866    }
5867
5868    unsafe impl<D: fidl::encoding::ResourceDialect>
5869        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D>
5870        for &BaseNetworkSocketGetIpTransparentResponse
5871    {
5872        #[inline]
5873        unsafe fn encode(
5874            self,
5875            encoder: &mut fidl::encoding::Encoder<'_, D>,
5876            offset: usize,
5877            _depth: fidl::encoding::Depth,
5878        ) -> fidl::Result<()> {
5879            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5880            // Delegate to tuple encoding.
5881            fidl::encoding::Encode::<BaseNetworkSocketGetIpTransparentResponse, D>::encode(
5882                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5883                encoder,
5884                offset,
5885                _depth,
5886            )
5887        }
5888    }
5889    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5890        fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D> for (T0,)
5891    {
5892        #[inline]
5893        unsafe fn encode(
5894            self,
5895            encoder: &mut fidl::encoding::Encoder<'_, D>,
5896            offset: usize,
5897            depth: fidl::encoding::Depth,
5898        ) -> fidl::Result<()> {
5899            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5900            // Zero out padding regions. There's no need to apply masks
5901            // because the unmasked parts will be overwritten by fields.
5902            // Write the fields.
5903            self.0.encode(encoder, offset + 0, depth)?;
5904            Ok(())
5905        }
5906    }
5907
5908    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5909        for BaseNetworkSocketGetIpTransparentResponse
5910    {
5911        #[inline(always)]
5912        fn new_empty() -> Self {
5913            Self { value: fidl::new_empty!(bool, D) }
5914        }
5915
5916        #[inline]
5917        unsafe fn decode(
5918            &mut self,
5919            decoder: &mut fidl::encoding::Decoder<'_, D>,
5920            offset: usize,
5921            _depth: fidl::encoding::Depth,
5922        ) -> fidl::Result<()> {
5923            decoder.debug_check_bounds::<Self>(offset);
5924            // Verify that padding bytes are zero.
5925            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5926            Ok(())
5927        }
5928    }
5929
5930    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTtlResponse {
5931        type Borrowed<'a> = &'a Self;
5932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5933            value
5934        }
5935    }
5936
5937    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTtlResponse {
5938        type Owned = Self;
5939
5940        #[inline(always)]
5941        fn inline_align(_context: fidl::encoding::Context) -> usize {
5942            1
5943        }
5944
5945        #[inline(always)]
5946        fn inline_size(_context: fidl::encoding::Context) -> usize {
5947            1
5948        }
5949        #[inline(always)]
5950        fn encode_is_copy() -> bool {
5951            true
5952        }
5953
5954        #[inline(always)]
5955        fn decode_is_copy() -> bool {
5956            true
5957        }
5958    }
5959
5960    unsafe impl<D: fidl::encoding::ResourceDialect>
5961        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D>
5962        for &BaseNetworkSocketGetIpTtlResponse
5963    {
5964        #[inline]
5965        unsafe fn encode(
5966            self,
5967            encoder: &mut fidl::encoding::Encoder<'_, D>,
5968            offset: usize,
5969            _depth: fidl::encoding::Depth,
5970        ) -> fidl::Result<()> {
5971            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5972            unsafe {
5973                // Copy the object into the buffer.
5974                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5975                (buf_ptr as *mut BaseNetworkSocketGetIpTtlResponse)
5976                    .write_unaligned((self as *const BaseNetworkSocketGetIpTtlResponse).read());
5977                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5978                // done second because the memcpy will write garbage to these bytes.
5979            }
5980            Ok(())
5981        }
5982    }
5983    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5984        fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D> for (T0,)
5985    {
5986        #[inline]
5987        unsafe fn encode(
5988            self,
5989            encoder: &mut fidl::encoding::Encoder<'_, D>,
5990            offset: usize,
5991            depth: fidl::encoding::Depth,
5992        ) -> fidl::Result<()> {
5993            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5994            // Zero out padding regions. There's no need to apply masks
5995            // because the unmasked parts will be overwritten by fields.
5996            // Write the fields.
5997            self.0.encode(encoder, offset + 0, depth)?;
5998            Ok(())
5999        }
6000    }
6001
6002    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6003        for BaseNetworkSocketGetIpTtlResponse
6004    {
6005        #[inline(always)]
6006        fn new_empty() -> Self {
6007            Self { value: fidl::new_empty!(u8, D) }
6008        }
6009
6010        #[inline]
6011        unsafe fn decode(
6012            &mut self,
6013            decoder: &mut fidl::encoding::Decoder<'_, D>,
6014            offset: usize,
6015            _depth: fidl::encoding::Depth,
6016        ) -> fidl::Result<()> {
6017            decoder.debug_check_bounds::<Self>(offset);
6018            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6019            // Verify that padding bytes are zero.
6020            // Copy from the buffer into the object.
6021            unsafe {
6022                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6023            }
6024            Ok(())
6025        }
6026    }
6027
6028    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
6029        type Borrowed<'a> = &'a Self;
6030        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6031            value
6032        }
6033    }
6034
6035    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
6036        type Owned = Self;
6037
6038        #[inline(always)]
6039        fn inline_align(_context: fidl::encoding::Context) -> usize {
6040            1
6041        }
6042
6043        #[inline(always)]
6044        fn inline_size(_context: fidl::encoding::Context) -> usize {
6045            1
6046        }
6047        #[inline(always)]
6048        fn encode_is_copy() -> bool {
6049            true
6050        }
6051
6052        #[inline(always)]
6053        fn decode_is_copy() -> bool {
6054            true
6055        }
6056    }
6057
6058    unsafe impl<D: fidl::encoding::ResourceDialect>
6059        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D>
6060        for &BaseNetworkSocketGetIpTypeOfServiceResponse
6061    {
6062        #[inline]
6063        unsafe fn encode(
6064            self,
6065            encoder: &mut fidl::encoding::Encoder<'_, D>,
6066            offset: usize,
6067            _depth: fidl::encoding::Depth,
6068        ) -> fidl::Result<()> {
6069            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
6070            unsafe {
6071                // Copy the object into the buffer.
6072                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6073                (buf_ptr as *mut BaseNetworkSocketGetIpTypeOfServiceResponse).write_unaligned(
6074                    (self as *const BaseNetworkSocketGetIpTypeOfServiceResponse).read(),
6075                );
6076                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6077                // done second because the memcpy will write garbage to these bytes.
6078            }
6079            Ok(())
6080        }
6081    }
6082    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6083        fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D> for (T0,)
6084    {
6085        #[inline]
6086        unsafe fn encode(
6087            self,
6088            encoder: &mut fidl::encoding::Encoder<'_, D>,
6089            offset: usize,
6090            depth: fidl::encoding::Depth,
6091        ) -> fidl::Result<()> {
6092            encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
6093            // Zero out padding regions. There's no need to apply masks
6094            // because the unmasked parts will be overwritten by fields.
6095            // Write the fields.
6096            self.0.encode(encoder, offset + 0, depth)?;
6097            Ok(())
6098        }
6099    }
6100
6101    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6102        for BaseNetworkSocketGetIpTypeOfServiceResponse
6103    {
6104        #[inline(always)]
6105        fn new_empty() -> Self {
6106            Self { value: fidl::new_empty!(u8, D) }
6107        }
6108
6109        #[inline]
6110        unsafe fn decode(
6111            &mut self,
6112            decoder: &mut fidl::encoding::Decoder<'_, D>,
6113            offset: usize,
6114            _depth: fidl::encoding::Depth,
6115        ) -> fidl::Result<()> {
6116            decoder.debug_check_bounds::<Self>(offset);
6117            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6118            // Verify that padding bytes are zero.
6119            // Copy from the buffer into the object.
6120            unsafe {
6121                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6122            }
6123            Ok(())
6124        }
6125    }
6126
6127    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
6128        type Borrowed<'a> = &'a Self;
6129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6130            value
6131        }
6132    }
6133
6134    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
6135        type Owned = Self;
6136
6137        #[inline(always)]
6138        fn inline_align(_context: fidl::encoding::Context) -> usize {
6139            1
6140        }
6141
6142        #[inline(always)]
6143        fn inline_size(_context: fidl::encoding::Context) -> usize {
6144            1
6145        }
6146        #[inline(always)]
6147        fn encode_is_copy() -> bool {
6148            true
6149        }
6150
6151        #[inline(always)]
6152        fn decode_is_copy() -> bool {
6153            true
6154        }
6155    }
6156
6157    unsafe impl<D: fidl::encoding::ResourceDialect>
6158        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D>
6159        for &BaseNetworkSocketGetIpv6MulticastHopsResponse
6160    {
6161        #[inline]
6162        unsafe fn encode(
6163            self,
6164            encoder: &mut fidl::encoding::Encoder<'_, D>,
6165            offset: usize,
6166            _depth: fidl::encoding::Depth,
6167        ) -> fidl::Result<()> {
6168            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6169            unsafe {
6170                // Copy the object into the buffer.
6171                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6172                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastHopsResponse).write_unaligned(
6173                    (self as *const BaseNetworkSocketGetIpv6MulticastHopsResponse).read(),
6174                );
6175                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6176                // done second because the memcpy will write garbage to these bytes.
6177            }
6178            Ok(())
6179        }
6180    }
6181    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6182        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D> for (T0,)
6183    {
6184        #[inline]
6185        unsafe fn encode(
6186            self,
6187            encoder: &mut fidl::encoding::Encoder<'_, D>,
6188            offset: usize,
6189            depth: fidl::encoding::Depth,
6190        ) -> fidl::Result<()> {
6191            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6192            // Zero out padding regions. There's no need to apply masks
6193            // because the unmasked parts will be overwritten by fields.
6194            // Write the fields.
6195            self.0.encode(encoder, offset + 0, depth)?;
6196            Ok(())
6197        }
6198    }
6199
6200    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6201        for BaseNetworkSocketGetIpv6MulticastHopsResponse
6202    {
6203        #[inline(always)]
6204        fn new_empty() -> Self {
6205            Self { value: fidl::new_empty!(u8, D) }
6206        }
6207
6208        #[inline]
6209        unsafe fn decode(
6210            &mut self,
6211            decoder: &mut fidl::encoding::Decoder<'_, D>,
6212            offset: usize,
6213            _depth: fidl::encoding::Depth,
6214        ) -> fidl::Result<()> {
6215            decoder.debug_check_bounds::<Self>(offset);
6216            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6217            // Verify that padding bytes are zero.
6218            // Copy from the buffer into the object.
6219            unsafe {
6220                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6221            }
6222            Ok(())
6223        }
6224    }
6225
6226    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6227        type Borrowed<'a> = &'a Self;
6228        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6229            value
6230        }
6231    }
6232
6233    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6234        type Owned = Self;
6235
6236        #[inline(always)]
6237        fn inline_align(_context: fidl::encoding::Context) -> usize {
6238            8
6239        }
6240
6241        #[inline(always)]
6242        fn inline_size(_context: fidl::encoding::Context) -> usize {
6243            8
6244        }
6245        #[inline(always)]
6246        fn encode_is_copy() -> bool {
6247            true
6248        }
6249
6250        #[inline(always)]
6251        fn decode_is_copy() -> bool {
6252            true
6253        }
6254    }
6255
6256    unsafe impl<D: fidl::encoding::ResourceDialect>
6257        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D>
6258        for &BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6259    {
6260        #[inline]
6261        unsafe fn encode(
6262            self,
6263            encoder: &mut fidl::encoding::Encoder<'_, D>,
6264            offset: usize,
6265            _depth: fidl::encoding::Depth,
6266        ) -> fidl::Result<()> {
6267            encoder
6268                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6269            unsafe {
6270                // Copy the object into the buffer.
6271                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6272                (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastInterfaceResponse)
6273                    .write_unaligned(
6274                        (self as *const BaseNetworkSocketGetIpv6MulticastInterfaceResponse).read(),
6275                    );
6276                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6277                // done second because the memcpy will write garbage to these bytes.
6278            }
6279            Ok(())
6280        }
6281    }
6282    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6283        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D> for (T0,)
6284    {
6285        #[inline]
6286        unsafe fn encode(
6287            self,
6288            encoder: &mut fidl::encoding::Encoder<'_, D>,
6289            offset: usize,
6290            depth: fidl::encoding::Depth,
6291        ) -> fidl::Result<()> {
6292            encoder
6293                .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6294            // Zero out padding regions. There's no need to apply masks
6295            // because the unmasked parts will be overwritten by fields.
6296            // Write the fields.
6297            self.0.encode(encoder, offset + 0, depth)?;
6298            Ok(())
6299        }
6300    }
6301
6302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6303        for BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6304    {
6305        #[inline(always)]
6306        fn new_empty() -> Self {
6307            Self { value: fidl::new_empty!(u64, D) }
6308        }
6309
6310        #[inline]
6311        unsafe fn decode(
6312            &mut self,
6313            decoder: &mut fidl::encoding::Decoder<'_, D>,
6314            offset: usize,
6315            _depth: fidl::encoding::Depth,
6316        ) -> fidl::Result<()> {
6317            decoder.debug_check_bounds::<Self>(offset);
6318            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6319            // Verify that padding bytes are zero.
6320            // Copy from the buffer into the object.
6321            unsafe {
6322                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6323            }
6324            Ok(())
6325        }
6326    }
6327
6328    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6329        type Borrowed<'a> = &'a Self;
6330        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6331            value
6332        }
6333    }
6334
6335    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6336        type Owned = Self;
6337
6338        #[inline(always)]
6339        fn inline_align(_context: fidl::encoding::Context) -> usize {
6340            1
6341        }
6342
6343        #[inline(always)]
6344        fn inline_size(_context: fidl::encoding::Context) -> usize {
6345            1
6346        }
6347    }
6348
6349    unsafe impl<D: fidl::encoding::ResourceDialect>
6350        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>
6351        for &BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6352    {
6353        #[inline]
6354        unsafe fn encode(
6355            self,
6356            encoder: &mut fidl::encoding::Encoder<'_, D>,
6357            offset: usize,
6358            _depth: fidl::encoding::Depth,
6359        ) -> fidl::Result<()> {
6360            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6361            // Delegate to tuple encoding.
6362            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>::encode(
6363                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6364                encoder,
6365                offset,
6366                _depth,
6367            )
6368        }
6369    }
6370    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6371        fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D> for (T0,)
6372    {
6373        #[inline]
6374        unsafe fn encode(
6375            self,
6376            encoder: &mut fidl::encoding::Encoder<'_, D>,
6377            offset: usize,
6378            depth: fidl::encoding::Depth,
6379        ) -> fidl::Result<()> {
6380            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6381            // Zero out padding regions. There's no need to apply masks
6382            // because the unmasked parts will be overwritten by fields.
6383            // Write the fields.
6384            self.0.encode(encoder, offset + 0, depth)?;
6385            Ok(())
6386        }
6387    }
6388
6389    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6390        for BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6391    {
6392        #[inline(always)]
6393        fn new_empty() -> Self {
6394            Self { value: fidl::new_empty!(bool, D) }
6395        }
6396
6397        #[inline]
6398        unsafe fn decode(
6399            &mut self,
6400            decoder: &mut fidl::encoding::Decoder<'_, D>,
6401            offset: usize,
6402            _depth: fidl::encoding::Depth,
6403        ) -> fidl::Result<()> {
6404            decoder.debug_check_bounds::<Self>(offset);
6405            // Verify that padding bytes are zero.
6406            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6407            Ok(())
6408        }
6409    }
6410
6411    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6412        type Borrowed<'a> = &'a Self;
6413        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6414            value
6415        }
6416    }
6417
6418    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
6419        type Owned = Self;
6420
6421        #[inline(always)]
6422        fn inline_align(_context: fidl::encoding::Context) -> usize {
6423            1
6424        }
6425
6426        #[inline(always)]
6427        fn inline_size(_context: fidl::encoding::Context) -> usize {
6428            1
6429        }
6430    }
6431
6432    unsafe impl<D: fidl::encoding::ResourceDialect>
6433        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D>
6434        for &BaseNetworkSocketGetIpv6OnlyResponse
6435    {
6436        #[inline]
6437        unsafe fn encode(
6438            self,
6439            encoder: &mut fidl::encoding::Encoder<'_, D>,
6440            offset: usize,
6441            _depth: fidl::encoding::Depth,
6442        ) -> fidl::Result<()> {
6443            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6444            // Delegate to tuple encoding.
6445            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6OnlyResponse, D>::encode(
6446                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6447                encoder,
6448                offset,
6449                _depth,
6450            )
6451        }
6452    }
6453    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6454        fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D> for (T0,)
6455    {
6456        #[inline]
6457        unsafe fn encode(
6458            self,
6459            encoder: &mut fidl::encoding::Encoder<'_, D>,
6460            offset: usize,
6461            depth: fidl::encoding::Depth,
6462        ) -> fidl::Result<()> {
6463            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6464            // Zero out padding regions. There's no need to apply masks
6465            // because the unmasked parts will be overwritten by fields.
6466            // Write the fields.
6467            self.0.encode(encoder, offset + 0, depth)?;
6468            Ok(())
6469        }
6470    }
6471
6472    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6473        for BaseNetworkSocketGetIpv6OnlyResponse
6474    {
6475        #[inline(always)]
6476        fn new_empty() -> Self {
6477            Self { value: fidl::new_empty!(bool, D) }
6478        }
6479
6480        #[inline]
6481        unsafe fn decode(
6482            &mut self,
6483            decoder: &mut fidl::encoding::Decoder<'_, D>,
6484            offset: usize,
6485            _depth: fidl::encoding::Depth,
6486        ) -> fidl::Result<()> {
6487            decoder.debug_check_bounds::<Self>(offset);
6488            // Verify that padding bytes are zero.
6489            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6490            Ok(())
6491        }
6492    }
6493
6494    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6495        type Borrowed<'a> = &'a Self;
6496        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6497            value
6498        }
6499    }
6500
6501    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6502        type Owned = Self;
6503
6504        #[inline(always)]
6505        fn inline_align(_context: fidl::encoding::Context) -> usize {
6506            1
6507        }
6508
6509        #[inline(always)]
6510        fn inline_size(_context: fidl::encoding::Context) -> usize {
6511            1
6512        }
6513    }
6514
6515    unsafe impl<D: fidl::encoding::ResourceDialect>
6516        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>
6517        for &BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6518    {
6519        #[inline]
6520        unsafe fn encode(
6521            self,
6522            encoder: &mut fidl::encoding::Encoder<'_, D>,
6523            offset: usize,
6524            _depth: fidl::encoding::Depth,
6525        ) -> fidl::Result<()> {
6526            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6527            // Delegate to tuple encoding.
6528            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>::encode(
6529                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6530                encoder,
6531                offset,
6532                _depth,
6533            )
6534        }
6535    }
6536    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6537        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D> for (T0,)
6538    {
6539        #[inline]
6540        unsafe fn encode(
6541            self,
6542            encoder: &mut fidl::encoding::Encoder<'_, D>,
6543            offset: usize,
6544            depth: fidl::encoding::Depth,
6545        ) -> fidl::Result<()> {
6546            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6547            // Zero out padding regions. There's no need to apply masks
6548            // because the unmasked parts will be overwritten by fields.
6549            // Write the fields.
6550            self.0.encode(encoder, offset + 0, depth)?;
6551            Ok(())
6552        }
6553    }
6554
6555    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6556        for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6557    {
6558        #[inline(always)]
6559        fn new_empty() -> Self {
6560            Self { value: fidl::new_empty!(bool, D) }
6561        }
6562
6563        #[inline]
6564        unsafe fn decode(
6565            &mut self,
6566            decoder: &mut fidl::encoding::Decoder<'_, D>,
6567            offset: usize,
6568            _depth: fidl::encoding::Depth,
6569        ) -> fidl::Result<()> {
6570            decoder.debug_check_bounds::<Self>(offset);
6571            // Verify that padding bytes are zero.
6572            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6573            Ok(())
6574        }
6575    }
6576
6577    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6578        type Borrowed<'a> = &'a Self;
6579        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6580            value
6581        }
6582    }
6583
6584    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6585        type Owned = Self;
6586
6587        #[inline(always)]
6588        fn inline_align(_context: fidl::encoding::Context) -> usize {
6589            1
6590        }
6591
6592        #[inline(always)]
6593        fn inline_size(_context: fidl::encoding::Context) -> usize {
6594            1
6595        }
6596    }
6597
6598    unsafe impl<D: fidl::encoding::ResourceDialect>
6599        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>
6600        for &BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6601    {
6602        #[inline]
6603        unsafe fn encode(
6604            self,
6605            encoder: &mut fidl::encoding::Encoder<'_, D>,
6606            offset: usize,
6607            _depth: fidl::encoding::Depth,
6608        ) -> fidl::Result<()> {
6609            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6610            // Delegate to tuple encoding.
6611            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>::encode(
6612                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6613                encoder,
6614                offset,
6615                _depth,
6616            )
6617        }
6618    }
6619    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6620        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D> for (T0,)
6621    {
6622        #[inline]
6623        unsafe fn encode(
6624            self,
6625            encoder: &mut fidl::encoding::Encoder<'_, D>,
6626            offset: usize,
6627            depth: fidl::encoding::Depth,
6628        ) -> fidl::Result<()> {
6629            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6630            // Zero out padding regions. There's no need to apply masks
6631            // because the unmasked parts will be overwritten by fields.
6632            // Write the fields.
6633            self.0.encode(encoder, offset + 0, depth)?;
6634            Ok(())
6635        }
6636    }
6637
6638    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6639        for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6640    {
6641        #[inline(always)]
6642        fn new_empty() -> Self {
6643            Self { value: fidl::new_empty!(bool, D) }
6644        }
6645
6646        #[inline]
6647        unsafe fn decode(
6648            &mut self,
6649            decoder: &mut fidl::encoding::Decoder<'_, D>,
6650            offset: usize,
6651            _depth: fidl::encoding::Depth,
6652        ) -> fidl::Result<()> {
6653            decoder.debug_check_bounds::<Self>(offset);
6654            // Verify that padding bytes are zero.
6655            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6656            Ok(())
6657        }
6658    }
6659
6660    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6661        type Borrowed<'a> = &'a Self;
6662        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6663            value
6664        }
6665    }
6666
6667    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6668        type Owned = Self;
6669
6670        #[inline(always)]
6671        fn inline_align(_context: fidl::encoding::Context) -> usize {
6672            1
6673        }
6674
6675        #[inline(always)]
6676        fn inline_size(_context: fidl::encoding::Context) -> usize {
6677            1
6678        }
6679    }
6680
6681    unsafe impl<D: fidl::encoding::ResourceDialect>
6682        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>
6683        for &BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6684    {
6685        #[inline]
6686        unsafe fn encode(
6687            self,
6688            encoder: &mut fidl::encoding::Encoder<'_, D>,
6689            offset: usize,
6690            _depth: fidl::encoding::Depth,
6691        ) -> fidl::Result<()> {
6692            encoder
6693                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6694            // Delegate to tuple encoding.
6695            fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>::encode(
6696                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6697                encoder,
6698                offset,
6699                _depth,
6700            )
6701        }
6702    }
6703    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6704        fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D> for (T0,)
6705    {
6706        #[inline]
6707        unsafe fn encode(
6708            self,
6709            encoder: &mut fidl::encoding::Encoder<'_, D>,
6710            offset: usize,
6711            depth: fidl::encoding::Depth,
6712        ) -> fidl::Result<()> {
6713            encoder
6714                .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6715            // Zero out padding regions. There's no need to apply masks
6716            // because the unmasked parts will be overwritten by fields.
6717            // Write the fields.
6718            self.0.encode(encoder, offset + 0, depth)?;
6719            Ok(())
6720        }
6721    }
6722
6723    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6724        for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6725    {
6726        #[inline(always)]
6727        fn new_empty() -> Self {
6728            Self { value: fidl::new_empty!(bool, D) }
6729        }
6730
6731        #[inline]
6732        unsafe fn decode(
6733            &mut self,
6734            decoder: &mut fidl::encoding::Decoder<'_, D>,
6735            offset: usize,
6736            _depth: fidl::encoding::Depth,
6737        ) -> fidl::Result<()> {
6738            decoder.debug_check_bounds::<Self>(offset);
6739            // Verify that padding bytes are zero.
6740            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6741            Ok(())
6742        }
6743    }
6744
6745    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6746        type Borrowed<'a> = &'a Self;
6747        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6748            value
6749        }
6750    }
6751
6752    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6753        type Owned = Self;
6754
6755        #[inline(always)]
6756        fn inline_align(_context: fidl::encoding::Context) -> usize {
6757            1
6758        }
6759
6760        #[inline(always)]
6761        fn inline_size(_context: fidl::encoding::Context) -> usize {
6762            1
6763        }
6764        #[inline(always)]
6765        fn encode_is_copy() -> bool {
6766            true
6767        }
6768
6769        #[inline(always)]
6770        fn decode_is_copy() -> bool {
6771            true
6772        }
6773    }
6774
6775    unsafe impl<D: fidl::encoding::ResourceDialect>
6776        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D>
6777        for &BaseNetworkSocketGetIpv6TrafficClassResponse
6778    {
6779        #[inline]
6780        unsafe fn encode(
6781            self,
6782            encoder: &mut fidl::encoding::Encoder<'_, D>,
6783            offset: usize,
6784            _depth: fidl::encoding::Depth,
6785        ) -> fidl::Result<()> {
6786            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6787            unsafe {
6788                // Copy the object into the buffer.
6789                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6790                (buf_ptr as *mut BaseNetworkSocketGetIpv6TrafficClassResponse).write_unaligned(
6791                    (self as *const BaseNetworkSocketGetIpv6TrafficClassResponse).read(),
6792                );
6793                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6794                // done second because the memcpy will write garbage to these bytes.
6795            }
6796            Ok(())
6797        }
6798    }
6799    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6800        fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D> for (T0,)
6801    {
6802        #[inline]
6803        unsafe fn encode(
6804            self,
6805            encoder: &mut fidl::encoding::Encoder<'_, D>,
6806            offset: usize,
6807            depth: fidl::encoding::Depth,
6808        ) -> fidl::Result<()> {
6809            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6810            // Zero out padding regions. There's no need to apply masks
6811            // because the unmasked parts will be overwritten by fields.
6812            // Write the fields.
6813            self.0.encode(encoder, offset + 0, depth)?;
6814            Ok(())
6815        }
6816    }
6817
6818    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6819        for BaseNetworkSocketGetIpv6TrafficClassResponse
6820    {
6821        #[inline(always)]
6822        fn new_empty() -> Self {
6823            Self { value: fidl::new_empty!(u8, D) }
6824        }
6825
6826        #[inline]
6827        unsafe fn decode(
6828            &mut self,
6829            decoder: &mut fidl::encoding::Decoder<'_, D>,
6830            offset: usize,
6831            _depth: fidl::encoding::Depth,
6832        ) -> fidl::Result<()> {
6833            decoder.debug_check_bounds::<Self>(offset);
6834            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6835            // Verify that padding bytes are zero.
6836            // Copy from the buffer into the object.
6837            unsafe {
6838                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6839            }
6840            Ok(())
6841        }
6842    }
6843
6844    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6845        type Borrowed<'a> = &'a Self;
6846        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6847            value
6848        }
6849    }
6850
6851    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6852        type Owned = Self;
6853
6854        #[inline(always)]
6855        fn inline_align(_context: fidl::encoding::Context) -> usize {
6856            1
6857        }
6858
6859        #[inline(always)]
6860        fn inline_size(_context: fidl::encoding::Context) -> usize {
6861            1
6862        }
6863        #[inline(always)]
6864        fn encode_is_copy() -> bool {
6865            true
6866        }
6867
6868        #[inline(always)]
6869        fn decode_is_copy() -> bool {
6870            true
6871        }
6872    }
6873
6874    unsafe impl<D: fidl::encoding::ResourceDialect>
6875        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D>
6876        for &BaseNetworkSocketGetIpv6UnicastHopsResponse
6877    {
6878        #[inline]
6879        unsafe fn encode(
6880            self,
6881            encoder: &mut fidl::encoding::Encoder<'_, D>,
6882            offset: usize,
6883            _depth: fidl::encoding::Depth,
6884        ) -> fidl::Result<()> {
6885            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6886            unsafe {
6887                // Copy the object into the buffer.
6888                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6889                (buf_ptr as *mut BaseNetworkSocketGetIpv6UnicastHopsResponse).write_unaligned(
6890                    (self as *const BaseNetworkSocketGetIpv6UnicastHopsResponse).read(),
6891                );
6892                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6893                // done second because the memcpy will write garbage to these bytes.
6894            }
6895            Ok(())
6896        }
6897    }
6898    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6899        fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D> for (T0,)
6900    {
6901        #[inline]
6902        unsafe fn encode(
6903            self,
6904            encoder: &mut fidl::encoding::Encoder<'_, D>,
6905            offset: usize,
6906            depth: fidl::encoding::Depth,
6907        ) -> fidl::Result<()> {
6908            encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6909            // Zero out padding regions. There's no need to apply masks
6910            // because the unmasked parts will be overwritten by fields.
6911            // Write the fields.
6912            self.0.encode(encoder, offset + 0, depth)?;
6913            Ok(())
6914        }
6915    }
6916
6917    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6918        for BaseNetworkSocketGetIpv6UnicastHopsResponse
6919    {
6920        #[inline(always)]
6921        fn new_empty() -> Self {
6922            Self { value: fidl::new_empty!(u8, D) }
6923        }
6924
6925        #[inline]
6926        unsafe fn decode(
6927            &mut self,
6928            decoder: &mut fidl::encoding::Decoder<'_, D>,
6929            offset: usize,
6930            _depth: fidl::encoding::Depth,
6931        ) -> fidl::Result<()> {
6932            decoder.debug_check_bounds::<Self>(offset);
6933            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6934            // Verify that padding bytes are zero.
6935            // Copy from the buffer into the object.
6936            unsafe {
6937                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6938            }
6939            Ok(())
6940        }
6941    }
6942
6943    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6944        type Borrowed<'a> = &'a Self;
6945        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6946            value
6947        }
6948    }
6949
6950    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6951        type Owned = Self;
6952
6953        #[inline(always)]
6954        fn inline_align(_context: fidl::encoding::Context) -> usize {
6955            8
6956        }
6957
6958        #[inline(always)]
6959        fn inline_size(_context: fidl::encoding::Context) -> usize {
6960            16
6961        }
6962    }
6963
6964    unsafe impl<D: fidl::encoding::ResourceDialect>
6965        fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D>
6966        for &BaseNetworkSocketGetOriginalDestinationResponse
6967    {
6968        #[inline]
6969        unsafe fn encode(
6970            self,
6971            encoder: &mut fidl::encoding::Encoder<'_, D>,
6972            offset: usize,
6973            _depth: fidl::encoding::Depth,
6974        ) -> fidl::Result<()> {
6975            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6976            // Delegate to tuple encoding.
6977            fidl::encoding::Encode::<BaseNetworkSocketGetOriginalDestinationResponse, D>::encode(
6978                (
6979                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6980                ),
6981                encoder, offset, _depth
6982            )
6983        }
6984    }
6985    unsafe impl<
6986        D: fidl::encoding::ResourceDialect,
6987        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
6988    > fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D> for (T0,)
6989    {
6990        #[inline]
6991        unsafe fn encode(
6992            self,
6993            encoder: &mut fidl::encoding::Encoder<'_, D>,
6994            offset: usize,
6995            depth: fidl::encoding::Depth,
6996        ) -> fidl::Result<()> {
6997            encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6998            // Zero out padding regions. There's no need to apply masks
6999            // because the unmasked parts will be overwritten by fields.
7000            // Write the fields.
7001            self.0.encode(encoder, offset + 0, depth)?;
7002            Ok(())
7003        }
7004    }
7005
7006    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7007        for BaseNetworkSocketGetOriginalDestinationResponse
7008    {
7009        #[inline(always)]
7010        fn new_empty() -> Self {
7011            Self { value: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
7012        }
7013
7014        #[inline]
7015        unsafe fn decode(
7016            &mut self,
7017            decoder: &mut fidl::encoding::Decoder<'_, D>,
7018            offset: usize,
7019            _depth: fidl::encoding::Depth,
7020        ) -> fidl::Result<()> {
7021            decoder.debug_check_bounds::<Self>(offset);
7022            // Verify that padding bytes are zero.
7023            fidl::decode!(
7024                fidl_fuchsia_net_common::SocketAddress,
7025                D,
7026                &mut self.value,
7027                decoder,
7028                offset + 0,
7029                _depth
7030            )?;
7031            Ok(())
7032        }
7033    }
7034
7035    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetPeerNameResponse {
7036        type Borrowed<'a> = &'a Self;
7037        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7038            value
7039        }
7040    }
7041
7042    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetPeerNameResponse {
7043        type Owned = Self;
7044
7045        #[inline(always)]
7046        fn inline_align(_context: fidl::encoding::Context) -> usize {
7047            8
7048        }
7049
7050        #[inline(always)]
7051        fn inline_size(_context: fidl::encoding::Context) -> usize {
7052            16
7053        }
7054    }
7055
7056    unsafe impl<D: fidl::encoding::ResourceDialect>
7057        fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D>
7058        for &BaseNetworkSocketGetPeerNameResponse
7059    {
7060        #[inline]
7061        unsafe fn encode(
7062            self,
7063            encoder: &mut fidl::encoding::Encoder<'_, D>,
7064            offset: usize,
7065            _depth: fidl::encoding::Depth,
7066        ) -> fidl::Result<()> {
7067            encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
7068            // Delegate to tuple encoding.
7069            fidl::encoding::Encode::<BaseNetworkSocketGetPeerNameResponse, D>::encode(
7070                (
7071                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
7072                ),
7073                encoder, offset, _depth
7074            )
7075        }
7076    }
7077    unsafe impl<
7078        D: fidl::encoding::ResourceDialect,
7079        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
7080    > fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D> for (T0,)
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::<BaseNetworkSocketGetPeerNameResponse>(offset);
7090            // Zero out padding regions. There's no need to apply masks
7091            // because the unmasked parts will be overwritten by fields.
7092            // Write the fields.
7093            self.0.encode(encoder, offset + 0, depth)?;
7094            Ok(())
7095        }
7096    }
7097
7098    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7099        for BaseNetworkSocketGetPeerNameResponse
7100    {
7101        #[inline(always)]
7102        fn new_empty() -> Self {
7103            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
7104        }
7105
7106        #[inline]
7107        unsafe fn decode(
7108            &mut self,
7109            decoder: &mut fidl::encoding::Decoder<'_, D>,
7110            offset: usize,
7111            _depth: fidl::encoding::Depth,
7112        ) -> fidl::Result<()> {
7113            decoder.debug_check_bounds::<Self>(offset);
7114            // Verify that padding bytes are zero.
7115            fidl::decode!(
7116                fidl_fuchsia_net_common::SocketAddress,
7117                D,
7118                &mut self.addr,
7119                decoder,
7120                offset + 0,
7121                _depth
7122            )?;
7123            Ok(())
7124        }
7125    }
7126
7127    impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetSockNameResponse {
7128        type Borrowed<'a> = &'a Self;
7129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7130            value
7131        }
7132    }
7133
7134    unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetSockNameResponse {
7135        type Owned = Self;
7136
7137        #[inline(always)]
7138        fn inline_align(_context: fidl::encoding::Context) -> usize {
7139            8
7140        }
7141
7142        #[inline(always)]
7143        fn inline_size(_context: fidl::encoding::Context) -> usize {
7144            16
7145        }
7146    }
7147
7148    unsafe impl<D: fidl::encoding::ResourceDialect>
7149        fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D>
7150        for &BaseNetworkSocketGetSockNameResponse
7151    {
7152        #[inline]
7153        unsafe fn encode(
7154            self,
7155            encoder: &mut fidl::encoding::Encoder<'_, D>,
7156            offset: usize,
7157            _depth: fidl::encoding::Depth,
7158        ) -> fidl::Result<()> {
7159            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
7160            // Delegate to tuple encoding.
7161            fidl::encoding::Encode::<BaseNetworkSocketGetSockNameResponse, D>::encode(
7162                (
7163                    <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
7164                ),
7165                encoder, offset, _depth
7166            )
7167        }
7168    }
7169    unsafe impl<
7170        D: fidl::encoding::ResourceDialect,
7171        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::SocketAddress, D>,
7172    > fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D> for (T0,)
7173    {
7174        #[inline]
7175        unsafe fn encode(
7176            self,
7177            encoder: &mut fidl::encoding::Encoder<'_, D>,
7178            offset: usize,
7179            depth: fidl::encoding::Depth,
7180        ) -> fidl::Result<()> {
7181            encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
7182            // Zero out padding regions. There's no need to apply masks
7183            // because the unmasked parts will be overwritten by fields.
7184            // Write the fields.
7185            self.0.encode(encoder, offset + 0, depth)?;
7186            Ok(())
7187        }
7188    }
7189
7190    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7191        for BaseNetworkSocketGetSockNameResponse
7192    {
7193        #[inline(always)]
7194        fn new_empty() -> Self {
7195            Self { addr: fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D) }
7196        }
7197
7198        #[inline]
7199        unsafe fn decode(
7200            &mut self,
7201            decoder: &mut fidl::encoding::Decoder<'_, D>,
7202            offset: usize,
7203            _depth: fidl::encoding::Depth,
7204        ) -> fidl::Result<()> {
7205            decoder.debug_check_bounds::<Self>(offset);
7206            // Verify that padding bytes are zero.
7207            fidl::decode!(
7208                fidl_fuchsia_net_common::SocketAddress,
7209                D,
7210                &mut self.addr,
7211                decoder,
7212                offset + 0,
7213                _depth
7214            )?;
7215            Ok(())
7216        }
7217    }
7218
7219    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkRequest {
7220        type Borrowed<'a> = &'a Self;
7221        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7222            value
7223        }
7224    }
7225
7226    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkRequest {
7227        type Owned = Self;
7228
7229        #[inline(always)]
7230        fn inline_align(_context: fidl::encoding::Context) -> usize {
7231            1
7232        }
7233
7234        #[inline(always)]
7235        fn inline_size(_context: fidl::encoding::Context) -> usize {
7236            1
7237        }
7238    }
7239
7240    unsafe impl<D: fidl::encoding::ResourceDialect>
7241        fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for &BaseSocketGetMarkRequest
7242    {
7243        #[inline]
7244        unsafe fn encode(
7245            self,
7246            encoder: &mut fidl::encoding::Encoder<'_, D>,
7247            offset: usize,
7248            _depth: fidl::encoding::Depth,
7249        ) -> fidl::Result<()> {
7250            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7251            // Delegate to tuple encoding.
7252            fidl::encoding::Encode::<BaseSocketGetMarkRequest, D>::encode(
7253                (<fidl_fuchsia_net_common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(
7254                    &self.domain,
7255                ),),
7256                encoder,
7257                offset,
7258                _depth,
7259            )
7260        }
7261    }
7262    unsafe impl<
7263        D: fidl::encoding::ResourceDialect,
7264        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::MarkDomain, D>,
7265    > fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for (T0,)
7266    {
7267        #[inline]
7268        unsafe fn encode(
7269            self,
7270            encoder: &mut fidl::encoding::Encoder<'_, D>,
7271            offset: usize,
7272            depth: fidl::encoding::Depth,
7273        ) -> fidl::Result<()> {
7274            encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7275            // Zero out padding regions. There's no need to apply masks
7276            // because the unmasked parts will be overwritten by fields.
7277            // Write the fields.
7278            self.0.encode(encoder, offset + 0, depth)?;
7279            Ok(())
7280        }
7281    }
7282
7283    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7284        for BaseSocketGetMarkRequest
7285    {
7286        #[inline(always)]
7287        fn new_empty() -> Self {
7288            Self { domain: fidl::new_empty!(fidl_fuchsia_net_common::MarkDomain, D) }
7289        }
7290
7291        #[inline]
7292        unsafe fn decode(
7293            &mut self,
7294            decoder: &mut fidl::encoding::Decoder<'_, D>,
7295            offset: usize,
7296            _depth: fidl::encoding::Depth,
7297        ) -> fidl::Result<()> {
7298            decoder.debug_check_bounds::<Self>(offset);
7299            // Verify that padding bytes are zero.
7300            fidl::decode!(
7301                fidl_fuchsia_net_common::MarkDomain,
7302                D,
7303                &mut self.domain,
7304                decoder,
7305                offset + 0,
7306                _depth
7307            )?;
7308            Ok(())
7309        }
7310    }
7311
7312    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToDeviceRequest {
7313        type Borrowed<'a> = &'a Self;
7314        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7315            value
7316        }
7317    }
7318
7319    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToDeviceRequest {
7320        type Owned = Self;
7321
7322        #[inline(always)]
7323        fn inline_align(_context: fidl::encoding::Context) -> usize {
7324            8
7325        }
7326
7327        #[inline(always)]
7328        fn inline_size(_context: fidl::encoding::Context) -> usize {
7329            16
7330        }
7331    }
7332
7333    unsafe impl<D: fidl::encoding::ResourceDialect>
7334        fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D>
7335        for &BaseSocketSetBindToDeviceRequest
7336    {
7337        #[inline]
7338        unsafe fn encode(
7339            self,
7340            encoder: &mut fidl::encoding::Encoder<'_, D>,
7341            offset: usize,
7342            _depth: fidl::encoding::Depth,
7343        ) -> fidl::Result<()> {
7344            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7345            // Delegate to tuple encoding.
7346            fidl::encoding::Encode::<BaseSocketSetBindToDeviceRequest, D>::encode(
7347                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
7348                    &self.value,
7349                ),),
7350                encoder,
7351                offset,
7352                _depth,
7353            )
7354        }
7355    }
7356    unsafe impl<
7357        D: fidl::encoding::ResourceDialect,
7358        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
7359    > fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D> for (T0,)
7360    {
7361        #[inline]
7362        unsafe fn encode(
7363            self,
7364            encoder: &mut fidl::encoding::Encoder<'_, D>,
7365            offset: usize,
7366            depth: fidl::encoding::Depth,
7367        ) -> fidl::Result<()> {
7368            encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7369            // Zero out padding regions. There's no need to apply masks
7370            // because the unmasked parts will be overwritten by fields.
7371            // Write the fields.
7372            self.0.encode(encoder, offset + 0, depth)?;
7373            Ok(())
7374        }
7375    }
7376
7377    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7378        for BaseSocketSetBindToDeviceRequest
7379    {
7380        #[inline(always)]
7381        fn new_empty() -> Self {
7382            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
7383        }
7384
7385        #[inline]
7386        unsafe fn decode(
7387            &mut self,
7388            decoder: &mut fidl::encoding::Decoder<'_, D>,
7389            offset: usize,
7390            _depth: fidl::encoding::Depth,
7391        ) -> fidl::Result<()> {
7392            decoder.debug_check_bounds::<Self>(offset);
7393            // Verify that padding bytes are zero.
7394            fidl::decode!(
7395                fidl::encoding::BoundedString<15>,
7396                D,
7397                &mut self.value,
7398                decoder,
7399                offset + 0,
7400                _depth
7401            )?;
7402            Ok(())
7403        }
7404    }
7405
7406    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7407        type Borrowed<'a> = &'a Self;
7408        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7409            value
7410        }
7411    }
7412
7413    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7414        type Owned = Self;
7415
7416        #[inline(always)]
7417        fn inline_align(_context: fidl::encoding::Context) -> usize {
7418            8
7419        }
7420
7421        #[inline(always)]
7422        fn inline_size(_context: fidl::encoding::Context) -> usize {
7423            8
7424        }
7425        #[inline(always)]
7426        fn encode_is_copy() -> bool {
7427            true
7428        }
7429
7430        #[inline(always)]
7431        fn decode_is_copy() -> bool {
7432            true
7433        }
7434    }
7435
7436    unsafe impl<D: fidl::encoding::ResourceDialect>
7437        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D>
7438        for &BaseSocketSetBindToInterfaceIndexRequest
7439    {
7440        #[inline]
7441        unsafe fn encode(
7442            self,
7443            encoder: &mut fidl::encoding::Encoder<'_, D>,
7444            offset: usize,
7445            _depth: fidl::encoding::Depth,
7446        ) -> fidl::Result<()> {
7447            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7448            unsafe {
7449                // Copy the object into the buffer.
7450                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7451                (buf_ptr as *mut BaseSocketSetBindToInterfaceIndexRequest).write_unaligned(
7452                    (self as *const BaseSocketSetBindToInterfaceIndexRequest).read(),
7453                );
7454                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7455                // done second because the memcpy will write garbage to these bytes.
7456            }
7457            Ok(())
7458        }
7459    }
7460    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7461        fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D> for (T0,)
7462    {
7463        #[inline]
7464        unsafe fn encode(
7465            self,
7466            encoder: &mut fidl::encoding::Encoder<'_, D>,
7467            offset: usize,
7468            depth: fidl::encoding::Depth,
7469        ) -> fidl::Result<()> {
7470            encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7471            // Zero out padding regions. There's no need to apply masks
7472            // because the unmasked parts will be overwritten by fields.
7473            // Write the fields.
7474            self.0.encode(encoder, offset + 0, depth)?;
7475            Ok(())
7476        }
7477    }
7478
7479    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7480        for BaseSocketSetBindToInterfaceIndexRequest
7481    {
7482        #[inline(always)]
7483        fn new_empty() -> Self {
7484            Self { value: fidl::new_empty!(u64, D) }
7485        }
7486
7487        #[inline]
7488        unsafe fn decode(
7489            &mut self,
7490            decoder: &mut fidl::encoding::Decoder<'_, D>,
7491            offset: usize,
7492            _depth: fidl::encoding::Depth,
7493        ) -> fidl::Result<()> {
7494            decoder.debug_check_bounds::<Self>(offset);
7495            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7496            // Verify that padding bytes are zero.
7497            // Copy from the buffer into the object.
7498            unsafe {
7499                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7500            }
7501            Ok(())
7502        }
7503    }
7504
7505    impl fidl::encoding::ValueTypeMarker for BaseSocketSetBroadcastRequest {
7506        type Borrowed<'a> = &'a Self;
7507        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7508            value
7509        }
7510    }
7511
7512    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBroadcastRequest {
7513        type Owned = Self;
7514
7515        #[inline(always)]
7516        fn inline_align(_context: fidl::encoding::Context) -> usize {
7517            1
7518        }
7519
7520        #[inline(always)]
7521        fn inline_size(_context: fidl::encoding::Context) -> usize {
7522            1
7523        }
7524    }
7525
7526    unsafe impl<D: fidl::encoding::ResourceDialect>
7527        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D>
7528        for &BaseSocketSetBroadcastRequest
7529    {
7530        #[inline]
7531        unsafe fn encode(
7532            self,
7533            encoder: &mut fidl::encoding::Encoder<'_, D>,
7534            offset: usize,
7535            _depth: fidl::encoding::Depth,
7536        ) -> fidl::Result<()> {
7537            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7538            // Delegate to tuple encoding.
7539            fidl::encoding::Encode::<BaseSocketSetBroadcastRequest, D>::encode(
7540                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7541                encoder,
7542                offset,
7543                _depth,
7544            )
7545        }
7546    }
7547    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7548        fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D> for (T0,)
7549    {
7550        #[inline]
7551        unsafe fn encode(
7552            self,
7553            encoder: &mut fidl::encoding::Encoder<'_, D>,
7554            offset: usize,
7555            depth: fidl::encoding::Depth,
7556        ) -> fidl::Result<()> {
7557            encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7558            // Zero out padding regions. There's no need to apply masks
7559            // because the unmasked parts will be overwritten by fields.
7560            // Write the fields.
7561            self.0.encode(encoder, offset + 0, depth)?;
7562            Ok(())
7563        }
7564    }
7565
7566    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7567        for BaseSocketSetBroadcastRequest
7568    {
7569        #[inline(always)]
7570        fn new_empty() -> Self {
7571            Self { value: fidl::new_empty!(bool, D) }
7572        }
7573
7574        #[inline]
7575        unsafe fn decode(
7576            &mut self,
7577            decoder: &mut fidl::encoding::Decoder<'_, D>,
7578            offset: usize,
7579            _depth: fidl::encoding::Depth,
7580        ) -> fidl::Result<()> {
7581            decoder.debug_check_bounds::<Self>(offset);
7582            // Verify that padding bytes are zero.
7583            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7584            Ok(())
7585        }
7586    }
7587
7588    impl fidl::encoding::ValueTypeMarker for BaseSocketSetKeepAliveRequest {
7589        type Borrowed<'a> = &'a Self;
7590        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7591            value
7592        }
7593    }
7594
7595    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetKeepAliveRequest {
7596        type Owned = Self;
7597
7598        #[inline(always)]
7599        fn inline_align(_context: fidl::encoding::Context) -> usize {
7600            1
7601        }
7602
7603        #[inline(always)]
7604        fn inline_size(_context: fidl::encoding::Context) -> usize {
7605            1
7606        }
7607    }
7608
7609    unsafe impl<D: fidl::encoding::ResourceDialect>
7610        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D>
7611        for &BaseSocketSetKeepAliveRequest
7612    {
7613        #[inline]
7614        unsafe fn encode(
7615            self,
7616            encoder: &mut fidl::encoding::Encoder<'_, D>,
7617            offset: usize,
7618            _depth: fidl::encoding::Depth,
7619        ) -> fidl::Result<()> {
7620            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7621            // Delegate to tuple encoding.
7622            fidl::encoding::Encode::<BaseSocketSetKeepAliveRequest, D>::encode(
7623                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7624                encoder,
7625                offset,
7626                _depth,
7627            )
7628        }
7629    }
7630    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7631        fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D> for (T0,)
7632    {
7633        #[inline]
7634        unsafe fn encode(
7635            self,
7636            encoder: &mut fidl::encoding::Encoder<'_, D>,
7637            offset: usize,
7638            depth: fidl::encoding::Depth,
7639        ) -> fidl::Result<()> {
7640            encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7641            // Zero out padding regions. There's no need to apply masks
7642            // because the unmasked parts will be overwritten by fields.
7643            // Write the fields.
7644            self.0.encode(encoder, offset + 0, depth)?;
7645            Ok(())
7646        }
7647    }
7648
7649    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7650        for BaseSocketSetKeepAliveRequest
7651    {
7652        #[inline(always)]
7653        fn new_empty() -> Self {
7654            Self { value: fidl::new_empty!(bool, D) }
7655        }
7656
7657        #[inline]
7658        unsafe fn decode(
7659            &mut self,
7660            decoder: &mut fidl::encoding::Decoder<'_, D>,
7661            offset: usize,
7662            _depth: fidl::encoding::Depth,
7663        ) -> fidl::Result<()> {
7664            decoder.debug_check_bounds::<Self>(offset);
7665            // Verify that padding bytes are zero.
7666            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7667            Ok(())
7668        }
7669    }
7670
7671    impl fidl::encoding::ValueTypeMarker for BaseSocketSetLingerRequest {
7672        type Borrowed<'a> = &'a Self;
7673        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7674            value
7675        }
7676    }
7677
7678    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetLingerRequest {
7679        type Owned = Self;
7680
7681        #[inline(always)]
7682        fn inline_align(_context: fidl::encoding::Context) -> usize {
7683            4
7684        }
7685
7686        #[inline(always)]
7687        fn inline_size(_context: fidl::encoding::Context) -> usize {
7688            8
7689        }
7690    }
7691
7692    unsafe impl<D: fidl::encoding::ResourceDialect>
7693        fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for &BaseSocketSetLingerRequest
7694    {
7695        #[inline]
7696        unsafe fn encode(
7697            self,
7698            encoder: &mut fidl::encoding::Encoder<'_, D>,
7699            offset: usize,
7700            _depth: fidl::encoding::Depth,
7701        ) -> fidl::Result<()> {
7702            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7703            // Delegate to tuple encoding.
7704            fidl::encoding::Encode::<BaseSocketSetLingerRequest, D>::encode(
7705                (
7706                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
7707                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
7708                ),
7709                encoder,
7710                offset,
7711                _depth,
7712            )
7713        }
7714    }
7715    unsafe impl<
7716        D: fidl::encoding::ResourceDialect,
7717        T0: fidl::encoding::Encode<bool, D>,
7718        T1: fidl::encoding::Encode<u32, D>,
7719    > fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for (T0, T1)
7720    {
7721        #[inline]
7722        unsafe fn encode(
7723            self,
7724            encoder: &mut fidl::encoding::Encoder<'_, D>,
7725            offset: usize,
7726            depth: fidl::encoding::Depth,
7727        ) -> fidl::Result<()> {
7728            encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7729            // Zero out padding regions. There's no need to apply masks
7730            // because the unmasked parts will be overwritten by fields.
7731            unsafe {
7732                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7733                (ptr as *mut u32).write_unaligned(0);
7734            }
7735            // Write the fields.
7736            self.0.encode(encoder, offset + 0, depth)?;
7737            self.1.encode(encoder, offset + 4, depth)?;
7738            Ok(())
7739        }
7740    }
7741
7742    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7743        for BaseSocketSetLingerRequest
7744    {
7745        #[inline(always)]
7746        fn new_empty() -> Self {
7747            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
7748        }
7749
7750        #[inline]
7751        unsafe fn decode(
7752            &mut self,
7753            decoder: &mut fidl::encoding::Decoder<'_, D>,
7754            offset: usize,
7755            _depth: fidl::encoding::Depth,
7756        ) -> fidl::Result<()> {
7757            decoder.debug_check_bounds::<Self>(offset);
7758            // Verify that padding bytes are zero.
7759            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7760            let padval = unsafe { (ptr as *const u32).read_unaligned() };
7761            let mask = 0xffffff00u32;
7762            let maskedval = padval & mask;
7763            if maskedval != 0 {
7764                return Err(fidl::Error::NonZeroPadding {
7765                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7766                });
7767            }
7768            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
7769            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
7770            Ok(())
7771        }
7772    }
7773
7774    impl fidl::encoding::ValueTypeMarker for BaseSocketSetMarkRequest {
7775        type Borrowed<'a> = &'a Self;
7776        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7777            value
7778        }
7779    }
7780
7781    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetMarkRequest {
7782        type Owned = Self;
7783
7784        #[inline(always)]
7785        fn inline_align(_context: fidl::encoding::Context) -> usize {
7786            8
7787        }
7788
7789        #[inline(always)]
7790        fn inline_size(_context: fidl::encoding::Context) -> usize {
7791            24
7792        }
7793    }
7794
7795    unsafe impl<D: fidl::encoding::ResourceDialect>
7796        fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for &BaseSocketSetMarkRequest
7797    {
7798        #[inline]
7799        unsafe fn encode(
7800            self,
7801            encoder: &mut fidl::encoding::Encoder<'_, D>,
7802            offset: usize,
7803            _depth: fidl::encoding::Depth,
7804        ) -> fidl::Result<()> {
7805            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7806            // Delegate to tuple encoding.
7807            fidl::encoding::Encode::<BaseSocketSetMarkRequest, D>::encode(
7808                (
7809                    <fidl_fuchsia_net_common::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
7810                    <OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),
7811                ),
7812                encoder, offset, _depth
7813            )
7814        }
7815    }
7816    unsafe impl<
7817        D: fidl::encoding::ResourceDialect,
7818        T0: fidl::encoding::Encode<fidl_fuchsia_net_common::MarkDomain, D>,
7819        T1: fidl::encoding::Encode<OptionalUint32, D>,
7820    > fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for (T0, T1)
7821    {
7822        #[inline]
7823        unsafe fn encode(
7824            self,
7825            encoder: &mut fidl::encoding::Encoder<'_, D>,
7826            offset: usize,
7827            depth: fidl::encoding::Depth,
7828        ) -> fidl::Result<()> {
7829            encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7830            // Zero out padding regions. There's no need to apply masks
7831            // because the unmasked parts will be overwritten by fields.
7832            unsafe {
7833                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7834                (ptr as *mut u64).write_unaligned(0);
7835            }
7836            // Write the fields.
7837            self.0.encode(encoder, offset + 0, depth)?;
7838            self.1.encode(encoder, offset + 8, depth)?;
7839            Ok(())
7840        }
7841    }
7842
7843    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7844        for BaseSocketSetMarkRequest
7845    {
7846        #[inline(always)]
7847        fn new_empty() -> Self {
7848            Self {
7849                domain: fidl::new_empty!(fidl_fuchsia_net_common::MarkDomain, D),
7850                mark: fidl::new_empty!(OptionalUint32, D),
7851            }
7852        }
7853
7854        #[inline]
7855        unsafe fn decode(
7856            &mut self,
7857            decoder: &mut fidl::encoding::Decoder<'_, D>,
7858            offset: usize,
7859            _depth: fidl::encoding::Depth,
7860        ) -> fidl::Result<()> {
7861            decoder.debug_check_bounds::<Self>(offset);
7862            // Verify that padding bytes are zero.
7863            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7864            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7865            let mask = 0xffffffffffffff00u64;
7866            let maskedval = padval & mask;
7867            if maskedval != 0 {
7868                return Err(fidl::Error::NonZeroPadding {
7869                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7870                });
7871            }
7872            fidl::decode!(
7873                fidl_fuchsia_net_common::MarkDomain,
7874                D,
7875                &mut self.domain,
7876                decoder,
7877                offset + 0,
7878                _depth
7879            )?;
7880            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 8, _depth)?;
7881            Ok(())
7882        }
7883    }
7884
7885    impl fidl::encoding::ValueTypeMarker for BaseSocketSetNoCheckRequest {
7886        type Borrowed<'a> = &'a Self;
7887        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7888            value
7889        }
7890    }
7891
7892    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetNoCheckRequest {
7893        type Owned = Self;
7894
7895        #[inline(always)]
7896        fn inline_align(_context: fidl::encoding::Context) -> usize {
7897            1
7898        }
7899
7900        #[inline(always)]
7901        fn inline_size(_context: fidl::encoding::Context) -> usize {
7902            1
7903        }
7904    }
7905
7906    unsafe impl<D: fidl::encoding::ResourceDialect>
7907        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for &BaseSocketSetNoCheckRequest
7908    {
7909        #[inline]
7910        unsafe fn encode(
7911            self,
7912            encoder: &mut fidl::encoding::Encoder<'_, D>,
7913            offset: usize,
7914            _depth: fidl::encoding::Depth,
7915        ) -> fidl::Result<()> {
7916            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7917            // Delegate to tuple encoding.
7918            fidl::encoding::Encode::<BaseSocketSetNoCheckRequest, D>::encode(
7919                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7920                encoder,
7921                offset,
7922                _depth,
7923            )
7924        }
7925    }
7926    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7927        fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for (T0,)
7928    {
7929        #[inline]
7930        unsafe fn encode(
7931            self,
7932            encoder: &mut fidl::encoding::Encoder<'_, D>,
7933            offset: usize,
7934            depth: fidl::encoding::Depth,
7935        ) -> fidl::Result<()> {
7936            encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7937            // Zero out padding regions. There's no need to apply masks
7938            // because the unmasked parts will be overwritten by fields.
7939            // Write the fields.
7940            self.0.encode(encoder, offset + 0, depth)?;
7941            Ok(())
7942        }
7943    }
7944
7945    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7946        for BaseSocketSetNoCheckRequest
7947    {
7948        #[inline(always)]
7949        fn new_empty() -> Self {
7950            Self { value: fidl::new_empty!(bool, D) }
7951        }
7952
7953        #[inline]
7954        unsafe fn decode(
7955            &mut self,
7956            decoder: &mut fidl::encoding::Decoder<'_, D>,
7957            offset: usize,
7958            _depth: fidl::encoding::Depth,
7959        ) -> fidl::Result<()> {
7960            decoder.debug_check_bounds::<Self>(offset);
7961            // Verify that padding bytes are zero.
7962            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7963            Ok(())
7964        }
7965    }
7966
7967    impl fidl::encoding::ValueTypeMarker for BaseSocketSetOutOfBandInlineRequest {
7968        type Borrowed<'a> = &'a Self;
7969        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7970            value
7971        }
7972    }
7973
7974    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetOutOfBandInlineRequest {
7975        type Owned = Self;
7976
7977        #[inline(always)]
7978        fn inline_align(_context: fidl::encoding::Context) -> usize {
7979            1
7980        }
7981
7982        #[inline(always)]
7983        fn inline_size(_context: fidl::encoding::Context) -> usize {
7984            1
7985        }
7986    }
7987
7988    unsafe impl<D: fidl::encoding::ResourceDialect>
7989        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D>
7990        for &BaseSocketSetOutOfBandInlineRequest
7991    {
7992        #[inline]
7993        unsafe fn encode(
7994            self,
7995            encoder: &mut fidl::encoding::Encoder<'_, D>,
7996            offset: usize,
7997            _depth: fidl::encoding::Depth,
7998        ) -> fidl::Result<()> {
7999            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
8000            // Delegate to tuple encoding.
8001            fidl::encoding::Encode::<BaseSocketSetOutOfBandInlineRequest, D>::encode(
8002                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8003                encoder,
8004                offset,
8005                _depth,
8006            )
8007        }
8008    }
8009    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8010        fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D> for (T0,)
8011    {
8012        #[inline]
8013        unsafe fn encode(
8014            self,
8015            encoder: &mut fidl::encoding::Encoder<'_, D>,
8016            offset: usize,
8017            depth: fidl::encoding::Depth,
8018        ) -> fidl::Result<()> {
8019            encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
8020            // Zero out padding regions. There's no need to apply masks
8021            // because the unmasked parts will be overwritten by fields.
8022            // Write the fields.
8023            self.0.encode(encoder, offset + 0, depth)?;
8024            Ok(())
8025        }
8026    }
8027
8028    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8029        for BaseSocketSetOutOfBandInlineRequest
8030    {
8031        #[inline(always)]
8032        fn new_empty() -> Self {
8033            Self { value: fidl::new_empty!(bool, D) }
8034        }
8035
8036        #[inline]
8037        unsafe fn decode(
8038            &mut self,
8039            decoder: &mut fidl::encoding::Decoder<'_, D>,
8040            offset: usize,
8041            _depth: fidl::encoding::Depth,
8042        ) -> fidl::Result<()> {
8043            decoder.debug_check_bounds::<Self>(offset);
8044            // Verify that padding bytes are zero.
8045            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8046            Ok(())
8047        }
8048    }
8049
8050    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReceiveBufferRequest {
8051        type Borrowed<'a> = &'a Self;
8052        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8053            value
8054        }
8055    }
8056
8057    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReceiveBufferRequest {
8058        type Owned = Self;
8059
8060        #[inline(always)]
8061        fn inline_align(_context: fidl::encoding::Context) -> usize {
8062            8
8063        }
8064
8065        #[inline(always)]
8066        fn inline_size(_context: fidl::encoding::Context) -> usize {
8067            8
8068        }
8069        #[inline(always)]
8070        fn encode_is_copy() -> bool {
8071            true
8072        }
8073
8074        #[inline(always)]
8075        fn decode_is_copy() -> bool {
8076            true
8077        }
8078    }
8079
8080    unsafe impl<D: fidl::encoding::ResourceDialect>
8081        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D>
8082        for &BaseSocketSetReceiveBufferRequest
8083    {
8084        #[inline]
8085        unsafe fn encode(
8086            self,
8087            encoder: &mut fidl::encoding::Encoder<'_, D>,
8088            offset: usize,
8089            _depth: fidl::encoding::Depth,
8090        ) -> fidl::Result<()> {
8091            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
8092            unsafe {
8093                // Copy the object into the buffer.
8094                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8095                (buf_ptr as *mut BaseSocketSetReceiveBufferRequest)
8096                    .write_unaligned((self as *const BaseSocketSetReceiveBufferRequest).read());
8097                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8098                // done second because the memcpy will write garbage to these bytes.
8099            }
8100            Ok(())
8101        }
8102    }
8103    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8104        fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D> for (T0,)
8105    {
8106        #[inline]
8107        unsafe fn encode(
8108            self,
8109            encoder: &mut fidl::encoding::Encoder<'_, D>,
8110            offset: usize,
8111            depth: fidl::encoding::Depth,
8112        ) -> fidl::Result<()> {
8113            encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
8114            // Zero out padding regions. There's no need to apply masks
8115            // because the unmasked parts will be overwritten by fields.
8116            // Write the fields.
8117            self.0.encode(encoder, offset + 0, depth)?;
8118            Ok(())
8119        }
8120    }
8121
8122    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8123        for BaseSocketSetReceiveBufferRequest
8124    {
8125        #[inline(always)]
8126        fn new_empty() -> Self {
8127            Self { value_bytes: fidl::new_empty!(u64, D) }
8128        }
8129
8130        #[inline]
8131        unsafe fn decode(
8132            &mut self,
8133            decoder: &mut fidl::encoding::Decoder<'_, D>,
8134            offset: usize,
8135            _depth: fidl::encoding::Depth,
8136        ) -> fidl::Result<()> {
8137            decoder.debug_check_bounds::<Self>(offset);
8138            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8139            // Verify that padding bytes are zero.
8140            // Copy from the buffer into the object.
8141            unsafe {
8142                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8143            }
8144            Ok(())
8145        }
8146    }
8147
8148    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReuseAddressRequest {
8149        type Borrowed<'a> = &'a Self;
8150        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8151            value
8152        }
8153    }
8154
8155    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReuseAddressRequest {
8156        type Owned = Self;
8157
8158        #[inline(always)]
8159        fn inline_align(_context: fidl::encoding::Context) -> usize {
8160            1
8161        }
8162
8163        #[inline(always)]
8164        fn inline_size(_context: fidl::encoding::Context) -> usize {
8165            1
8166        }
8167    }
8168
8169    unsafe impl<D: fidl::encoding::ResourceDialect>
8170        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D>
8171        for &BaseSocketSetReuseAddressRequest
8172    {
8173        #[inline]
8174        unsafe fn encode(
8175            self,
8176            encoder: &mut fidl::encoding::Encoder<'_, D>,
8177            offset: usize,
8178            _depth: fidl::encoding::Depth,
8179        ) -> fidl::Result<()> {
8180            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8181            // Delegate to tuple encoding.
8182            fidl::encoding::Encode::<BaseSocketSetReuseAddressRequest, D>::encode(
8183                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8184                encoder,
8185                offset,
8186                _depth,
8187            )
8188        }
8189    }
8190    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8191        fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D> for (T0,)
8192    {
8193        #[inline]
8194        unsafe fn encode(
8195            self,
8196            encoder: &mut fidl::encoding::Encoder<'_, D>,
8197            offset: usize,
8198            depth: fidl::encoding::Depth,
8199        ) -> fidl::Result<()> {
8200            encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8201            // Zero out padding regions. There's no need to apply masks
8202            // because the unmasked parts will be overwritten by fields.
8203            // Write the fields.
8204            self.0.encode(encoder, offset + 0, depth)?;
8205            Ok(())
8206        }
8207    }
8208
8209    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8210        for BaseSocketSetReuseAddressRequest
8211    {
8212        #[inline(always)]
8213        fn new_empty() -> Self {
8214            Self { value: fidl::new_empty!(bool, D) }
8215        }
8216
8217        #[inline]
8218        unsafe fn decode(
8219            &mut self,
8220            decoder: &mut fidl::encoding::Decoder<'_, D>,
8221            offset: usize,
8222            _depth: fidl::encoding::Depth,
8223        ) -> fidl::Result<()> {
8224            decoder.debug_check_bounds::<Self>(offset);
8225            // Verify that padding bytes are zero.
8226            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8227            Ok(())
8228        }
8229    }
8230
8231    impl fidl::encoding::ValueTypeMarker for BaseSocketSetReusePortDeprecatedRequest {
8232        type Borrowed<'a> = &'a Self;
8233        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8234            value
8235        }
8236    }
8237
8238    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReusePortDeprecatedRequest {
8239        type Owned = Self;
8240
8241        #[inline(always)]
8242        fn inline_align(_context: fidl::encoding::Context) -> usize {
8243            1
8244        }
8245
8246        #[inline(always)]
8247        fn inline_size(_context: fidl::encoding::Context) -> usize {
8248            1
8249        }
8250    }
8251
8252    unsafe impl<D: fidl::encoding::ResourceDialect>
8253        fidl::encoding::Encode<BaseSocketSetReusePortDeprecatedRequest, D>
8254        for &BaseSocketSetReusePortDeprecatedRequest
8255    {
8256        #[inline]
8257        unsafe fn encode(
8258            self,
8259            encoder: &mut fidl::encoding::Encoder<'_, D>,
8260            offset: usize,
8261            _depth: fidl::encoding::Depth,
8262        ) -> fidl::Result<()> {
8263            encoder.debug_check_bounds::<BaseSocketSetReusePortDeprecatedRequest>(offset);
8264            // Delegate to tuple encoding.
8265            fidl::encoding::Encode::<BaseSocketSetReusePortDeprecatedRequest, D>::encode(
8266                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8267                encoder,
8268                offset,
8269                _depth,
8270            )
8271        }
8272    }
8273    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8274        fidl::encoding::Encode<BaseSocketSetReusePortDeprecatedRequest, D> for (T0,)
8275    {
8276        #[inline]
8277        unsafe fn encode(
8278            self,
8279            encoder: &mut fidl::encoding::Encoder<'_, D>,
8280            offset: usize,
8281            depth: fidl::encoding::Depth,
8282        ) -> fidl::Result<()> {
8283            encoder.debug_check_bounds::<BaseSocketSetReusePortDeprecatedRequest>(offset);
8284            // Zero out padding regions. There's no need to apply masks
8285            // because the unmasked parts will be overwritten by fields.
8286            // Write the fields.
8287            self.0.encode(encoder, offset + 0, depth)?;
8288            Ok(())
8289        }
8290    }
8291
8292    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8293        for BaseSocketSetReusePortDeprecatedRequest
8294    {
8295        #[inline(always)]
8296        fn new_empty() -> Self {
8297            Self { value: fidl::new_empty!(bool, D) }
8298        }
8299
8300        #[inline]
8301        unsafe fn decode(
8302            &mut self,
8303            decoder: &mut fidl::encoding::Decoder<'_, D>,
8304            offset: usize,
8305            _depth: fidl::encoding::Depth,
8306        ) -> fidl::Result<()> {
8307            decoder.debug_check_bounds::<Self>(offset);
8308            // Verify that padding bytes are zero.
8309            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8310            Ok(())
8311        }
8312    }
8313
8314    impl fidl::encoding::ValueTypeMarker for BaseSocketSetSendBufferRequest {
8315        type Borrowed<'a> = &'a Self;
8316        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8317            value
8318        }
8319    }
8320
8321    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetSendBufferRequest {
8322        type Owned = Self;
8323
8324        #[inline(always)]
8325        fn inline_align(_context: fidl::encoding::Context) -> usize {
8326            8
8327        }
8328
8329        #[inline(always)]
8330        fn inline_size(_context: fidl::encoding::Context) -> usize {
8331            8
8332        }
8333        #[inline(always)]
8334        fn encode_is_copy() -> bool {
8335            true
8336        }
8337
8338        #[inline(always)]
8339        fn decode_is_copy() -> bool {
8340            true
8341        }
8342    }
8343
8344    unsafe impl<D: fidl::encoding::ResourceDialect>
8345        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D>
8346        for &BaseSocketSetSendBufferRequest
8347    {
8348        #[inline]
8349        unsafe fn encode(
8350            self,
8351            encoder: &mut fidl::encoding::Encoder<'_, D>,
8352            offset: usize,
8353            _depth: fidl::encoding::Depth,
8354        ) -> fidl::Result<()> {
8355            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8356            unsafe {
8357                // Copy the object into the buffer.
8358                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8359                (buf_ptr as *mut BaseSocketSetSendBufferRequest)
8360                    .write_unaligned((self as *const BaseSocketSetSendBufferRequest).read());
8361                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8362                // done second because the memcpy will write garbage to these bytes.
8363            }
8364            Ok(())
8365        }
8366    }
8367    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8368        fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D> for (T0,)
8369    {
8370        #[inline]
8371        unsafe fn encode(
8372            self,
8373            encoder: &mut fidl::encoding::Encoder<'_, D>,
8374            offset: usize,
8375            depth: fidl::encoding::Depth,
8376        ) -> fidl::Result<()> {
8377            encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8378            // Zero out padding regions. There's no need to apply masks
8379            // because the unmasked parts will be overwritten by fields.
8380            // Write the fields.
8381            self.0.encode(encoder, offset + 0, depth)?;
8382            Ok(())
8383        }
8384    }
8385
8386    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8387        for BaseSocketSetSendBufferRequest
8388    {
8389        #[inline(always)]
8390        fn new_empty() -> Self {
8391            Self { value_bytes: fidl::new_empty!(u64, D) }
8392        }
8393
8394        #[inline]
8395        unsafe fn decode(
8396            &mut self,
8397            decoder: &mut fidl::encoding::Decoder<'_, D>,
8398            offset: usize,
8399            _depth: fidl::encoding::Depth,
8400        ) -> fidl::Result<()> {
8401            decoder.debug_check_bounds::<Self>(offset);
8402            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8403            // Verify that padding bytes are zero.
8404            // Copy from the buffer into the object.
8405            unsafe {
8406                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8407            }
8408            Ok(())
8409        }
8410    }
8411
8412    impl fidl::encoding::ValueTypeMarker for BaseSocketSetTimestampRequest {
8413        type Borrowed<'a> = &'a Self;
8414        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8415            value
8416        }
8417    }
8418
8419    unsafe impl fidl::encoding::TypeMarker for BaseSocketSetTimestampRequest {
8420        type Owned = Self;
8421
8422        #[inline(always)]
8423        fn inline_align(_context: fidl::encoding::Context) -> usize {
8424            4
8425        }
8426
8427        #[inline(always)]
8428        fn inline_size(_context: fidl::encoding::Context) -> usize {
8429            4
8430        }
8431    }
8432
8433    unsafe impl<D: fidl::encoding::ResourceDialect>
8434        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D>
8435        for &BaseSocketSetTimestampRequest
8436    {
8437        #[inline]
8438        unsafe fn encode(
8439            self,
8440            encoder: &mut fidl::encoding::Encoder<'_, D>,
8441            offset: usize,
8442            _depth: fidl::encoding::Depth,
8443        ) -> fidl::Result<()> {
8444            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8445            // Delegate to tuple encoding.
8446            fidl::encoding::Encode::<BaseSocketSetTimestampRequest, D>::encode(
8447                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8448                encoder,
8449                offset,
8450                _depth,
8451            )
8452        }
8453    }
8454    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
8455        fidl::encoding::Encode<BaseSocketSetTimestampRequest, D> for (T0,)
8456    {
8457        #[inline]
8458        unsafe fn encode(
8459            self,
8460            encoder: &mut fidl::encoding::Encoder<'_, D>,
8461            offset: usize,
8462            depth: fidl::encoding::Depth,
8463        ) -> fidl::Result<()> {
8464            encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8465            // Zero out padding regions. There's no need to apply masks
8466            // because the unmasked parts will be overwritten by fields.
8467            // Write the fields.
8468            self.0.encode(encoder, offset + 0, depth)?;
8469            Ok(())
8470        }
8471    }
8472
8473    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8474        for BaseSocketSetTimestampRequest
8475    {
8476        #[inline(always)]
8477        fn new_empty() -> Self {
8478            Self { value: fidl::new_empty!(TimestampOption, D) }
8479        }
8480
8481        #[inline]
8482        unsafe fn decode(
8483            &mut self,
8484            decoder: &mut fidl::encoding::Decoder<'_, D>,
8485            offset: usize,
8486            _depth: fidl::encoding::Depth,
8487        ) -> fidl::Result<()> {
8488            decoder.debug_check_bounds::<Self>(offset);
8489            // Verify that padding bytes are zero.
8490            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
8491            Ok(())
8492        }
8493    }
8494
8495    impl fidl::encoding::ValueTypeMarker for BaseSocketGetAcceptConnResponse {
8496        type Borrowed<'a> = &'a Self;
8497        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8498            value
8499        }
8500    }
8501
8502    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetAcceptConnResponse {
8503        type Owned = Self;
8504
8505        #[inline(always)]
8506        fn inline_align(_context: fidl::encoding::Context) -> usize {
8507            1
8508        }
8509
8510        #[inline(always)]
8511        fn inline_size(_context: fidl::encoding::Context) -> usize {
8512            1
8513        }
8514    }
8515
8516    unsafe impl<D: fidl::encoding::ResourceDialect>
8517        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D>
8518        for &BaseSocketGetAcceptConnResponse
8519    {
8520        #[inline]
8521        unsafe fn encode(
8522            self,
8523            encoder: &mut fidl::encoding::Encoder<'_, D>,
8524            offset: usize,
8525            _depth: fidl::encoding::Depth,
8526        ) -> fidl::Result<()> {
8527            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8528            // Delegate to tuple encoding.
8529            fidl::encoding::Encode::<BaseSocketGetAcceptConnResponse, D>::encode(
8530                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8531                encoder,
8532                offset,
8533                _depth,
8534            )
8535        }
8536    }
8537    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8538        fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D> for (T0,)
8539    {
8540        #[inline]
8541        unsafe fn encode(
8542            self,
8543            encoder: &mut fidl::encoding::Encoder<'_, D>,
8544            offset: usize,
8545            depth: fidl::encoding::Depth,
8546        ) -> fidl::Result<()> {
8547            encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8548            // Zero out padding regions. There's no need to apply masks
8549            // because the unmasked parts will be overwritten by fields.
8550            // Write the fields.
8551            self.0.encode(encoder, offset + 0, depth)?;
8552            Ok(())
8553        }
8554    }
8555
8556    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8557        for BaseSocketGetAcceptConnResponse
8558    {
8559        #[inline(always)]
8560        fn new_empty() -> Self {
8561            Self { value: fidl::new_empty!(bool, D) }
8562        }
8563
8564        #[inline]
8565        unsafe fn decode(
8566            &mut self,
8567            decoder: &mut fidl::encoding::Decoder<'_, D>,
8568            offset: usize,
8569            _depth: fidl::encoding::Depth,
8570        ) -> fidl::Result<()> {
8571            decoder.debug_check_bounds::<Self>(offset);
8572            // Verify that padding bytes are zero.
8573            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8574            Ok(())
8575        }
8576    }
8577
8578    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToDeviceResponse {
8579        type Borrowed<'a> = &'a Self;
8580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8581            value
8582        }
8583    }
8584
8585    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToDeviceResponse {
8586        type Owned = Self;
8587
8588        #[inline(always)]
8589        fn inline_align(_context: fidl::encoding::Context) -> usize {
8590            8
8591        }
8592
8593        #[inline(always)]
8594        fn inline_size(_context: fidl::encoding::Context) -> usize {
8595            16
8596        }
8597    }
8598
8599    unsafe impl<D: fidl::encoding::ResourceDialect>
8600        fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D>
8601        for &BaseSocketGetBindToDeviceResponse
8602    {
8603        #[inline]
8604        unsafe fn encode(
8605            self,
8606            encoder: &mut fidl::encoding::Encoder<'_, D>,
8607            offset: usize,
8608            _depth: fidl::encoding::Depth,
8609        ) -> fidl::Result<()> {
8610            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8611            // Delegate to tuple encoding.
8612            fidl::encoding::Encode::<BaseSocketGetBindToDeviceResponse, D>::encode(
8613                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
8614                    &self.value,
8615                ),),
8616                encoder,
8617                offset,
8618                _depth,
8619            )
8620        }
8621    }
8622    unsafe impl<
8623        D: fidl::encoding::ResourceDialect,
8624        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
8625    > fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D> for (T0,)
8626    {
8627        #[inline]
8628        unsafe fn encode(
8629            self,
8630            encoder: &mut fidl::encoding::Encoder<'_, D>,
8631            offset: usize,
8632            depth: fidl::encoding::Depth,
8633        ) -> fidl::Result<()> {
8634            encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8635            // Zero out padding regions. There's no need to apply masks
8636            // because the unmasked parts will be overwritten by fields.
8637            // Write the fields.
8638            self.0.encode(encoder, offset + 0, depth)?;
8639            Ok(())
8640        }
8641    }
8642
8643    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8644        for BaseSocketGetBindToDeviceResponse
8645    {
8646        #[inline(always)]
8647        fn new_empty() -> Self {
8648            Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
8649        }
8650
8651        #[inline]
8652        unsafe fn decode(
8653            &mut self,
8654            decoder: &mut fidl::encoding::Decoder<'_, D>,
8655            offset: usize,
8656            _depth: fidl::encoding::Depth,
8657        ) -> fidl::Result<()> {
8658            decoder.debug_check_bounds::<Self>(offset);
8659            // Verify that padding bytes are zero.
8660            fidl::decode!(
8661                fidl::encoding::BoundedString<15>,
8662                D,
8663                &mut self.value,
8664                decoder,
8665                offset + 0,
8666                _depth
8667            )?;
8668            Ok(())
8669        }
8670    }
8671
8672    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8673        type Borrowed<'a> = &'a Self;
8674        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8675            value
8676        }
8677    }
8678
8679    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8680        type Owned = Self;
8681
8682        #[inline(always)]
8683        fn inline_align(_context: fidl::encoding::Context) -> usize {
8684            8
8685        }
8686
8687        #[inline(always)]
8688        fn inline_size(_context: fidl::encoding::Context) -> usize {
8689            8
8690        }
8691        #[inline(always)]
8692        fn encode_is_copy() -> bool {
8693            true
8694        }
8695
8696        #[inline(always)]
8697        fn decode_is_copy() -> bool {
8698            true
8699        }
8700    }
8701
8702    unsafe impl<D: fidl::encoding::ResourceDialect>
8703        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D>
8704        for &BaseSocketGetBindToInterfaceIndexResponse
8705    {
8706        #[inline]
8707        unsafe fn encode(
8708            self,
8709            encoder: &mut fidl::encoding::Encoder<'_, D>,
8710            offset: usize,
8711            _depth: fidl::encoding::Depth,
8712        ) -> fidl::Result<()> {
8713            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8714            unsafe {
8715                // Copy the object into the buffer.
8716                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8717                (buf_ptr as *mut BaseSocketGetBindToInterfaceIndexResponse).write_unaligned(
8718                    (self as *const BaseSocketGetBindToInterfaceIndexResponse).read(),
8719                );
8720                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8721                // done second because the memcpy will write garbage to these bytes.
8722            }
8723            Ok(())
8724        }
8725    }
8726    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8727        fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D> for (T0,)
8728    {
8729        #[inline]
8730        unsafe fn encode(
8731            self,
8732            encoder: &mut fidl::encoding::Encoder<'_, D>,
8733            offset: usize,
8734            depth: fidl::encoding::Depth,
8735        ) -> fidl::Result<()> {
8736            encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8737            // Zero out padding regions. There's no need to apply masks
8738            // because the unmasked parts will be overwritten by fields.
8739            // Write the fields.
8740            self.0.encode(encoder, offset + 0, depth)?;
8741            Ok(())
8742        }
8743    }
8744
8745    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8746        for BaseSocketGetBindToInterfaceIndexResponse
8747    {
8748        #[inline(always)]
8749        fn new_empty() -> Self {
8750            Self { value: fidl::new_empty!(u64, D) }
8751        }
8752
8753        #[inline]
8754        unsafe fn decode(
8755            &mut self,
8756            decoder: &mut fidl::encoding::Decoder<'_, D>,
8757            offset: usize,
8758            _depth: fidl::encoding::Depth,
8759        ) -> fidl::Result<()> {
8760            decoder.debug_check_bounds::<Self>(offset);
8761            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8762            // Verify that padding bytes are zero.
8763            // Copy from the buffer into the object.
8764            unsafe {
8765                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8766            }
8767            Ok(())
8768        }
8769    }
8770
8771    impl fidl::encoding::ValueTypeMarker for BaseSocketGetBroadcastResponse {
8772        type Borrowed<'a> = &'a Self;
8773        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8774            value
8775        }
8776    }
8777
8778    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBroadcastResponse {
8779        type Owned = Self;
8780
8781        #[inline(always)]
8782        fn inline_align(_context: fidl::encoding::Context) -> usize {
8783            1
8784        }
8785
8786        #[inline(always)]
8787        fn inline_size(_context: fidl::encoding::Context) -> usize {
8788            1
8789        }
8790    }
8791
8792    unsafe impl<D: fidl::encoding::ResourceDialect>
8793        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D>
8794        for &BaseSocketGetBroadcastResponse
8795    {
8796        #[inline]
8797        unsafe fn encode(
8798            self,
8799            encoder: &mut fidl::encoding::Encoder<'_, D>,
8800            offset: usize,
8801            _depth: fidl::encoding::Depth,
8802        ) -> fidl::Result<()> {
8803            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8804            // Delegate to tuple encoding.
8805            fidl::encoding::Encode::<BaseSocketGetBroadcastResponse, D>::encode(
8806                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8807                encoder,
8808                offset,
8809                _depth,
8810            )
8811        }
8812    }
8813    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8814        fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D> for (T0,)
8815    {
8816        #[inline]
8817        unsafe fn encode(
8818            self,
8819            encoder: &mut fidl::encoding::Encoder<'_, D>,
8820            offset: usize,
8821            depth: fidl::encoding::Depth,
8822        ) -> fidl::Result<()> {
8823            encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8824            // Zero out padding regions. There's no need to apply masks
8825            // because the unmasked parts will be overwritten by fields.
8826            // Write the fields.
8827            self.0.encode(encoder, offset + 0, depth)?;
8828            Ok(())
8829        }
8830    }
8831
8832    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8833        for BaseSocketGetBroadcastResponse
8834    {
8835        #[inline(always)]
8836        fn new_empty() -> Self {
8837            Self { value: fidl::new_empty!(bool, D) }
8838        }
8839
8840        #[inline]
8841        unsafe fn decode(
8842            &mut self,
8843            decoder: &mut fidl::encoding::Decoder<'_, D>,
8844            offset: usize,
8845            _depth: fidl::encoding::Depth,
8846        ) -> fidl::Result<()> {
8847            decoder.debug_check_bounds::<Self>(offset);
8848            // Verify that padding bytes are zero.
8849            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8850            Ok(())
8851        }
8852    }
8853
8854    impl fidl::encoding::ValueTypeMarker for BaseSocketGetCookieResponse {
8855        type Borrowed<'a> = &'a Self;
8856        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8857            value
8858        }
8859    }
8860
8861    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetCookieResponse {
8862        type Owned = Self;
8863
8864        #[inline(always)]
8865        fn inline_align(_context: fidl::encoding::Context) -> usize {
8866            8
8867        }
8868
8869        #[inline(always)]
8870        fn inline_size(_context: fidl::encoding::Context) -> usize {
8871            8
8872        }
8873        #[inline(always)]
8874        fn encode_is_copy() -> bool {
8875            true
8876        }
8877
8878        #[inline(always)]
8879        fn decode_is_copy() -> bool {
8880            true
8881        }
8882    }
8883
8884    unsafe impl<D: fidl::encoding::ResourceDialect>
8885        fidl::encoding::Encode<BaseSocketGetCookieResponse, D> for &BaseSocketGetCookieResponse
8886    {
8887        #[inline]
8888        unsafe fn encode(
8889            self,
8890            encoder: &mut fidl::encoding::Encoder<'_, D>,
8891            offset: usize,
8892            _depth: fidl::encoding::Depth,
8893        ) -> fidl::Result<()> {
8894            encoder.debug_check_bounds::<BaseSocketGetCookieResponse>(offset);
8895            unsafe {
8896                // Copy the object into the buffer.
8897                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8898                (buf_ptr as *mut BaseSocketGetCookieResponse)
8899                    .write_unaligned((self as *const BaseSocketGetCookieResponse).read());
8900                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8901                // done second because the memcpy will write garbage to these bytes.
8902            }
8903            Ok(())
8904        }
8905    }
8906    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8907        fidl::encoding::Encode<BaseSocketGetCookieResponse, D> for (T0,)
8908    {
8909        #[inline]
8910        unsafe fn encode(
8911            self,
8912            encoder: &mut fidl::encoding::Encoder<'_, D>,
8913            offset: usize,
8914            depth: fidl::encoding::Depth,
8915        ) -> fidl::Result<()> {
8916            encoder.debug_check_bounds::<BaseSocketGetCookieResponse>(offset);
8917            // Zero out padding regions. There's no need to apply masks
8918            // because the unmasked parts will be overwritten by fields.
8919            // Write the fields.
8920            self.0.encode(encoder, offset + 0, depth)?;
8921            Ok(())
8922        }
8923    }
8924
8925    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8926        for BaseSocketGetCookieResponse
8927    {
8928        #[inline(always)]
8929        fn new_empty() -> Self {
8930            Self { value: fidl::new_empty!(u64, D) }
8931        }
8932
8933        #[inline]
8934        unsafe fn decode(
8935            &mut self,
8936            decoder: &mut fidl::encoding::Decoder<'_, D>,
8937            offset: usize,
8938            _depth: fidl::encoding::Depth,
8939        ) -> fidl::Result<()> {
8940            decoder.debug_check_bounds::<Self>(offset);
8941            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8942            // Verify that padding bytes are zero.
8943            // Copy from the buffer into the object.
8944            unsafe {
8945                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8946            }
8947            Ok(())
8948        }
8949    }
8950
8951    impl fidl::encoding::ValueTypeMarker for BaseSocketGetKeepAliveResponse {
8952        type Borrowed<'a> = &'a Self;
8953        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8954            value
8955        }
8956    }
8957
8958    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetKeepAliveResponse {
8959        type Owned = Self;
8960
8961        #[inline(always)]
8962        fn inline_align(_context: fidl::encoding::Context) -> usize {
8963            1
8964        }
8965
8966        #[inline(always)]
8967        fn inline_size(_context: fidl::encoding::Context) -> usize {
8968            1
8969        }
8970    }
8971
8972    unsafe impl<D: fidl::encoding::ResourceDialect>
8973        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D>
8974        for &BaseSocketGetKeepAliveResponse
8975    {
8976        #[inline]
8977        unsafe fn encode(
8978            self,
8979            encoder: &mut fidl::encoding::Encoder<'_, D>,
8980            offset: usize,
8981            _depth: fidl::encoding::Depth,
8982        ) -> fidl::Result<()> {
8983            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8984            // Delegate to tuple encoding.
8985            fidl::encoding::Encode::<BaseSocketGetKeepAliveResponse, D>::encode(
8986                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8987                encoder,
8988                offset,
8989                _depth,
8990            )
8991        }
8992    }
8993    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8994        fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D> for (T0,)
8995    {
8996        #[inline]
8997        unsafe fn encode(
8998            self,
8999            encoder: &mut fidl::encoding::Encoder<'_, D>,
9000            offset: usize,
9001            depth: fidl::encoding::Depth,
9002        ) -> fidl::Result<()> {
9003            encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
9004            // Zero out padding regions. There's no need to apply masks
9005            // because the unmasked parts will be overwritten by fields.
9006            // Write the fields.
9007            self.0.encode(encoder, offset + 0, depth)?;
9008            Ok(())
9009        }
9010    }
9011
9012    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9013        for BaseSocketGetKeepAliveResponse
9014    {
9015        #[inline(always)]
9016        fn new_empty() -> Self {
9017            Self { value: fidl::new_empty!(bool, D) }
9018        }
9019
9020        #[inline]
9021        unsafe fn decode(
9022            &mut self,
9023            decoder: &mut fidl::encoding::Decoder<'_, D>,
9024            offset: usize,
9025            _depth: fidl::encoding::Depth,
9026        ) -> fidl::Result<()> {
9027            decoder.debug_check_bounds::<Self>(offset);
9028            // Verify that padding bytes are zero.
9029            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9030            Ok(())
9031        }
9032    }
9033
9034    impl fidl::encoding::ValueTypeMarker for BaseSocketGetLingerResponse {
9035        type Borrowed<'a> = &'a Self;
9036        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9037            value
9038        }
9039    }
9040
9041    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetLingerResponse {
9042        type Owned = Self;
9043
9044        #[inline(always)]
9045        fn inline_align(_context: fidl::encoding::Context) -> usize {
9046            4
9047        }
9048
9049        #[inline(always)]
9050        fn inline_size(_context: fidl::encoding::Context) -> usize {
9051            8
9052        }
9053    }
9054
9055    unsafe impl<D: fidl::encoding::ResourceDialect>
9056        fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for &BaseSocketGetLingerResponse
9057    {
9058        #[inline]
9059        unsafe fn encode(
9060            self,
9061            encoder: &mut fidl::encoding::Encoder<'_, D>,
9062            offset: usize,
9063            _depth: fidl::encoding::Depth,
9064        ) -> fidl::Result<()> {
9065            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
9066            // Delegate to tuple encoding.
9067            fidl::encoding::Encode::<BaseSocketGetLingerResponse, D>::encode(
9068                (
9069                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
9070                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
9071                ),
9072                encoder,
9073                offset,
9074                _depth,
9075            )
9076        }
9077    }
9078    unsafe impl<
9079        D: fidl::encoding::ResourceDialect,
9080        T0: fidl::encoding::Encode<bool, D>,
9081        T1: fidl::encoding::Encode<u32, D>,
9082    > fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for (T0, T1)
9083    {
9084        #[inline]
9085        unsafe fn encode(
9086            self,
9087            encoder: &mut fidl::encoding::Encoder<'_, D>,
9088            offset: usize,
9089            depth: fidl::encoding::Depth,
9090        ) -> fidl::Result<()> {
9091            encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
9092            // Zero out padding regions. There's no need to apply masks
9093            // because the unmasked parts will be overwritten by fields.
9094            unsafe {
9095                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9096                (ptr as *mut u32).write_unaligned(0);
9097            }
9098            // Write the fields.
9099            self.0.encode(encoder, offset + 0, depth)?;
9100            self.1.encode(encoder, offset + 4, depth)?;
9101            Ok(())
9102        }
9103    }
9104
9105    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9106        for BaseSocketGetLingerResponse
9107    {
9108        #[inline(always)]
9109        fn new_empty() -> Self {
9110            Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
9111        }
9112
9113        #[inline]
9114        unsafe fn decode(
9115            &mut self,
9116            decoder: &mut fidl::encoding::Decoder<'_, D>,
9117            offset: usize,
9118            _depth: fidl::encoding::Depth,
9119        ) -> fidl::Result<()> {
9120            decoder.debug_check_bounds::<Self>(offset);
9121            // Verify that padding bytes are zero.
9122            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9123            let padval = unsafe { (ptr as *const u32).read_unaligned() };
9124            let mask = 0xffffff00u32;
9125            let maskedval = padval & mask;
9126            if maskedval != 0 {
9127                return Err(fidl::Error::NonZeroPadding {
9128                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9129                });
9130            }
9131            fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
9132            fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
9133            Ok(())
9134        }
9135    }
9136
9137    impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkResponse {
9138        type Borrowed<'a> = &'a Self;
9139        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9140            value
9141        }
9142    }
9143
9144    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkResponse {
9145        type Owned = Self;
9146
9147        #[inline(always)]
9148        fn inline_align(_context: fidl::encoding::Context) -> usize {
9149            8
9150        }
9151
9152        #[inline(always)]
9153        fn inline_size(_context: fidl::encoding::Context) -> usize {
9154            16
9155        }
9156    }
9157
9158    unsafe impl<D: fidl::encoding::ResourceDialect>
9159        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for &BaseSocketGetMarkResponse
9160    {
9161        #[inline]
9162        unsafe fn encode(
9163            self,
9164            encoder: &mut fidl::encoding::Encoder<'_, D>,
9165            offset: usize,
9166            _depth: fidl::encoding::Depth,
9167        ) -> fidl::Result<()> {
9168            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
9169            // Delegate to tuple encoding.
9170            fidl::encoding::Encode::<BaseSocketGetMarkResponse, D>::encode(
9171                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),),
9172                encoder,
9173                offset,
9174                _depth,
9175            )
9176        }
9177    }
9178    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
9179        fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for (T0,)
9180    {
9181        #[inline]
9182        unsafe fn encode(
9183            self,
9184            encoder: &mut fidl::encoding::Encoder<'_, D>,
9185            offset: usize,
9186            depth: fidl::encoding::Depth,
9187        ) -> fidl::Result<()> {
9188            encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
9189            // Zero out padding regions. There's no need to apply masks
9190            // because the unmasked parts will be overwritten by fields.
9191            // Write the fields.
9192            self.0.encode(encoder, offset + 0, depth)?;
9193            Ok(())
9194        }
9195    }
9196
9197    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9198        for BaseSocketGetMarkResponse
9199    {
9200        #[inline(always)]
9201        fn new_empty() -> Self {
9202            Self { mark: fidl::new_empty!(OptionalUint32, D) }
9203        }
9204
9205        #[inline]
9206        unsafe fn decode(
9207            &mut self,
9208            decoder: &mut fidl::encoding::Decoder<'_, D>,
9209            offset: usize,
9210            _depth: fidl::encoding::Depth,
9211        ) -> fidl::Result<()> {
9212            decoder.debug_check_bounds::<Self>(offset);
9213            // Verify that padding bytes are zero.
9214            fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 0, _depth)?;
9215            Ok(())
9216        }
9217    }
9218
9219    impl fidl::encoding::ValueTypeMarker for BaseSocketGetNoCheckResponse {
9220        type Borrowed<'a> = &'a Self;
9221        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9222            value
9223        }
9224    }
9225
9226    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetNoCheckResponse {
9227        type Owned = Self;
9228
9229        #[inline(always)]
9230        fn inline_align(_context: fidl::encoding::Context) -> usize {
9231            1
9232        }
9233
9234        #[inline(always)]
9235        fn inline_size(_context: fidl::encoding::Context) -> usize {
9236            1
9237        }
9238    }
9239
9240    unsafe impl<D: fidl::encoding::ResourceDialect>
9241        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for &BaseSocketGetNoCheckResponse
9242    {
9243        #[inline]
9244        unsafe fn encode(
9245            self,
9246            encoder: &mut fidl::encoding::Encoder<'_, D>,
9247            offset: usize,
9248            _depth: fidl::encoding::Depth,
9249        ) -> fidl::Result<()> {
9250            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
9251            // Delegate to tuple encoding.
9252            fidl::encoding::Encode::<BaseSocketGetNoCheckResponse, D>::encode(
9253                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9254                encoder,
9255                offset,
9256                _depth,
9257            )
9258        }
9259    }
9260    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9261        fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for (T0,)
9262    {
9263        #[inline]
9264        unsafe fn encode(
9265            self,
9266            encoder: &mut fidl::encoding::Encoder<'_, D>,
9267            offset: usize,
9268            depth: fidl::encoding::Depth,
9269        ) -> fidl::Result<()> {
9270            encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
9271            // Zero out padding regions. There's no need to apply masks
9272            // because the unmasked parts will be overwritten by fields.
9273            // Write the fields.
9274            self.0.encode(encoder, offset + 0, depth)?;
9275            Ok(())
9276        }
9277    }
9278
9279    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9280        for BaseSocketGetNoCheckResponse
9281    {
9282        #[inline(always)]
9283        fn new_empty() -> Self {
9284            Self { value: fidl::new_empty!(bool, D) }
9285        }
9286
9287        #[inline]
9288        unsafe fn decode(
9289            &mut self,
9290            decoder: &mut fidl::encoding::Decoder<'_, D>,
9291            offset: usize,
9292            _depth: fidl::encoding::Depth,
9293        ) -> fidl::Result<()> {
9294            decoder.debug_check_bounds::<Self>(offset);
9295            // Verify that padding bytes are zero.
9296            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9297            Ok(())
9298        }
9299    }
9300
9301    impl fidl::encoding::ValueTypeMarker for BaseSocketGetOutOfBandInlineResponse {
9302        type Borrowed<'a> = &'a Self;
9303        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9304            value
9305        }
9306    }
9307
9308    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetOutOfBandInlineResponse {
9309        type Owned = Self;
9310
9311        #[inline(always)]
9312        fn inline_align(_context: fidl::encoding::Context) -> usize {
9313            1
9314        }
9315
9316        #[inline(always)]
9317        fn inline_size(_context: fidl::encoding::Context) -> usize {
9318            1
9319        }
9320    }
9321
9322    unsafe impl<D: fidl::encoding::ResourceDialect>
9323        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D>
9324        for &BaseSocketGetOutOfBandInlineResponse
9325    {
9326        #[inline]
9327        unsafe fn encode(
9328            self,
9329            encoder: &mut fidl::encoding::Encoder<'_, D>,
9330            offset: usize,
9331            _depth: fidl::encoding::Depth,
9332        ) -> fidl::Result<()> {
9333            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9334            // Delegate to tuple encoding.
9335            fidl::encoding::Encode::<BaseSocketGetOutOfBandInlineResponse, D>::encode(
9336                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9337                encoder,
9338                offset,
9339                _depth,
9340            )
9341        }
9342    }
9343    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9344        fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D> for (T0,)
9345    {
9346        #[inline]
9347        unsafe fn encode(
9348            self,
9349            encoder: &mut fidl::encoding::Encoder<'_, D>,
9350            offset: usize,
9351            depth: fidl::encoding::Depth,
9352        ) -> fidl::Result<()> {
9353            encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9354            // Zero out padding regions. There's no need to apply masks
9355            // because the unmasked parts will be overwritten by fields.
9356            // Write the fields.
9357            self.0.encode(encoder, offset + 0, depth)?;
9358            Ok(())
9359        }
9360    }
9361
9362    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9363        for BaseSocketGetOutOfBandInlineResponse
9364    {
9365        #[inline(always)]
9366        fn new_empty() -> Self {
9367            Self { value: fidl::new_empty!(bool, D) }
9368        }
9369
9370        #[inline]
9371        unsafe fn decode(
9372            &mut self,
9373            decoder: &mut fidl::encoding::Decoder<'_, D>,
9374            offset: usize,
9375            _depth: fidl::encoding::Depth,
9376        ) -> fidl::Result<()> {
9377            decoder.debug_check_bounds::<Self>(offset);
9378            // Verify that padding bytes are zero.
9379            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9380            Ok(())
9381        }
9382    }
9383
9384    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReceiveBufferResponse {
9385        type Borrowed<'a> = &'a Self;
9386        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9387            value
9388        }
9389    }
9390
9391    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReceiveBufferResponse {
9392        type Owned = Self;
9393
9394        #[inline(always)]
9395        fn inline_align(_context: fidl::encoding::Context) -> usize {
9396            8
9397        }
9398
9399        #[inline(always)]
9400        fn inline_size(_context: fidl::encoding::Context) -> usize {
9401            8
9402        }
9403        #[inline(always)]
9404        fn encode_is_copy() -> bool {
9405            true
9406        }
9407
9408        #[inline(always)]
9409        fn decode_is_copy() -> bool {
9410            true
9411        }
9412    }
9413
9414    unsafe impl<D: fidl::encoding::ResourceDialect>
9415        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D>
9416        for &BaseSocketGetReceiveBufferResponse
9417    {
9418        #[inline]
9419        unsafe fn encode(
9420            self,
9421            encoder: &mut fidl::encoding::Encoder<'_, D>,
9422            offset: usize,
9423            _depth: fidl::encoding::Depth,
9424        ) -> fidl::Result<()> {
9425            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9426            unsafe {
9427                // Copy the object into the buffer.
9428                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9429                (buf_ptr as *mut BaseSocketGetReceiveBufferResponse)
9430                    .write_unaligned((self as *const BaseSocketGetReceiveBufferResponse).read());
9431                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9432                // done second because the memcpy will write garbage to these bytes.
9433            }
9434            Ok(())
9435        }
9436    }
9437    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9438        fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D> for (T0,)
9439    {
9440        #[inline]
9441        unsafe fn encode(
9442            self,
9443            encoder: &mut fidl::encoding::Encoder<'_, D>,
9444            offset: usize,
9445            depth: fidl::encoding::Depth,
9446        ) -> fidl::Result<()> {
9447            encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9448            // Zero out padding regions. There's no need to apply masks
9449            // because the unmasked parts will be overwritten by fields.
9450            // Write the fields.
9451            self.0.encode(encoder, offset + 0, depth)?;
9452            Ok(())
9453        }
9454    }
9455
9456    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9457        for BaseSocketGetReceiveBufferResponse
9458    {
9459        #[inline(always)]
9460        fn new_empty() -> Self {
9461            Self { value_bytes: fidl::new_empty!(u64, D) }
9462        }
9463
9464        #[inline]
9465        unsafe fn decode(
9466            &mut self,
9467            decoder: &mut fidl::encoding::Decoder<'_, D>,
9468            offset: usize,
9469            _depth: fidl::encoding::Depth,
9470        ) -> fidl::Result<()> {
9471            decoder.debug_check_bounds::<Self>(offset);
9472            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9473            // Verify that padding bytes are zero.
9474            // Copy from the buffer into the object.
9475            unsafe {
9476                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9477            }
9478            Ok(())
9479        }
9480    }
9481
9482    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReuseAddressResponse {
9483        type Borrowed<'a> = &'a Self;
9484        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9485            value
9486        }
9487    }
9488
9489    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReuseAddressResponse {
9490        type Owned = Self;
9491
9492        #[inline(always)]
9493        fn inline_align(_context: fidl::encoding::Context) -> usize {
9494            1
9495        }
9496
9497        #[inline(always)]
9498        fn inline_size(_context: fidl::encoding::Context) -> usize {
9499            1
9500        }
9501    }
9502
9503    unsafe impl<D: fidl::encoding::ResourceDialect>
9504        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D>
9505        for &BaseSocketGetReuseAddressResponse
9506    {
9507        #[inline]
9508        unsafe fn encode(
9509            self,
9510            encoder: &mut fidl::encoding::Encoder<'_, D>,
9511            offset: usize,
9512            _depth: fidl::encoding::Depth,
9513        ) -> fidl::Result<()> {
9514            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9515            // Delegate to tuple encoding.
9516            fidl::encoding::Encode::<BaseSocketGetReuseAddressResponse, D>::encode(
9517                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9518                encoder,
9519                offset,
9520                _depth,
9521            )
9522        }
9523    }
9524    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9525        fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D> for (T0,)
9526    {
9527        #[inline]
9528        unsafe fn encode(
9529            self,
9530            encoder: &mut fidl::encoding::Encoder<'_, D>,
9531            offset: usize,
9532            depth: fidl::encoding::Depth,
9533        ) -> fidl::Result<()> {
9534            encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9535            // Zero out padding regions. There's no need to apply masks
9536            // because the unmasked parts will be overwritten by fields.
9537            // Write the fields.
9538            self.0.encode(encoder, offset + 0, depth)?;
9539            Ok(())
9540        }
9541    }
9542
9543    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9544        for BaseSocketGetReuseAddressResponse
9545    {
9546        #[inline(always)]
9547        fn new_empty() -> Self {
9548            Self { value: fidl::new_empty!(bool, D) }
9549        }
9550
9551        #[inline]
9552        unsafe fn decode(
9553            &mut self,
9554            decoder: &mut fidl::encoding::Decoder<'_, D>,
9555            offset: usize,
9556            _depth: fidl::encoding::Depth,
9557        ) -> fidl::Result<()> {
9558            decoder.debug_check_bounds::<Self>(offset);
9559            // Verify that padding bytes are zero.
9560            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9561            Ok(())
9562        }
9563    }
9564
9565    impl fidl::encoding::ValueTypeMarker for BaseSocketGetReusePortResponse {
9566        type Borrowed<'a> = &'a Self;
9567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9568            value
9569        }
9570    }
9571
9572    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReusePortResponse {
9573        type Owned = Self;
9574
9575        #[inline(always)]
9576        fn inline_align(_context: fidl::encoding::Context) -> usize {
9577            1
9578        }
9579
9580        #[inline(always)]
9581        fn inline_size(_context: fidl::encoding::Context) -> usize {
9582            1
9583        }
9584    }
9585
9586    unsafe impl<D: fidl::encoding::ResourceDialect>
9587        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D>
9588        for &BaseSocketGetReusePortResponse
9589    {
9590        #[inline]
9591        unsafe fn encode(
9592            self,
9593            encoder: &mut fidl::encoding::Encoder<'_, D>,
9594            offset: usize,
9595            _depth: fidl::encoding::Depth,
9596        ) -> fidl::Result<()> {
9597            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9598            // Delegate to tuple encoding.
9599            fidl::encoding::Encode::<BaseSocketGetReusePortResponse, D>::encode(
9600                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9601                encoder,
9602                offset,
9603                _depth,
9604            )
9605        }
9606    }
9607    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9608        fidl::encoding::Encode<BaseSocketGetReusePortResponse, D> for (T0,)
9609    {
9610        #[inline]
9611        unsafe fn encode(
9612            self,
9613            encoder: &mut fidl::encoding::Encoder<'_, D>,
9614            offset: usize,
9615            depth: fidl::encoding::Depth,
9616        ) -> fidl::Result<()> {
9617            encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9618            // Zero out padding regions. There's no need to apply masks
9619            // because the unmasked parts will be overwritten by fields.
9620            // Write the fields.
9621            self.0.encode(encoder, offset + 0, depth)?;
9622            Ok(())
9623        }
9624    }
9625
9626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9627        for BaseSocketGetReusePortResponse
9628    {
9629        #[inline(always)]
9630        fn new_empty() -> Self {
9631            Self { value: fidl::new_empty!(bool, D) }
9632        }
9633
9634        #[inline]
9635        unsafe fn decode(
9636            &mut self,
9637            decoder: &mut fidl::encoding::Decoder<'_, D>,
9638            offset: usize,
9639            _depth: fidl::encoding::Depth,
9640        ) -> fidl::Result<()> {
9641            decoder.debug_check_bounds::<Self>(offset);
9642            // Verify that padding bytes are zero.
9643            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9644            Ok(())
9645        }
9646    }
9647
9648    impl fidl::encoding::ValueTypeMarker for BaseSocketGetSendBufferResponse {
9649        type Borrowed<'a> = &'a Self;
9650        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9651            value
9652        }
9653    }
9654
9655    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetSendBufferResponse {
9656        type Owned = Self;
9657
9658        #[inline(always)]
9659        fn inline_align(_context: fidl::encoding::Context) -> usize {
9660            8
9661        }
9662
9663        #[inline(always)]
9664        fn inline_size(_context: fidl::encoding::Context) -> usize {
9665            8
9666        }
9667        #[inline(always)]
9668        fn encode_is_copy() -> bool {
9669            true
9670        }
9671
9672        #[inline(always)]
9673        fn decode_is_copy() -> bool {
9674            true
9675        }
9676    }
9677
9678    unsafe impl<D: fidl::encoding::ResourceDialect>
9679        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D>
9680        for &BaseSocketGetSendBufferResponse
9681    {
9682        #[inline]
9683        unsafe fn encode(
9684            self,
9685            encoder: &mut fidl::encoding::Encoder<'_, D>,
9686            offset: usize,
9687            _depth: fidl::encoding::Depth,
9688        ) -> fidl::Result<()> {
9689            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9690            unsafe {
9691                // Copy the object into the buffer.
9692                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9693                (buf_ptr as *mut BaseSocketGetSendBufferResponse)
9694                    .write_unaligned((self as *const BaseSocketGetSendBufferResponse).read());
9695                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9696                // done second because the memcpy will write garbage to these bytes.
9697            }
9698            Ok(())
9699        }
9700    }
9701    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9702        fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D> for (T0,)
9703    {
9704        #[inline]
9705        unsafe fn encode(
9706            self,
9707            encoder: &mut fidl::encoding::Encoder<'_, D>,
9708            offset: usize,
9709            depth: fidl::encoding::Depth,
9710        ) -> fidl::Result<()> {
9711            encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9712            // Zero out padding regions. There's no need to apply masks
9713            // because the unmasked parts will be overwritten by fields.
9714            // Write the fields.
9715            self.0.encode(encoder, offset + 0, depth)?;
9716            Ok(())
9717        }
9718    }
9719
9720    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9721        for BaseSocketGetSendBufferResponse
9722    {
9723        #[inline(always)]
9724        fn new_empty() -> Self {
9725            Self { value_bytes: fidl::new_empty!(u64, D) }
9726        }
9727
9728        #[inline]
9729        unsafe fn decode(
9730            &mut self,
9731            decoder: &mut fidl::encoding::Decoder<'_, D>,
9732            offset: usize,
9733            _depth: fidl::encoding::Depth,
9734        ) -> fidl::Result<()> {
9735            decoder.debug_check_bounds::<Self>(offset);
9736            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9737            // Verify that padding bytes are zero.
9738            // Copy from the buffer into the object.
9739            unsafe {
9740                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9741            }
9742            Ok(())
9743        }
9744    }
9745
9746    impl fidl::encoding::ValueTypeMarker for BaseSocketGetTimestampResponse {
9747        type Borrowed<'a> = &'a Self;
9748        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9749            value
9750        }
9751    }
9752
9753    unsafe impl fidl::encoding::TypeMarker for BaseSocketGetTimestampResponse {
9754        type Owned = Self;
9755
9756        #[inline(always)]
9757        fn inline_align(_context: fidl::encoding::Context) -> usize {
9758            4
9759        }
9760
9761        #[inline(always)]
9762        fn inline_size(_context: fidl::encoding::Context) -> usize {
9763            4
9764        }
9765    }
9766
9767    unsafe impl<D: fidl::encoding::ResourceDialect>
9768        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D>
9769        for &BaseSocketGetTimestampResponse
9770    {
9771        #[inline]
9772        unsafe fn encode(
9773            self,
9774            encoder: &mut fidl::encoding::Encoder<'_, D>,
9775            offset: usize,
9776            _depth: fidl::encoding::Depth,
9777        ) -> fidl::Result<()> {
9778            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9779            // Delegate to tuple encoding.
9780            fidl::encoding::Encode::<BaseSocketGetTimestampResponse, D>::encode(
9781                (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9782                encoder,
9783                offset,
9784                _depth,
9785            )
9786        }
9787    }
9788    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
9789        fidl::encoding::Encode<BaseSocketGetTimestampResponse, D> for (T0,)
9790    {
9791        #[inline]
9792        unsafe fn encode(
9793            self,
9794            encoder: &mut fidl::encoding::Encoder<'_, D>,
9795            offset: usize,
9796            depth: fidl::encoding::Depth,
9797        ) -> fidl::Result<()> {
9798            encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9799            // Zero out padding regions. There's no need to apply masks
9800            // because the unmasked parts will be overwritten by fields.
9801            // Write the fields.
9802            self.0.encode(encoder, offset + 0, depth)?;
9803            Ok(())
9804        }
9805    }
9806
9807    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9808        for BaseSocketGetTimestampResponse
9809    {
9810        #[inline(always)]
9811        fn new_empty() -> Self {
9812            Self { value: fidl::new_empty!(TimestampOption, D) }
9813        }
9814
9815        #[inline]
9816        unsafe fn decode(
9817            &mut self,
9818            decoder: &mut fidl::encoding::Decoder<'_, D>,
9819            offset: usize,
9820            _depth: fidl::encoding::Depth,
9821        ) -> fidl::Result<()> {
9822            decoder.debug_check_bounds::<Self>(offset);
9823            // Verify that padding bytes are zero.
9824            fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
9825            Ok(())
9826        }
9827    }
9828
9829    impl fidl::encoding::ValueTypeMarker for Empty {
9830        type Borrowed<'a> = &'a Self;
9831        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9832            value
9833        }
9834    }
9835
9836    unsafe impl fidl::encoding::TypeMarker for Empty {
9837        type Owned = Self;
9838
9839        #[inline(always)]
9840        fn inline_align(_context: fidl::encoding::Context) -> usize {
9841            1
9842        }
9843
9844        #[inline(always)]
9845        fn inline_size(_context: fidl::encoding::Context) -> usize {
9846            1
9847        }
9848    }
9849
9850    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
9851        #[inline]
9852        unsafe fn encode(
9853            self,
9854            encoder: &mut fidl::encoding::Encoder<'_, D>,
9855            offset: usize,
9856            _depth: fidl::encoding::Depth,
9857        ) -> fidl::Result<()> {
9858            encoder.debug_check_bounds::<Empty>(offset);
9859            encoder.write_num(0u8, offset);
9860            Ok(())
9861        }
9862    }
9863
9864    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
9865        #[inline(always)]
9866        fn new_empty() -> Self {
9867            Self
9868        }
9869
9870        #[inline]
9871        unsafe fn decode(
9872            &mut self,
9873            decoder: &mut fidl::encoding::Decoder<'_, D>,
9874            offset: usize,
9875            _depth: fidl::encoding::Depth,
9876        ) -> fidl::Result<()> {
9877            decoder.debug_check_bounds::<Self>(offset);
9878            match decoder.read_num::<u8>(offset) {
9879                0 => Ok(()),
9880                _ => Err(fidl::Error::Invalid),
9881            }
9882        }
9883    }
9884
9885    impl fidl::encoding::ValueTypeMarker for IpMulticastMembership {
9886        type Borrowed<'a> = &'a Self;
9887        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9888            value
9889        }
9890    }
9891
9892    unsafe impl fidl::encoding::TypeMarker for IpMulticastMembership {
9893        type Owned = Self;
9894
9895        #[inline(always)]
9896        fn inline_align(_context: fidl::encoding::Context) -> usize {
9897            8
9898        }
9899
9900        #[inline(always)]
9901        fn inline_size(_context: fidl::encoding::Context) -> usize {
9902            16
9903        }
9904    }
9905
9906    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpMulticastMembership, D>
9907        for &IpMulticastMembership
9908    {
9909        #[inline]
9910        unsafe fn encode(
9911            self,
9912            encoder: &mut fidl::encoding::Encoder<'_, D>,
9913            offset: usize,
9914            _depth: fidl::encoding::Depth,
9915        ) -> fidl::Result<()> {
9916            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9917            // Delegate to tuple encoding.
9918            fidl::encoding::Encode::<IpMulticastMembership, D>::encode(
9919                (
9920                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9921                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
9922                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
9923                ),
9924                encoder, offset, _depth
9925            )
9926        }
9927    }
9928    unsafe impl<
9929        D: fidl::encoding::ResourceDialect,
9930        T0: fidl::encoding::Encode<u64, D>,
9931        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
9932        T2: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
9933    > fidl::encoding::Encode<IpMulticastMembership, D> for (T0, T1, T2)
9934    {
9935        #[inline]
9936        unsafe fn encode(
9937            self,
9938            encoder: &mut fidl::encoding::Encoder<'_, D>,
9939            offset: usize,
9940            depth: fidl::encoding::Depth,
9941        ) -> fidl::Result<()> {
9942            encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9943            // Zero out padding regions. There's no need to apply masks
9944            // because the unmasked parts will be overwritten by fields.
9945            // Write the fields.
9946            self.0.encode(encoder, offset + 0, depth)?;
9947            self.1.encode(encoder, offset + 8, depth)?;
9948            self.2.encode(encoder, offset + 12, depth)?;
9949            Ok(())
9950        }
9951    }
9952
9953    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpMulticastMembership {
9954        #[inline(always)]
9955        fn new_empty() -> Self {
9956            Self {
9957                iface: fidl::new_empty!(u64, D),
9958                local_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
9959                mcast_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
9960            }
9961        }
9962
9963        #[inline]
9964        unsafe fn decode(
9965            &mut self,
9966            decoder: &mut fidl::encoding::Decoder<'_, D>,
9967            offset: usize,
9968            _depth: fidl::encoding::Depth,
9969        ) -> fidl::Result<()> {
9970            decoder.debug_check_bounds::<Self>(offset);
9971            // Verify that padding bytes are zero.
9972            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9973            fidl::decode!(
9974                fidl_fuchsia_net_common::Ipv4Address,
9975                D,
9976                &mut self.local_addr,
9977                decoder,
9978                offset + 8,
9979                _depth
9980            )?;
9981            fidl::decode!(
9982                fidl_fuchsia_net_common::Ipv4Address,
9983                D,
9984                &mut self.mcast_addr,
9985                decoder,
9986                offset + 12,
9987                _depth
9988            )?;
9989            Ok(())
9990        }
9991    }
9992
9993    impl fidl::encoding::ValueTypeMarker for Ipv4PktInfoRecvControlData {
9994        type Borrowed<'a> = &'a Self;
9995        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9996            value
9997        }
9998    }
9999
10000    unsafe impl fidl::encoding::TypeMarker for Ipv4PktInfoRecvControlData {
10001        type Owned = Self;
10002
10003        #[inline(always)]
10004        fn inline_align(_context: fidl::encoding::Context) -> usize {
10005            8
10006        }
10007
10008        #[inline(always)]
10009        fn inline_size(_context: fidl::encoding::Context) -> usize {
10010            16
10011        }
10012    }
10013
10014    unsafe impl<D: fidl::encoding::ResourceDialect>
10015        fidl::encoding::Encode<Ipv4PktInfoRecvControlData, D> for &Ipv4PktInfoRecvControlData
10016    {
10017        #[inline]
10018        unsafe fn encode(
10019            self,
10020            encoder: &mut fidl::encoding::Encoder<'_, D>,
10021            offset: usize,
10022            _depth: fidl::encoding::Depth,
10023        ) -> fidl::Result<()> {
10024            encoder.debug_check_bounds::<Ipv4PktInfoRecvControlData>(offset);
10025            // Delegate to tuple encoding.
10026            fidl::encoding::Encode::<Ipv4PktInfoRecvControlData, D>::encode(
10027                (
10028                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10029                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
10030                    <fidl_fuchsia_net_common::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(&self.header_destination_addr),
10031                ),
10032                encoder, offset, _depth
10033            )
10034        }
10035    }
10036    unsafe impl<
10037        D: fidl::encoding::ResourceDialect,
10038        T0: fidl::encoding::Encode<u64, D>,
10039        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
10040        T2: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv4Address, D>,
10041    > fidl::encoding::Encode<Ipv4PktInfoRecvControlData, D> for (T0, T1, T2)
10042    {
10043        #[inline]
10044        unsafe fn encode(
10045            self,
10046            encoder: &mut fidl::encoding::Encoder<'_, D>,
10047            offset: usize,
10048            depth: fidl::encoding::Depth,
10049        ) -> fidl::Result<()> {
10050            encoder.debug_check_bounds::<Ipv4PktInfoRecvControlData>(offset);
10051            // Zero out padding regions. There's no need to apply masks
10052            // because the unmasked parts will be overwritten by fields.
10053            // Write the fields.
10054            self.0.encode(encoder, offset + 0, depth)?;
10055            self.1.encode(encoder, offset + 8, depth)?;
10056            self.2.encode(encoder, offset + 12, depth)?;
10057            Ok(())
10058        }
10059    }
10060
10061    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10062        for Ipv4PktInfoRecvControlData
10063    {
10064        #[inline(always)]
10065        fn new_empty() -> Self {
10066            Self {
10067                iface: fidl::new_empty!(u64, D),
10068                local_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
10069                header_destination_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv4Address, D),
10070            }
10071        }
10072
10073        #[inline]
10074        unsafe fn decode(
10075            &mut self,
10076            decoder: &mut fidl::encoding::Decoder<'_, D>,
10077            offset: usize,
10078            _depth: fidl::encoding::Depth,
10079        ) -> fidl::Result<()> {
10080            decoder.debug_check_bounds::<Self>(offset);
10081            // Verify that padding bytes are zero.
10082            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10083            fidl::decode!(
10084                fidl_fuchsia_net_common::Ipv4Address,
10085                D,
10086                &mut self.local_addr,
10087                decoder,
10088                offset + 8,
10089                _depth
10090            )?;
10091            fidl::decode!(
10092                fidl_fuchsia_net_common::Ipv4Address,
10093                D,
10094                &mut self.header_destination_addr,
10095                decoder,
10096                offset + 12,
10097                _depth
10098            )?;
10099            Ok(())
10100        }
10101    }
10102
10103    impl fidl::encoding::ValueTypeMarker for Ipv6MulticastMembership {
10104        type Borrowed<'a> = &'a Self;
10105        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10106            value
10107        }
10108    }
10109
10110    unsafe impl fidl::encoding::TypeMarker for Ipv6MulticastMembership {
10111        type Owned = Self;
10112
10113        #[inline(always)]
10114        fn inline_align(_context: fidl::encoding::Context) -> usize {
10115            8
10116        }
10117
10118        #[inline(always)]
10119        fn inline_size(_context: fidl::encoding::Context) -> usize {
10120            24
10121        }
10122    }
10123
10124    unsafe impl<D: fidl::encoding::ResourceDialect>
10125        fidl::encoding::Encode<Ipv6MulticastMembership, D> for &Ipv6MulticastMembership
10126    {
10127        #[inline]
10128        unsafe fn encode(
10129            self,
10130            encoder: &mut fidl::encoding::Encoder<'_, D>,
10131            offset: usize,
10132            _depth: fidl::encoding::Depth,
10133        ) -> fidl::Result<()> {
10134            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
10135            // Delegate to tuple encoding.
10136            fidl::encoding::Encode::<Ipv6MulticastMembership, D>::encode(
10137                (
10138                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10139                    <fidl_fuchsia_net_common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.mcast_addr),
10140                ),
10141                encoder, offset, _depth
10142            )
10143        }
10144    }
10145    unsafe impl<
10146        D: fidl::encoding::ResourceDialect,
10147        T0: fidl::encoding::Encode<u64, D>,
10148        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv6Address, D>,
10149    > fidl::encoding::Encode<Ipv6MulticastMembership, D> for (T0, T1)
10150    {
10151        #[inline]
10152        unsafe fn encode(
10153            self,
10154            encoder: &mut fidl::encoding::Encoder<'_, D>,
10155            offset: usize,
10156            depth: fidl::encoding::Depth,
10157        ) -> fidl::Result<()> {
10158            encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
10159            // Zero out padding regions. There's no need to apply masks
10160            // because the unmasked parts will be overwritten by fields.
10161            // Write the fields.
10162            self.0.encode(encoder, offset + 0, depth)?;
10163            self.1.encode(encoder, offset + 8, depth)?;
10164            Ok(())
10165        }
10166    }
10167
10168    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10169        for Ipv6MulticastMembership
10170    {
10171        #[inline(always)]
10172        fn new_empty() -> Self {
10173            Self {
10174                iface: fidl::new_empty!(u64, D),
10175                mcast_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv6Address, D),
10176            }
10177        }
10178
10179        #[inline]
10180        unsafe fn decode(
10181            &mut self,
10182            decoder: &mut fidl::encoding::Decoder<'_, D>,
10183            offset: usize,
10184            _depth: fidl::encoding::Depth,
10185        ) -> fidl::Result<()> {
10186            decoder.debug_check_bounds::<Self>(offset);
10187            // Verify that padding bytes are zero.
10188            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10189            fidl::decode!(
10190                fidl_fuchsia_net_common::Ipv6Address,
10191                D,
10192                &mut self.mcast_addr,
10193                decoder,
10194                offset + 8,
10195                _depth
10196            )?;
10197            Ok(())
10198        }
10199    }
10200
10201    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoRecvControlData {
10202        type Borrowed<'a> = &'a Self;
10203        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10204            value
10205        }
10206    }
10207
10208    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoRecvControlData {
10209        type Owned = Self;
10210
10211        #[inline(always)]
10212        fn inline_align(_context: fidl::encoding::Context) -> usize {
10213            8
10214        }
10215
10216        #[inline(always)]
10217        fn inline_size(_context: fidl::encoding::Context) -> usize {
10218            24
10219        }
10220    }
10221
10222    unsafe impl<D: fidl::encoding::ResourceDialect>
10223        fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for &Ipv6PktInfoRecvControlData
10224    {
10225        #[inline]
10226        unsafe fn encode(
10227            self,
10228            encoder: &mut fidl::encoding::Encoder<'_, D>,
10229            offset: usize,
10230            _depth: fidl::encoding::Depth,
10231        ) -> fidl::Result<()> {
10232            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
10233            // Delegate to tuple encoding.
10234            fidl::encoding::Encode::<Ipv6PktInfoRecvControlData, D>::encode(
10235                (
10236                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10237                    <fidl_fuchsia_net_common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.header_destination_addr),
10238                ),
10239                encoder, offset, _depth
10240            )
10241        }
10242    }
10243    unsafe impl<
10244        D: fidl::encoding::ResourceDialect,
10245        T0: fidl::encoding::Encode<u64, D>,
10246        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv6Address, D>,
10247    > fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for (T0, T1)
10248    {
10249        #[inline]
10250        unsafe fn encode(
10251            self,
10252            encoder: &mut fidl::encoding::Encoder<'_, D>,
10253            offset: usize,
10254            depth: fidl::encoding::Depth,
10255        ) -> fidl::Result<()> {
10256            encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
10257            // Zero out padding regions. There's no need to apply masks
10258            // because the unmasked parts will be overwritten by fields.
10259            // Write the fields.
10260            self.0.encode(encoder, offset + 0, depth)?;
10261            self.1.encode(encoder, offset + 8, depth)?;
10262            Ok(())
10263        }
10264    }
10265
10266    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10267        for Ipv6PktInfoRecvControlData
10268    {
10269        #[inline(always)]
10270        fn new_empty() -> Self {
10271            Self {
10272                iface: fidl::new_empty!(u64, D),
10273                header_destination_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv6Address, D),
10274            }
10275        }
10276
10277        #[inline]
10278        unsafe fn decode(
10279            &mut self,
10280            decoder: &mut fidl::encoding::Decoder<'_, D>,
10281            offset: usize,
10282            _depth: fidl::encoding::Depth,
10283        ) -> fidl::Result<()> {
10284            decoder.debug_check_bounds::<Self>(offset);
10285            // Verify that padding bytes are zero.
10286            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10287            fidl::decode!(
10288                fidl_fuchsia_net_common::Ipv6Address,
10289                D,
10290                &mut self.header_destination_addr,
10291                decoder,
10292                offset + 8,
10293                _depth
10294            )?;
10295            Ok(())
10296        }
10297    }
10298
10299    impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoSendControlData {
10300        type Borrowed<'a> = &'a Self;
10301        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10302            value
10303        }
10304    }
10305
10306    unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoSendControlData {
10307        type Owned = Self;
10308
10309        #[inline(always)]
10310        fn inline_align(_context: fidl::encoding::Context) -> usize {
10311            8
10312        }
10313
10314        #[inline(always)]
10315        fn inline_size(_context: fidl::encoding::Context) -> usize {
10316            24
10317        }
10318    }
10319
10320    unsafe impl<D: fidl::encoding::ResourceDialect>
10321        fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for &Ipv6PktInfoSendControlData
10322    {
10323        #[inline]
10324        unsafe fn encode(
10325            self,
10326            encoder: &mut fidl::encoding::Encoder<'_, D>,
10327            offset: usize,
10328            _depth: fidl::encoding::Depth,
10329        ) -> fidl::Result<()> {
10330            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
10331            // Delegate to tuple encoding.
10332            fidl::encoding::Encode::<Ipv6PktInfoSendControlData, D>::encode(
10333                (
10334                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
10335                    <fidl_fuchsia_net_common::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(&self.local_addr),
10336                ),
10337                encoder, offset, _depth
10338            )
10339        }
10340    }
10341    unsafe impl<
10342        D: fidl::encoding::ResourceDialect,
10343        T0: fidl::encoding::Encode<u64, D>,
10344        T1: fidl::encoding::Encode<fidl_fuchsia_net_common::Ipv6Address, D>,
10345    > fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for (T0, T1)
10346    {
10347        #[inline]
10348        unsafe fn encode(
10349            self,
10350            encoder: &mut fidl::encoding::Encoder<'_, D>,
10351            offset: usize,
10352            depth: fidl::encoding::Depth,
10353        ) -> fidl::Result<()> {
10354            encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
10355            // Zero out padding regions. There's no need to apply masks
10356            // because the unmasked parts will be overwritten by fields.
10357            // Write the fields.
10358            self.0.encode(encoder, offset + 0, depth)?;
10359            self.1.encode(encoder, offset + 8, depth)?;
10360            Ok(())
10361        }
10362    }
10363
10364    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10365        for Ipv6PktInfoSendControlData
10366    {
10367        #[inline(always)]
10368        fn new_empty() -> Self {
10369            Self {
10370                iface: fidl::new_empty!(u64, D),
10371                local_addr: fidl::new_empty!(fidl_fuchsia_net_common::Ipv6Address, D),
10372            }
10373        }
10374
10375        #[inline]
10376        unsafe fn decode(
10377            &mut self,
10378            decoder: &mut fidl::encoding::Decoder<'_, D>,
10379            offset: usize,
10380            _depth: fidl::encoding::Depth,
10381        ) -> fidl::Result<()> {
10382            decoder.debug_check_bounds::<Self>(offset);
10383            // Verify that padding bytes are zero.
10384            fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10385            fidl::decode!(
10386                fidl_fuchsia_net_common::Ipv6Address,
10387                D,
10388                &mut self.local_addr,
10389                decoder,
10390                offset + 8,
10391                _depth
10392            )?;
10393            Ok(())
10394        }
10395    }
10396
10397    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketDeprecatedRequest {
10398        type Borrowed<'a> = &'a Self;
10399        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10400            value
10401        }
10402    }
10403
10404    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketDeprecatedRequest {
10405        type Owned = Self;
10406
10407        #[inline(always)]
10408        fn inline_align(_context: fidl::encoding::Context) -> usize {
10409            4
10410        }
10411
10412        #[inline(always)]
10413        fn inline_size(_context: fidl::encoding::Context) -> usize {
10414            8
10415        }
10416    }
10417
10418    unsafe impl<D: fidl::encoding::ResourceDialect>
10419        fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D>
10420        for &ProviderDatagramSocketDeprecatedRequest
10421    {
10422        #[inline]
10423        unsafe fn encode(
10424            self,
10425            encoder: &mut fidl::encoding::Encoder<'_, D>,
10426            offset: usize,
10427            _depth: fidl::encoding::Depth,
10428        ) -> fidl::Result<()> {
10429            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10430            // Delegate to tuple encoding.
10431            fidl::encoding::Encode::<ProviderDatagramSocketDeprecatedRequest, D>::encode(
10432                (
10433                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10434                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10435                        &self.proto,
10436                    ),
10437                ),
10438                encoder,
10439                offset,
10440                _depth,
10441            )
10442        }
10443    }
10444    unsafe impl<
10445        D: fidl::encoding::ResourceDialect,
10446        T0: fidl::encoding::Encode<Domain, D>,
10447        T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10448    > fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D> for (T0, T1)
10449    {
10450        #[inline]
10451        unsafe fn encode(
10452            self,
10453            encoder: &mut fidl::encoding::Encoder<'_, D>,
10454            offset: usize,
10455            depth: fidl::encoding::Depth,
10456        ) -> fidl::Result<()> {
10457            encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10458            // Zero out padding regions. There's no need to apply masks
10459            // because the unmasked parts will be overwritten by fields.
10460            unsafe {
10461                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10462                (ptr as *mut u32).write_unaligned(0);
10463            }
10464            // Write the fields.
10465            self.0.encode(encoder, offset + 0, depth)?;
10466            self.1.encode(encoder, offset + 4, depth)?;
10467            Ok(())
10468        }
10469    }
10470
10471    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10472        for ProviderDatagramSocketDeprecatedRequest
10473    {
10474        #[inline(always)]
10475        fn new_empty() -> Self {
10476            Self {
10477                domain: fidl::new_empty!(Domain, D),
10478                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10479            }
10480        }
10481
10482        #[inline]
10483        unsafe fn decode(
10484            &mut self,
10485            decoder: &mut fidl::encoding::Decoder<'_, D>,
10486            offset: usize,
10487            _depth: fidl::encoding::Depth,
10488        ) -> fidl::Result<()> {
10489            decoder.debug_check_bounds::<Self>(offset);
10490            // Verify that padding bytes are zero.
10491            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10492            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10493            let mask = 0xffff0000u32;
10494            let maskedval = padval & mask;
10495            if maskedval != 0 {
10496                return Err(fidl::Error::NonZeroPadding {
10497                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10498                });
10499            }
10500            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10501            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10502            Ok(())
10503        }
10504    }
10505
10506    impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketRequest {
10507        type Borrowed<'a> = &'a Self;
10508        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10509            value
10510        }
10511    }
10512
10513    unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketRequest {
10514        type Owned = Self;
10515
10516        #[inline(always)]
10517        fn inline_align(_context: fidl::encoding::Context) -> usize {
10518            4
10519        }
10520
10521        #[inline(always)]
10522        fn inline_size(_context: fidl::encoding::Context) -> usize {
10523            8
10524        }
10525    }
10526
10527    unsafe impl<D: fidl::encoding::ResourceDialect>
10528        fidl::encoding::Encode<ProviderDatagramSocketRequest, D>
10529        for &ProviderDatagramSocketRequest
10530    {
10531        #[inline]
10532        unsafe fn encode(
10533            self,
10534            encoder: &mut fidl::encoding::Encoder<'_, D>,
10535            offset: usize,
10536            _depth: fidl::encoding::Depth,
10537        ) -> fidl::Result<()> {
10538            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10539            // Delegate to tuple encoding.
10540            fidl::encoding::Encode::<ProviderDatagramSocketRequest, D>::encode(
10541                (
10542                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10543                    <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10544                        &self.proto,
10545                    ),
10546                ),
10547                encoder,
10548                offset,
10549                _depth,
10550            )
10551        }
10552    }
10553    unsafe impl<
10554        D: fidl::encoding::ResourceDialect,
10555        T0: fidl::encoding::Encode<Domain, D>,
10556        T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10557    > fidl::encoding::Encode<ProviderDatagramSocketRequest, D> for (T0, T1)
10558    {
10559        #[inline]
10560        unsafe fn encode(
10561            self,
10562            encoder: &mut fidl::encoding::Encoder<'_, D>,
10563            offset: usize,
10564            depth: fidl::encoding::Depth,
10565        ) -> fidl::Result<()> {
10566            encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10567            // Zero out padding regions. There's no need to apply masks
10568            // because the unmasked parts will be overwritten by fields.
10569            unsafe {
10570                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10571                (ptr as *mut u32).write_unaligned(0);
10572            }
10573            // Write the fields.
10574            self.0.encode(encoder, offset + 0, depth)?;
10575            self.1.encode(encoder, offset + 4, depth)?;
10576            Ok(())
10577        }
10578    }
10579
10580    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10581        for ProviderDatagramSocketRequest
10582    {
10583        #[inline(always)]
10584        fn new_empty() -> Self {
10585            Self {
10586                domain: fidl::new_empty!(Domain, D),
10587                proto: fidl::new_empty!(DatagramSocketProtocol, D),
10588            }
10589        }
10590
10591        #[inline]
10592        unsafe fn decode(
10593            &mut self,
10594            decoder: &mut fidl::encoding::Decoder<'_, D>,
10595            offset: usize,
10596            _depth: fidl::encoding::Depth,
10597        ) -> fidl::Result<()> {
10598            decoder.debug_check_bounds::<Self>(offset);
10599            // Verify that padding bytes are zero.
10600            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10601            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10602            let mask = 0xffff0000u32;
10603            let maskedval = padval & mask;
10604            if maskedval != 0 {
10605                return Err(fidl::Error::NonZeroPadding {
10606                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10607                });
10608            }
10609            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10610            fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10611            Ok(())
10612        }
10613    }
10614
10615    impl fidl::encoding::ValueTypeMarker for ProviderGetInterfaceAddressesResponse {
10616        type Borrowed<'a> = &'a Self;
10617        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10618            value
10619        }
10620    }
10621
10622    unsafe impl fidl::encoding::TypeMarker for ProviderGetInterfaceAddressesResponse {
10623        type Owned = Self;
10624
10625        #[inline(always)]
10626        fn inline_align(_context: fidl::encoding::Context) -> usize {
10627            8
10628        }
10629
10630        #[inline(always)]
10631        fn inline_size(_context: fidl::encoding::Context) -> usize {
10632            16
10633        }
10634    }
10635
10636    unsafe impl<D: fidl::encoding::ResourceDialect>
10637        fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D>
10638        for &ProviderGetInterfaceAddressesResponse
10639    {
10640        #[inline]
10641        unsafe fn encode(
10642            self,
10643            encoder: &mut fidl::encoding::Encoder<'_, D>,
10644            offset: usize,
10645            _depth: fidl::encoding::Depth,
10646        ) -> fidl::Result<()> {
10647            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10648            // Delegate to tuple encoding.
10649            fidl::encoding::Encode::<ProviderGetInterfaceAddressesResponse, D>::encode(
10650                (
10651                    <fidl::encoding::UnboundedVector<InterfaceAddresses> as fidl::encoding::ValueTypeMarker>::borrow(&self.interfaces),
10652                ),
10653                encoder, offset, _depth
10654            )
10655        }
10656    }
10657    unsafe impl<
10658        D: fidl::encoding::ResourceDialect,
10659        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<InterfaceAddresses>, D>,
10660    > fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D> for (T0,)
10661    {
10662        #[inline]
10663        unsafe fn encode(
10664            self,
10665            encoder: &mut fidl::encoding::Encoder<'_, D>,
10666            offset: usize,
10667            depth: fidl::encoding::Depth,
10668        ) -> fidl::Result<()> {
10669            encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10670            // Zero out padding regions. There's no need to apply masks
10671            // because the unmasked parts will be overwritten by fields.
10672            // Write the fields.
10673            self.0.encode(encoder, offset + 0, depth)?;
10674            Ok(())
10675        }
10676    }
10677
10678    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10679        for ProviderGetInterfaceAddressesResponse
10680    {
10681        #[inline(always)]
10682        fn new_empty() -> Self {
10683            Self {
10684                interfaces: fidl::new_empty!(
10685                    fidl::encoding::UnboundedVector<InterfaceAddresses>,
10686                    D
10687                ),
10688            }
10689        }
10690
10691        #[inline]
10692        unsafe fn decode(
10693            &mut self,
10694            decoder: &mut fidl::encoding::Decoder<'_, D>,
10695            offset: usize,
10696            _depth: fidl::encoding::Depth,
10697        ) -> fidl::Result<()> {
10698            decoder.debug_check_bounds::<Self>(offset);
10699            // Verify that padding bytes are zero.
10700            fidl::decode!(
10701                fidl::encoding::UnboundedVector<InterfaceAddresses>,
10702                D,
10703                &mut self.interfaces,
10704                decoder,
10705                offset + 0,
10706                _depth
10707            )?;
10708            Ok(())
10709        }
10710    }
10711
10712    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameRequest {
10713        type Borrowed<'a> = &'a Self;
10714        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10715            value
10716        }
10717    }
10718
10719    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameRequest {
10720        type Owned = Self;
10721
10722        #[inline(always)]
10723        fn inline_align(_context: fidl::encoding::Context) -> usize {
10724            8
10725        }
10726
10727        #[inline(always)]
10728        fn inline_size(_context: fidl::encoding::Context) -> usize {
10729            8
10730        }
10731        #[inline(always)]
10732        fn encode_is_copy() -> bool {
10733            true
10734        }
10735
10736        #[inline(always)]
10737        fn decode_is_copy() -> bool {
10738            true
10739        }
10740    }
10741
10742    unsafe impl<D: fidl::encoding::ResourceDialect>
10743        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D>
10744        for &ProviderInterfaceIndexToNameRequest
10745    {
10746        #[inline]
10747        unsafe fn encode(
10748            self,
10749            encoder: &mut fidl::encoding::Encoder<'_, D>,
10750            offset: usize,
10751            _depth: fidl::encoding::Depth,
10752        ) -> fidl::Result<()> {
10753            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10754            unsafe {
10755                // Copy the object into the buffer.
10756                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10757                (buf_ptr as *mut ProviderInterfaceIndexToNameRequest)
10758                    .write_unaligned((self as *const ProviderInterfaceIndexToNameRequest).read());
10759                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10760                // done second because the memcpy will write garbage to these bytes.
10761            }
10762            Ok(())
10763        }
10764    }
10765    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
10766        fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D> for (T0,)
10767    {
10768        #[inline]
10769        unsafe fn encode(
10770            self,
10771            encoder: &mut fidl::encoding::Encoder<'_, D>,
10772            offset: usize,
10773            depth: fidl::encoding::Depth,
10774        ) -> fidl::Result<()> {
10775            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10776            // Zero out padding regions. There's no need to apply masks
10777            // because the unmasked parts will be overwritten by fields.
10778            // Write the fields.
10779            self.0.encode(encoder, offset + 0, depth)?;
10780            Ok(())
10781        }
10782    }
10783
10784    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10785        for ProviderInterfaceIndexToNameRequest
10786    {
10787        #[inline(always)]
10788        fn new_empty() -> Self {
10789            Self { index: fidl::new_empty!(u64, D) }
10790        }
10791
10792        #[inline]
10793        unsafe fn decode(
10794            &mut self,
10795            decoder: &mut fidl::encoding::Decoder<'_, D>,
10796            offset: usize,
10797            _depth: fidl::encoding::Depth,
10798        ) -> fidl::Result<()> {
10799            decoder.debug_check_bounds::<Self>(offset);
10800            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10801            // Verify that padding bytes are zero.
10802            // Copy from the buffer into the object.
10803            unsafe {
10804                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10805            }
10806            Ok(())
10807        }
10808    }
10809
10810    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsRequest {
10811        type Borrowed<'a> = &'a Self;
10812        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10813            value
10814        }
10815    }
10816
10817    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsRequest {
10818        type Owned = Self;
10819
10820        #[inline(always)]
10821        fn inline_align(_context: fidl::encoding::Context) -> usize {
10822            8
10823        }
10824
10825        #[inline(always)]
10826        fn inline_size(_context: fidl::encoding::Context) -> usize {
10827            16
10828        }
10829    }
10830
10831    unsafe impl<D: fidl::encoding::ResourceDialect>
10832        fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D>
10833        for &ProviderInterfaceNameToFlagsRequest
10834    {
10835        #[inline]
10836        unsafe fn encode(
10837            self,
10838            encoder: &mut fidl::encoding::Encoder<'_, D>,
10839            offset: usize,
10840            _depth: fidl::encoding::Depth,
10841        ) -> fidl::Result<()> {
10842            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10843            // Delegate to tuple encoding.
10844            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsRequest, D>::encode(
10845                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10846                    &self.name,
10847                ),),
10848                encoder,
10849                offset,
10850                _depth,
10851            )
10852        }
10853    }
10854    unsafe impl<
10855        D: fidl::encoding::ResourceDialect,
10856        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10857    > fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D> for (T0,)
10858    {
10859        #[inline]
10860        unsafe fn encode(
10861            self,
10862            encoder: &mut fidl::encoding::Encoder<'_, D>,
10863            offset: usize,
10864            depth: fidl::encoding::Depth,
10865        ) -> fidl::Result<()> {
10866            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10867            // Zero out padding regions. There's no need to apply masks
10868            // because the unmasked parts will be overwritten by fields.
10869            // Write the fields.
10870            self.0.encode(encoder, offset + 0, depth)?;
10871            Ok(())
10872        }
10873    }
10874
10875    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10876        for ProviderInterfaceNameToFlagsRequest
10877    {
10878        #[inline(always)]
10879        fn new_empty() -> Self {
10880            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10881        }
10882
10883        #[inline]
10884        unsafe fn decode(
10885            &mut self,
10886            decoder: &mut fidl::encoding::Decoder<'_, D>,
10887            offset: usize,
10888            _depth: fidl::encoding::Depth,
10889        ) -> fidl::Result<()> {
10890            decoder.debug_check_bounds::<Self>(offset);
10891            // Verify that padding bytes are zero.
10892            fidl::decode!(
10893                fidl::encoding::BoundedString<15>,
10894                D,
10895                &mut self.name,
10896                decoder,
10897                offset + 0,
10898                _depth
10899            )?;
10900            Ok(())
10901        }
10902    }
10903
10904    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexRequest {
10905        type Borrowed<'a> = &'a Self;
10906        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10907            value
10908        }
10909    }
10910
10911    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexRequest {
10912        type Owned = Self;
10913
10914        #[inline(always)]
10915        fn inline_align(_context: fidl::encoding::Context) -> usize {
10916            8
10917        }
10918
10919        #[inline(always)]
10920        fn inline_size(_context: fidl::encoding::Context) -> usize {
10921            16
10922        }
10923    }
10924
10925    unsafe impl<D: fidl::encoding::ResourceDialect>
10926        fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D>
10927        for &ProviderInterfaceNameToIndexRequest
10928    {
10929        #[inline]
10930        unsafe fn encode(
10931            self,
10932            encoder: &mut fidl::encoding::Encoder<'_, D>,
10933            offset: usize,
10934            _depth: fidl::encoding::Depth,
10935        ) -> fidl::Result<()> {
10936            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10937            // Delegate to tuple encoding.
10938            fidl::encoding::Encode::<ProviderInterfaceNameToIndexRequest, D>::encode(
10939                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10940                    &self.name,
10941                ),),
10942                encoder,
10943                offset,
10944                _depth,
10945            )
10946        }
10947    }
10948    unsafe impl<
10949        D: fidl::encoding::ResourceDialect,
10950        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10951    > fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D> for (T0,)
10952    {
10953        #[inline]
10954        unsafe fn encode(
10955            self,
10956            encoder: &mut fidl::encoding::Encoder<'_, D>,
10957            offset: usize,
10958            depth: fidl::encoding::Depth,
10959        ) -> fidl::Result<()> {
10960            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10961            // Zero out padding regions. There's no need to apply masks
10962            // because the unmasked parts will be overwritten by fields.
10963            // Write the fields.
10964            self.0.encode(encoder, offset + 0, depth)?;
10965            Ok(())
10966        }
10967    }
10968
10969    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10970        for ProviderInterfaceNameToIndexRequest
10971    {
10972        #[inline(always)]
10973        fn new_empty() -> Self {
10974            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10975        }
10976
10977        #[inline]
10978        unsafe fn decode(
10979            &mut self,
10980            decoder: &mut fidl::encoding::Decoder<'_, D>,
10981            offset: usize,
10982            _depth: fidl::encoding::Depth,
10983        ) -> fidl::Result<()> {
10984            decoder.debug_check_bounds::<Self>(offset);
10985            // Verify that padding bytes are zero.
10986            fidl::decode!(
10987                fidl::encoding::BoundedString<15>,
10988                D,
10989                &mut self.name,
10990                decoder,
10991                offset + 0,
10992                _depth
10993            )?;
10994            Ok(())
10995        }
10996    }
10997
10998    impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketRequest {
10999        type Borrowed<'a> = &'a Self;
11000        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11001            value
11002        }
11003    }
11004
11005    unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketRequest {
11006        type Owned = Self;
11007
11008        #[inline(always)]
11009        fn inline_align(_context: fidl::encoding::Context) -> usize {
11010            4
11011        }
11012
11013        #[inline(always)]
11014        fn inline_size(_context: fidl::encoding::Context) -> usize {
11015            8
11016        }
11017    }
11018
11019    unsafe impl<D: fidl::encoding::ResourceDialect>
11020        fidl::encoding::Encode<ProviderStreamSocketRequest, D> for &ProviderStreamSocketRequest
11021    {
11022        #[inline]
11023        unsafe fn encode(
11024            self,
11025            encoder: &mut fidl::encoding::Encoder<'_, D>,
11026            offset: usize,
11027            _depth: fidl::encoding::Depth,
11028        ) -> fidl::Result<()> {
11029            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
11030            // Delegate to tuple encoding.
11031            fidl::encoding::Encode::<ProviderStreamSocketRequest, D>::encode(
11032                (
11033                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
11034                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
11035                ),
11036                encoder,
11037                offset,
11038                _depth,
11039            )
11040        }
11041    }
11042    unsafe impl<
11043        D: fidl::encoding::ResourceDialect,
11044        T0: fidl::encoding::Encode<Domain, D>,
11045        T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
11046    > fidl::encoding::Encode<ProviderStreamSocketRequest, D> for (T0, T1)
11047    {
11048        #[inline]
11049        unsafe fn encode(
11050            self,
11051            encoder: &mut fidl::encoding::Encoder<'_, D>,
11052            offset: usize,
11053            depth: fidl::encoding::Depth,
11054        ) -> fidl::Result<()> {
11055            encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
11056            // Zero out padding regions. There's no need to apply masks
11057            // because the unmasked parts will be overwritten by fields.
11058            unsafe {
11059                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11060                (ptr as *mut u32).write_unaligned(0);
11061            }
11062            // Write the fields.
11063            self.0.encode(encoder, offset + 0, depth)?;
11064            self.1.encode(encoder, offset + 4, depth)?;
11065            Ok(())
11066        }
11067    }
11068
11069    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11070        for ProviderStreamSocketRequest
11071    {
11072        #[inline(always)]
11073        fn new_empty() -> Self {
11074            Self {
11075                domain: fidl::new_empty!(Domain, D),
11076                proto: fidl::new_empty!(StreamSocketProtocol, D),
11077            }
11078        }
11079
11080        #[inline]
11081        unsafe fn decode(
11082            &mut self,
11083            decoder: &mut fidl::encoding::Decoder<'_, D>,
11084            offset: usize,
11085            _depth: fidl::encoding::Depth,
11086        ) -> fidl::Result<()> {
11087            decoder.debug_check_bounds::<Self>(offset);
11088            // Verify that padding bytes are zero.
11089            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11090            let padval = unsafe { (ptr as *const u32).read_unaligned() };
11091            let mask = 0xffff0000u32;
11092            let maskedval = padval & mask;
11093            if maskedval != 0 {
11094                return Err(fidl::Error::NonZeroPadding {
11095                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11096                });
11097            }
11098            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
11099            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
11100            Ok(())
11101        }
11102    }
11103
11104    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameResponse {
11105        type Borrowed<'a> = &'a Self;
11106        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11107            value
11108        }
11109    }
11110
11111    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameResponse {
11112        type Owned = Self;
11113
11114        #[inline(always)]
11115        fn inline_align(_context: fidl::encoding::Context) -> usize {
11116            8
11117        }
11118
11119        #[inline(always)]
11120        fn inline_size(_context: fidl::encoding::Context) -> usize {
11121            16
11122        }
11123    }
11124
11125    unsafe impl<D: fidl::encoding::ResourceDialect>
11126        fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D>
11127        for &ProviderInterfaceIndexToNameResponse
11128    {
11129        #[inline]
11130        unsafe fn encode(
11131            self,
11132            encoder: &mut fidl::encoding::Encoder<'_, D>,
11133            offset: usize,
11134            _depth: fidl::encoding::Depth,
11135        ) -> fidl::Result<()> {
11136            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
11137            // Delegate to tuple encoding.
11138            fidl::encoding::Encode::<ProviderInterfaceIndexToNameResponse, D>::encode(
11139                (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
11140                    &self.name,
11141                ),),
11142                encoder,
11143                offset,
11144                _depth,
11145            )
11146        }
11147    }
11148    unsafe impl<
11149        D: fidl::encoding::ResourceDialect,
11150        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
11151    > fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D> for (T0,)
11152    {
11153        #[inline]
11154        unsafe fn encode(
11155            self,
11156            encoder: &mut fidl::encoding::Encoder<'_, D>,
11157            offset: usize,
11158            depth: fidl::encoding::Depth,
11159        ) -> fidl::Result<()> {
11160            encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
11161            // Zero out padding regions. There's no need to apply masks
11162            // because the unmasked parts will be overwritten by fields.
11163            // Write the fields.
11164            self.0.encode(encoder, offset + 0, depth)?;
11165            Ok(())
11166        }
11167    }
11168
11169    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11170        for ProviderInterfaceIndexToNameResponse
11171    {
11172        #[inline(always)]
11173        fn new_empty() -> Self {
11174            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
11175        }
11176
11177        #[inline]
11178        unsafe fn decode(
11179            &mut self,
11180            decoder: &mut fidl::encoding::Decoder<'_, D>,
11181            offset: usize,
11182            _depth: fidl::encoding::Depth,
11183        ) -> fidl::Result<()> {
11184            decoder.debug_check_bounds::<Self>(offset);
11185            // Verify that padding bytes are zero.
11186            fidl::decode!(
11187                fidl::encoding::BoundedString<15>,
11188                D,
11189                &mut self.name,
11190                decoder,
11191                offset + 0,
11192                _depth
11193            )?;
11194            Ok(())
11195        }
11196    }
11197
11198    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsResponse {
11199        type Borrowed<'a> = &'a Self;
11200        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11201            value
11202        }
11203    }
11204
11205    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsResponse {
11206        type Owned = Self;
11207
11208        #[inline(always)]
11209        fn inline_align(_context: fidl::encoding::Context) -> usize {
11210            2
11211        }
11212
11213        #[inline(always)]
11214        fn inline_size(_context: fidl::encoding::Context) -> usize {
11215            2
11216        }
11217    }
11218
11219    unsafe impl<D: fidl::encoding::ResourceDialect>
11220        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D>
11221        for &ProviderInterfaceNameToFlagsResponse
11222    {
11223        #[inline]
11224        unsafe fn encode(
11225            self,
11226            encoder: &mut fidl::encoding::Encoder<'_, D>,
11227            offset: usize,
11228            _depth: fidl::encoding::Depth,
11229        ) -> fidl::Result<()> {
11230            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11231            // Delegate to tuple encoding.
11232            fidl::encoding::Encode::<ProviderInterfaceNameToFlagsResponse, D>::encode(
11233                (<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
11234                encoder,
11235                offset,
11236                _depth,
11237            )
11238        }
11239    }
11240    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<InterfaceFlags, D>>
11241        fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D> for (T0,)
11242    {
11243        #[inline]
11244        unsafe fn encode(
11245            self,
11246            encoder: &mut fidl::encoding::Encoder<'_, D>,
11247            offset: usize,
11248            depth: fidl::encoding::Depth,
11249        ) -> fidl::Result<()> {
11250            encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11251            // Zero out padding regions. There's no need to apply masks
11252            // because the unmasked parts will be overwritten by fields.
11253            // Write the fields.
11254            self.0.encode(encoder, offset + 0, depth)?;
11255            Ok(())
11256        }
11257    }
11258
11259    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11260        for ProviderInterfaceNameToFlagsResponse
11261    {
11262        #[inline(always)]
11263        fn new_empty() -> Self {
11264            Self { flags: fidl::new_empty!(InterfaceFlags, D) }
11265        }
11266
11267        #[inline]
11268        unsafe fn decode(
11269            &mut self,
11270            decoder: &mut fidl::encoding::Decoder<'_, D>,
11271            offset: usize,
11272            _depth: fidl::encoding::Depth,
11273        ) -> fidl::Result<()> {
11274            decoder.debug_check_bounds::<Self>(offset);
11275            // Verify that padding bytes are zero.
11276            fidl::decode!(InterfaceFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
11277            Ok(())
11278        }
11279    }
11280
11281    impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexResponse {
11282        type Borrowed<'a> = &'a Self;
11283        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11284            value
11285        }
11286    }
11287
11288    unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexResponse {
11289        type Owned = Self;
11290
11291        #[inline(always)]
11292        fn inline_align(_context: fidl::encoding::Context) -> usize {
11293            8
11294        }
11295
11296        #[inline(always)]
11297        fn inline_size(_context: fidl::encoding::Context) -> usize {
11298            8
11299        }
11300        #[inline(always)]
11301        fn encode_is_copy() -> bool {
11302            true
11303        }
11304
11305        #[inline(always)]
11306        fn decode_is_copy() -> bool {
11307            true
11308        }
11309    }
11310
11311    unsafe impl<D: fidl::encoding::ResourceDialect>
11312        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D>
11313        for &ProviderInterfaceNameToIndexResponse
11314    {
11315        #[inline]
11316        unsafe fn encode(
11317            self,
11318            encoder: &mut fidl::encoding::Encoder<'_, D>,
11319            offset: usize,
11320            _depth: fidl::encoding::Depth,
11321        ) -> fidl::Result<()> {
11322            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11323            unsafe {
11324                // Copy the object into the buffer.
11325                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11326                (buf_ptr as *mut ProviderInterfaceNameToIndexResponse)
11327                    .write_unaligned((self as *const ProviderInterfaceNameToIndexResponse).read());
11328                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11329                // done second because the memcpy will write garbage to these bytes.
11330            }
11331            Ok(())
11332        }
11333    }
11334    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11335        fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D> for (T0,)
11336    {
11337        #[inline]
11338        unsafe fn encode(
11339            self,
11340            encoder: &mut fidl::encoding::Encoder<'_, D>,
11341            offset: usize,
11342            depth: fidl::encoding::Depth,
11343        ) -> fidl::Result<()> {
11344            encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11345            // Zero out padding regions. There's no need to apply masks
11346            // because the unmasked parts will be overwritten by fields.
11347            // Write the fields.
11348            self.0.encode(encoder, offset + 0, depth)?;
11349            Ok(())
11350        }
11351    }
11352
11353    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11354        for ProviderInterfaceNameToIndexResponse
11355    {
11356        #[inline(always)]
11357        fn new_empty() -> Self {
11358            Self { index: fidl::new_empty!(u64, D) }
11359        }
11360
11361        #[inline]
11362        unsafe fn decode(
11363            &mut self,
11364            decoder: &mut fidl::encoding::Decoder<'_, D>,
11365            offset: usize,
11366            _depth: fidl::encoding::Depth,
11367        ) -> fidl::Result<()> {
11368            decoder.debug_check_bounds::<Self>(offset);
11369            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11370            // Verify that padding bytes are zero.
11371            // Copy from the buffer into the object.
11372            unsafe {
11373                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11374            }
11375            Ok(())
11376        }
11377    }
11378
11379    impl fidl::encoding::ValueTypeMarker for StreamSocketAcceptRequest {
11380        type Borrowed<'a> = &'a Self;
11381        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11382            value
11383        }
11384    }
11385
11386    unsafe impl fidl::encoding::TypeMarker for StreamSocketAcceptRequest {
11387        type Owned = Self;
11388
11389        #[inline(always)]
11390        fn inline_align(_context: fidl::encoding::Context) -> usize {
11391            1
11392        }
11393
11394        #[inline(always)]
11395        fn inline_size(_context: fidl::encoding::Context) -> usize {
11396            1
11397        }
11398    }
11399
11400    unsafe impl<D: fidl::encoding::ResourceDialect>
11401        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for &StreamSocketAcceptRequest
11402    {
11403        #[inline]
11404        unsafe fn encode(
11405            self,
11406            encoder: &mut fidl::encoding::Encoder<'_, D>,
11407            offset: usize,
11408            _depth: fidl::encoding::Depth,
11409        ) -> fidl::Result<()> {
11410            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11411            // Delegate to tuple encoding.
11412            fidl::encoding::Encode::<StreamSocketAcceptRequest, D>::encode(
11413                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),),
11414                encoder,
11415                offset,
11416                _depth,
11417            )
11418        }
11419    }
11420    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11421        fidl::encoding::Encode<StreamSocketAcceptRequest, D> for (T0,)
11422    {
11423        #[inline]
11424        unsafe fn encode(
11425            self,
11426            encoder: &mut fidl::encoding::Encoder<'_, D>,
11427            offset: usize,
11428            depth: fidl::encoding::Depth,
11429        ) -> fidl::Result<()> {
11430            encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11431            // Zero out padding regions. There's no need to apply masks
11432            // because the unmasked parts will be overwritten by fields.
11433            // Write the fields.
11434            self.0.encode(encoder, offset + 0, depth)?;
11435            Ok(())
11436        }
11437    }
11438
11439    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11440        for StreamSocketAcceptRequest
11441    {
11442        #[inline(always)]
11443        fn new_empty() -> Self {
11444            Self { want_addr: fidl::new_empty!(bool, D) }
11445        }
11446
11447        #[inline]
11448        unsafe fn decode(
11449            &mut self,
11450            decoder: &mut fidl::encoding::Decoder<'_, D>,
11451            offset: usize,
11452            _depth: fidl::encoding::Depth,
11453        ) -> fidl::Result<()> {
11454            decoder.debug_check_bounds::<Self>(offset);
11455            // Verify that padding bytes are zero.
11456            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
11457            Ok(())
11458        }
11459    }
11460
11461    impl fidl::encoding::ValueTypeMarker for StreamSocketListenRequest {
11462        type Borrowed<'a> = &'a Self;
11463        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11464            value
11465        }
11466    }
11467
11468    unsafe impl fidl::encoding::TypeMarker for StreamSocketListenRequest {
11469        type Owned = Self;
11470
11471        #[inline(always)]
11472        fn inline_align(_context: fidl::encoding::Context) -> usize {
11473            2
11474        }
11475
11476        #[inline(always)]
11477        fn inline_size(_context: fidl::encoding::Context) -> usize {
11478            2
11479        }
11480        #[inline(always)]
11481        fn encode_is_copy() -> bool {
11482            true
11483        }
11484
11485        #[inline(always)]
11486        fn decode_is_copy() -> bool {
11487            true
11488        }
11489    }
11490
11491    unsafe impl<D: fidl::encoding::ResourceDialect>
11492        fidl::encoding::Encode<StreamSocketListenRequest, D> for &StreamSocketListenRequest
11493    {
11494        #[inline]
11495        unsafe fn encode(
11496            self,
11497            encoder: &mut fidl::encoding::Encoder<'_, D>,
11498            offset: usize,
11499            _depth: fidl::encoding::Depth,
11500        ) -> fidl::Result<()> {
11501            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11502            unsafe {
11503                // Copy the object into the buffer.
11504                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11505                (buf_ptr as *mut StreamSocketListenRequest)
11506                    .write_unaligned((self as *const StreamSocketListenRequest).read());
11507                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11508                // done second because the memcpy will write garbage to these bytes.
11509            }
11510            Ok(())
11511        }
11512    }
11513    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i16, D>>
11514        fidl::encoding::Encode<StreamSocketListenRequest, D> for (T0,)
11515    {
11516        #[inline]
11517        unsafe fn encode(
11518            self,
11519            encoder: &mut fidl::encoding::Encoder<'_, D>,
11520            offset: usize,
11521            depth: fidl::encoding::Depth,
11522        ) -> fidl::Result<()> {
11523            encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11524            // Zero out padding regions. There's no need to apply masks
11525            // because the unmasked parts will be overwritten by fields.
11526            // Write the fields.
11527            self.0.encode(encoder, offset + 0, depth)?;
11528            Ok(())
11529        }
11530    }
11531
11532    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11533        for StreamSocketListenRequest
11534    {
11535        #[inline(always)]
11536        fn new_empty() -> Self {
11537            Self { backlog: fidl::new_empty!(i16, D) }
11538        }
11539
11540        #[inline]
11541        unsafe fn decode(
11542            &mut self,
11543            decoder: &mut fidl::encoding::Decoder<'_, D>,
11544            offset: usize,
11545            _depth: fidl::encoding::Depth,
11546        ) -> fidl::Result<()> {
11547            decoder.debug_check_bounds::<Self>(offset);
11548            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11549            // Verify that padding bytes are zero.
11550            // Copy from the buffer into the object.
11551            unsafe {
11552                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
11553            }
11554            Ok(())
11555        }
11556    }
11557
11558    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCongestionRequest {
11559        type Borrowed<'a> = &'a Self;
11560        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11561            value
11562        }
11563    }
11564
11565    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCongestionRequest {
11566        type Owned = Self;
11567
11568        #[inline(always)]
11569        fn inline_align(_context: fidl::encoding::Context) -> usize {
11570            4
11571        }
11572
11573        #[inline(always)]
11574        fn inline_size(_context: fidl::encoding::Context) -> usize {
11575            4
11576        }
11577    }
11578
11579    unsafe impl<D: fidl::encoding::ResourceDialect>
11580        fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D>
11581        for &StreamSocketSetTcpCongestionRequest
11582    {
11583        #[inline]
11584        unsafe fn encode(
11585            self,
11586            encoder: &mut fidl::encoding::Encoder<'_, D>,
11587            offset: usize,
11588            _depth: fidl::encoding::Depth,
11589        ) -> fidl::Result<()> {
11590            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11591            // Delegate to tuple encoding.
11592            fidl::encoding::Encode::<StreamSocketSetTcpCongestionRequest, D>::encode(
11593                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11594                encoder,
11595                offset,
11596                _depth,
11597            )
11598        }
11599    }
11600    unsafe impl<
11601        D: fidl::encoding::ResourceDialect,
11602        T0: fidl::encoding::Encode<TcpCongestionControl, D>,
11603    > fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D> for (T0,)
11604    {
11605        #[inline]
11606        unsafe fn encode(
11607            self,
11608            encoder: &mut fidl::encoding::Encoder<'_, D>,
11609            offset: usize,
11610            depth: fidl::encoding::Depth,
11611        ) -> fidl::Result<()> {
11612            encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11613            // Zero out padding regions. There's no need to apply masks
11614            // because the unmasked parts will be overwritten by fields.
11615            // Write the fields.
11616            self.0.encode(encoder, offset + 0, depth)?;
11617            Ok(())
11618        }
11619    }
11620
11621    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11622        for StreamSocketSetTcpCongestionRequest
11623    {
11624        #[inline(always)]
11625        fn new_empty() -> Self {
11626            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
11627        }
11628
11629        #[inline]
11630        unsafe fn decode(
11631            &mut self,
11632            decoder: &mut fidl::encoding::Decoder<'_, D>,
11633            offset: usize,
11634            _depth: fidl::encoding::Depth,
11635        ) -> fidl::Result<()> {
11636            decoder.debug_check_bounds::<Self>(offset);
11637            // Verify that padding bytes are zero.
11638            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
11639            Ok(())
11640        }
11641    }
11642
11643    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCorkRequest {
11644        type Borrowed<'a> = &'a Self;
11645        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11646            value
11647        }
11648    }
11649
11650    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCorkRequest {
11651        type Owned = Self;
11652
11653        #[inline(always)]
11654        fn inline_align(_context: fidl::encoding::Context) -> usize {
11655            1
11656        }
11657
11658        #[inline(always)]
11659        fn inline_size(_context: fidl::encoding::Context) -> usize {
11660            1
11661        }
11662    }
11663
11664    unsafe impl<D: fidl::encoding::ResourceDialect>
11665        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D>
11666        for &StreamSocketSetTcpCorkRequest
11667    {
11668        #[inline]
11669        unsafe fn encode(
11670            self,
11671            encoder: &mut fidl::encoding::Encoder<'_, D>,
11672            offset: usize,
11673            _depth: fidl::encoding::Depth,
11674        ) -> fidl::Result<()> {
11675            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11676            // Delegate to tuple encoding.
11677            fidl::encoding::Encode::<StreamSocketSetTcpCorkRequest, D>::encode(
11678                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11679                encoder,
11680                offset,
11681                _depth,
11682            )
11683        }
11684    }
11685    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11686        fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D> for (T0,)
11687    {
11688        #[inline]
11689        unsafe fn encode(
11690            self,
11691            encoder: &mut fidl::encoding::Encoder<'_, D>,
11692            offset: usize,
11693            depth: fidl::encoding::Depth,
11694        ) -> fidl::Result<()> {
11695            encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11696            // Zero out padding regions. There's no need to apply masks
11697            // because the unmasked parts will be overwritten by fields.
11698            // Write the fields.
11699            self.0.encode(encoder, offset + 0, depth)?;
11700            Ok(())
11701        }
11702    }
11703
11704    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11705        for StreamSocketSetTcpCorkRequest
11706    {
11707        #[inline(always)]
11708        fn new_empty() -> Self {
11709            Self { value: fidl::new_empty!(bool, D) }
11710        }
11711
11712        #[inline]
11713        unsafe fn decode(
11714            &mut self,
11715            decoder: &mut fidl::encoding::Decoder<'_, D>,
11716            offset: usize,
11717            _depth: fidl::encoding::Depth,
11718        ) -> fidl::Result<()> {
11719            decoder.debug_check_bounds::<Self>(offset);
11720            // Verify that padding bytes are zero.
11721            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
11722            Ok(())
11723        }
11724    }
11725
11726    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11727        type Borrowed<'a> = &'a Self;
11728        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11729            value
11730        }
11731    }
11732
11733    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11734        type Owned = Self;
11735
11736        #[inline(always)]
11737        fn inline_align(_context: fidl::encoding::Context) -> usize {
11738            4
11739        }
11740
11741        #[inline(always)]
11742        fn inline_size(_context: fidl::encoding::Context) -> usize {
11743            4
11744        }
11745        #[inline(always)]
11746        fn encode_is_copy() -> bool {
11747            true
11748        }
11749
11750        #[inline(always)]
11751        fn decode_is_copy() -> bool {
11752            true
11753        }
11754    }
11755
11756    unsafe impl<D: fidl::encoding::ResourceDialect>
11757        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D>
11758        for &StreamSocketSetTcpDeferAcceptRequest
11759    {
11760        #[inline]
11761        unsafe fn encode(
11762            self,
11763            encoder: &mut fidl::encoding::Encoder<'_, D>,
11764            offset: usize,
11765            _depth: fidl::encoding::Depth,
11766        ) -> fidl::Result<()> {
11767            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11768            unsafe {
11769                // Copy the object into the buffer.
11770                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11771                (buf_ptr as *mut StreamSocketSetTcpDeferAcceptRequest)
11772                    .write_unaligned((self as *const StreamSocketSetTcpDeferAcceptRequest).read());
11773                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11774                // done second because the memcpy will write garbage to these bytes.
11775            }
11776            Ok(())
11777        }
11778    }
11779    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11780        fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D> for (T0,)
11781    {
11782        #[inline]
11783        unsafe fn encode(
11784            self,
11785            encoder: &mut fidl::encoding::Encoder<'_, D>,
11786            offset: usize,
11787            depth: fidl::encoding::Depth,
11788        ) -> fidl::Result<()> {
11789            encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11790            // Zero out padding regions. There's no need to apply masks
11791            // because the unmasked parts will be overwritten by fields.
11792            // Write the fields.
11793            self.0.encode(encoder, offset + 0, depth)?;
11794            Ok(())
11795        }
11796    }
11797
11798    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11799        for StreamSocketSetTcpDeferAcceptRequest
11800    {
11801        #[inline(always)]
11802        fn new_empty() -> Self {
11803            Self { value_secs: fidl::new_empty!(u32, D) }
11804        }
11805
11806        #[inline]
11807        unsafe fn decode(
11808            &mut self,
11809            decoder: &mut fidl::encoding::Decoder<'_, D>,
11810            offset: usize,
11811            _depth: fidl::encoding::Depth,
11812        ) -> fidl::Result<()> {
11813            decoder.debug_check_bounds::<Self>(offset);
11814            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11815            // Verify that padding bytes are zero.
11816            // Copy from the buffer into the object.
11817            unsafe {
11818                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11819            }
11820            Ok(())
11821        }
11822    }
11823
11824    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11825        type Borrowed<'a> = &'a Self;
11826        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11827            value
11828        }
11829    }
11830
11831    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11832        type Owned = Self;
11833
11834        #[inline(always)]
11835        fn inline_align(_context: fidl::encoding::Context) -> usize {
11836            4
11837        }
11838
11839        #[inline(always)]
11840        fn inline_size(_context: fidl::encoding::Context) -> usize {
11841            4
11842        }
11843        #[inline(always)]
11844        fn encode_is_copy() -> bool {
11845            true
11846        }
11847
11848        #[inline(always)]
11849        fn decode_is_copy() -> bool {
11850            true
11851        }
11852    }
11853
11854    unsafe impl<D: fidl::encoding::ResourceDialect>
11855        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D>
11856        for &StreamSocketSetTcpKeepAliveCountRequest
11857    {
11858        #[inline]
11859        unsafe fn encode(
11860            self,
11861            encoder: &mut fidl::encoding::Encoder<'_, D>,
11862            offset: usize,
11863            _depth: fidl::encoding::Depth,
11864        ) -> fidl::Result<()> {
11865            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11866            unsafe {
11867                // Copy the object into the buffer.
11868                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11869                (buf_ptr as *mut StreamSocketSetTcpKeepAliveCountRequest).write_unaligned(
11870                    (self as *const StreamSocketSetTcpKeepAliveCountRequest).read(),
11871                );
11872                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11873                // done second because the memcpy will write garbage to these bytes.
11874            }
11875            Ok(())
11876        }
11877    }
11878    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11879        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D> for (T0,)
11880    {
11881        #[inline]
11882        unsafe fn encode(
11883            self,
11884            encoder: &mut fidl::encoding::Encoder<'_, D>,
11885            offset: usize,
11886            depth: fidl::encoding::Depth,
11887        ) -> fidl::Result<()> {
11888            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11889            // Zero out padding regions. There's no need to apply masks
11890            // because the unmasked parts will be overwritten by fields.
11891            // Write the fields.
11892            self.0.encode(encoder, offset + 0, depth)?;
11893            Ok(())
11894        }
11895    }
11896
11897    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11898        for StreamSocketSetTcpKeepAliveCountRequest
11899    {
11900        #[inline(always)]
11901        fn new_empty() -> Self {
11902            Self { value: fidl::new_empty!(u32, D) }
11903        }
11904
11905        #[inline]
11906        unsafe fn decode(
11907            &mut self,
11908            decoder: &mut fidl::encoding::Decoder<'_, D>,
11909            offset: usize,
11910            _depth: fidl::encoding::Depth,
11911        ) -> fidl::Result<()> {
11912            decoder.debug_check_bounds::<Self>(offset);
11913            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11914            // Verify that padding bytes are zero.
11915            // Copy from the buffer into the object.
11916            unsafe {
11917                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11918            }
11919            Ok(())
11920        }
11921    }
11922
11923    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11924        type Borrowed<'a> = &'a Self;
11925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11926            value
11927        }
11928    }
11929
11930    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11931        type Owned = Self;
11932
11933        #[inline(always)]
11934        fn inline_align(_context: fidl::encoding::Context) -> usize {
11935            4
11936        }
11937
11938        #[inline(always)]
11939        fn inline_size(_context: fidl::encoding::Context) -> usize {
11940            4
11941        }
11942        #[inline(always)]
11943        fn encode_is_copy() -> bool {
11944            true
11945        }
11946
11947        #[inline(always)]
11948        fn decode_is_copy() -> bool {
11949            true
11950        }
11951    }
11952
11953    unsafe impl<D: fidl::encoding::ResourceDialect>
11954        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D>
11955        for &StreamSocketSetTcpKeepAliveIdleRequest
11956    {
11957        #[inline]
11958        unsafe fn encode(
11959            self,
11960            encoder: &mut fidl::encoding::Encoder<'_, D>,
11961            offset: usize,
11962            _depth: fidl::encoding::Depth,
11963        ) -> fidl::Result<()> {
11964            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11965            unsafe {
11966                // Copy the object into the buffer.
11967                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11968                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIdleRequest).write_unaligned(
11969                    (self as *const StreamSocketSetTcpKeepAliveIdleRequest).read(),
11970                );
11971                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11972                // done second because the memcpy will write garbage to these bytes.
11973            }
11974            Ok(())
11975        }
11976    }
11977    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11978        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D> for (T0,)
11979    {
11980        #[inline]
11981        unsafe fn encode(
11982            self,
11983            encoder: &mut fidl::encoding::Encoder<'_, D>,
11984            offset: usize,
11985            depth: fidl::encoding::Depth,
11986        ) -> fidl::Result<()> {
11987            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11988            // Zero out padding regions. There's no need to apply masks
11989            // because the unmasked parts will be overwritten by fields.
11990            // Write the fields.
11991            self.0.encode(encoder, offset + 0, depth)?;
11992            Ok(())
11993        }
11994    }
11995
11996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11997        for StreamSocketSetTcpKeepAliveIdleRequest
11998    {
11999        #[inline(always)]
12000        fn new_empty() -> Self {
12001            Self { value_secs: fidl::new_empty!(u32, D) }
12002        }
12003
12004        #[inline]
12005        unsafe fn decode(
12006            &mut self,
12007            decoder: &mut fidl::encoding::Decoder<'_, D>,
12008            offset: usize,
12009            _depth: fidl::encoding::Depth,
12010        ) -> fidl::Result<()> {
12011            decoder.debug_check_bounds::<Self>(offset);
12012            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12013            // Verify that padding bytes are zero.
12014            // Copy from the buffer into the object.
12015            unsafe {
12016                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12017            }
12018            Ok(())
12019        }
12020    }
12021
12022    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
12023        type Borrowed<'a> = &'a Self;
12024        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12025            value
12026        }
12027    }
12028
12029    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
12030        type Owned = Self;
12031
12032        #[inline(always)]
12033        fn inline_align(_context: fidl::encoding::Context) -> usize {
12034            4
12035        }
12036
12037        #[inline(always)]
12038        fn inline_size(_context: fidl::encoding::Context) -> usize {
12039            4
12040        }
12041        #[inline(always)]
12042        fn encode_is_copy() -> bool {
12043            true
12044        }
12045
12046        #[inline(always)]
12047        fn decode_is_copy() -> bool {
12048            true
12049        }
12050    }
12051
12052    unsafe impl<D: fidl::encoding::ResourceDialect>
12053        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D>
12054        for &StreamSocketSetTcpKeepAliveIntervalRequest
12055    {
12056        #[inline]
12057        unsafe fn encode(
12058            self,
12059            encoder: &mut fidl::encoding::Encoder<'_, D>,
12060            offset: usize,
12061            _depth: fidl::encoding::Depth,
12062        ) -> fidl::Result<()> {
12063            encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
12064            unsafe {
12065                // Copy the object into the buffer.
12066                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12067                (buf_ptr as *mut StreamSocketSetTcpKeepAliveIntervalRequest).write_unaligned(
12068                    (self as *const StreamSocketSetTcpKeepAliveIntervalRequest).read(),
12069                );
12070                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12071                // done second because the memcpy will write garbage to these bytes.
12072            }
12073            Ok(())
12074        }
12075    }
12076    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12077        fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D> for (T0,)
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::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
12087            // Zero out padding regions. There's no need to apply masks
12088            // because the unmasked parts will be overwritten by fields.
12089            // Write the fields.
12090            self.0.encode(encoder, offset + 0, depth)?;
12091            Ok(())
12092        }
12093    }
12094
12095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12096        for StreamSocketSetTcpKeepAliveIntervalRequest
12097    {
12098        #[inline(always)]
12099        fn new_empty() -> Self {
12100            Self { value_secs: fidl::new_empty!(u32, D) }
12101        }
12102
12103        #[inline]
12104        unsafe fn decode(
12105            &mut self,
12106            decoder: &mut fidl::encoding::Decoder<'_, D>,
12107            offset: usize,
12108            _depth: fidl::encoding::Depth,
12109        ) -> fidl::Result<()> {
12110            decoder.debug_check_bounds::<Self>(offset);
12111            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12112            // Verify that padding bytes are zero.
12113            // Copy from the buffer into the object.
12114            unsafe {
12115                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12116            }
12117            Ok(())
12118        }
12119    }
12120
12121    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpLingerRequest {
12122        type Borrowed<'a> = &'a Self;
12123        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12124            value
12125        }
12126    }
12127
12128    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpLingerRequest {
12129        type Owned = Self;
12130
12131        #[inline(always)]
12132        fn inline_align(_context: fidl::encoding::Context) -> usize {
12133            8
12134        }
12135
12136        #[inline(always)]
12137        fn inline_size(_context: fidl::encoding::Context) -> usize {
12138            16
12139        }
12140    }
12141
12142    unsafe impl<D: fidl::encoding::ResourceDialect>
12143        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D>
12144        for &StreamSocketSetTcpLingerRequest
12145    {
12146        #[inline]
12147        unsafe fn encode(
12148            self,
12149            encoder: &mut fidl::encoding::Encoder<'_, D>,
12150            offset: usize,
12151            _depth: fidl::encoding::Depth,
12152        ) -> fidl::Result<()> {
12153            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12154            // Delegate to tuple encoding.
12155            fidl::encoding::Encode::<StreamSocketSetTcpLingerRequest, D>::encode(
12156                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
12157                encoder,
12158                offset,
12159                _depth,
12160            )
12161        }
12162    }
12163    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
12164        fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D> for (T0,)
12165    {
12166        #[inline]
12167        unsafe fn encode(
12168            self,
12169            encoder: &mut fidl::encoding::Encoder<'_, D>,
12170            offset: usize,
12171            depth: fidl::encoding::Depth,
12172        ) -> fidl::Result<()> {
12173            encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12174            // Zero out padding regions. There's no need to apply masks
12175            // because the unmasked parts will be overwritten by fields.
12176            // Write the fields.
12177            self.0.encode(encoder, offset + 0, depth)?;
12178            Ok(())
12179        }
12180    }
12181
12182    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12183        for StreamSocketSetTcpLingerRequest
12184    {
12185        #[inline(always)]
12186        fn new_empty() -> Self {
12187            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
12188        }
12189
12190        #[inline]
12191        unsafe fn decode(
12192            &mut self,
12193            decoder: &mut fidl::encoding::Decoder<'_, D>,
12194            offset: usize,
12195            _depth: fidl::encoding::Depth,
12196        ) -> fidl::Result<()> {
12197            decoder.debug_check_bounds::<Self>(offset);
12198            // Verify that padding bytes are zero.
12199            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
12200            Ok(())
12201        }
12202    }
12203
12204    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12205        type Borrowed<'a> = &'a Self;
12206        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12207            value
12208        }
12209    }
12210
12211    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12212        type Owned = Self;
12213
12214        #[inline(always)]
12215        fn inline_align(_context: fidl::encoding::Context) -> usize {
12216            4
12217        }
12218
12219        #[inline(always)]
12220        fn inline_size(_context: fidl::encoding::Context) -> usize {
12221            4
12222        }
12223        #[inline(always)]
12224        fn encode_is_copy() -> bool {
12225            true
12226        }
12227
12228        #[inline(always)]
12229        fn decode_is_copy() -> bool {
12230            true
12231        }
12232    }
12233
12234    unsafe impl<D: fidl::encoding::ResourceDialect>
12235        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D>
12236        for &StreamSocketSetTcpMaxSegmentRequest
12237    {
12238        #[inline]
12239        unsafe fn encode(
12240            self,
12241            encoder: &mut fidl::encoding::Encoder<'_, D>,
12242            offset: usize,
12243            _depth: fidl::encoding::Depth,
12244        ) -> fidl::Result<()> {
12245            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12246            unsafe {
12247                // Copy the object into the buffer.
12248                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12249                (buf_ptr as *mut StreamSocketSetTcpMaxSegmentRequest)
12250                    .write_unaligned((self as *const StreamSocketSetTcpMaxSegmentRequest).read());
12251                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12252                // done second because the memcpy will write garbage to these bytes.
12253            }
12254            Ok(())
12255        }
12256    }
12257    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12258        fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D> for (T0,)
12259    {
12260        #[inline]
12261        unsafe fn encode(
12262            self,
12263            encoder: &mut fidl::encoding::Encoder<'_, D>,
12264            offset: usize,
12265            depth: fidl::encoding::Depth,
12266        ) -> fidl::Result<()> {
12267            encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12268            // Zero out padding regions. There's no need to apply masks
12269            // because the unmasked parts will be overwritten by fields.
12270            // Write the fields.
12271            self.0.encode(encoder, offset + 0, depth)?;
12272            Ok(())
12273        }
12274    }
12275
12276    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12277        for StreamSocketSetTcpMaxSegmentRequest
12278    {
12279        #[inline(always)]
12280        fn new_empty() -> Self {
12281            Self { value_bytes: fidl::new_empty!(u32, D) }
12282        }
12283
12284        #[inline]
12285        unsafe fn decode(
12286            &mut self,
12287            decoder: &mut fidl::encoding::Decoder<'_, D>,
12288            offset: usize,
12289            _depth: fidl::encoding::Depth,
12290        ) -> fidl::Result<()> {
12291            decoder.debug_check_bounds::<Self>(offset);
12292            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12293            // Verify that padding bytes are zero.
12294            // Copy from the buffer into the object.
12295            unsafe {
12296                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12297            }
12298            Ok(())
12299        }
12300    }
12301
12302    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpNoDelayRequest {
12303        type Borrowed<'a> = &'a Self;
12304        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12305            value
12306        }
12307    }
12308
12309    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpNoDelayRequest {
12310        type Owned = Self;
12311
12312        #[inline(always)]
12313        fn inline_align(_context: fidl::encoding::Context) -> usize {
12314            1
12315        }
12316
12317        #[inline(always)]
12318        fn inline_size(_context: fidl::encoding::Context) -> usize {
12319            1
12320        }
12321    }
12322
12323    unsafe impl<D: fidl::encoding::ResourceDialect>
12324        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D>
12325        for &StreamSocketSetTcpNoDelayRequest
12326    {
12327        #[inline]
12328        unsafe fn encode(
12329            self,
12330            encoder: &mut fidl::encoding::Encoder<'_, D>,
12331            offset: usize,
12332            _depth: fidl::encoding::Depth,
12333        ) -> fidl::Result<()> {
12334            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12335            // Delegate to tuple encoding.
12336            fidl::encoding::Encode::<StreamSocketSetTcpNoDelayRequest, D>::encode(
12337                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12338                encoder,
12339                offset,
12340                _depth,
12341            )
12342        }
12343    }
12344    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12345        fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D> for (T0,)
12346    {
12347        #[inline]
12348        unsafe fn encode(
12349            self,
12350            encoder: &mut fidl::encoding::Encoder<'_, D>,
12351            offset: usize,
12352            depth: fidl::encoding::Depth,
12353        ) -> fidl::Result<()> {
12354            encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12355            // Zero out padding regions. There's no need to apply masks
12356            // because the unmasked parts will be overwritten by fields.
12357            // Write the fields.
12358            self.0.encode(encoder, offset + 0, depth)?;
12359            Ok(())
12360        }
12361    }
12362
12363    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12364        for StreamSocketSetTcpNoDelayRequest
12365    {
12366        #[inline(always)]
12367        fn new_empty() -> Self {
12368            Self { value: fidl::new_empty!(bool, D) }
12369        }
12370
12371        #[inline]
12372        unsafe fn decode(
12373            &mut self,
12374            decoder: &mut fidl::encoding::Decoder<'_, D>,
12375            offset: usize,
12376            _depth: fidl::encoding::Depth,
12377        ) -> fidl::Result<()> {
12378            decoder.debug_check_bounds::<Self>(offset);
12379            // Verify that padding bytes are zero.
12380            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12381            Ok(())
12382        }
12383    }
12384
12385    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpQuickAckRequest {
12386        type Borrowed<'a> = &'a Self;
12387        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12388            value
12389        }
12390    }
12391
12392    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpQuickAckRequest {
12393        type Owned = Self;
12394
12395        #[inline(always)]
12396        fn inline_align(_context: fidl::encoding::Context) -> usize {
12397            1
12398        }
12399
12400        #[inline(always)]
12401        fn inline_size(_context: fidl::encoding::Context) -> usize {
12402            1
12403        }
12404    }
12405
12406    unsafe impl<D: fidl::encoding::ResourceDialect>
12407        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D>
12408        for &StreamSocketSetTcpQuickAckRequest
12409    {
12410        #[inline]
12411        unsafe fn encode(
12412            self,
12413            encoder: &mut fidl::encoding::Encoder<'_, D>,
12414            offset: usize,
12415            _depth: fidl::encoding::Depth,
12416        ) -> fidl::Result<()> {
12417            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12418            // Delegate to tuple encoding.
12419            fidl::encoding::Encode::<StreamSocketSetTcpQuickAckRequest, D>::encode(
12420                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12421                encoder,
12422                offset,
12423                _depth,
12424            )
12425        }
12426    }
12427    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12428        fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D> for (T0,)
12429    {
12430        #[inline]
12431        unsafe fn encode(
12432            self,
12433            encoder: &mut fidl::encoding::Encoder<'_, D>,
12434            offset: usize,
12435            depth: fidl::encoding::Depth,
12436        ) -> fidl::Result<()> {
12437            encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12438            // Zero out padding regions. There's no need to apply masks
12439            // because the unmasked parts will be overwritten by fields.
12440            // Write the fields.
12441            self.0.encode(encoder, offset + 0, depth)?;
12442            Ok(())
12443        }
12444    }
12445
12446    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12447        for StreamSocketSetTcpQuickAckRequest
12448    {
12449        #[inline(always)]
12450        fn new_empty() -> Self {
12451            Self { value: fidl::new_empty!(bool, D) }
12452        }
12453
12454        #[inline]
12455        unsafe fn decode(
12456            &mut self,
12457            decoder: &mut fidl::encoding::Decoder<'_, D>,
12458            offset: usize,
12459            _depth: fidl::encoding::Depth,
12460        ) -> fidl::Result<()> {
12461            decoder.debug_check_bounds::<Self>(offset);
12462            // Verify that padding bytes are zero.
12463            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12464            Ok(())
12465        }
12466    }
12467
12468    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpSynCountRequest {
12469        type Borrowed<'a> = &'a Self;
12470        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12471            value
12472        }
12473    }
12474
12475    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpSynCountRequest {
12476        type Owned = Self;
12477
12478        #[inline(always)]
12479        fn inline_align(_context: fidl::encoding::Context) -> usize {
12480            4
12481        }
12482
12483        #[inline(always)]
12484        fn inline_size(_context: fidl::encoding::Context) -> usize {
12485            4
12486        }
12487        #[inline(always)]
12488        fn encode_is_copy() -> bool {
12489            true
12490        }
12491
12492        #[inline(always)]
12493        fn decode_is_copy() -> bool {
12494            true
12495        }
12496    }
12497
12498    unsafe impl<D: fidl::encoding::ResourceDialect>
12499        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D>
12500        for &StreamSocketSetTcpSynCountRequest
12501    {
12502        #[inline]
12503        unsafe fn encode(
12504            self,
12505            encoder: &mut fidl::encoding::Encoder<'_, D>,
12506            offset: usize,
12507            _depth: fidl::encoding::Depth,
12508        ) -> fidl::Result<()> {
12509            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12510            unsafe {
12511                // Copy the object into the buffer.
12512                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12513                (buf_ptr as *mut StreamSocketSetTcpSynCountRequest)
12514                    .write_unaligned((self as *const StreamSocketSetTcpSynCountRequest).read());
12515                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12516                // done second because the memcpy will write garbage to these bytes.
12517            }
12518            Ok(())
12519        }
12520    }
12521    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12522        fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D> for (T0,)
12523    {
12524        #[inline]
12525        unsafe fn encode(
12526            self,
12527            encoder: &mut fidl::encoding::Encoder<'_, D>,
12528            offset: usize,
12529            depth: fidl::encoding::Depth,
12530        ) -> fidl::Result<()> {
12531            encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12532            // Zero out padding regions. There's no need to apply masks
12533            // because the unmasked parts will be overwritten by fields.
12534            // Write the fields.
12535            self.0.encode(encoder, offset + 0, depth)?;
12536            Ok(())
12537        }
12538    }
12539
12540    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12541        for StreamSocketSetTcpSynCountRequest
12542    {
12543        #[inline(always)]
12544        fn new_empty() -> Self {
12545            Self { value: fidl::new_empty!(u32, D) }
12546        }
12547
12548        #[inline]
12549        unsafe fn decode(
12550            &mut self,
12551            decoder: &mut fidl::encoding::Decoder<'_, D>,
12552            offset: usize,
12553            _depth: fidl::encoding::Depth,
12554        ) -> fidl::Result<()> {
12555            decoder.debug_check_bounds::<Self>(offset);
12556            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12557            // Verify that padding bytes are zero.
12558            // Copy from the buffer into the object.
12559            unsafe {
12560                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12561            }
12562            Ok(())
12563        }
12564    }
12565
12566    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12567        type Borrowed<'a> = &'a Self;
12568        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12569            value
12570        }
12571    }
12572
12573    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12574        type Owned = Self;
12575
12576        #[inline(always)]
12577        fn inline_align(_context: fidl::encoding::Context) -> usize {
12578            4
12579        }
12580
12581        #[inline(always)]
12582        fn inline_size(_context: fidl::encoding::Context) -> usize {
12583            4
12584        }
12585        #[inline(always)]
12586        fn encode_is_copy() -> bool {
12587            true
12588        }
12589
12590        #[inline(always)]
12591        fn decode_is_copy() -> bool {
12592            true
12593        }
12594    }
12595
12596    unsafe impl<D: fidl::encoding::ResourceDialect>
12597        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D>
12598        for &StreamSocketSetTcpUserTimeoutRequest
12599    {
12600        #[inline]
12601        unsafe fn encode(
12602            self,
12603            encoder: &mut fidl::encoding::Encoder<'_, D>,
12604            offset: usize,
12605            _depth: fidl::encoding::Depth,
12606        ) -> fidl::Result<()> {
12607            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12608            unsafe {
12609                // Copy the object into the buffer.
12610                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12611                (buf_ptr as *mut StreamSocketSetTcpUserTimeoutRequest)
12612                    .write_unaligned((self as *const StreamSocketSetTcpUserTimeoutRequest).read());
12613                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12614                // done second because the memcpy will write garbage to these bytes.
12615            }
12616            Ok(())
12617        }
12618    }
12619    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12620        fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D> for (T0,)
12621    {
12622        #[inline]
12623        unsafe fn encode(
12624            self,
12625            encoder: &mut fidl::encoding::Encoder<'_, D>,
12626            offset: usize,
12627            depth: fidl::encoding::Depth,
12628        ) -> fidl::Result<()> {
12629            encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12630            // Zero out padding regions. There's no need to apply masks
12631            // because the unmasked parts will be overwritten by fields.
12632            // Write the fields.
12633            self.0.encode(encoder, offset + 0, depth)?;
12634            Ok(())
12635        }
12636    }
12637
12638    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12639        for StreamSocketSetTcpUserTimeoutRequest
12640    {
12641        #[inline(always)]
12642        fn new_empty() -> Self {
12643            Self { value_millis: fidl::new_empty!(u32, D) }
12644        }
12645
12646        #[inline]
12647        unsafe fn decode(
12648            &mut self,
12649            decoder: &mut fidl::encoding::Decoder<'_, D>,
12650            offset: usize,
12651            _depth: fidl::encoding::Depth,
12652        ) -> fidl::Result<()> {
12653            decoder.debug_check_bounds::<Self>(offset);
12654            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12655            // Verify that padding bytes are zero.
12656            // Copy from the buffer into the object.
12657            unsafe {
12658                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12659            }
12660            Ok(())
12661        }
12662    }
12663
12664    impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpWindowClampRequest {
12665        type Borrowed<'a> = &'a Self;
12666        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12667            value
12668        }
12669    }
12670
12671    unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpWindowClampRequest {
12672        type Owned = Self;
12673
12674        #[inline(always)]
12675        fn inline_align(_context: fidl::encoding::Context) -> usize {
12676            4
12677        }
12678
12679        #[inline(always)]
12680        fn inline_size(_context: fidl::encoding::Context) -> usize {
12681            4
12682        }
12683        #[inline(always)]
12684        fn encode_is_copy() -> bool {
12685            true
12686        }
12687
12688        #[inline(always)]
12689        fn decode_is_copy() -> bool {
12690            true
12691        }
12692    }
12693
12694    unsafe impl<D: fidl::encoding::ResourceDialect>
12695        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D>
12696        for &StreamSocketSetTcpWindowClampRequest
12697    {
12698        #[inline]
12699        unsafe fn encode(
12700            self,
12701            encoder: &mut fidl::encoding::Encoder<'_, D>,
12702            offset: usize,
12703            _depth: fidl::encoding::Depth,
12704        ) -> fidl::Result<()> {
12705            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12706            unsafe {
12707                // Copy the object into the buffer.
12708                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12709                (buf_ptr as *mut StreamSocketSetTcpWindowClampRequest)
12710                    .write_unaligned((self as *const StreamSocketSetTcpWindowClampRequest).read());
12711                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12712                // done second because the memcpy will write garbage to these bytes.
12713            }
12714            Ok(())
12715        }
12716    }
12717    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12718        fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D> for (T0,)
12719    {
12720        #[inline]
12721        unsafe fn encode(
12722            self,
12723            encoder: &mut fidl::encoding::Encoder<'_, D>,
12724            offset: usize,
12725            depth: fidl::encoding::Depth,
12726        ) -> fidl::Result<()> {
12727            encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12728            // Zero out padding regions. There's no need to apply masks
12729            // because the unmasked parts will be overwritten by fields.
12730            // Write the fields.
12731            self.0.encode(encoder, offset + 0, depth)?;
12732            Ok(())
12733        }
12734    }
12735
12736    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12737        for StreamSocketSetTcpWindowClampRequest
12738    {
12739        #[inline(always)]
12740        fn new_empty() -> Self {
12741            Self { value: fidl::new_empty!(u32, D) }
12742        }
12743
12744        #[inline]
12745        unsafe fn decode(
12746            &mut self,
12747            decoder: &mut fidl::encoding::Decoder<'_, D>,
12748            offset: usize,
12749            _depth: fidl::encoding::Depth,
12750        ) -> fidl::Result<()> {
12751            decoder.debug_check_bounds::<Self>(offset);
12752            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12753            // Verify that padding bytes are zero.
12754            // Copy from the buffer into the object.
12755            unsafe {
12756                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12757            }
12758            Ok(())
12759        }
12760    }
12761
12762    impl fidl::encoding::ValueTypeMarker for StreamSocketGetInfoResponse {
12763        type Borrowed<'a> = &'a Self;
12764        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12765            value
12766        }
12767    }
12768
12769    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetInfoResponse {
12770        type Owned = Self;
12771
12772        #[inline(always)]
12773        fn inline_align(_context: fidl::encoding::Context) -> usize {
12774            4
12775        }
12776
12777        #[inline(always)]
12778        fn inline_size(_context: fidl::encoding::Context) -> usize {
12779            8
12780        }
12781    }
12782
12783    unsafe impl<D: fidl::encoding::ResourceDialect>
12784        fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for &StreamSocketGetInfoResponse
12785    {
12786        #[inline]
12787        unsafe fn encode(
12788            self,
12789            encoder: &mut fidl::encoding::Encoder<'_, D>,
12790            offset: usize,
12791            _depth: fidl::encoding::Depth,
12792        ) -> fidl::Result<()> {
12793            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12794            // Delegate to tuple encoding.
12795            fidl::encoding::Encode::<StreamSocketGetInfoResponse, D>::encode(
12796                (
12797                    <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
12798                    <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
12799                ),
12800                encoder,
12801                offset,
12802                _depth,
12803            )
12804        }
12805    }
12806    unsafe impl<
12807        D: fidl::encoding::ResourceDialect,
12808        T0: fidl::encoding::Encode<Domain, D>,
12809        T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
12810    > fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for (T0, T1)
12811    {
12812        #[inline]
12813        unsafe fn encode(
12814            self,
12815            encoder: &mut fidl::encoding::Encoder<'_, D>,
12816            offset: usize,
12817            depth: fidl::encoding::Depth,
12818        ) -> fidl::Result<()> {
12819            encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12820            // Zero out padding regions. There's no need to apply masks
12821            // because the unmasked parts will be overwritten by fields.
12822            unsafe {
12823                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12824                (ptr as *mut u32).write_unaligned(0);
12825            }
12826            // Write the fields.
12827            self.0.encode(encoder, offset + 0, depth)?;
12828            self.1.encode(encoder, offset + 4, depth)?;
12829            Ok(())
12830        }
12831    }
12832
12833    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12834        for StreamSocketGetInfoResponse
12835    {
12836        #[inline(always)]
12837        fn new_empty() -> Self {
12838            Self {
12839                domain: fidl::new_empty!(Domain, D),
12840                proto: fidl::new_empty!(StreamSocketProtocol, D),
12841            }
12842        }
12843
12844        #[inline]
12845        unsafe fn decode(
12846            &mut self,
12847            decoder: &mut fidl::encoding::Decoder<'_, D>,
12848            offset: usize,
12849            _depth: fidl::encoding::Depth,
12850        ) -> fidl::Result<()> {
12851            decoder.debug_check_bounds::<Self>(offset);
12852            // Verify that padding bytes are zero.
12853            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12854            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12855            let mask = 0xffff0000u32;
12856            let maskedval = padval & mask;
12857            if maskedval != 0 {
12858                return Err(fidl::Error::NonZeroPadding {
12859                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12860                });
12861            }
12862            fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
12863            fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
12864            Ok(())
12865        }
12866    }
12867
12868    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCongestionResponse {
12869        type Borrowed<'a> = &'a Self;
12870        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12871            value
12872        }
12873    }
12874
12875    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCongestionResponse {
12876        type Owned = Self;
12877
12878        #[inline(always)]
12879        fn inline_align(_context: fidl::encoding::Context) -> usize {
12880            4
12881        }
12882
12883        #[inline(always)]
12884        fn inline_size(_context: fidl::encoding::Context) -> usize {
12885            4
12886        }
12887    }
12888
12889    unsafe impl<D: fidl::encoding::ResourceDialect>
12890        fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D>
12891        for &StreamSocketGetTcpCongestionResponse
12892    {
12893        #[inline]
12894        unsafe fn encode(
12895            self,
12896            encoder: &mut fidl::encoding::Encoder<'_, D>,
12897            offset: usize,
12898            _depth: fidl::encoding::Depth,
12899        ) -> fidl::Result<()> {
12900            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12901            // Delegate to tuple encoding.
12902            fidl::encoding::Encode::<StreamSocketGetTcpCongestionResponse, D>::encode(
12903                (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12904                encoder,
12905                offset,
12906                _depth,
12907            )
12908        }
12909    }
12910    unsafe impl<
12911        D: fidl::encoding::ResourceDialect,
12912        T0: fidl::encoding::Encode<TcpCongestionControl, D>,
12913    > fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D> for (T0,)
12914    {
12915        #[inline]
12916        unsafe fn encode(
12917            self,
12918            encoder: &mut fidl::encoding::Encoder<'_, D>,
12919            offset: usize,
12920            depth: fidl::encoding::Depth,
12921        ) -> fidl::Result<()> {
12922            encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12923            // Zero out padding regions. There's no need to apply masks
12924            // because the unmasked parts will be overwritten by fields.
12925            // Write the fields.
12926            self.0.encode(encoder, offset + 0, depth)?;
12927            Ok(())
12928        }
12929    }
12930
12931    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12932        for StreamSocketGetTcpCongestionResponse
12933    {
12934        #[inline(always)]
12935        fn new_empty() -> Self {
12936            Self { value: fidl::new_empty!(TcpCongestionControl, D) }
12937        }
12938
12939        #[inline]
12940        unsafe fn decode(
12941            &mut self,
12942            decoder: &mut fidl::encoding::Decoder<'_, D>,
12943            offset: usize,
12944            _depth: fidl::encoding::Depth,
12945        ) -> fidl::Result<()> {
12946            decoder.debug_check_bounds::<Self>(offset);
12947            // Verify that padding bytes are zero.
12948            fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
12949            Ok(())
12950        }
12951    }
12952
12953    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCorkResponse {
12954        type Borrowed<'a> = &'a Self;
12955        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12956            value
12957        }
12958    }
12959
12960    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCorkResponse {
12961        type Owned = Self;
12962
12963        #[inline(always)]
12964        fn inline_align(_context: fidl::encoding::Context) -> usize {
12965            1
12966        }
12967
12968        #[inline(always)]
12969        fn inline_size(_context: fidl::encoding::Context) -> usize {
12970            1
12971        }
12972    }
12973
12974    unsafe impl<D: fidl::encoding::ResourceDialect>
12975        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D>
12976        for &StreamSocketGetTcpCorkResponse
12977    {
12978        #[inline]
12979        unsafe fn encode(
12980            self,
12981            encoder: &mut fidl::encoding::Encoder<'_, D>,
12982            offset: usize,
12983            _depth: fidl::encoding::Depth,
12984        ) -> fidl::Result<()> {
12985            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12986            // Delegate to tuple encoding.
12987            fidl::encoding::Encode::<StreamSocketGetTcpCorkResponse, D>::encode(
12988                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12989                encoder,
12990                offset,
12991                _depth,
12992            )
12993        }
12994    }
12995    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12996        fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D> for (T0,)
12997    {
12998        #[inline]
12999        unsafe fn encode(
13000            self,
13001            encoder: &mut fidl::encoding::Encoder<'_, D>,
13002            offset: usize,
13003            depth: fidl::encoding::Depth,
13004        ) -> fidl::Result<()> {
13005            encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
13006            // Zero out padding regions. There's no need to apply masks
13007            // because the unmasked parts will be overwritten by fields.
13008            // Write the fields.
13009            self.0.encode(encoder, offset + 0, depth)?;
13010            Ok(())
13011        }
13012    }
13013
13014    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13015        for StreamSocketGetTcpCorkResponse
13016    {
13017        #[inline(always)]
13018        fn new_empty() -> Self {
13019            Self { value: fidl::new_empty!(bool, D) }
13020        }
13021
13022        #[inline]
13023        unsafe fn decode(
13024            &mut self,
13025            decoder: &mut fidl::encoding::Decoder<'_, D>,
13026            offset: usize,
13027            _depth: fidl::encoding::Depth,
13028        ) -> fidl::Result<()> {
13029            decoder.debug_check_bounds::<Self>(offset);
13030            // Verify that padding bytes are zero.
13031            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13032            Ok(())
13033        }
13034    }
13035
13036    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpDeferAcceptResponse {
13037        type Borrowed<'a> = &'a Self;
13038        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13039            value
13040        }
13041    }
13042
13043    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpDeferAcceptResponse {
13044        type Owned = Self;
13045
13046        #[inline(always)]
13047        fn inline_align(_context: fidl::encoding::Context) -> usize {
13048            4
13049        }
13050
13051        #[inline(always)]
13052        fn inline_size(_context: fidl::encoding::Context) -> usize {
13053            4
13054        }
13055        #[inline(always)]
13056        fn encode_is_copy() -> bool {
13057            true
13058        }
13059
13060        #[inline(always)]
13061        fn decode_is_copy() -> bool {
13062            true
13063        }
13064    }
13065
13066    unsafe impl<D: fidl::encoding::ResourceDialect>
13067        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D>
13068        for &StreamSocketGetTcpDeferAcceptResponse
13069    {
13070        #[inline]
13071        unsafe fn encode(
13072            self,
13073            encoder: &mut fidl::encoding::Encoder<'_, D>,
13074            offset: usize,
13075            _depth: fidl::encoding::Depth,
13076        ) -> fidl::Result<()> {
13077            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
13078            unsafe {
13079                // Copy the object into the buffer.
13080                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13081                (buf_ptr as *mut StreamSocketGetTcpDeferAcceptResponse)
13082                    .write_unaligned((self as *const StreamSocketGetTcpDeferAcceptResponse).read());
13083                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13084                // done second because the memcpy will write garbage to these bytes.
13085            }
13086            Ok(())
13087        }
13088    }
13089    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13090        fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D> for (T0,)
13091    {
13092        #[inline]
13093        unsafe fn encode(
13094            self,
13095            encoder: &mut fidl::encoding::Encoder<'_, D>,
13096            offset: usize,
13097            depth: fidl::encoding::Depth,
13098        ) -> fidl::Result<()> {
13099            encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
13100            // Zero out padding regions. There's no need to apply masks
13101            // because the unmasked parts will be overwritten by fields.
13102            // Write the fields.
13103            self.0.encode(encoder, offset + 0, depth)?;
13104            Ok(())
13105        }
13106    }
13107
13108    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13109        for StreamSocketGetTcpDeferAcceptResponse
13110    {
13111        #[inline(always)]
13112        fn new_empty() -> Self {
13113            Self { value_secs: fidl::new_empty!(u32, D) }
13114        }
13115
13116        #[inline]
13117        unsafe fn decode(
13118            &mut self,
13119            decoder: &mut fidl::encoding::Decoder<'_, D>,
13120            offset: usize,
13121            _depth: fidl::encoding::Depth,
13122        ) -> fidl::Result<()> {
13123            decoder.debug_check_bounds::<Self>(offset);
13124            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13125            // Verify that padding bytes are zero.
13126            // Copy from the buffer into the object.
13127            unsafe {
13128                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13129            }
13130            Ok(())
13131        }
13132    }
13133
13134    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpInfoResponse {
13135        type Borrowed<'a> = &'a Self;
13136        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13137            value
13138        }
13139    }
13140
13141    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpInfoResponse {
13142        type Owned = Self;
13143
13144        #[inline(always)]
13145        fn inline_align(_context: fidl::encoding::Context) -> usize {
13146            8
13147        }
13148
13149        #[inline(always)]
13150        fn inline_size(_context: fidl::encoding::Context) -> usize {
13151            16
13152        }
13153    }
13154
13155    unsafe impl<D: fidl::encoding::ResourceDialect>
13156        fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D>
13157        for &StreamSocketGetTcpInfoResponse
13158    {
13159        #[inline]
13160        unsafe fn encode(
13161            self,
13162            encoder: &mut fidl::encoding::Encoder<'_, D>,
13163            offset: usize,
13164            _depth: fidl::encoding::Depth,
13165        ) -> fidl::Result<()> {
13166            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13167            // Delegate to tuple encoding.
13168            fidl::encoding::Encode::<StreamSocketGetTcpInfoResponse, D>::encode(
13169                (<fidl_fuchsia_net_tcp_common::Info as fidl::encoding::ValueTypeMarker>::borrow(
13170                    &self.info,
13171                ),),
13172                encoder,
13173                offset,
13174                _depth,
13175            )
13176        }
13177    }
13178    unsafe impl<
13179        D: fidl::encoding::ResourceDialect,
13180        T0: fidl::encoding::Encode<fidl_fuchsia_net_tcp_common::Info, D>,
13181    > fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D> for (T0,)
13182    {
13183        #[inline]
13184        unsafe fn encode(
13185            self,
13186            encoder: &mut fidl::encoding::Encoder<'_, D>,
13187            offset: usize,
13188            depth: fidl::encoding::Depth,
13189        ) -> fidl::Result<()> {
13190            encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13191            // Zero out padding regions. There's no need to apply masks
13192            // because the unmasked parts will be overwritten by fields.
13193            // Write the fields.
13194            self.0.encode(encoder, offset + 0, depth)?;
13195            Ok(())
13196        }
13197    }
13198
13199    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13200        for StreamSocketGetTcpInfoResponse
13201    {
13202        #[inline(always)]
13203        fn new_empty() -> Self {
13204            Self { info: fidl::new_empty!(fidl_fuchsia_net_tcp_common::Info, D) }
13205        }
13206
13207        #[inline]
13208        unsafe fn decode(
13209            &mut self,
13210            decoder: &mut fidl::encoding::Decoder<'_, D>,
13211            offset: usize,
13212            _depth: fidl::encoding::Depth,
13213        ) -> fidl::Result<()> {
13214            decoder.debug_check_bounds::<Self>(offset);
13215            // Verify that padding bytes are zero.
13216            fidl::decode!(
13217                fidl_fuchsia_net_tcp_common::Info,
13218                D,
13219                &mut self.info,
13220                decoder,
13221                offset + 0,
13222                _depth
13223            )?;
13224            Ok(())
13225        }
13226    }
13227
13228    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13229        type Borrowed<'a> = &'a Self;
13230        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13231            value
13232        }
13233    }
13234
13235    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13236        type Owned = Self;
13237
13238        #[inline(always)]
13239        fn inline_align(_context: fidl::encoding::Context) -> usize {
13240            4
13241        }
13242
13243        #[inline(always)]
13244        fn inline_size(_context: fidl::encoding::Context) -> usize {
13245            4
13246        }
13247        #[inline(always)]
13248        fn encode_is_copy() -> bool {
13249            true
13250        }
13251
13252        #[inline(always)]
13253        fn decode_is_copy() -> bool {
13254            true
13255        }
13256    }
13257
13258    unsafe impl<D: fidl::encoding::ResourceDialect>
13259        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D>
13260        for &StreamSocketGetTcpKeepAliveCountResponse
13261    {
13262        #[inline]
13263        unsafe fn encode(
13264            self,
13265            encoder: &mut fidl::encoding::Encoder<'_, D>,
13266            offset: usize,
13267            _depth: fidl::encoding::Depth,
13268        ) -> fidl::Result<()> {
13269            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13270            unsafe {
13271                // Copy the object into the buffer.
13272                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13273                (buf_ptr as *mut StreamSocketGetTcpKeepAliveCountResponse).write_unaligned(
13274                    (self as *const StreamSocketGetTcpKeepAliveCountResponse).read(),
13275                );
13276                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13277                // done second because the memcpy will write garbage to these bytes.
13278            }
13279            Ok(())
13280        }
13281    }
13282    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13283        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D> for (T0,)
13284    {
13285        #[inline]
13286        unsafe fn encode(
13287            self,
13288            encoder: &mut fidl::encoding::Encoder<'_, D>,
13289            offset: usize,
13290            depth: fidl::encoding::Depth,
13291        ) -> fidl::Result<()> {
13292            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13293            // Zero out padding regions. There's no need to apply masks
13294            // because the unmasked parts will be overwritten by fields.
13295            // Write the fields.
13296            self.0.encode(encoder, offset + 0, depth)?;
13297            Ok(())
13298        }
13299    }
13300
13301    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13302        for StreamSocketGetTcpKeepAliveCountResponse
13303    {
13304        #[inline(always)]
13305        fn new_empty() -> Self {
13306            Self { value: fidl::new_empty!(u32, D) }
13307        }
13308
13309        #[inline]
13310        unsafe fn decode(
13311            &mut self,
13312            decoder: &mut fidl::encoding::Decoder<'_, D>,
13313            offset: usize,
13314            _depth: fidl::encoding::Depth,
13315        ) -> fidl::Result<()> {
13316            decoder.debug_check_bounds::<Self>(offset);
13317            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13318            // Verify that padding bytes are zero.
13319            // Copy from the buffer into the object.
13320            unsafe {
13321                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13322            }
13323            Ok(())
13324        }
13325    }
13326
13327    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13328        type Borrowed<'a> = &'a Self;
13329        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13330            value
13331        }
13332    }
13333
13334    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13335        type Owned = Self;
13336
13337        #[inline(always)]
13338        fn inline_align(_context: fidl::encoding::Context) -> usize {
13339            4
13340        }
13341
13342        #[inline(always)]
13343        fn inline_size(_context: fidl::encoding::Context) -> usize {
13344            4
13345        }
13346        #[inline(always)]
13347        fn encode_is_copy() -> bool {
13348            true
13349        }
13350
13351        #[inline(always)]
13352        fn decode_is_copy() -> bool {
13353            true
13354        }
13355    }
13356
13357    unsafe impl<D: fidl::encoding::ResourceDialect>
13358        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D>
13359        for &StreamSocketGetTcpKeepAliveIdleResponse
13360    {
13361        #[inline]
13362        unsafe fn encode(
13363            self,
13364            encoder: &mut fidl::encoding::Encoder<'_, D>,
13365            offset: usize,
13366            _depth: fidl::encoding::Depth,
13367        ) -> fidl::Result<()> {
13368            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13369            unsafe {
13370                // Copy the object into the buffer.
13371                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13372                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIdleResponse).write_unaligned(
13373                    (self as *const StreamSocketGetTcpKeepAliveIdleResponse).read(),
13374                );
13375                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13376                // done second because the memcpy will write garbage to these bytes.
13377            }
13378            Ok(())
13379        }
13380    }
13381    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13382        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D> for (T0,)
13383    {
13384        #[inline]
13385        unsafe fn encode(
13386            self,
13387            encoder: &mut fidl::encoding::Encoder<'_, D>,
13388            offset: usize,
13389            depth: fidl::encoding::Depth,
13390        ) -> fidl::Result<()> {
13391            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13392            // Zero out padding regions. There's no need to apply masks
13393            // because the unmasked parts will be overwritten by fields.
13394            // Write the fields.
13395            self.0.encode(encoder, offset + 0, depth)?;
13396            Ok(())
13397        }
13398    }
13399
13400    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13401        for StreamSocketGetTcpKeepAliveIdleResponse
13402    {
13403        #[inline(always)]
13404        fn new_empty() -> Self {
13405            Self { value_secs: fidl::new_empty!(u32, D) }
13406        }
13407
13408        #[inline]
13409        unsafe fn decode(
13410            &mut self,
13411            decoder: &mut fidl::encoding::Decoder<'_, D>,
13412            offset: usize,
13413            _depth: fidl::encoding::Depth,
13414        ) -> fidl::Result<()> {
13415            decoder.debug_check_bounds::<Self>(offset);
13416            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13417            // Verify that padding bytes are zero.
13418            // Copy from the buffer into the object.
13419            unsafe {
13420                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13421            }
13422            Ok(())
13423        }
13424    }
13425
13426    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13427        type Borrowed<'a> = &'a Self;
13428        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13429            value
13430        }
13431    }
13432
13433    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13434        type Owned = Self;
13435
13436        #[inline(always)]
13437        fn inline_align(_context: fidl::encoding::Context) -> usize {
13438            4
13439        }
13440
13441        #[inline(always)]
13442        fn inline_size(_context: fidl::encoding::Context) -> usize {
13443            4
13444        }
13445        #[inline(always)]
13446        fn encode_is_copy() -> bool {
13447            true
13448        }
13449
13450        #[inline(always)]
13451        fn decode_is_copy() -> bool {
13452            true
13453        }
13454    }
13455
13456    unsafe impl<D: fidl::encoding::ResourceDialect>
13457        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D>
13458        for &StreamSocketGetTcpKeepAliveIntervalResponse
13459    {
13460        #[inline]
13461        unsafe fn encode(
13462            self,
13463            encoder: &mut fidl::encoding::Encoder<'_, D>,
13464            offset: usize,
13465            _depth: fidl::encoding::Depth,
13466        ) -> fidl::Result<()> {
13467            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13468            unsafe {
13469                // Copy the object into the buffer.
13470                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13471                (buf_ptr as *mut StreamSocketGetTcpKeepAliveIntervalResponse).write_unaligned(
13472                    (self as *const StreamSocketGetTcpKeepAliveIntervalResponse).read(),
13473                );
13474                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13475                // done second because the memcpy will write garbage to these bytes.
13476            }
13477            Ok(())
13478        }
13479    }
13480    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13481        fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D> for (T0,)
13482    {
13483        #[inline]
13484        unsafe fn encode(
13485            self,
13486            encoder: &mut fidl::encoding::Encoder<'_, D>,
13487            offset: usize,
13488            depth: fidl::encoding::Depth,
13489        ) -> fidl::Result<()> {
13490            encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13491            // Zero out padding regions. There's no need to apply masks
13492            // because the unmasked parts will be overwritten by fields.
13493            // Write the fields.
13494            self.0.encode(encoder, offset + 0, depth)?;
13495            Ok(())
13496        }
13497    }
13498
13499    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13500        for StreamSocketGetTcpKeepAliveIntervalResponse
13501    {
13502        #[inline(always)]
13503        fn new_empty() -> Self {
13504            Self { value_secs: fidl::new_empty!(u32, D) }
13505        }
13506
13507        #[inline]
13508        unsafe fn decode(
13509            &mut self,
13510            decoder: &mut fidl::encoding::Decoder<'_, D>,
13511            offset: usize,
13512            _depth: fidl::encoding::Depth,
13513        ) -> fidl::Result<()> {
13514            decoder.debug_check_bounds::<Self>(offset);
13515            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13516            // Verify that padding bytes are zero.
13517            // Copy from the buffer into the object.
13518            unsafe {
13519                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13520            }
13521            Ok(())
13522        }
13523    }
13524
13525    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpLingerResponse {
13526        type Borrowed<'a> = &'a Self;
13527        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13528            value
13529        }
13530    }
13531
13532    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpLingerResponse {
13533        type Owned = Self;
13534
13535        #[inline(always)]
13536        fn inline_align(_context: fidl::encoding::Context) -> usize {
13537            8
13538        }
13539
13540        #[inline(always)]
13541        fn inline_size(_context: fidl::encoding::Context) -> usize {
13542            16
13543        }
13544    }
13545
13546    unsafe impl<D: fidl::encoding::ResourceDialect>
13547        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D>
13548        for &StreamSocketGetTcpLingerResponse
13549    {
13550        #[inline]
13551        unsafe fn encode(
13552            self,
13553            encoder: &mut fidl::encoding::Encoder<'_, D>,
13554            offset: usize,
13555            _depth: fidl::encoding::Depth,
13556        ) -> fidl::Result<()> {
13557            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13558            // Delegate to tuple encoding.
13559            fidl::encoding::Encode::<StreamSocketGetTcpLingerResponse, D>::encode(
13560                (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
13561                encoder,
13562                offset,
13563                _depth,
13564            )
13565        }
13566    }
13567    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
13568        fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D> for (T0,)
13569    {
13570        #[inline]
13571        unsafe fn encode(
13572            self,
13573            encoder: &mut fidl::encoding::Encoder<'_, D>,
13574            offset: usize,
13575            depth: fidl::encoding::Depth,
13576        ) -> fidl::Result<()> {
13577            encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13578            // Zero out padding regions. There's no need to apply masks
13579            // because the unmasked parts will be overwritten by fields.
13580            // Write the fields.
13581            self.0.encode(encoder, offset + 0, depth)?;
13582            Ok(())
13583        }
13584    }
13585
13586    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13587        for StreamSocketGetTcpLingerResponse
13588    {
13589        #[inline(always)]
13590        fn new_empty() -> Self {
13591            Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
13592        }
13593
13594        #[inline]
13595        unsafe fn decode(
13596            &mut self,
13597            decoder: &mut fidl::encoding::Decoder<'_, D>,
13598            offset: usize,
13599            _depth: fidl::encoding::Depth,
13600        ) -> fidl::Result<()> {
13601            decoder.debug_check_bounds::<Self>(offset);
13602            // Verify that padding bytes are zero.
13603            fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
13604            Ok(())
13605        }
13606    }
13607
13608    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13609        type Borrowed<'a> = &'a Self;
13610        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13611            value
13612        }
13613    }
13614
13615    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13616        type Owned = Self;
13617
13618        #[inline(always)]
13619        fn inline_align(_context: fidl::encoding::Context) -> usize {
13620            4
13621        }
13622
13623        #[inline(always)]
13624        fn inline_size(_context: fidl::encoding::Context) -> usize {
13625            4
13626        }
13627        #[inline(always)]
13628        fn encode_is_copy() -> bool {
13629            true
13630        }
13631
13632        #[inline(always)]
13633        fn decode_is_copy() -> bool {
13634            true
13635        }
13636    }
13637
13638    unsafe impl<D: fidl::encoding::ResourceDialect>
13639        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D>
13640        for &StreamSocketGetTcpMaxSegmentResponse
13641    {
13642        #[inline]
13643        unsafe fn encode(
13644            self,
13645            encoder: &mut fidl::encoding::Encoder<'_, D>,
13646            offset: usize,
13647            _depth: fidl::encoding::Depth,
13648        ) -> fidl::Result<()> {
13649            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13650            unsafe {
13651                // Copy the object into the buffer.
13652                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13653                (buf_ptr as *mut StreamSocketGetTcpMaxSegmentResponse)
13654                    .write_unaligned((self as *const StreamSocketGetTcpMaxSegmentResponse).read());
13655                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13656                // done second because the memcpy will write garbage to these bytes.
13657            }
13658            Ok(())
13659        }
13660    }
13661    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13662        fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D> for (T0,)
13663    {
13664        #[inline]
13665        unsafe fn encode(
13666            self,
13667            encoder: &mut fidl::encoding::Encoder<'_, D>,
13668            offset: usize,
13669            depth: fidl::encoding::Depth,
13670        ) -> fidl::Result<()> {
13671            encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13672            // Zero out padding regions. There's no need to apply masks
13673            // because the unmasked parts will be overwritten by fields.
13674            // Write the fields.
13675            self.0.encode(encoder, offset + 0, depth)?;
13676            Ok(())
13677        }
13678    }
13679
13680    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13681        for StreamSocketGetTcpMaxSegmentResponse
13682    {
13683        #[inline(always)]
13684        fn new_empty() -> Self {
13685            Self { value_bytes: fidl::new_empty!(u32, D) }
13686        }
13687
13688        #[inline]
13689        unsafe fn decode(
13690            &mut self,
13691            decoder: &mut fidl::encoding::Decoder<'_, D>,
13692            offset: usize,
13693            _depth: fidl::encoding::Depth,
13694        ) -> fidl::Result<()> {
13695            decoder.debug_check_bounds::<Self>(offset);
13696            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13697            // Verify that padding bytes are zero.
13698            // Copy from the buffer into the object.
13699            unsafe {
13700                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13701            }
13702            Ok(())
13703        }
13704    }
13705
13706    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpNoDelayResponse {
13707        type Borrowed<'a> = &'a Self;
13708        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13709            value
13710        }
13711    }
13712
13713    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpNoDelayResponse {
13714        type Owned = Self;
13715
13716        #[inline(always)]
13717        fn inline_align(_context: fidl::encoding::Context) -> usize {
13718            1
13719        }
13720
13721        #[inline(always)]
13722        fn inline_size(_context: fidl::encoding::Context) -> usize {
13723            1
13724        }
13725    }
13726
13727    unsafe impl<D: fidl::encoding::ResourceDialect>
13728        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D>
13729        for &StreamSocketGetTcpNoDelayResponse
13730    {
13731        #[inline]
13732        unsafe fn encode(
13733            self,
13734            encoder: &mut fidl::encoding::Encoder<'_, D>,
13735            offset: usize,
13736            _depth: fidl::encoding::Depth,
13737        ) -> fidl::Result<()> {
13738            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13739            // Delegate to tuple encoding.
13740            fidl::encoding::Encode::<StreamSocketGetTcpNoDelayResponse, D>::encode(
13741                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13742                encoder,
13743                offset,
13744                _depth,
13745            )
13746        }
13747    }
13748    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13749        fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D> for (T0,)
13750    {
13751        #[inline]
13752        unsafe fn encode(
13753            self,
13754            encoder: &mut fidl::encoding::Encoder<'_, D>,
13755            offset: usize,
13756            depth: fidl::encoding::Depth,
13757        ) -> fidl::Result<()> {
13758            encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13759            // Zero out padding regions. There's no need to apply masks
13760            // because the unmasked parts will be overwritten by fields.
13761            // Write the fields.
13762            self.0.encode(encoder, offset + 0, depth)?;
13763            Ok(())
13764        }
13765    }
13766
13767    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13768        for StreamSocketGetTcpNoDelayResponse
13769    {
13770        #[inline(always)]
13771        fn new_empty() -> Self {
13772            Self { value: fidl::new_empty!(bool, D) }
13773        }
13774
13775        #[inline]
13776        unsafe fn decode(
13777            &mut self,
13778            decoder: &mut fidl::encoding::Decoder<'_, D>,
13779            offset: usize,
13780            _depth: fidl::encoding::Depth,
13781        ) -> fidl::Result<()> {
13782            decoder.debug_check_bounds::<Self>(offset);
13783            // Verify that padding bytes are zero.
13784            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13785            Ok(())
13786        }
13787    }
13788
13789    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpQuickAckResponse {
13790        type Borrowed<'a> = &'a Self;
13791        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13792            value
13793        }
13794    }
13795
13796    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpQuickAckResponse {
13797        type Owned = Self;
13798
13799        #[inline(always)]
13800        fn inline_align(_context: fidl::encoding::Context) -> usize {
13801            1
13802        }
13803
13804        #[inline(always)]
13805        fn inline_size(_context: fidl::encoding::Context) -> usize {
13806            1
13807        }
13808    }
13809
13810    unsafe impl<D: fidl::encoding::ResourceDialect>
13811        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D>
13812        for &StreamSocketGetTcpQuickAckResponse
13813    {
13814        #[inline]
13815        unsafe fn encode(
13816            self,
13817            encoder: &mut fidl::encoding::Encoder<'_, D>,
13818            offset: usize,
13819            _depth: fidl::encoding::Depth,
13820        ) -> fidl::Result<()> {
13821            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13822            // Delegate to tuple encoding.
13823            fidl::encoding::Encode::<StreamSocketGetTcpQuickAckResponse, D>::encode(
13824                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13825                encoder,
13826                offset,
13827                _depth,
13828            )
13829        }
13830    }
13831    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13832        fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D> for (T0,)
13833    {
13834        #[inline]
13835        unsafe fn encode(
13836            self,
13837            encoder: &mut fidl::encoding::Encoder<'_, D>,
13838            offset: usize,
13839            depth: fidl::encoding::Depth,
13840        ) -> fidl::Result<()> {
13841            encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13842            // Zero out padding regions. There's no need to apply masks
13843            // because the unmasked parts will be overwritten by fields.
13844            // Write the fields.
13845            self.0.encode(encoder, offset + 0, depth)?;
13846            Ok(())
13847        }
13848    }
13849
13850    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13851        for StreamSocketGetTcpQuickAckResponse
13852    {
13853        #[inline(always)]
13854        fn new_empty() -> Self {
13855            Self { value: fidl::new_empty!(bool, D) }
13856        }
13857
13858        #[inline]
13859        unsafe fn decode(
13860            &mut self,
13861            decoder: &mut fidl::encoding::Decoder<'_, D>,
13862            offset: usize,
13863            _depth: fidl::encoding::Depth,
13864        ) -> fidl::Result<()> {
13865            decoder.debug_check_bounds::<Self>(offset);
13866            // Verify that padding bytes are zero.
13867            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13868            Ok(())
13869        }
13870    }
13871
13872    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpSynCountResponse {
13873        type Borrowed<'a> = &'a Self;
13874        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13875            value
13876        }
13877    }
13878
13879    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpSynCountResponse {
13880        type Owned = Self;
13881
13882        #[inline(always)]
13883        fn inline_align(_context: fidl::encoding::Context) -> usize {
13884            4
13885        }
13886
13887        #[inline(always)]
13888        fn inline_size(_context: fidl::encoding::Context) -> usize {
13889            4
13890        }
13891        #[inline(always)]
13892        fn encode_is_copy() -> bool {
13893            true
13894        }
13895
13896        #[inline(always)]
13897        fn decode_is_copy() -> bool {
13898            true
13899        }
13900    }
13901
13902    unsafe impl<D: fidl::encoding::ResourceDialect>
13903        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D>
13904        for &StreamSocketGetTcpSynCountResponse
13905    {
13906        #[inline]
13907        unsafe fn encode(
13908            self,
13909            encoder: &mut fidl::encoding::Encoder<'_, D>,
13910            offset: usize,
13911            _depth: fidl::encoding::Depth,
13912        ) -> fidl::Result<()> {
13913            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13914            unsafe {
13915                // Copy the object into the buffer.
13916                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13917                (buf_ptr as *mut StreamSocketGetTcpSynCountResponse)
13918                    .write_unaligned((self as *const StreamSocketGetTcpSynCountResponse).read());
13919                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13920                // done second because the memcpy will write garbage to these bytes.
13921            }
13922            Ok(())
13923        }
13924    }
13925    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13926        fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D> for (T0,)
13927    {
13928        #[inline]
13929        unsafe fn encode(
13930            self,
13931            encoder: &mut fidl::encoding::Encoder<'_, D>,
13932            offset: usize,
13933            depth: fidl::encoding::Depth,
13934        ) -> fidl::Result<()> {
13935            encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13936            // Zero out padding regions. There's no need to apply masks
13937            // because the unmasked parts will be overwritten by fields.
13938            // Write the fields.
13939            self.0.encode(encoder, offset + 0, depth)?;
13940            Ok(())
13941        }
13942    }
13943
13944    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13945        for StreamSocketGetTcpSynCountResponse
13946    {
13947        #[inline(always)]
13948        fn new_empty() -> Self {
13949            Self { value: fidl::new_empty!(u32, D) }
13950        }
13951
13952        #[inline]
13953        unsafe fn decode(
13954            &mut self,
13955            decoder: &mut fidl::encoding::Decoder<'_, D>,
13956            offset: usize,
13957            _depth: fidl::encoding::Depth,
13958        ) -> fidl::Result<()> {
13959            decoder.debug_check_bounds::<Self>(offset);
13960            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13961            // Verify that padding bytes are zero.
13962            // Copy from the buffer into the object.
13963            unsafe {
13964                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13965            }
13966            Ok(())
13967        }
13968    }
13969
13970    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13971        type Borrowed<'a> = &'a Self;
13972        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13973            value
13974        }
13975    }
13976
13977    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13978        type Owned = Self;
13979
13980        #[inline(always)]
13981        fn inline_align(_context: fidl::encoding::Context) -> usize {
13982            4
13983        }
13984
13985        #[inline(always)]
13986        fn inline_size(_context: fidl::encoding::Context) -> usize {
13987            4
13988        }
13989        #[inline(always)]
13990        fn encode_is_copy() -> bool {
13991            true
13992        }
13993
13994        #[inline(always)]
13995        fn decode_is_copy() -> bool {
13996            true
13997        }
13998    }
13999
14000    unsafe impl<D: fidl::encoding::ResourceDialect>
14001        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D>
14002        for &StreamSocketGetTcpUserTimeoutResponse
14003    {
14004        #[inline]
14005        unsafe fn encode(
14006            self,
14007            encoder: &mut fidl::encoding::Encoder<'_, D>,
14008            offset: usize,
14009            _depth: fidl::encoding::Depth,
14010        ) -> fidl::Result<()> {
14011            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
14012            unsafe {
14013                // Copy the object into the buffer.
14014                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14015                (buf_ptr as *mut StreamSocketGetTcpUserTimeoutResponse)
14016                    .write_unaligned((self as *const StreamSocketGetTcpUserTimeoutResponse).read());
14017                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14018                // done second because the memcpy will write garbage to these bytes.
14019            }
14020            Ok(())
14021        }
14022    }
14023    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14024        fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D> for (T0,)
14025    {
14026        #[inline]
14027        unsafe fn encode(
14028            self,
14029            encoder: &mut fidl::encoding::Encoder<'_, D>,
14030            offset: usize,
14031            depth: fidl::encoding::Depth,
14032        ) -> fidl::Result<()> {
14033            encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
14034            // Zero out padding regions. There's no need to apply masks
14035            // because the unmasked parts will be overwritten by fields.
14036            // Write the fields.
14037            self.0.encode(encoder, offset + 0, depth)?;
14038            Ok(())
14039        }
14040    }
14041
14042    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14043        for StreamSocketGetTcpUserTimeoutResponse
14044    {
14045        #[inline(always)]
14046        fn new_empty() -> Self {
14047            Self { value_millis: fidl::new_empty!(u32, D) }
14048        }
14049
14050        #[inline]
14051        unsafe fn decode(
14052            &mut self,
14053            decoder: &mut fidl::encoding::Decoder<'_, D>,
14054            offset: usize,
14055            _depth: fidl::encoding::Depth,
14056        ) -> fidl::Result<()> {
14057            decoder.debug_check_bounds::<Self>(offset);
14058            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14059            // Verify that padding bytes are zero.
14060            // Copy from the buffer into the object.
14061            unsafe {
14062                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14063            }
14064            Ok(())
14065        }
14066    }
14067
14068    impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpWindowClampResponse {
14069        type Borrowed<'a> = &'a Self;
14070        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14071            value
14072        }
14073    }
14074
14075    unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpWindowClampResponse {
14076        type Owned = Self;
14077
14078        #[inline(always)]
14079        fn inline_align(_context: fidl::encoding::Context) -> usize {
14080            4
14081        }
14082
14083        #[inline(always)]
14084        fn inline_size(_context: fidl::encoding::Context) -> usize {
14085            4
14086        }
14087        #[inline(always)]
14088        fn encode_is_copy() -> bool {
14089            true
14090        }
14091
14092        #[inline(always)]
14093        fn decode_is_copy() -> bool {
14094            true
14095        }
14096    }
14097
14098    unsafe impl<D: fidl::encoding::ResourceDialect>
14099        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D>
14100        for &StreamSocketGetTcpWindowClampResponse
14101    {
14102        #[inline]
14103        unsafe fn encode(
14104            self,
14105            encoder: &mut fidl::encoding::Encoder<'_, D>,
14106            offset: usize,
14107            _depth: fidl::encoding::Depth,
14108        ) -> fidl::Result<()> {
14109            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
14110            unsafe {
14111                // Copy the object into the buffer.
14112                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14113                (buf_ptr as *mut StreamSocketGetTcpWindowClampResponse)
14114                    .write_unaligned((self as *const StreamSocketGetTcpWindowClampResponse).read());
14115                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14116                // done second because the memcpy will write garbage to these bytes.
14117            }
14118            Ok(())
14119        }
14120    }
14121    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
14122        fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D> for (T0,)
14123    {
14124        #[inline]
14125        unsafe fn encode(
14126            self,
14127            encoder: &mut fidl::encoding::Encoder<'_, D>,
14128            offset: usize,
14129            depth: fidl::encoding::Depth,
14130        ) -> fidl::Result<()> {
14131            encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
14132            // Zero out padding regions. There's no need to apply masks
14133            // because the unmasked parts will be overwritten by fields.
14134            // Write the fields.
14135            self.0.encode(encoder, offset + 0, depth)?;
14136            Ok(())
14137        }
14138    }
14139
14140    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14141        for StreamSocketGetTcpWindowClampResponse
14142    {
14143        #[inline(always)]
14144        fn new_empty() -> Self {
14145            Self { value: fidl::new_empty!(u32, D) }
14146        }
14147
14148        #[inline]
14149        unsafe fn decode(
14150            &mut self,
14151            decoder: &mut fidl::encoding::Decoder<'_, D>,
14152            offset: usize,
14153            _depth: fidl::encoding::Depth,
14154        ) -> fidl::Result<()> {
14155            decoder.debug_check_bounds::<Self>(offset);
14156            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14157            // Verify that padding bytes are zero.
14158            // Copy from the buffer into the object.
14159            unsafe {
14160                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14161            }
14162            Ok(())
14163        }
14164    }
14165
14166    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14167        type Borrowed<'a> = &'a Self;
14168        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14169            value
14170        }
14171    }
14172
14173    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14174        type Owned = Self;
14175
14176        #[inline(always)]
14177        fn inline_align(_context: fidl::encoding::Context) -> usize {
14178            4
14179        }
14180
14181        #[inline(always)]
14182        fn inline_size(_context: fidl::encoding::Context) -> usize {
14183            12
14184        }
14185    }
14186
14187    unsafe impl<D: fidl::encoding::ResourceDialect>
14188        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D>
14189        for &SynchronousDatagramSocketRecvMsgRequest
14190    {
14191        #[inline]
14192        unsafe fn encode(
14193            self,
14194            encoder: &mut fidl::encoding::Encoder<'_, D>,
14195            offset: usize,
14196            _depth: fidl::encoding::Depth,
14197        ) -> fidl::Result<()> {
14198            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14199            // Delegate to tuple encoding.
14200            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgRequest, D>::encode(
14201                (
14202                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),
14203                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_len),
14204                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_control),
14205                    <RecvMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14206                ),
14207                encoder,
14208                offset,
14209                _depth,
14210            )
14211        }
14212    }
14213    unsafe impl<
14214        D: fidl::encoding::ResourceDialect,
14215        T0: fidl::encoding::Encode<bool, D>,
14216        T1: fidl::encoding::Encode<u32, D>,
14217        T2: fidl::encoding::Encode<bool, D>,
14218        T3: fidl::encoding::Encode<RecvMsgFlags, D>,
14219    > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D> for (T0, T1, T2, T3)
14220    {
14221        #[inline]
14222        unsafe fn encode(
14223            self,
14224            encoder: &mut fidl::encoding::Encoder<'_, D>,
14225            offset: usize,
14226            depth: fidl::encoding::Depth,
14227        ) -> fidl::Result<()> {
14228            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14229            // Zero out padding regions. There's no need to apply masks
14230            // because the unmasked parts will be overwritten by fields.
14231            unsafe {
14232                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14233                (ptr as *mut u32).write_unaligned(0);
14234            }
14235            unsafe {
14236                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14237                (ptr as *mut u32).write_unaligned(0);
14238            }
14239            // Write the fields.
14240            self.0.encode(encoder, offset + 0, depth)?;
14241            self.1.encode(encoder, offset + 4, depth)?;
14242            self.2.encode(encoder, offset + 8, depth)?;
14243            self.3.encode(encoder, offset + 10, depth)?;
14244            Ok(())
14245        }
14246    }
14247
14248    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14249        for SynchronousDatagramSocketRecvMsgRequest
14250    {
14251        #[inline(always)]
14252        fn new_empty() -> Self {
14253            Self {
14254                want_addr: fidl::new_empty!(bool, D),
14255                data_len: fidl::new_empty!(u32, D),
14256                want_control: fidl::new_empty!(bool, D),
14257                flags: fidl::new_empty!(RecvMsgFlags, D),
14258            }
14259        }
14260
14261        #[inline]
14262        unsafe fn decode(
14263            &mut self,
14264            decoder: &mut fidl::encoding::Decoder<'_, D>,
14265            offset: usize,
14266            _depth: fidl::encoding::Depth,
14267        ) -> fidl::Result<()> {
14268            decoder.debug_check_bounds::<Self>(offset);
14269            // Verify that padding bytes are zero.
14270            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14271            let padval = unsafe { (ptr as *const u32).read_unaligned() };
14272            let mask = 0xffffff00u32;
14273            let maskedval = padval & mask;
14274            if maskedval != 0 {
14275                return Err(fidl::Error::NonZeroPadding {
14276                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14277                });
14278            }
14279            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14280            let padval = unsafe { (ptr as *const u32).read_unaligned() };
14281            let mask = 0xff00u32;
14282            let maskedval = padval & mask;
14283            if maskedval != 0 {
14284                return Err(fidl::Error::NonZeroPadding {
14285                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14286                });
14287            }
14288            fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
14289            fidl::decode!(u32, D, &mut self.data_len, decoder, offset + 4, _depth)?;
14290            fidl::decode!(bool, D, &mut self.want_control, decoder, offset + 8, _depth)?;
14291            fidl::decode!(RecvMsgFlags, D, &mut self.flags, decoder, offset + 10, _depth)?;
14292            Ok(())
14293        }
14294    }
14295
14296    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgRequest {
14297        type Borrowed<'a> = &'a Self;
14298        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14299            value
14300        }
14301    }
14302
14303    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgRequest {
14304        type Owned = Self;
14305
14306        #[inline(always)]
14307        fn inline_align(_context: fidl::encoding::Context) -> usize {
14308            8
14309        }
14310
14311        #[inline(always)]
14312        fn inline_size(_context: fidl::encoding::Context) -> usize {
14313            56
14314        }
14315    }
14316
14317    unsafe impl<D: fidl::encoding::ResourceDialect>
14318        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D>
14319        for &SynchronousDatagramSocketSendMsgRequest
14320    {
14321        #[inline]
14322        unsafe fn encode(
14323            self,
14324            encoder: &mut fidl::encoding::Encoder<'_, D>,
14325            offset: usize,
14326            _depth: fidl::encoding::Depth,
14327        ) -> fidl::Result<()> {
14328            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14329            // Delegate to tuple encoding.
14330            fidl::encoding::Encode::<SynchronousDatagramSocketSendMsgRequest, D>::encode(
14331                (
14332                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14333                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14334                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14335                    <SendMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14336                ),
14337                encoder, offset, _depth
14338            )
14339        }
14340    }
14341    unsafe impl<
14342        D: fidl::encoding::ResourceDialect,
14343        T0: fidl::encoding::Encode<
14344                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14345                D,
14346            >,
14347        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14348        T2: fidl::encoding::Encode<DatagramSocketSendControlData, D>,
14349        T3: fidl::encoding::Encode<SendMsgFlags, D>,
14350    > fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D> for (T0, T1, T2, T3)
14351    {
14352        #[inline]
14353        unsafe fn encode(
14354            self,
14355            encoder: &mut fidl::encoding::Encoder<'_, D>,
14356            offset: usize,
14357            depth: fidl::encoding::Depth,
14358        ) -> fidl::Result<()> {
14359            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14360            // Zero out padding regions. There's no need to apply masks
14361            // because the unmasked parts will be overwritten by fields.
14362            unsafe {
14363                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14364                (ptr as *mut u64).write_unaligned(0);
14365            }
14366            // Write the fields.
14367            self.0.encode(encoder, offset + 0, depth)?;
14368            self.1.encode(encoder, offset + 16, depth)?;
14369            self.2.encode(encoder, offset + 32, depth)?;
14370            self.3.encode(encoder, offset + 48, depth)?;
14371            Ok(())
14372        }
14373    }
14374
14375    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14376        for SynchronousDatagramSocketSendMsgRequest
14377    {
14378        #[inline(always)]
14379        fn new_empty() -> Self {
14380            Self {
14381                addr: fidl::new_empty!(
14382                    fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14383                    D
14384                ),
14385                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14386                control: fidl::new_empty!(DatagramSocketSendControlData, D),
14387                flags: fidl::new_empty!(SendMsgFlags, D),
14388            }
14389        }
14390
14391        #[inline]
14392        unsafe fn decode(
14393            &mut self,
14394            decoder: &mut fidl::encoding::Decoder<'_, D>,
14395            offset: usize,
14396            _depth: fidl::encoding::Depth,
14397        ) -> fidl::Result<()> {
14398            decoder.debug_check_bounds::<Self>(offset);
14399            // Verify that padding bytes are zero.
14400            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14401            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14402            let mask = 0xffffffffffff0000u64;
14403            let maskedval = padval & mask;
14404            if maskedval != 0 {
14405                return Err(fidl::Error::NonZeroPadding {
14406                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14407                });
14408            }
14409            fidl::decode!(
14410                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14411                D,
14412                &mut self.addr,
14413                decoder,
14414                offset + 0,
14415                _depth
14416            )?;
14417            fidl::decode!(
14418                fidl::encoding::UnboundedVector<u8>,
14419                D,
14420                &mut self.data,
14421                decoder,
14422                offset + 16,
14423                _depth
14424            )?;
14425            fidl::decode!(
14426                DatagramSocketSendControlData,
14427                D,
14428                &mut self.control,
14429                decoder,
14430                offset + 32,
14431                _depth
14432            )?;
14433            fidl::decode!(SendMsgFlags, D, &mut self.flags, decoder, offset + 48, _depth)?;
14434            Ok(())
14435        }
14436    }
14437
14438    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14439        type Borrowed<'a> = &'a Self;
14440        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14441            value
14442        }
14443    }
14444
14445    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14446        type Owned = Self;
14447
14448        #[inline(always)]
14449        fn inline_align(_context: fidl::encoding::Context) -> usize {
14450            8
14451        }
14452
14453        #[inline(always)]
14454        fn inline_size(_context: fidl::encoding::Context) -> usize {
14455            56
14456        }
14457    }
14458
14459    unsafe impl<D: fidl::encoding::ResourceDialect>
14460        fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D>
14461        for &SynchronousDatagramSocketRecvMsgResponse
14462    {
14463        #[inline]
14464        unsafe fn encode(
14465            self,
14466            encoder: &mut fidl::encoding::Encoder<'_, D>,
14467            offset: usize,
14468            _depth: fidl::encoding::Depth,
14469        ) -> fidl::Result<()> {
14470            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14471            // Delegate to tuple encoding.
14472            fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgResponse, D>::encode(
14473                (
14474                    <fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14475                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14476                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14477                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.truncated),
14478                ),
14479                encoder, offset, _depth
14480            )
14481        }
14482    }
14483    unsafe impl<
14484        D: fidl::encoding::ResourceDialect,
14485        T0: fidl::encoding::Encode<
14486                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14487                D,
14488            >,
14489        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14490        T2: fidl::encoding::Encode<DatagramSocketRecvControlData, D>,
14491        T3: fidl::encoding::Encode<u32, D>,
14492    > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D> for (T0, T1, T2, T3)
14493    {
14494        #[inline]
14495        unsafe fn encode(
14496            self,
14497            encoder: &mut fidl::encoding::Encoder<'_, D>,
14498            offset: usize,
14499            depth: fidl::encoding::Depth,
14500        ) -> fidl::Result<()> {
14501            encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14502            // Zero out padding regions. There's no need to apply masks
14503            // because the unmasked parts will be overwritten by fields.
14504            unsafe {
14505                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14506                (ptr as *mut u64).write_unaligned(0);
14507            }
14508            // Write the fields.
14509            self.0.encode(encoder, offset + 0, depth)?;
14510            self.1.encode(encoder, offset + 16, depth)?;
14511            self.2.encode(encoder, offset + 32, depth)?;
14512            self.3.encode(encoder, offset + 48, depth)?;
14513            Ok(())
14514        }
14515    }
14516
14517    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14518        for SynchronousDatagramSocketRecvMsgResponse
14519    {
14520        #[inline(always)]
14521        fn new_empty() -> Self {
14522            Self {
14523                addr: fidl::new_empty!(
14524                    fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14525                    D
14526                ),
14527                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14528                control: fidl::new_empty!(DatagramSocketRecvControlData, D),
14529                truncated: fidl::new_empty!(u32, D),
14530            }
14531        }
14532
14533        #[inline]
14534        unsafe fn decode(
14535            &mut self,
14536            decoder: &mut fidl::encoding::Decoder<'_, D>,
14537            offset: usize,
14538            _depth: fidl::encoding::Depth,
14539        ) -> fidl::Result<()> {
14540            decoder.debug_check_bounds::<Self>(offset);
14541            // Verify that padding bytes are zero.
14542            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14543            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14544            let mask = 0xffffffff00000000u64;
14545            let maskedval = padval & mask;
14546            if maskedval != 0 {
14547                return Err(fidl::Error::NonZeroPadding {
14548                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14549                });
14550            }
14551            fidl::decode!(
14552                fidl::encoding::OptionalUnion<fidl_fuchsia_net_common::SocketAddress>,
14553                D,
14554                &mut self.addr,
14555                decoder,
14556                offset + 0,
14557                _depth
14558            )?;
14559            fidl::decode!(
14560                fidl::encoding::UnboundedVector<u8>,
14561                D,
14562                &mut self.data,
14563                decoder,
14564                offset + 16,
14565                _depth
14566            )?;
14567            fidl::decode!(
14568                DatagramSocketRecvControlData,
14569                D,
14570                &mut self.control,
14571                decoder,
14572                offset + 32,
14573                _depth
14574            )?;
14575            fidl::decode!(u32, D, &mut self.truncated, decoder, offset + 48, _depth)?;
14576            Ok(())
14577        }
14578    }
14579
14580    impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgResponse {
14581        type Borrowed<'a> = &'a Self;
14582        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14583            value
14584        }
14585    }
14586
14587    unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgResponse {
14588        type Owned = Self;
14589
14590        #[inline(always)]
14591        fn inline_align(_context: fidl::encoding::Context) -> usize {
14592            8
14593        }
14594
14595        #[inline(always)]
14596        fn inline_size(_context: fidl::encoding::Context) -> usize {
14597            8
14598        }
14599        #[inline(always)]
14600        fn encode_is_copy() -> bool {
14601            true
14602        }
14603
14604        #[inline(always)]
14605        fn decode_is_copy() -> bool {
14606            true
14607        }
14608    }
14609
14610    unsafe impl<D: fidl::encoding::ResourceDialect>
14611        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D>
14612        for &SynchronousDatagramSocketSendMsgResponse
14613    {
14614        #[inline]
14615        unsafe fn encode(
14616            self,
14617            encoder: &mut fidl::encoding::Encoder<'_, D>,
14618            offset: usize,
14619            _depth: fidl::encoding::Depth,
14620        ) -> fidl::Result<()> {
14621            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14622            unsafe {
14623                // Copy the object into the buffer.
14624                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14625                (buf_ptr as *mut SynchronousDatagramSocketSendMsgResponse).write_unaligned(
14626                    (self as *const SynchronousDatagramSocketSendMsgResponse).read(),
14627                );
14628                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
14629                // done second because the memcpy will write garbage to these bytes.
14630            }
14631            Ok(())
14632        }
14633    }
14634    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
14635        fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D> for (T0,)
14636    {
14637        #[inline]
14638        unsafe fn encode(
14639            self,
14640            encoder: &mut fidl::encoding::Encoder<'_, D>,
14641            offset: usize,
14642            depth: fidl::encoding::Depth,
14643        ) -> fidl::Result<()> {
14644            encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14645            // Zero out padding regions. There's no need to apply masks
14646            // because the unmasked parts will be overwritten by fields.
14647            // Write the fields.
14648            self.0.encode(encoder, offset + 0, depth)?;
14649            Ok(())
14650        }
14651    }
14652
14653    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14654        for SynchronousDatagramSocketSendMsgResponse
14655    {
14656        #[inline(always)]
14657        fn new_empty() -> Self {
14658            Self { len: fidl::new_empty!(i64, D) }
14659        }
14660
14661        #[inline]
14662        unsafe fn decode(
14663            &mut self,
14664            decoder: &mut fidl::encoding::Decoder<'_, D>,
14665            offset: usize,
14666            _depth: fidl::encoding::Depth,
14667        ) -> fidl::Result<()> {
14668            decoder.debug_check_bounds::<Self>(offset);
14669            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14670            // Verify that padding bytes are zero.
14671            // Copy from the buffer into the object.
14672            unsafe {
14673                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
14674            }
14675            Ok(())
14676        }
14677    }
14678
14679    impl fidl::encoding::ValueTypeMarker for Timestamp {
14680        type Borrowed<'a> = &'a Self;
14681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14682            value
14683        }
14684    }
14685
14686    unsafe impl fidl::encoding::TypeMarker for Timestamp {
14687        type Owned = Self;
14688
14689        #[inline(always)]
14690        fn inline_align(_context: fidl::encoding::Context) -> usize {
14691            8
14692        }
14693
14694        #[inline(always)]
14695        fn inline_size(_context: fidl::encoding::Context) -> usize {
14696            16
14697        }
14698    }
14699
14700    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Timestamp, D>
14701        for &Timestamp
14702    {
14703        #[inline]
14704        unsafe fn encode(
14705            self,
14706            encoder: &mut fidl::encoding::Encoder<'_, D>,
14707            offset: usize,
14708            _depth: fidl::encoding::Depth,
14709        ) -> fidl::Result<()> {
14710            encoder.debug_check_bounds::<Timestamp>(offset);
14711            // Delegate to tuple encoding.
14712            fidl::encoding::Encode::<Timestamp, D>::encode(
14713                (
14714                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.nanoseconds),
14715                    <TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.requested),
14716                ),
14717                encoder,
14718                offset,
14719                _depth,
14720            )
14721        }
14722    }
14723    unsafe impl<
14724        D: fidl::encoding::ResourceDialect,
14725        T0: fidl::encoding::Encode<i64, D>,
14726        T1: fidl::encoding::Encode<TimestampOption, D>,
14727    > fidl::encoding::Encode<Timestamp, D> for (T0, T1)
14728    {
14729        #[inline]
14730        unsafe fn encode(
14731            self,
14732            encoder: &mut fidl::encoding::Encoder<'_, D>,
14733            offset: usize,
14734            depth: fidl::encoding::Depth,
14735        ) -> fidl::Result<()> {
14736            encoder.debug_check_bounds::<Timestamp>(offset);
14737            // Zero out padding regions. There's no need to apply masks
14738            // because the unmasked parts will be overwritten by fields.
14739            unsafe {
14740                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14741                (ptr as *mut u64).write_unaligned(0);
14742            }
14743            // Write the fields.
14744            self.0.encode(encoder, offset + 0, depth)?;
14745            self.1.encode(encoder, offset + 8, depth)?;
14746            Ok(())
14747        }
14748    }
14749
14750    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Timestamp {
14751        #[inline(always)]
14752        fn new_empty() -> Self {
14753            Self {
14754                nanoseconds: fidl::new_empty!(i64, D),
14755                requested: fidl::new_empty!(TimestampOption, D),
14756            }
14757        }
14758
14759        #[inline]
14760        unsafe fn decode(
14761            &mut self,
14762            decoder: &mut fidl::encoding::Decoder<'_, D>,
14763            offset: usize,
14764            _depth: fidl::encoding::Depth,
14765        ) -> fidl::Result<()> {
14766            decoder.debug_check_bounds::<Self>(offset);
14767            // Verify that padding bytes are zero.
14768            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14769            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14770            let mask = 0xffffffff00000000u64;
14771            let maskedval = padval & mask;
14772            if maskedval != 0 {
14773                return Err(fidl::Error::NonZeroPadding {
14774                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14775                });
14776            }
14777            fidl::decode!(i64, D, &mut self.nanoseconds, decoder, offset + 0, _depth)?;
14778            fidl::decode!(TimestampOption, D, &mut self.requested, decoder, offset + 8, _depth)?;
14779            Ok(())
14780        }
14781    }
14782
14783    impl DatagramSocketRecvControlData {
14784        #[inline(always)]
14785        fn max_ordinal_present(&self) -> u64 {
14786            if let Some(_) = self.network {
14787                return 1;
14788            }
14789            0
14790        }
14791    }
14792
14793    impl fidl::encoding::ValueTypeMarker for DatagramSocketRecvControlData {
14794        type Borrowed<'a> = &'a Self;
14795        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14796            value
14797        }
14798    }
14799
14800    unsafe impl fidl::encoding::TypeMarker for DatagramSocketRecvControlData {
14801        type Owned = Self;
14802
14803        #[inline(always)]
14804        fn inline_align(_context: fidl::encoding::Context) -> usize {
14805            8
14806        }
14807
14808        #[inline(always)]
14809        fn inline_size(_context: fidl::encoding::Context) -> usize {
14810            16
14811        }
14812    }
14813
14814    unsafe impl<D: fidl::encoding::ResourceDialect>
14815        fidl::encoding::Encode<DatagramSocketRecvControlData, D>
14816        for &DatagramSocketRecvControlData
14817    {
14818        unsafe fn encode(
14819            self,
14820            encoder: &mut fidl::encoding::Encoder<'_, D>,
14821            offset: usize,
14822            mut depth: fidl::encoding::Depth,
14823        ) -> fidl::Result<()> {
14824            encoder.debug_check_bounds::<DatagramSocketRecvControlData>(offset);
14825            // Vector header
14826            let max_ordinal: u64 = self.max_ordinal_present();
14827            encoder.write_num(max_ordinal, offset);
14828            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14829            // Calling encoder.out_of_line_offset(0) is not allowed.
14830            if max_ordinal == 0 {
14831                return Ok(());
14832            }
14833            depth.increment()?;
14834            let envelope_size = 8;
14835            let bytes_len = max_ordinal as usize * envelope_size;
14836            #[allow(unused_variables)]
14837            let offset = encoder.out_of_line_offset(bytes_len);
14838            let mut _prev_end_offset: usize = 0;
14839            if 1 > max_ordinal {
14840                return Ok(());
14841            }
14842
14843            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14844            // are envelope_size bytes.
14845            let cur_offset: usize = (1 - 1) * envelope_size;
14846
14847            // Zero reserved fields.
14848            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14849
14850            // Safety:
14851            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14852            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14853            //   envelope_size bytes, there is always sufficient room.
14854            fidl::encoding::encode_in_envelope_optional::<NetworkSocketRecvControlData, D>(
14855                self.network
14856                    .as_ref()
14857                    .map(<NetworkSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
14858                encoder,
14859                offset + cur_offset,
14860                depth,
14861            )?;
14862
14863            _prev_end_offset = cur_offset + envelope_size;
14864
14865            Ok(())
14866        }
14867    }
14868
14869    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14870        for DatagramSocketRecvControlData
14871    {
14872        #[inline(always)]
14873        fn new_empty() -> Self {
14874            Self::default()
14875        }
14876
14877        unsafe fn decode(
14878            &mut self,
14879            decoder: &mut fidl::encoding::Decoder<'_, D>,
14880            offset: usize,
14881            mut depth: fidl::encoding::Depth,
14882        ) -> fidl::Result<()> {
14883            decoder.debug_check_bounds::<Self>(offset);
14884            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14885                None => return Err(fidl::Error::NotNullable),
14886                Some(len) => len,
14887            };
14888            // Calling decoder.out_of_line_offset(0) is not allowed.
14889            if len == 0 {
14890                return Ok(());
14891            };
14892            depth.increment()?;
14893            let envelope_size = 8;
14894            let bytes_len = len * envelope_size;
14895            let offset = decoder.out_of_line_offset(bytes_len)?;
14896            // Decode the envelope for each type.
14897            let mut _next_ordinal_to_read = 0;
14898            let mut next_offset = offset;
14899            let end_offset = offset + bytes_len;
14900            _next_ordinal_to_read += 1;
14901            if next_offset >= end_offset {
14902                return Ok(());
14903            }
14904
14905            // Decode unknown envelopes for gaps in ordinals.
14906            while _next_ordinal_to_read < 1 {
14907                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14908                _next_ordinal_to_read += 1;
14909                next_offset += envelope_size;
14910            }
14911
14912            let next_out_of_line = decoder.next_out_of_line();
14913            let handles_before = decoder.remaining_handles();
14914            if let Some((inlined, num_bytes, num_handles)) =
14915                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14916            {
14917                let member_inline_size =
14918                    <NetworkSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
14919                        decoder.context,
14920                    );
14921                if inlined != (member_inline_size <= 4) {
14922                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14923                }
14924                let inner_offset;
14925                let mut inner_depth = depth.clone();
14926                if inlined {
14927                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14928                    inner_offset = next_offset;
14929                } else {
14930                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14931                    inner_depth.increment()?;
14932                }
14933                let val_ref = self
14934                    .network
14935                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketRecvControlData, D));
14936                fidl::decode!(
14937                    NetworkSocketRecvControlData,
14938                    D,
14939                    val_ref,
14940                    decoder,
14941                    inner_offset,
14942                    inner_depth
14943                )?;
14944                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14945                {
14946                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14947                }
14948                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14949                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14950                }
14951            }
14952
14953            next_offset += envelope_size;
14954
14955            // Decode the remaining unknown envelopes.
14956            while next_offset < end_offset {
14957                _next_ordinal_to_read += 1;
14958                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14959                next_offset += envelope_size;
14960            }
14961
14962            Ok(())
14963        }
14964    }
14965
14966    impl DatagramSocketSendControlData {
14967        #[inline(always)]
14968        fn max_ordinal_present(&self) -> u64 {
14969            if let Some(_) = self.network {
14970                return 1;
14971            }
14972            0
14973        }
14974    }
14975
14976    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendControlData {
14977        type Borrowed<'a> = &'a Self;
14978        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14979            value
14980        }
14981    }
14982
14983    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendControlData {
14984        type Owned = Self;
14985
14986        #[inline(always)]
14987        fn inline_align(_context: fidl::encoding::Context) -> usize {
14988            8
14989        }
14990
14991        #[inline(always)]
14992        fn inline_size(_context: fidl::encoding::Context) -> usize {
14993            16
14994        }
14995    }
14996
14997    unsafe impl<D: fidl::encoding::ResourceDialect>
14998        fidl::encoding::Encode<DatagramSocketSendControlData, D>
14999        for &DatagramSocketSendControlData
15000    {
15001        unsafe fn encode(
15002            self,
15003            encoder: &mut fidl::encoding::Encoder<'_, D>,
15004            offset: usize,
15005            mut depth: fidl::encoding::Depth,
15006        ) -> fidl::Result<()> {
15007            encoder.debug_check_bounds::<DatagramSocketSendControlData>(offset);
15008            // Vector header
15009            let max_ordinal: u64 = self.max_ordinal_present();
15010            encoder.write_num(max_ordinal, offset);
15011            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15012            // Calling encoder.out_of_line_offset(0) is not allowed.
15013            if max_ordinal == 0 {
15014                return Ok(());
15015            }
15016            depth.increment()?;
15017            let envelope_size = 8;
15018            let bytes_len = max_ordinal as usize * envelope_size;
15019            #[allow(unused_variables)]
15020            let offset = encoder.out_of_line_offset(bytes_len);
15021            let mut _prev_end_offset: usize = 0;
15022            if 1 > max_ordinal {
15023                return Ok(());
15024            }
15025
15026            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15027            // are envelope_size bytes.
15028            let cur_offset: usize = (1 - 1) * envelope_size;
15029
15030            // Zero reserved fields.
15031            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15032
15033            // Safety:
15034            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15035            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15036            //   envelope_size bytes, there is always sufficient room.
15037            fidl::encoding::encode_in_envelope_optional::<NetworkSocketSendControlData, D>(
15038                self.network
15039                    .as_ref()
15040                    .map(<NetworkSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15041                encoder,
15042                offset + cur_offset,
15043                depth,
15044            )?;
15045
15046            _prev_end_offset = cur_offset + envelope_size;
15047
15048            Ok(())
15049        }
15050    }
15051
15052    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15053        for DatagramSocketSendControlData
15054    {
15055        #[inline(always)]
15056        fn new_empty() -> Self {
15057            Self::default()
15058        }
15059
15060        unsafe fn decode(
15061            &mut self,
15062            decoder: &mut fidl::encoding::Decoder<'_, D>,
15063            offset: usize,
15064            mut depth: fidl::encoding::Depth,
15065        ) -> fidl::Result<()> {
15066            decoder.debug_check_bounds::<Self>(offset);
15067            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15068                None => return Err(fidl::Error::NotNullable),
15069                Some(len) => len,
15070            };
15071            // Calling decoder.out_of_line_offset(0) is not allowed.
15072            if len == 0 {
15073                return Ok(());
15074            };
15075            depth.increment()?;
15076            let envelope_size = 8;
15077            let bytes_len = len * envelope_size;
15078            let offset = decoder.out_of_line_offset(bytes_len)?;
15079            // Decode the envelope for each type.
15080            let mut _next_ordinal_to_read = 0;
15081            let mut next_offset = offset;
15082            let end_offset = offset + bytes_len;
15083            _next_ordinal_to_read += 1;
15084            if next_offset >= end_offset {
15085                return Ok(());
15086            }
15087
15088            // Decode unknown envelopes for gaps in ordinals.
15089            while _next_ordinal_to_read < 1 {
15090                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15091                _next_ordinal_to_read += 1;
15092                next_offset += envelope_size;
15093            }
15094
15095            let next_out_of_line = decoder.next_out_of_line();
15096            let handles_before = decoder.remaining_handles();
15097            if let Some((inlined, num_bytes, num_handles)) =
15098                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15099            {
15100                let member_inline_size =
15101                    <NetworkSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
15102                        decoder.context,
15103                    );
15104                if inlined != (member_inline_size <= 4) {
15105                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15106                }
15107                let inner_offset;
15108                let mut inner_depth = depth.clone();
15109                if inlined {
15110                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15111                    inner_offset = next_offset;
15112                } else {
15113                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15114                    inner_depth.increment()?;
15115                }
15116                let val_ref = self
15117                    .network
15118                    .get_or_insert_with(|| fidl::new_empty!(NetworkSocketSendControlData, D));
15119                fidl::decode!(
15120                    NetworkSocketSendControlData,
15121                    D,
15122                    val_ref,
15123                    decoder,
15124                    inner_offset,
15125                    inner_depth
15126                )?;
15127                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15128                {
15129                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15130                }
15131                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15132                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15133                }
15134            }
15135
15136            next_offset += envelope_size;
15137
15138            // Decode the remaining unknown envelopes.
15139            while next_offset < end_offset {
15140                _next_ordinal_to_read += 1;
15141                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15142                next_offset += envelope_size;
15143            }
15144
15145            Ok(())
15146        }
15147    }
15148
15149    impl DatagramSocketSendMsgPreflightRequest {
15150        #[inline(always)]
15151        fn max_ordinal_present(&self) -> u64 {
15152            if let Some(_) = self.ipv6_pktinfo {
15153                return 2;
15154            }
15155            if let Some(_) = self.to {
15156                return 1;
15157            }
15158            0
15159        }
15160    }
15161
15162    impl fidl::encoding::ValueTypeMarker for DatagramSocketSendMsgPreflightRequest {
15163        type Borrowed<'a> = &'a Self;
15164        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15165            value
15166        }
15167    }
15168
15169    unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendMsgPreflightRequest {
15170        type Owned = Self;
15171
15172        #[inline(always)]
15173        fn inline_align(_context: fidl::encoding::Context) -> usize {
15174            8
15175        }
15176
15177        #[inline(always)]
15178        fn inline_size(_context: fidl::encoding::Context) -> usize {
15179            16
15180        }
15181    }
15182
15183    unsafe impl<D: fidl::encoding::ResourceDialect>
15184        fidl::encoding::Encode<DatagramSocketSendMsgPreflightRequest, D>
15185        for &DatagramSocketSendMsgPreflightRequest
15186    {
15187        unsafe fn encode(
15188            self,
15189            encoder: &mut fidl::encoding::Encoder<'_, D>,
15190            offset: usize,
15191            mut depth: fidl::encoding::Depth,
15192        ) -> fidl::Result<()> {
15193            encoder.debug_check_bounds::<DatagramSocketSendMsgPreflightRequest>(offset);
15194            // Vector header
15195            let max_ordinal: u64 = self.max_ordinal_present();
15196            encoder.write_num(max_ordinal, offset);
15197            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15198            // Calling encoder.out_of_line_offset(0) is not allowed.
15199            if max_ordinal == 0 {
15200                return Ok(());
15201            }
15202            depth.increment()?;
15203            let envelope_size = 8;
15204            let bytes_len = max_ordinal as usize * envelope_size;
15205            #[allow(unused_variables)]
15206            let offset = encoder.out_of_line_offset(bytes_len);
15207            let mut _prev_end_offset: usize = 0;
15208            if 1 > max_ordinal {
15209                return Ok(());
15210            }
15211
15212            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15213            // are envelope_size bytes.
15214            let cur_offset: usize = (1 - 1) * envelope_size;
15215
15216            // Zero reserved fields.
15217            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15218
15219            // Safety:
15220            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15221            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15222            //   envelope_size bytes, there is always sufficient room.
15223            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
15224            self.to.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
15225            encoder, offset + cur_offset, depth
15226        )?;
15227
15228            _prev_end_offset = cur_offset + envelope_size;
15229            if 2 > max_ordinal {
15230                return Ok(());
15231            }
15232
15233            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15234            // are envelope_size bytes.
15235            let cur_offset: usize = (2 - 1) * envelope_size;
15236
15237            // Zero reserved fields.
15238            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15239
15240            // Safety:
15241            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15242            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15243            //   envelope_size bytes, there is always sufficient room.
15244            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
15245                self.ipv6_pktinfo
15246                    .as_ref()
15247                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15248                encoder,
15249                offset + cur_offset,
15250                depth,
15251            )?;
15252
15253            _prev_end_offset = cur_offset + envelope_size;
15254
15255            Ok(())
15256        }
15257    }
15258
15259    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15260        for DatagramSocketSendMsgPreflightRequest
15261    {
15262        #[inline(always)]
15263        fn new_empty() -> Self {
15264            Self::default()
15265        }
15266
15267        unsafe fn decode(
15268            &mut self,
15269            decoder: &mut fidl::encoding::Decoder<'_, D>,
15270            offset: usize,
15271            mut depth: fidl::encoding::Depth,
15272        ) -> fidl::Result<()> {
15273            decoder.debug_check_bounds::<Self>(offset);
15274            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15275                None => return Err(fidl::Error::NotNullable),
15276                Some(len) => len,
15277            };
15278            // Calling decoder.out_of_line_offset(0) is not allowed.
15279            if len == 0 {
15280                return Ok(());
15281            };
15282            depth.increment()?;
15283            let envelope_size = 8;
15284            let bytes_len = len * envelope_size;
15285            let offset = decoder.out_of_line_offset(bytes_len)?;
15286            // Decode the envelope for each type.
15287            let mut _next_ordinal_to_read = 0;
15288            let mut next_offset = offset;
15289            let end_offset = offset + bytes_len;
15290            _next_ordinal_to_read += 1;
15291            if next_offset >= end_offset {
15292                return Ok(());
15293            }
15294
15295            // Decode unknown envelopes for gaps in ordinals.
15296            while _next_ordinal_to_read < 1 {
15297                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15298                _next_ordinal_to_read += 1;
15299                next_offset += envelope_size;
15300            }
15301
15302            let next_out_of_line = decoder.next_out_of_line();
15303            let handles_before = decoder.remaining_handles();
15304            if let Some((inlined, num_bytes, num_handles)) =
15305                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15306            {
15307                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15308                if inlined != (member_inline_size <= 4) {
15309                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15310                }
15311                let inner_offset;
15312                let mut inner_depth = depth.clone();
15313                if inlined {
15314                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15315                    inner_offset = next_offset;
15316                } else {
15317                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15318                    inner_depth.increment()?;
15319                }
15320                let val_ref = self.to.get_or_insert_with(|| {
15321                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
15322                });
15323                fidl::decode!(
15324                    fidl_fuchsia_net_common::SocketAddress,
15325                    D,
15326                    val_ref,
15327                    decoder,
15328                    inner_offset,
15329                    inner_depth
15330                )?;
15331                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15332                {
15333                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15334                }
15335                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15336                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15337                }
15338            }
15339
15340            next_offset += envelope_size;
15341            _next_ordinal_to_read += 1;
15342            if next_offset >= end_offset {
15343                return Ok(());
15344            }
15345
15346            // Decode unknown envelopes for gaps in ordinals.
15347            while _next_ordinal_to_read < 2 {
15348                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15349                _next_ordinal_to_read += 1;
15350                next_offset += envelope_size;
15351            }
15352
15353            let next_out_of_line = decoder.next_out_of_line();
15354            let handles_before = decoder.remaining_handles();
15355            if let Some((inlined, num_bytes, num_handles)) =
15356                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15357            {
15358                let member_inline_size =
15359                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
15360                        decoder.context,
15361                    );
15362                if inlined != (member_inline_size <= 4) {
15363                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15364                }
15365                let inner_offset;
15366                let mut inner_depth = depth.clone();
15367                if inlined {
15368                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15369                    inner_offset = next_offset;
15370                } else {
15371                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15372                    inner_depth.increment()?;
15373                }
15374                let val_ref = self
15375                    .ipv6_pktinfo
15376                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
15377                fidl::decode!(
15378                    Ipv6PktInfoSendControlData,
15379                    D,
15380                    val_ref,
15381                    decoder,
15382                    inner_offset,
15383                    inner_depth
15384                )?;
15385                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15386                {
15387                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15388                }
15389                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15390                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15391                }
15392            }
15393
15394            next_offset += envelope_size;
15395
15396            // Decode the remaining unknown envelopes.
15397            while next_offset < end_offset {
15398                _next_ordinal_to_read += 1;
15399                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15400                next_offset += envelope_size;
15401            }
15402
15403            Ok(())
15404        }
15405    }
15406
15407    impl InterfaceAddresses {
15408        #[inline(always)]
15409        fn max_ordinal_present(&self) -> u64 {
15410            if let Some(_) = self.interface_flags {
15411                return 5;
15412            }
15413            if let Some(_) = self.addresses {
15414                return 4;
15415            }
15416            if let Some(_) = self.name {
15417                return 2;
15418            }
15419            if let Some(_) = self.id {
15420                return 1;
15421            }
15422            0
15423        }
15424    }
15425
15426    impl fidl::encoding::ValueTypeMarker for InterfaceAddresses {
15427        type Borrowed<'a> = &'a Self;
15428        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15429            value
15430        }
15431    }
15432
15433    unsafe impl fidl::encoding::TypeMarker for InterfaceAddresses {
15434        type Owned = Self;
15435
15436        #[inline(always)]
15437        fn inline_align(_context: fidl::encoding::Context) -> usize {
15438            8
15439        }
15440
15441        #[inline(always)]
15442        fn inline_size(_context: fidl::encoding::Context) -> usize {
15443            16
15444        }
15445    }
15446
15447    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterfaceAddresses, D>
15448        for &InterfaceAddresses
15449    {
15450        unsafe fn encode(
15451            self,
15452            encoder: &mut fidl::encoding::Encoder<'_, D>,
15453            offset: usize,
15454            mut depth: fidl::encoding::Depth,
15455        ) -> fidl::Result<()> {
15456            encoder.debug_check_bounds::<InterfaceAddresses>(offset);
15457            // Vector header
15458            let max_ordinal: u64 = self.max_ordinal_present();
15459            encoder.write_num(max_ordinal, offset);
15460            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15461            // Calling encoder.out_of_line_offset(0) is not allowed.
15462            if max_ordinal == 0 {
15463                return Ok(());
15464            }
15465            depth.increment()?;
15466            let envelope_size = 8;
15467            let bytes_len = max_ordinal as usize * envelope_size;
15468            #[allow(unused_variables)]
15469            let offset = encoder.out_of_line_offset(bytes_len);
15470            let mut _prev_end_offset: usize = 0;
15471            if 1 > max_ordinal {
15472                return Ok(());
15473            }
15474
15475            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15476            // are envelope_size bytes.
15477            let cur_offset: usize = (1 - 1) * envelope_size;
15478
15479            // Zero reserved fields.
15480            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15481
15482            // Safety:
15483            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15484            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15485            //   envelope_size bytes, there is always sufficient room.
15486            fidl::encoding::encode_in_envelope_optional::<u64, D>(
15487                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15488                encoder,
15489                offset + cur_offset,
15490                depth,
15491            )?;
15492
15493            _prev_end_offset = cur_offset + envelope_size;
15494            if 2 > max_ordinal {
15495                return Ok(());
15496            }
15497
15498            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15499            // are envelope_size bytes.
15500            let cur_offset: usize = (2 - 1) * envelope_size;
15501
15502            // Zero reserved fields.
15503            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15504
15505            // Safety:
15506            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15507            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15508            //   envelope_size bytes, there is always sufficient room.
15509            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
15510                self.name.as_ref().map(
15511                    <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow,
15512                ),
15513                encoder,
15514                offset + cur_offset,
15515                depth,
15516            )?;
15517
15518            _prev_end_offset = cur_offset + envelope_size;
15519            if 4 > max_ordinal {
15520                return Ok(());
15521            }
15522
15523            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15524            // are envelope_size bytes.
15525            let cur_offset: usize = (4 - 1) * envelope_size;
15526
15527            // Zero reserved fields.
15528            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15529
15530            // Safety:
15531            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15532            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15533            //   envelope_size bytes, there is always sufficient room.
15534            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet>, D>(
15535            self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
15536            encoder, offset + cur_offset, depth
15537        )?;
15538
15539            _prev_end_offset = cur_offset + envelope_size;
15540            if 5 > max_ordinal {
15541                return Ok(());
15542            }
15543
15544            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15545            // are envelope_size bytes.
15546            let cur_offset: usize = (5 - 1) * envelope_size;
15547
15548            // Zero reserved fields.
15549            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15550
15551            // Safety:
15552            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15553            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15554            //   envelope_size bytes, there is always sufficient room.
15555            fidl::encoding::encode_in_envelope_optional::<InterfaceFlags, D>(
15556                self.interface_flags
15557                    .as_ref()
15558                    .map(<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow),
15559                encoder,
15560                offset + cur_offset,
15561                depth,
15562            )?;
15563
15564            _prev_end_offset = cur_offset + envelope_size;
15565
15566            Ok(())
15567        }
15568    }
15569
15570    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceAddresses {
15571        #[inline(always)]
15572        fn new_empty() -> Self {
15573            Self::default()
15574        }
15575
15576        unsafe fn decode(
15577            &mut self,
15578            decoder: &mut fidl::encoding::Decoder<'_, D>,
15579            offset: usize,
15580            mut depth: fidl::encoding::Depth,
15581        ) -> fidl::Result<()> {
15582            decoder.debug_check_bounds::<Self>(offset);
15583            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15584                None => return Err(fidl::Error::NotNullable),
15585                Some(len) => len,
15586            };
15587            // Calling decoder.out_of_line_offset(0) is not allowed.
15588            if len == 0 {
15589                return Ok(());
15590            };
15591            depth.increment()?;
15592            let envelope_size = 8;
15593            let bytes_len = len * envelope_size;
15594            let offset = decoder.out_of_line_offset(bytes_len)?;
15595            // Decode the envelope for each type.
15596            let mut _next_ordinal_to_read = 0;
15597            let mut next_offset = offset;
15598            let end_offset = offset + bytes_len;
15599            _next_ordinal_to_read += 1;
15600            if next_offset >= end_offset {
15601                return Ok(());
15602            }
15603
15604            // Decode unknown envelopes for gaps in ordinals.
15605            while _next_ordinal_to_read < 1 {
15606                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15607                _next_ordinal_to_read += 1;
15608                next_offset += envelope_size;
15609            }
15610
15611            let next_out_of_line = decoder.next_out_of_line();
15612            let handles_before = decoder.remaining_handles();
15613            if let Some((inlined, num_bytes, num_handles)) =
15614                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15615            {
15616                let member_inline_size =
15617                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15618                if inlined != (member_inline_size <= 4) {
15619                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15620                }
15621                let inner_offset;
15622                let mut inner_depth = depth.clone();
15623                if inlined {
15624                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15625                    inner_offset = next_offset;
15626                } else {
15627                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15628                    inner_depth.increment()?;
15629                }
15630                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
15631                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15632                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15633                {
15634                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15635                }
15636                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15637                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15638                }
15639            }
15640
15641            next_offset += envelope_size;
15642            _next_ordinal_to_read += 1;
15643            if next_offset >= end_offset {
15644                return Ok(());
15645            }
15646
15647            // Decode unknown envelopes for gaps in ordinals.
15648            while _next_ordinal_to_read < 2 {
15649                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15650                _next_ordinal_to_read += 1;
15651                next_offset += envelope_size;
15652            }
15653
15654            let next_out_of_line = decoder.next_out_of_line();
15655            let handles_before = decoder.remaining_handles();
15656            if let Some((inlined, num_bytes, num_handles)) =
15657                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15658            {
15659                let member_inline_size =
15660                    <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
15661                        decoder.context,
15662                    );
15663                if inlined != (member_inline_size <= 4) {
15664                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15665                }
15666                let inner_offset;
15667                let mut inner_depth = depth.clone();
15668                if inlined {
15669                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15670                    inner_offset = next_offset;
15671                } else {
15672                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15673                    inner_depth.increment()?;
15674                }
15675                let val_ref = self
15676                    .name
15677                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
15678                fidl::decode!(
15679                    fidl::encoding::BoundedString<15>,
15680                    D,
15681                    val_ref,
15682                    decoder,
15683                    inner_offset,
15684                    inner_depth
15685                )?;
15686                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15687                {
15688                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15689                }
15690                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15691                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15692                }
15693            }
15694
15695            next_offset += envelope_size;
15696            _next_ordinal_to_read += 1;
15697            if next_offset >= end_offset {
15698                return Ok(());
15699            }
15700
15701            // Decode unknown envelopes for gaps in ordinals.
15702            while _next_ordinal_to_read < 4 {
15703                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15704                _next_ordinal_to_read += 1;
15705                next_offset += envelope_size;
15706            }
15707
15708            let next_out_of_line = decoder.next_out_of_line();
15709            let handles_before = decoder.remaining_handles();
15710            if let Some((inlined, num_bytes, num_handles)) =
15711                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15712            {
15713                let member_inline_size = <fidl::encoding::UnboundedVector<
15714                    fidl_fuchsia_net_common::Subnet,
15715                > as fidl::encoding::TypeMarker>::inline_size(
15716                    decoder.context
15717                );
15718                if inlined != (member_inline_size <= 4) {
15719                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15720                }
15721                let inner_offset;
15722                let mut inner_depth = depth.clone();
15723                if inlined {
15724                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15725                    inner_offset = next_offset;
15726                } else {
15727                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15728                    inner_depth.increment()?;
15729                }
15730                let val_ref = self.addresses.get_or_insert_with(|| {
15731                    fidl::new_empty!(
15732                        fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet>,
15733                        D
15734                    )
15735                });
15736                fidl::decode!(
15737                    fidl::encoding::UnboundedVector<fidl_fuchsia_net_common::Subnet>,
15738                    D,
15739                    val_ref,
15740                    decoder,
15741                    inner_offset,
15742                    inner_depth
15743                )?;
15744                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15745                {
15746                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15747                }
15748                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15749                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15750                }
15751            }
15752
15753            next_offset += envelope_size;
15754            _next_ordinal_to_read += 1;
15755            if next_offset >= end_offset {
15756                return Ok(());
15757            }
15758
15759            // Decode unknown envelopes for gaps in ordinals.
15760            while _next_ordinal_to_read < 5 {
15761                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15762                _next_ordinal_to_read += 1;
15763                next_offset += envelope_size;
15764            }
15765
15766            let next_out_of_line = decoder.next_out_of_line();
15767            let handles_before = decoder.remaining_handles();
15768            if let Some((inlined, num_bytes, num_handles)) =
15769                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15770            {
15771                let member_inline_size =
15772                    <InterfaceFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15773                if inlined != (member_inline_size <= 4) {
15774                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15775                }
15776                let inner_offset;
15777                let mut inner_depth = depth.clone();
15778                if inlined {
15779                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15780                    inner_offset = next_offset;
15781                } else {
15782                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15783                    inner_depth.increment()?;
15784                }
15785                let val_ref =
15786                    self.interface_flags.get_or_insert_with(|| fidl::new_empty!(InterfaceFlags, D));
15787                fidl::decode!(InterfaceFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
15788                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15789                {
15790                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15791                }
15792                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15793                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15794                }
15795            }
15796
15797            next_offset += envelope_size;
15798
15799            // Decode the remaining unknown envelopes.
15800            while next_offset < end_offset {
15801                _next_ordinal_to_read += 1;
15802                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15803                next_offset += envelope_size;
15804            }
15805
15806            Ok(())
15807        }
15808    }
15809
15810    impl IpRecvControlData {
15811        #[inline(always)]
15812        fn max_ordinal_present(&self) -> u64 {
15813            if let Some(_) = self.pktinfo {
15814                return 4;
15815            }
15816            if let Some(_) = self.original_destination_address {
15817                return 3;
15818            }
15819            if let Some(_) = self.ttl {
15820                return 2;
15821            }
15822            if let Some(_) = self.tos {
15823                return 1;
15824            }
15825            0
15826        }
15827    }
15828
15829    impl fidl::encoding::ValueTypeMarker for IpRecvControlData {
15830        type Borrowed<'a> = &'a Self;
15831        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15832            value
15833        }
15834    }
15835
15836    unsafe impl fidl::encoding::TypeMarker for IpRecvControlData {
15837        type Owned = Self;
15838
15839        #[inline(always)]
15840        fn inline_align(_context: fidl::encoding::Context) -> usize {
15841            8
15842        }
15843
15844        #[inline(always)]
15845        fn inline_size(_context: fidl::encoding::Context) -> usize {
15846            16
15847        }
15848    }
15849
15850    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpRecvControlData, D>
15851        for &IpRecvControlData
15852    {
15853        unsafe fn encode(
15854            self,
15855            encoder: &mut fidl::encoding::Encoder<'_, D>,
15856            offset: usize,
15857            mut depth: fidl::encoding::Depth,
15858        ) -> fidl::Result<()> {
15859            encoder.debug_check_bounds::<IpRecvControlData>(offset);
15860            // Vector header
15861            let max_ordinal: u64 = self.max_ordinal_present();
15862            encoder.write_num(max_ordinal, offset);
15863            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15864            // Calling encoder.out_of_line_offset(0) is not allowed.
15865            if max_ordinal == 0 {
15866                return Ok(());
15867            }
15868            depth.increment()?;
15869            let envelope_size = 8;
15870            let bytes_len = max_ordinal as usize * envelope_size;
15871            #[allow(unused_variables)]
15872            let offset = encoder.out_of_line_offset(bytes_len);
15873            let mut _prev_end_offset: usize = 0;
15874            if 1 > max_ordinal {
15875                return Ok(());
15876            }
15877
15878            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15879            // are envelope_size bytes.
15880            let cur_offset: usize = (1 - 1) * envelope_size;
15881
15882            // Zero reserved fields.
15883            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15884
15885            // Safety:
15886            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15887            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15888            //   envelope_size bytes, there is always sufficient room.
15889            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15890                self.tos.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15891                encoder,
15892                offset + cur_offset,
15893                depth,
15894            )?;
15895
15896            _prev_end_offset = cur_offset + envelope_size;
15897            if 2 > max_ordinal {
15898                return Ok(());
15899            }
15900
15901            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15902            // are envelope_size bytes.
15903            let cur_offset: usize = (2 - 1) * envelope_size;
15904
15905            // Zero reserved fields.
15906            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15907
15908            // Safety:
15909            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15910            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15911            //   envelope_size bytes, there is always sufficient room.
15912            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15913                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15914                encoder,
15915                offset + cur_offset,
15916                depth,
15917            )?;
15918
15919            _prev_end_offset = cur_offset + envelope_size;
15920            if 3 > max_ordinal {
15921                return Ok(());
15922            }
15923
15924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15925            // are envelope_size bytes.
15926            let cur_offset: usize = (3 - 1) * envelope_size;
15927
15928            // Zero reserved fields.
15929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15930
15931            // Safety:
15932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15934            //   envelope_size bytes, there is always sufficient room.
15935            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
15936            self.original_destination_address.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
15937            encoder, offset + cur_offset, depth
15938        )?;
15939
15940            _prev_end_offset = cur_offset + envelope_size;
15941            if 4 > max_ordinal {
15942                return Ok(());
15943            }
15944
15945            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15946            // are envelope_size bytes.
15947            let cur_offset: usize = (4 - 1) * envelope_size;
15948
15949            // Zero reserved fields.
15950            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15951
15952            // Safety:
15953            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15954            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15955            //   envelope_size bytes, there is always sufficient room.
15956            fidl::encoding::encode_in_envelope_optional::<Ipv4PktInfoRecvControlData, D>(
15957                self.pktinfo
15958                    .as_ref()
15959                    .map(<Ipv4PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
15960                encoder,
15961                offset + cur_offset,
15962                depth,
15963            )?;
15964
15965            _prev_end_offset = cur_offset + envelope_size;
15966
15967            Ok(())
15968        }
15969    }
15970
15971    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpRecvControlData {
15972        #[inline(always)]
15973        fn new_empty() -> Self {
15974            Self::default()
15975        }
15976
15977        unsafe fn decode(
15978            &mut self,
15979            decoder: &mut fidl::encoding::Decoder<'_, D>,
15980            offset: usize,
15981            mut depth: fidl::encoding::Depth,
15982        ) -> fidl::Result<()> {
15983            decoder.debug_check_bounds::<Self>(offset);
15984            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15985                None => return Err(fidl::Error::NotNullable),
15986                Some(len) => len,
15987            };
15988            // Calling decoder.out_of_line_offset(0) is not allowed.
15989            if len == 0 {
15990                return Ok(());
15991            };
15992            depth.increment()?;
15993            let envelope_size = 8;
15994            let bytes_len = len * envelope_size;
15995            let offset = decoder.out_of_line_offset(bytes_len)?;
15996            // Decode the envelope for each type.
15997            let mut _next_ordinal_to_read = 0;
15998            let mut next_offset = offset;
15999            let end_offset = offset + bytes_len;
16000            _next_ordinal_to_read += 1;
16001            if next_offset >= end_offset {
16002                return Ok(());
16003            }
16004
16005            // Decode unknown envelopes for gaps in ordinals.
16006            while _next_ordinal_to_read < 1 {
16007                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16008                _next_ordinal_to_read += 1;
16009                next_offset += envelope_size;
16010            }
16011
16012            let next_out_of_line = decoder.next_out_of_line();
16013            let handles_before = decoder.remaining_handles();
16014            if let Some((inlined, num_bytes, num_handles)) =
16015                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16016            {
16017                let member_inline_size =
16018                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16019                if inlined != (member_inline_size <= 4) {
16020                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16021                }
16022                let inner_offset;
16023                let mut inner_depth = depth.clone();
16024                if inlined {
16025                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16026                    inner_offset = next_offset;
16027                } else {
16028                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16029                    inner_depth.increment()?;
16030                }
16031                let val_ref = self.tos.get_or_insert_with(|| fidl::new_empty!(u8, D));
16032                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16033                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16034                {
16035                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16036                }
16037                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16038                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16039                }
16040            }
16041
16042            next_offset += envelope_size;
16043            _next_ordinal_to_read += 1;
16044            if next_offset >= end_offset {
16045                return Ok(());
16046            }
16047
16048            // Decode unknown envelopes for gaps in ordinals.
16049            while _next_ordinal_to_read < 2 {
16050                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16051                _next_ordinal_to_read += 1;
16052                next_offset += envelope_size;
16053            }
16054
16055            let next_out_of_line = decoder.next_out_of_line();
16056            let handles_before = decoder.remaining_handles();
16057            if let Some((inlined, num_bytes, num_handles)) =
16058                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16059            {
16060                let member_inline_size =
16061                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16062                if inlined != (member_inline_size <= 4) {
16063                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16064                }
16065                let inner_offset;
16066                let mut inner_depth = depth.clone();
16067                if inlined {
16068                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16069                    inner_offset = next_offset;
16070                } else {
16071                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16072                    inner_depth.increment()?;
16073                }
16074                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16075                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16076                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16077                {
16078                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16079                }
16080                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16081                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16082                }
16083            }
16084
16085            next_offset += envelope_size;
16086            _next_ordinal_to_read += 1;
16087            if next_offset >= end_offset {
16088                return Ok(());
16089            }
16090
16091            // Decode unknown envelopes for gaps in ordinals.
16092            while _next_ordinal_to_read < 3 {
16093                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16094                _next_ordinal_to_read += 1;
16095                next_offset += envelope_size;
16096            }
16097
16098            let next_out_of_line = decoder.next_out_of_line();
16099            let handles_before = decoder.remaining_handles();
16100            if let Some((inlined, num_bytes, num_handles)) =
16101                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16102            {
16103                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16104                if inlined != (member_inline_size <= 4) {
16105                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16106                }
16107                let inner_offset;
16108                let mut inner_depth = depth.clone();
16109                if inlined {
16110                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16111                    inner_offset = next_offset;
16112                } else {
16113                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16114                    inner_depth.increment()?;
16115                }
16116                let val_ref = self.original_destination_address.get_or_insert_with(|| {
16117                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
16118                });
16119                fidl::decode!(
16120                    fidl_fuchsia_net_common::SocketAddress,
16121                    D,
16122                    val_ref,
16123                    decoder,
16124                    inner_offset,
16125                    inner_depth
16126                )?;
16127                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16128                {
16129                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16130                }
16131                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16132                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16133                }
16134            }
16135
16136            next_offset += envelope_size;
16137            _next_ordinal_to_read += 1;
16138            if next_offset >= end_offset {
16139                return Ok(());
16140            }
16141
16142            // Decode unknown envelopes for gaps in ordinals.
16143            while _next_ordinal_to_read < 4 {
16144                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16145                _next_ordinal_to_read += 1;
16146                next_offset += envelope_size;
16147            }
16148
16149            let next_out_of_line = decoder.next_out_of_line();
16150            let handles_before = decoder.remaining_handles();
16151            if let Some((inlined, num_bytes, num_handles)) =
16152                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16153            {
16154                let member_inline_size =
16155                    <Ipv4PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16156                        decoder.context,
16157                    );
16158                if inlined != (member_inline_size <= 4) {
16159                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16160                }
16161                let inner_offset;
16162                let mut inner_depth = depth.clone();
16163                if inlined {
16164                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16165                    inner_offset = next_offset;
16166                } else {
16167                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16168                    inner_depth.increment()?;
16169                }
16170                let val_ref = self
16171                    .pktinfo
16172                    .get_or_insert_with(|| fidl::new_empty!(Ipv4PktInfoRecvControlData, D));
16173                fidl::decode!(
16174                    Ipv4PktInfoRecvControlData,
16175                    D,
16176                    val_ref,
16177                    decoder,
16178                    inner_offset,
16179                    inner_depth
16180                )?;
16181                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16182                {
16183                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16184                }
16185                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16186                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16187                }
16188            }
16189
16190            next_offset += envelope_size;
16191
16192            // Decode the remaining unknown envelopes.
16193            while next_offset < end_offset {
16194                _next_ordinal_to_read += 1;
16195                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16196                next_offset += envelope_size;
16197            }
16198
16199            Ok(())
16200        }
16201    }
16202
16203    impl IpSendControlData {
16204        #[inline(always)]
16205        fn max_ordinal_present(&self) -> u64 {
16206            if let Some(_) = self.ttl {
16207                return 2;
16208            }
16209            0
16210        }
16211    }
16212
16213    impl fidl::encoding::ValueTypeMarker for IpSendControlData {
16214        type Borrowed<'a> = &'a Self;
16215        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16216            value
16217        }
16218    }
16219
16220    unsafe impl fidl::encoding::TypeMarker for IpSendControlData {
16221        type Owned = Self;
16222
16223        #[inline(always)]
16224        fn inline_align(_context: fidl::encoding::Context) -> usize {
16225            8
16226        }
16227
16228        #[inline(always)]
16229        fn inline_size(_context: fidl::encoding::Context) -> usize {
16230            16
16231        }
16232    }
16233
16234    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpSendControlData, D>
16235        for &IpSendControlData
16236    {
16237        unsafe fn encode(
16238            self,
16239            encoder: &mut fidl::encoding::Encoder<'_, D>,
16240            offset: usize,
16241            mut depth: fidl::encoding::Depth,
16242        ) -> fidl::Result<()> {
16243            encoder.debug_check_bounds::<IpSendControlData>(offset);
16244            // Vector header
16245            let max_ordinal: u64 = self.max_ordinal_present();
16246            encoder.write_num(max_ordinal, offset);
16247            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16248            // Calling encoder.out_of_line_offset(0) is not allowed.
16249            if max_ordinal == 0 {
16250                return Ok(());
16251            }
16252            depth.increment()?;
16253            let envelope_size = 8;
16254            let bytes_len = max_ordinal as usize * envelope_size;
16255            #[allow(unused_variables)]
16256            let offset = encoder.out_of_line_offset(bytes_len);
16257            let mut _prev_end_offset: usize = 0;
16258            if 2 > max_ordinal {
16259                return Ok(());
16260            }
16261
16262            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16263            // are envelope_size bytes.
16264            let cur_offset: usize = (2 - 1) * envelope_size;
16265
16266            // Zero reserved fields.
16267            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16268
16269            // Safety:
16270            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16271            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16272            //   envelope_size bytes, there is always sufficient room.
16273            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16274                self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16275                encoder,
16276                offset + cur_offset,
16277                depth,
16278            )?;
16279
16280            _prev_end_offset = cur_offset + envelope_size;
16281
16282            Ok(())
16283        }
16284    }
16285
16286    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpSendControlData {
16287        #[inline(always)]
16288        fn new_empty() -> Self {
16289            Self::default()
16290        }
16291
16292        unsafe fn decode(
16293            &mut self,
16294            decoder: &mut fidl::encoding::Decoder<'_, D>,
16295            offset: usize,
16296            mut depth: fidl::encoding::Depth,
16297        ) -> fidl::Result<()> {
16298            decoder.debug_check_bounds::<Self>(offset);
16299            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16300                None => return Err(fidl::Error::NotNullable),
16301                Some(len) => len,
16302            };
16303            // Calling decoder.out_of_line_offset(0) is not allowed.
16304            if len == 0 {
16305                return Ok(());
16306            };
16307            depth.increment()?;
16308            let envelope_size = 8;
16309            let bytes_len = len * envelope_size;
16310            let offset = decoder.out_of_line_offset(bytes_len)?;
16311            // Decode the envelope for each type.
16312            let mut _next_ordinal_to_read = 0;
16313            let mut next_offset = offset;
16314            let end_offset = offset + bytes_len;
16315            _next_ordinal_to_read += 1;
16316            if next_offset >= end_offset {
16317                return Ok(());
16318            }
16319
16320            // Decode unknown envelopes for gaps in ordinals.
16321            while _next_ordinal_to_read < 2 {
16322                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16323                _next_ordinal_to_read += 1;
16324                next_offset += envelope_size;
16325            }
16326
16327            let next_out_of_line = decoder.next_out_of_line();
16328            let handles_before = decoder.remaining_handles();
16329            if let Some((inlined, num_bytes, num_handles)) =
16330                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16331            {
16332                let member_inline_size =
16333                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16334                if inlined != (member_inline_size <= 4) {
16335                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16336                }
16337                let inner_offset;
16338                let mut inner_depth = depth.clone();
16339                if inlined {
16340                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16341                    inner_offset = next_offset;
16342                } else {
16343                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16344                    inner_depth.increment()?;
16345                }
16346                let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16347                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16348                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16349                {
16350                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16351                }
16352                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16353                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16354                }
16355            }
16356
16357            next_offset += envelope_size;
16358
16359            // Decode the remaining unknown envelopes.
16360            while next_offset < end_offset {
16361                _next_ordinal_to_read += 1;
16362                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16363                next_offset += envelope_size;
16364            }
16365
16366            Ok(())
16367        }
16368    }
16369
16370    impl Ipv6RecvControlData {
16371        #[inline(always)]
16372        fn max_ordinal_present(&self) -> u64 {
16373            if let Some(_) = self.pktinfo {
16374                return 3;
16375            }
16376            if let Some(_) = self.hoplimit {
16377                return 2;
16378            }
16379            if let Some(_) = self.tclass {
16380                return 1;
16381            }
16382            0
16383        }
16384    }
16385
16386    impl fidl::encoding::ValueTypeMarker for Ipv6RecvControlData {
16387        type Borrowed<'a> = &'a Self;
16388        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16389            value
16390        }
16391    }
16392
16393    unsafe impl fidl::encoding::TypeMarker for Ipv6RecvControlData {
16394        type Owned = Self;
16395
16396        #[inline(always)]
16397        fn inline_align(_context: fidl::encoding::Context) -> usize {
16398            8
16399        }
16400
16401        #[inline(always)]
16402        fn inline_size(_context: fidl::encoding::Context) -> usize {
16403            16
16404        }
16405    }
16406
16407    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6RecvControlData, D>
16408        for &Ipv6RecvControlData
16409    {
16410        unsafe fn encode(
16411            self,
16412            encoder: &mut fidl::encoding::Encoder<'_, D>,
16413            offset: usize,
16414            mut depth: fidl::encoding::Depth,
16415        ) -> fidl::Result<()> {
16416            encoder.debug_check_bounds::<Ipv6RecvControlData>(offset);
16417            // Vector header
16418            let max_ordinal: u64 = self.max_ordinal_present();
16419            encoder.write_num(max_ordinal, offset);
16420            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16421            // Calling encoder.out_of_line_offset(0) is not allowed.
16422            if max_ordinal == 0 {
16423                return Ok(());
16424            }
16425            depth.increment()?;
16426            let envelope_size = 8;
16427            let bytes_len = max_ordinal as usize * envelope_size;
16428            #[allow(unused_variables)]
16429            let offset = encoder.out_of_line_offset(bytes_len);
16430            let mut _prev_end_offset: usize = 0;
16431            if 1 > max_ordinal {
16432                return Ok(());
16433            }
16434
16435            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16436            // are envelope_size bytes.
16437            let cur_offset: usize = (1 - 1) * envelope_size;
16438
16439            // Zero reserved fields.
16440            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16441
16442            // Safety:
16443            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16444            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16445            //   envelope_size bytes, there is always sufficient room.
16446            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16447                self.tclass.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16448                encoder,
16449                offset + cur_offset,
16450                depth,
16451            )?;
16452
16453            _prev_end_offset = cur_offset + envelope_size;
16454            if 2 > max_ordinal {
16455                return Ok(());
16456            }
16457
16458            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16459            // are envelope_size bytes.
16460            let cur_offset: usize = (2 - 1) * envelope_size;
16461
16462            // Zero reserved fields.
16463            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16464
16465            // Safety:
16466            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16467            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16468            //   envelope_size bytes, there is always sufficient room.
16469            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16470                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16471                encoder,
16472                offset + cur_offset,
16473                depth,
16474            )?;
16475
16476            _prev_end_offset = cur_offset + envelope_size;
16477            if 3 > max_ordinal {
16478                return Ok(());
16479            }
16480
16481            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16482            // are envelope_size bytes.
16483            let cur_offset: usize = (3 - 1) * envelope_size;
16484
16485            // Zero reserved fields.
16486            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16487
16488            // Safety:
16489            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16490            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16491            //   envelope_size bytes, there is always sufficient room.
16492            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoRecvControlData, D>(
16493                self.pktinfo
16494                    .as_ref()
16495                    .map(<Ipv6PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16496                encoder,
16497                offset + cur_offset,
16498                depth,
16499            )?;
16500
16501            _prev_end_offset = cur_offset + envelope_size;
16502
16503            Ok(())
16504        }
16505    }
16506
16507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6RecvControlData {
16508        #[inline(always)]
16509        fn new_empty() -> Self {
16510            Self::default()
16511        }
16512
16513        unsafe fn decode(
16514            &mut self,
16515            decoder: &mut fidl::encoding::Decoder<'_, D>,
16516            offset: usize,
16517            mut depth: fidl::encoding::Depth,
16518        ) -> fidl::Result<()> {
16519            decoder.debug_check_bounds::<Self>(offset);
16520            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16521                None => return Err(fidl::Error::NotNullable),
16522                Some(len) => len,
16523            };
16524            // Calling decoder.out_of_line_offset(0) is not allowed.
16525            if len == 0 {
16526                return Ok(());
16527            };
16528            depth.increment()?;
16529            let envelope_size = 8;
16530            let bytes_len = len * envelope_size;
16531            let offset = decoder.out_of_line_offset(bytes_len)?;
16532            // Decode the envelope for each type.
16533            let mut _next_ordinal_to_read = 0;
16534            let mut next_offset = offset;
16535            let end_offset = offset + bytes_len;
16536            _next_ordinal_to_read += 1;
16537            if next_offset >= end_offset {
16538                return Ok(());
16539            }
16540
16541            // Decode unknown envelopes for gaps in ordinals.
16542            while _next_ordinal_to_read < 1 {
16543                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16544                _next_ordinal_to_read += 1;
16545                next_offset += envelope_size;
16546            }
16547
16548            let next_out_of_line = decoder.next_out_of_line();
16549            let handles_before = decoder.remaining_handles();
16550            if let Some((inlined, num_bytes, num_handles)) =
16551                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16552            {
16553                let member_inline_size =
16554                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16555                if inlined != (member_inline_size <= 4) {
16556                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16557                }
16558                let inner_offset;
16559                let mut inner_depth = depth.clone();
16560                if inlined {
16561                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16562                    inner_offset = next_offset;
16563                } else {
16564                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16565                    inner_depth.increment()?;
16566                }
16567                let val_ref = self.tclass.get_or_insert_with(|| fidl::new_empty!(u8, D));
16568                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16569                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16570                {
16571                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16572                }
16573                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16574                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16575                }
16576            }
16577
16578            next_offset += envelope_size;
16579            _next_ordinal_to_read += 1;
16580            if next_offset >= end_offset {
16581                return Ok(());
16582            }
16583
16584            // Decode unknown envelopes for gaps in ordinals.
16585            while _next_ordinal_to_read < 2 {
16586                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16587                _next_ordinal_to_read += 1;
16588                next_offset += envelope_size;
16589            }
16590
16591            let next_out_of_line = decoder.next_out_of_line();
16592            let handles_before = decoder.remaining_handles();
16593            if let Some((inlined, num_bytes, num_handles)) =
16594                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16595            {
16596                let member_inline_size =
16597                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16598                if inlined != (member_inline_size <= 4) {
16599                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16600                }
16601                let inner_offset;
16602                let mut inner_depth = depth.clone();
16603                if inlined {
16604                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16605                    inner_offset = next_offset;
16606                } else {
16607                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16608                    inner_depth.increment()?;
16609                }
16610                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16611                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16612                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16613                {
16614                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16615                }
16616                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16617                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16618                }
16619            }
16620
16621            next_offset += envelope_size;
16622            _next_ordinal_to_read += 1;
16623            if next_offset >= end_offset {
16624                return Ok(());
16625            }
16626
16627            // Decode unknown envelopes for gaps in ordinals.
16628            while _next_ordinal_to_read < 3 {
16629                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16630                _next_ordinal_to_read += 1;
16631                next_offset += envelope_size;
16632            }
16633
16634            let next_out_of_line = decoder.next_out_of_line();
16635            let handles_before = decoder.remaining_handles();
16636            if let Some((inlined, num_bytes, num_handles)) =
16637                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16638            {
16639                let member_inline_size =
16640                    <Ipv6PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16641                        decoder.context,
16642                    );
16643                if inlined != (member_inline_size <= 4) {
16644                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16645                }
16646                let inner_offset;
16647                let mut inner_depth = depth.clone();
16648                if inlined {
16649                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16650                    inner_offset = next_offset;
16651                } else {
16652                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16653                    inner_depth.increment()?;
16654                }
16655                let val_ref = self
16656                    .pktinfo
16657                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoRecvControlData, D));
16658                fidl::decode!(
16659                    Ipv6PktInfoRecvControlData,
16660                    D,
16661                    val_ref,
16662                    decoder,
16663                    inner_offset,
16664                    inner_depth
16665                )?;
16666                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16667                {
16668                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16669                }
16670                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16671                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16672                }
16673            }
16674
16675            next_offset += envelope_size;
16676
16677            // Decode the remaining unknown envelopes.
16678            while next_offset < end_offset {
16679                _next_ordinal_to_read += 1;
16680                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16681                next_offset += envelope_size;
16682            }
16683
16684            Ok(())
16685        }
16686    }
16687
16688    impl Ipv6SendControlData {
16689        #[inline(always)]
16690        fn max_ordinal_present(&self) -> u64 {
16691            if let Some(_) = self.pktinfo {
16692                return 3;
16693            }
16694            if let Some(_) = self.hoplimit {
16695                return 2;
16696            }
16697            0
16698        }
16699    }
16700
16701    impl fidl::encoding::ValueTypeMarker for Ipv6SendControlData {
16702        type Borrowed<'a> = &'a Self;
16703        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16704            value
16705        }
16706    }
16707
16708    unsafe impl fidl::encoding::TypeMarker for Ipv6SendControlData {
16709        type Owned = Self;
16710
16711        #[inline(always)]
16712        fn inline_align(_context: fidl::encoding::Context) -> usize {
16713            8
16714        }
16715
16716        #[inline(always)]
16717        fn inline_size(_context: fidl::encoding::Context) -> usize {
16718            16
16719        }
16720    }
16721
16722    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6SendControlData, D>
16723        for &Ipv6SendControlData
16724    {
16725        unsafe fn encode(
16726            self,
16727            encoder: &mut fidl::encoding::Encoder<'_, D>,
16728            offset: usize,
16729            mut depth: fidl::encoding::Depth,
16730        ) -> fidl::Result<()> {
16731            encoder.debug_check_bounds::<Ipv6SendControlData>(offset);
16732            // Vector header
16733            let max_ordinal: u64 = self.max_ordinal_present();
16734            encoder.write_num(max_ordinal, offset);
16735            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16736            // Calling encoder.out_of_line_offset(0) is not allowed.
16737            if max_ordinal == 0 {
16738                return Ok(());
16739            }
16740            depth.increment()?;
16741            let envelope_size = 8;
16742            let bytes_len = max_ordinal as usize * envelope_size;
16743            #[allow(unused_variables)]
16744            let offset = encoder.out_of_line_offset(bytes_len);
16745            let mut _prev_end_offset: usize = 0;
16746            if 2 > max_ordinal {
16747                return Ok(());
16748            }
16749
16750            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16751            // are envelope_size bytes.
16752            let cur_offset: usize = (2 - 1) * envelope_size;
16753
16754            // Zero reserved fields.
16755            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16756
16757            // Safety:
16758            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16759            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16760            //   envelope_size bytes, there is always sufficient room.
16761            fidl::encoding::encode_in_envelope_optional::<u8, D>(
16762                self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16763                encoder,
16764                offset + cur_offset,
16765                depth,
16766            )?;
16767
16768            _prev_end_offset = cur_offset + envelope_size;
16769            if 3 > max_ordinal {
16770                return Ok(());
16771            }
16772
16773            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16774            // are envelope_size bytes.
16775            let cur_offset: usize = (3 - 1) * envelope_size;
16776
16777            // Zero reserved fields.
16778            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16779
16780            // Safety:
16781            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16782            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16783            //   envelope_size bytes, there is always sufficient room.
16784            fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
16785                self.pktinfo
16786                    .as_ref()
16787                    .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16788                encoder,
16789                offset + cur_offset,
16790                depth,
16791            )?;
16792
16793            _prev_end_offset = cur_offset + envelope_size;
16794
16795            Ok(())
16796        }
16797    }
16798
16799    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6SendControlData {
16800        #[inline(always)]
16801        fn new_empty() -> Self {
16802            Self::default()
16803        }
16804
16805        unsafe fn decode(
16806            &mut self,
16807            decoder: &mut fidl::encoding::Decoder<'_, D>,
16808            offset: usize,
16809            mut depth: fidl::encoding::Depth,
16810        ) -> fidl::Result<()> {
16811            decoder.debug_check_bounds::<Self>(offset);
16812            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16813                None => return Err(fidl::Error::NotNullable),
16814                Some(len) => len,
16815            };
16816            // Calling decoder.out_of_line_offset(0) is not allowed.
16817            if len == 0 {
16818                return Ok(());
16819            };
16820            depth.increment()?;
16821            let envelope_size = 8;
16822            let bytes_len = len * envelope_size;
16823            let offset = decoder.out_of_line_offset(bytes_len)?;
16824            // Decode the envelope for each type.
16825            let mut _next_ordinal_to_read = 0;
16826            let mut next_offset = offset;
16827            let end_offset = offset + bytes_len;
16828            _next_ordinal_to_read += 1;
16829            if next_offset >= end_offset {
16830                return Ok(());
16831            }
16832
16833            // Decode unknown envelopes for gaps in ordinals.
16834            while _next_ordinal_to_read < 2 {
16835                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16836                _next_ordinal_to_read += 1;
16837                next_offset += envelope_size;
16838            }
16839
16840            let next_out_of_line = decoder.next_out_of_line();
16841            let handles_before = decoder.remaining_handles();
16842            if let Some((inlined, num_bytes, num_handles)) =
16843                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16844            {
16845                let member_inline_size =
16846                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16847                if inlined != (member_inline_size <= 4) {
16848                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16849                }
16850                let inner_offset;
16851                let mut inner_depth = depth.clone();
16852                if inlined {
16853                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16854                    inner_offset = next_offset;
16855                } else {
16856                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16857                    inner_depth.increment()?;
16858                }
16859                let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16860                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16861                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16862                {
16863                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16864                }
16865                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16866                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16867                }
16868            }
16869
16870            next_offset += envelope_size;
16871            _next_ordinal_to_read += 1;
16872            if next_offset >= end_offset {
16873                return Ok(());
16874            }
16875
16876            // Decode unknown envelopes for gaps in ordinals.
16877            while _next_ordinal_to_read < 3 {
16878                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16879                _next_ordinal_to_read += 1;
16880                next_offset += envelope_size;
16881            }
16882
16883            let next_out_of_line = decoder.next_out_of_line();
16884            let handles_before = decoder.remaining_handles();
16885            if let Some((inlined, num_bytes, num_handles)) =
16886                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16887            {
16888                let member_inline_size =
16889                    <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
16890                        decoder.context,
16891                    );
16892                if inlined != (member_inline_size <= 4) {
16893                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16894                }
16895                let inner_offset;
16896                let mut inner_depth = depth.clone();
16897                if inlined {
16898                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16899                    inner_offset = next_offset;
16900                } else {
16901                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16902                    inner_depth.increment()?;
16903                }
16904                let val_ref = self
16905                    .pktinfo
16906                    .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
16907                fidl::decode!(
16908                    Ipv6PktInfoSendControlData,
16909                    D,
16910                    val_ref,
16911                    decoder,
16912                    inner_offset,
16913                    inner_depth
16914                )?;
16915                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16916                {
16917                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16918                }
16919                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16920                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16921                }
16922            }
16923
16924            next_offset += envelope_size;
16925
16926            // Decode the remaining unknown envelopes.
16927            while next_offset < end_offset {
16928                _next_ordinal_to_read += 1;
16929                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16930                next_offset += envelope_size;
16931            }
16932
16933            Ok(())
16934        }
16935    }
16936
16937    impl NetworkSocketRecvControlData {
16938        #[inline(always)]
16939        fn max_ordinal_present(&self) -> u64 {
16940            if let Some(_) = self.ipv6 {
16941                return 3;
16942            }
16943            if let Some(_) = self.ip {
16944                return 2;
16945            }
16946            if let Some(_) = self.socket {
16947                return 1;
16948            }
16949            0
16950        }
16951    }
16952
16953    impl fidl::encoding::ValueTypeMarker for NetworkSocketRecvControlData {
16954        type Borrowed<'a> = &'a Self;
16955        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16956            value
16957        }
16958    }
16959
16960    unsafe impl fidl::encoding::TypeMarker for NetworkSocketRecvControlData {
16961        type Owned = Self;
16962
16963        #[inline(always)]
16964        fn inline_align(_context: fidl::encoding::Context) -> usize {
16965            8
16966        }
16967
16968        #[inline(always)]
16969        fn inline_size(_context: fidl::encoding::Context) -> usize {
16970            16
16971        }
16972    }
16973
16974    unsafe impl<D: fidl::encoding::ResourceDialect>
16975        fidl::encoding::Encode<NetworkSocketRecvControlData, D> for &NetworkSocketRecvControlData
16976    {
16977        unsafe fn encode(
16978            self,
16979            encoder: &mut fidl::encoding::Encoder<'_, D>,
16980            offset: usize,
16981            mut depth: fidl::encoding::Depth,
16982        ) -> fidl::Result<()> {
16983            encoder.debug_check_bounds::<NetworkSocketRecvControlData>(offset);
16984            // Vector header
16985            let max_ordinal: u64 = self.max_ordinal_present();
16986            encoder.write_num(max_ordinal, offset);
16987            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16988            // Calling encoder.out_of_line_offset(0) is not allowed.
16989            if max_ordinal == 0 {
16990                return Ok(());
16991            }
16992            depth.increment()?;
16993            let envelope_size = 8;
16994            let bytes_len = max_ordinal as usize * envelope_size;
16995            #[allow(unused_variables)]
16996            let offset = encoder.out_of_line_offset(bytes_len);
16997            let mut _prev_end_offset: usize = 0;
16998            if 1 > max_ordinal {
16999                return Ok(());
17000            }
17001
17002            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17003            // are envelope_size bytes.
17004            let cur_offset: usize = (1 - 1) * envelope_size;
17005
17006            // Zero reserved fields.
17007            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17008
17009            // Safety:
17010            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17011            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17012            //   envelope_size bytes, there is always sufficient room.
17013            fidl::encoding::encode_in_envelope_optional::<SocketRecvControlData, D>(
17014                self.socket
17015                    .as_ref()
17016                    .map(<SocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17017                encoder,
17018                offset + cur_offset,
17019                depth,
17020            )?;
17021
17022            _prev_end_offset = cur_offset + envelope_size;
17023            if 2 > max_ordinal {
17024                return Ok(());
17025            }
17026
17027            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17028            // are envelope_size bytes.
17029            let cur_offset: usize = (2 - 1) * envelope_size;
17030
17031            // Zero reserved fields.
17032            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17033
17034            // Safety:
17035            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17036            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17037            //   envelope_size bytes, there is always sufficient room.
17038            fidl::encoding::encode_in_envelope_optional::<IpRecvControlData, D>(
17039                self.ip
17040                    .as_ref()
17041                    .map(<IpRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17042                encoder,
17043                offset + cur_offset,
17044                depth,
17045            )?;
17046
17047            _prev_end_offset = cur_offset + envelope_size;
17048            if 3 > max_ordinal {
17049                return Ok(());
17050            }
17051
17052            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17053            // are envelope_size bytes.
17054            let cur_offset: usize = (3 - 1) * envelope_size;
17055
17056            // Zero reserved fields.
17057            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17058
17059            // Safety:
17060            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17061            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17062            //   envelope_size bytes, there is always sufficient room.
17063            fidl::encoding::encode_in_envelope_optional::<Ipv6RecvControlData, D>(
17064                self.ipv6
17065                    .as_ref()
17066                    .map(<Ipv6RecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
17067                encoder,
17068                offset + cur_offset,
17069                depth,
17070            )?;
17071
17072            _prev_end_offset = cur_offset + envelope_size;
17073
17074            Ok(())
17075        }
17076    }
17077
17078    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17079        for NetworkSocketRecvControlData
17080    {
17081        #[inline(always)]
17082        fn new_empty() -> Self {
17083            Self::default()
17084        }
17085
17086        unsafe fn decode(
17087            &mut self,
17088            decoder: &mut fidl::encoding::Decoder<'_, D>,
17089            offset: usize,
17090            mut depth: fidl::encoding::Depth,
17091        ) -> fidl::Result<()> {
17092            decoder.debug_check_bounds::<Self>(offset);
17093            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17094                None => return Err(fidl::Error::NotNullable),
17095                Some(len) => len,
17096            };
17097            // Calling decoder.out_of_line_offset(0) is not allowed.
17098            if len == 0 {
17099                return Ok(());
17100            };
17101            depth.increment()?;
17102            let envelope_size = 8;
17103            let bytes_len = len * envelope_size;
17104            let offset = decoder.out_of_line_offset(bytes_len)?;
17105            // Decode the envelope for each type.
17106            let mut _next_ordinal_to_read = 0;
17107            let mut next_offset = offset;
17108            let end_offset = offset + bytes_len;
17109            _next_ordinal_to_read += 1;
17110            if next_offset >= end_offset {
17111                return Ok(());
17112            }
17113
17114            // Decode unknown envelopes for gaps in ordinals.
17115            while _next_ordinal_to_read < 1 {
17116                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17117                _next_ordinal_to_read += 1;
17118                next_offset += envelope_size;
17119            }
17120
17121            let next_out_of_line = decoder.next_out_of_line();
17122            let handles_before = decoder.remaining_handles();
17123            if let Some((inlined, num_bytes, num_handles)) =
17124                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17125            {
17126                let member_inline_size =
17127                    <SocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17128                        decoder.context,
17129                    );
17130                if inlined != (member_inline_size <= 4) {
17131                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17132                }
17133                let inner_offset;
17134                let mut inner_depth = depth.clone();
17135                if inlined {
17136                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17137                    inner_offset = next_offset;
17138                } else {
17139                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17140                    inner_depth.increment()?;
17141                }
17142                let val_ref =
17143                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketRecvControlData, D));
17144                fidl::decode!(
17145                    SocketRecvControlData,
17146                    D,
17147                    val_ref,
17148                    decoder,
17149                    inner_offset,
17150                    inner_depth
17151                )?;
17152                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17153                {
17154                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17155                }
17156                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17157                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17158                }
17159            }
17160
17161            next_offset += envelope_size;
17162            _next_ordinal_to_read += 1;
17163            if next_offset >= end_offset {
17164                return Ok(());
17165            }
17166
17167            // Decode unknown envelopes for gaps in ordinals.
17168            while _next_ordinal_to_read < 2 {
17169                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17170                _next_ordinal_to_read += 1;
17171                next_offset += envelope_size;
17172            }
17173
17174            let next_out_of_line = decoder.next_out_of_line();
17175            let handles_before = decoder.remaining_handles();
17176            if let Some((inlined, num_bytes, num_handles)) =
17177                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17178            {
17179                let member_inline_size =
17180                    <IpRecvControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17181                if inlined != (member_inline_size <= 4) {
17182                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17183                }
17184                let inner_offset;
17185                let mut inner_depth = depth.clone();
17186                if inlined {
17187                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17188                    inner_offset = next_offset;
17189                } else {
17190                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17191                    inner_depth.increment()?;
17192                }
17193                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpRecvControlData, D));
17194                fidl::decode!(IpRecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17195                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17196                {
17197                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17198                }
17199                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17200                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17201                }
17202            }
17203
17204            next_offset += envelope_size;
17205            _next_ordinal_to_read += 1;
17206            if next_offset >= end_offset {
17207                return Ok(());
17208            }
17209
17210            // Decode unknown envelopes for gaps in ordinals.
17211            while _next_ordinal_to_read < 3 {
17212                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17213                _next_ordinal_to_read += 1;
17214                next_offset += envelope_size;
17215            }
17216
17217            let next_out_of_line = decoder.next_out_of_line();
17218            let handles_before = decoder.remaining_handles();
17219            if let Some((inlined, num_bytes, num_handles)) =
17220                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17221            {
17222                let member_inline_size =
17223                    <Ipv6RecvControlData as fidl::encoding::TypeMarker>::inline_size(
17224                        decoder.context,
17225                    );
17226                if inlined != (member_inline_size <= 4) {
17227                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17228                }
17229                let inner_offset;
17230                let mut inner_depth = depth.clone();
17231                if inlined {
17232                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17233                    inner_offset = next_offset;
17234                } else {
17235                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17236                    inner_depth.increment()?;
17237                }
17238                let val_ref =
17239                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6RecvControlData, D));
17240                fidl::decode!(Ipv6RecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17241                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17242                {
17243                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17244                }
17245                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17246                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17247                }
17248            }
17249
17250            next_offset += envelope_size;
17251
17252            // Decode the remaining unknown envelopes.
17253            while next_offset < end_offset {
17254                _next_ordinal_to_read += 1;
17255                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17256                next_offset += envelope_size;
17257            }
17258
17259            Ok(())
17260        }
17261    }
17262
17263    impl NetworkSocketSendControlData {
17264        #[inline(always)]
17265        fn max_ordinal_present(&self) -> u64 {
17266            if let Some(_) = self.ipv6 {
17267                return 3;
17268            }
17269            if let Some(_) = self.ip {
17270                return 2;
17271            }
17272            if let Some(_) = self.socket {
17273                return 1;
17274            }
17275            0
17276        }
17277    }
17278
17279    impl fidl::encoding::ValueTypeMarker for NetworkSocketSendControlData {
17280        type Borrowed<'a> = &'a Self;
17281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17282            value
17283        }
17284    }
17285
17286    unsafe impl fidl::encoding::TypeMarker for NetworkSocketSendControlData {
17287        type Owned = Self;
17288
17289        #[inline(always)]
17290        fn inline_align(_context: fidl::encoding::Context) -> usize {
17291            8
17292        }
17293
17294        #[inline(always)]
17295        fn inline_size(_context: fidl::encoding::Context) -> usize {
17296            16
17297        }
17298    }
17299
17300    unsafe impl<D: fidl::encoding::ResourceDialect>
17301        fidl::encoding::Encode<NetworkSocketSendControlData, D> for &NetworkSocketSendControlData
17302    {
17303        unsafe fn encode(
17304            self,
17305            encoder: &mut fidl::encoding::Encoder<'_, D>,
17306            offset: usize,
17307            mut depth: fidl::encoding::Depth,
17308        ) -> fidl::Result<()> {
17309            encoder.debug_check_bounds::<NetworkSocketSendControlData>(offset);
17310            // Vector header
17311            let max_ordinal: u64 = self.max_ordinal_present();
17312            encoder.write_num(max_ordinal, offset);
17313            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17314            // Calling encoder.out_of_line_offset(0) is not allowed.
17315            if max_ordinal == 0 {
17316                return Ok(());
17317            }
17318            depth.increment()?;
17319            let envelope_size = 8;
17320            let bytes_len = max_ordinal as usize * envelope_size;
17321            #[allow(unused_variables)]
17322            let offset = encoder.out_of_line_offset(bytes_len);
17323            let mut _prev_end_offset: usize = 0;
17324            if 1 > max_ordinal {
17325                return Ok(());
17326            }
17327
17328            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17329            // are envelope_size bytes.
17330            let cur_offset: usize = (1 - 1) * envelope_size;
17331
17332            // Zero reserved fields.
17333            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17334
17335            // Safety:
17336            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17337            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17338            //   envelope_size bytes, there is always sufficient room.
17339            fidl::encoding::encode_in_envelope_optional::<SocketSendControlData, D>(
17340                self.socket
17341                    .as_ref()
17342                    .map(<SocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17343                encoder,
17344                offset + cur_offset,
17345                depth,
17346            )?;
17347
17348            _prev_end_offset = cur_offset + envelope_size;
17349            if 2 > max_ordinal {
17350                return Ok(());
17351            }
17352
17353            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17354            // are envelope_size bytes.
17355            let cur_offset: usize = (2 - 1) * envelope_size;
17356
17357            // Zero reserved fields.
17358            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17359
17360            // Safety:
17361            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17362            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17363            //   envelope_size bytes, there is always sufficient room.
17364            fidl::encoding::encode_in_envelope_optional::<IpSendControlData, D>(
17365                self.ip
17366                    .as_ref()
17367                    .map(<IpSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17368                encoder,
17369                offset + cur_offset,
17370                depth,
17371            )?;
17372
17373            _prev_end_offset = cur_offset + envelope_size;
17374            if 3 > max_ordinal {
17375                return Ok(());
17376            }
17377
17378            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17379            // are envelope_size bytes.
17380            let cur_offset: usize = (3 - 1) * envelope_size;
17381
17382            // Zero reserved fields.
17383            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17384
17385            // Safety:
17386            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17387            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17388            //   envelope_size bytes, there is always sufficient room.
17389            fidl::encoding::encode_in_envelope_optional::<Ipv6SendControlData, D>(
17390                self.ipv6
17391                    .as_ref()
17392                    .map(<Ipv6SendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17393                encoder,
17394                offset + cur_offset,
17395                depth,
17396            )?;
17397
17398            _prev_end_offset = cur_offset + envelope_size;
17399
17400            Ok(())
17401        }
17402    }
17403
17404    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17405        for NetworkSocketSendControlData
17406    {
17407        #[inline(always)]
17408        fn new_empty() -> Self {
17409            Self::default()
17410        }
17411
17412        unsafe fn decode(
17413            &mut self,
17414            decoder: &mut fidl::encoding::Decoder<'_, D>,
17415            offset: usize,
17416            mut depth: fidl::encoding::Depth,
17417        ) -> fidl::Result<()> {
17418            decoder.debug_check_bounds::<Self>(offset);
17419            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17420                None => return Err(fidl::Error::NotNullable),
17421                Some(len) => len,
17422            };
17423            // Calling decoder.out_of_line_offset(0) is not allowed.
17424            if len == 0 {
17425                return Ok(());
17426            };
17427            depth.increment()?;
17428            let envelope_size = 8;
17429            let bytes_len = len * envelope_size;
17430            let offset = decoder.out_of_line_offset(bytes_len)?;
17431            // Decode the envelope for each type.
17432            let mut _next_ordinal_to_read = 0;
17433            let mut next_offset = offset;
17434            let end_offset = offset + bytes_len;
17435            _next_ordinal_to_read += 1;
17436            if next_offset >= end_offset {
17437                return Ok(());
17438            }
17439
17440            // Decode unknown envelopes for gaps in ordinals.
17441            while _next_ordinal_to_read < 1 {
17442                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17443                _next_ordinal_to_read += 1;
17444                next_offset += envelope_size;
17445            }
17446
17447            let next_out_of_line = decoder.next_out_of_line();
17448            let handles_before = decoder.remaining_handles();
17449            if let Some((inlined, num_bytes, num_handles)) =
17450                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17451            {
17452                let member_inline_size =
17453                    <SocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17454                        decoder.context,
17455                    );
17456                if inlined != (member_inline_size <= 4) {
17457                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17458                }
17459                let inner_offset;
17460                let mut inner_depth = depth.clone();
17461                if inlined {
17462                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17463                    inner_offset = next_offset;
17464                } else {
17465                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17466                    inner_depth.increment()?;
17467                }
17468                let val_ref =
17469                    self.socket.get_or_insert_with(|| fidl::new_empty!(SocketSendControlData, D));
17470                fidl::decode!(
17471                    SocketSendControlData,
17472                    D,
17473                    val_ref,
17474                    decoder,
17475                    inner_offset,
17476                    inner_depth
17477                )?;
17478                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17479                {
17480                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17481                }
17482                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17483                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17484                }
17485            }
17486
17487            next_offset += envelope_size;
17488            _next_ordinal_to_read += 1;
17489            if next_offset >= end_offset {
17490                return Ok(());
17491            }
17492
17493            // Decode unknown envelopes for gaps in ordinals.
17494            while _next_ordinal_to_read < 2 {
17495                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17496                _next_ordinal_to_read += 1;
17497                next_offset += envelope_size;
17498            }
17499
17500            let next_out_of_line = decoder.next_out_of_line();
17501            let handles_before = decoder.remaining_handles();
17502            if let Some((inlined, num_bytes, num_handles)) =
17503                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17504            {
17505                let member_inline_size =
17506                    <IpSendControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17507                if inlined != (member_inline_size <= 4) {
17508                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17509                }
17510                let inner_offset;
17511                let mut inner_depth = depth.clone();
17512                if inlined {
17513                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17514                    inner_offset = next_offset;
17515                } else {
17516                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17517                    inner_depth.increment()?;
17518                }
17519                let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpSendControlData, D));
17520                fidl::decode!(IpSendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17521                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17522                {
17523                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17524                }
17525                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17526                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17527                }
17528            }
17529
17530            next_offset += envelope_size;
17531            _next_ordinal_to_read += 1;
17532            if next_offset >= end_offset {
17533                return Ok(());
17534            }
17535
17536            // Decode unknown envelopes for gaps in ordinals.
17537            while _next_ordinal_to_read < 3 {
17538                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17539                _next_ordinal_to_read += 1;
17540                next_offset += envelope_size;
17541            }
17542
17543            let next_out_of_line = decoder.next_out_of_line();
17544            let handles_before = decoder.remaining_handles();
17545            if let Some((inlined, num_bytes, num_handles)) =
17546                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17547            {
17548                let member_inline_size =
17549                    <Ipv6SendControlData as fidl::encoding::TypeMarker>::inline_size(
17550                        decoder.context,
17551                    );
17552                if inlined != (member_inline_size <= 4) {
17553                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17554                }
17555                let inner_offset;
17556                let mut inner_depth = depth.clone();
17557                if inlined {
17558                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17559                    inner_offset = next_offset;
17560                } else {
17561                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17562                    inner_depth.increment()?;
17563                }
17564                let val_ref =
17565                    self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6SendControlData, D));
17566                fidl::decode!(Ipv6SendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17567                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17568                {
17569                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17570                }
17571                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17572                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17573                }
17574            }
17575
17576            next_offset += envelope_size;
17577
17578            // Decode the remaining unknown envelopes.
17579            while next_offset < end_offset {
17580                _next_ordinal_to_read += 1;
17581                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17582                next_offset += envelope_size;
17583            }
17584
17585            Ok(())
17586        }
17587    }
17588
17589    impl RecvMsgMeta {
17590        #[inline(always)]
17591        fn max_ordinal_present(&self) -> u64 {
17592            if let Some(_) = self.payload_len {
17593                return 3;
17594            }
17595            if let Some(_) = self.control {
17596                return 2;
17597            }
17598            if let Some(_) = self.from {
17599                return 1;
17600            }
17601            0
17602        }
17603    }
17604
17605    impl fidl::encoding::ValueTypeMarker for RecvMsgMeta {
17606        type Borrowed<'a> = &'a Self;
17607        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17608            value
17609        }
17610    }
17611
17612    unsafe impl fidl::encoding::TypeMarker for RecvMsgMeta {
17613        type Owned = Self;
17614
17615        #[inline(always)]
17616        fn inline_align(_context: fidl::encoding::Context) -> usize {
17617            8
17618        }
17619
17620        #[inline(always)]
17621        fn inline_size(_context: fidl::encoding::Context) -> usize {
17622            16
17623        }
17624    }
17625
17626    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecvMsgMeta, D>
17627        for &RecvMsgMeta
17628    {
17629        unsafe fn encode(
17630            self,
17631            encoder: &mut fidl::encoding::Encoder<'_, D>,
17632            offset: usize,
17633            mut depth: fidl::encoding::Depth,
17634        ) -> fidl::Result<()> {
17635            encoder.debug_check_bounds::<RecvMsgMeta>(offset);
17636            // Vector header
17637            let max_ordinal: u64 = self.max_ordinal_present();
17638            encoder.write_num(max_ordinal, offset);
17639            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17640            // Calling encoder.out_of_line_offset(0) is not allowed.
17641            if max_ordinal == 0 {
17642                return Ok(());
17643            }
17644            depth.increment()?;
17645            let envelope_size = 8;
17646            let bytes_len = max_ordinal as usize * envelope_size;
17647            #[allow(unused_variables)]
17648            let offset = encoder.out_of_line_offset(bytes_len);
17649            let mut _prev_end_offset: usize = 0;
17650            if 1 > max_ordinal {
17651                return Ok(());
17652            }
17653
17654            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17655            // are envelope_size bytes.
17656            let cur_offset: usize = (1 - 1) * envelope_size;
17657
17658            // Zero reserved fields.
17659            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17660
17661            // Safety:
17662            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17663            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17664            //   envelope_size bytes, there is always sufficient room.
17665            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
17666            self.from.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17667            encoder, offset + cur_offset, depth
17668        )?;
17669
17670            _prev_end_offset = cur_offset + envelope_size;
17671            if 2 > max_ordinal {
17672                return Ok(());
17673            }
17674
17675            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17676            // are envelope_size bytes.
17677            let cur_offset: usize = (2 - 1) * envelope_size;
17678
17679            // Zero reserved fields.
17680            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17681
17682            // Safety:
17683            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17684            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17685            //   envelope_size bytes, there is always sufficient room.
17686            fidl::encoding::encode_in_envelope_optional::<DatagramSocketRecvControlData, D>(
17687                self.control.as_ref().map(
17688                    <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow,
17689                ),
17690                encoder,
17691                offset + cur_offset,
17692                depth,
17693            )?;
17694
17695            _prev_end_offset = cur_offset + envelope_size;
17696            if 3 > max_ordinal {
17697                return Ok(());
17698            }
17699
17700            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17701            // are envelope_size bytes.
17702            let cur_offset: usize = (3 - 1) * envelope_size;
17703
17704            // Zero reserved fields.
17705            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17706
17707            // Safety:
17708            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17709            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17710            //   envelope_size bytes, there is always sufficient room.
17711            fidl::encoding::encode_in_envelope_optional::<u16, D>(
17712                self.payload_len.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17713                encoder,
17714                offset + cur_offset,
17715                depth,
17716            )?;
17717
17718            _prev_end_offset = cur_offset + envelope_size;
17719
17720            Ok(())
17721        }
17722    }
17723
17724    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgMeta {
17725        #[inline(always)]
17726        fn new_empty() -> Self {
17727            Self::default()
17728        }
17729
17730        unsafe fn decode(
17731            &mut self,
17732            decoder: &mut fidl::encoding::Decoder<'_, D>,
17733            offset: usize,
17734            mut depth: fidl::encoding::Depth,
17735        ) -> fidl::Result<()> {
17736            decoder.debug_check_bounds::<Self>(offset);
17737            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17738                None => return Err(fidl::Error::NotNullable),
17739                Some(len) => len,
17740            };
17741            // Calling decoder.out_of_line_offset(0) is not allowed.
17742            if len == 0 {
17743                return Ok(());
17744            };
17745            depth.increment()?;
17746            let envelope_size = 8;
17747            let bytes_len = len * envelope_size;
17748            let offset = decoder.out_of_line_offset(bytes_len)?;
17749            // Decode the envelope for each type.
17750            let mut _next_ordinal_to_read = 0;
17751            let mut next_offset = offset;
17752            let end_offset = offset + bytes_len;
17753            _next_ordinal_to_read += 1;
17754            if next_offset >= end_offset {
17755                return Ok(());
17756            }
17757
17758            // Decode unknown envelopes for gaps in ordinals.
17759            while _next_ordinal_to_read < 1 {
17760                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17761                _next_ordinal_to_read += 1;
17762                next_offset += envelope_size;
17763            }
17764
17765            let next_out_of_line = decoder.next_out_of_line();
17766            let handles_before = decoder.remaining_handles();
17767            if let Some((inlined, num_bytes, num_handles)) =
17768                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17769            {
17770                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17771                if inlined != (member_inline_size <= 4) {
17772                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17773                }
17774                let inner_offset;
17775                let mut inner_depth = depth.clone();
17776                if inlined {
17777                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17778                    inner_offset = next_offset;
17779                } else {
17780                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17781                    inner_depth.increment()?;
17782                }
17783                let val_ref = self.from.get_or_insert_with(|| {
17784                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
17785                });
17786                fidl::decode!(
17787                    fidl_fuchsia_net_common::SocketAddress,
17788                    D,
17789                    val_ref,
17790                    decoder,
17791                    inner_offset,
17792                    inner_depth
17793                )?;
17794                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17795                {
17796                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17797                }
17798                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17799                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17800                }
17801            }
17802
17803            next_offset += envelope_size;
17804            _next_ordinal_to_read += 1;
17805            if next_offset >= end_offset {
17806                return Ok(());
17807            }
17808
17809            // Decode unknown envelopes for gaps in ordinals.
17810            while _next_ordinal_to_read < 2 {
17811                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17812                _next_ordinal_to_read += 1;
17813                next_offset += envelope_size;
17814            }
17815
17816            let next_out_of_line = decoder.next_out_of_line();
17817            let handles_before = decoder.remaining_handles();
17818            if let Some((inlined, num_bytes, num_handles)) =
17819                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17820            {
17821                let member_inline_size =
17822                    <DatagramSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17823                        decoder.context,
17824                    );
17825                if inlined != (member_inline_size <= 4) {
17826                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17827                }
17828                let inner_offset;
17829                let mut inner_depth = depth.clone();
17830                if inlined {
17831                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17832                    inner_offset = next_offset;
17833                } else {
17834                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17835                    inner_depth.increment()?;
17836                }
17837                let val_ref = self
17838                    .control
17839                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketRecvControlData, D));
17840                fidl::decode!(
17841                    DatagramSocketRecvControlData,
17842                    D,
17843                    val_ref,
17844                    decoder,
17845                    inner_offset,
17846                    inner_depth
17847                )?;
17848                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17849                {
17850                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17851                }
17852                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17853                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17854                }
17855            }
17856
17857            next_offset += envelope_size;
17858            _next_ordinal_to_read += 1;
17859            if next_offset >= end_offset {
17860                return Ok(());
17861            }
17862
17863            // Decode unknown envelopes for gaps in ordinals.
17864            while _next_ordinal_to_read < 3 {
17865                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17866                _next_ordinal_to_read += 1;
17867                next_offset += envelope_size;
17868            }
17869
17870            let next_out_of_line = decoder.next_out_of_line();
17871            let handles_before = decoder.remaining_handles();
17872            if let Some((inlined, num_bytes, num_handles)) =
17873                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17874            {
17875                let member_inline_size =
17876                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17877                if inlined != (member_inline_size <= 4) {
17878                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17879                }
17880                let inner_offset;
17881                let mut inner_depth = depth.clone();
17882                if inlined {
17883                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17884                    inner_offset = next_offset;
17885                } else {
17886                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17887                    inner_depth.increment()?;
17888                }
17889                let val_ref = self.payload_len.get_or_insert_with(|| fidl::new_empty!(u16, D));
17890                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
17891                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17892                {
17893                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17894                }
17895                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17896                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17897                }
17898            }
17899
17900            next_offset += envelope_size;
17901
17902            // Decode the remaining unknown envelopes.
17903            while next_offset < end_offset {
17904                _next_ordinal_to_read += 1;
17905                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17906                next_offset += envelope_size;
17907            }
17908
17909            Ok(())
17910        }
17911    }
17912
17913    impl SendMsgMeta {
17914        #[inline(always)]
17915        fn max_ordinal_present(&self) -> u64 {
17916            if let Some(_) = self.control {
17917                return 2;
17918            }
17919            if let Some(_) = self.to {
17920                return 1;
17921            }
17922            0
17923        }
17924    }
17925
17926    impl fidl::encoding::ValueTypeMarker for SendMsgMeta {
17927        type Borrowed<'a> = &'a Self;
17928        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17929            value
17930        }
17931    }
17932
17933    unsafe impl fidl::encoding::TypeMarker for SendMsgMeta {
17934        type Owned = Self;
17935
17936        #[inline(always)]
17937        fn inline_align(_context: fidl::encoding::Context) -> usize {
17938            8
17939        }
17940
17941        #[inline(always)]
17942        fn inline_size(_context: fidl::encoding::Context) -> usize {
17943            16
17944        }
17945    }
17946
17947    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SendMsgMeta, D>
17948        for &SendMsgMeta
17949    {
17950        unsafe fn encode(
17951            self,
17952            encoder: &mut fidl::encoding::Encoder<'_, D>,
17953            offset: usize,
17954            mut depth: fidl::encoding::Depth,
17955        ) -> fidl::Result<()> {
17956            encoder.debug_check_bounds::<SendMsgMeta>(offset);
17957            // Vector header
17958            let max_ordinal: u64 = self.max_ordinal_present();
17959            encoder.write_num(max_ordinal, offset);
17960            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17961            // Calling encoder.out_of_line_offset(0) is not allowed.
17962            if max_ordinal == 0 {
17963                return Ok(());
17964            }
17965            depth.increment()?;
17966            let envelope_size = 8;
17967            let bytes_len = max_ordinal as usize * envelope_size;
17968            #[allow(unused_variables)]
17969            let offset = encoder.out_of_line_offset(bytes_len);
17970            let mut _prev_end_offset: usize = 0;
17971            if 1 > max_ordinal {
17972                return Ok(());
17973            }
17974
17975            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17976            // are envelope_size bytes.
17977            let cur_offset: usize = (1 - 1) * envelope_size;
17978
17979            // Zero reserved fields.
17980            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17981
17982            // Safety:
17983            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17984            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17985            //   envelope_size bytes, there is always sufficient room.
17986            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_common::SocketAddress, D>(
17987            self.to.as_ref().map(<fidl_fuchsia_net_common::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow),
17988            encoder, offset + cur_offset, depth
17989        )?;
17990
17991            _prev_end_offset = cur_offset + envelope_size;
17992            if 2 > max_ordinal {
17993                return Ok(());
17994            }
17995
17996            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17997            // are envelope_size bytes.
17998            let cur_offset: usize = (2 - 1) * envelope_size;
17999
18000            // Zero reserved fields.
18001            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18002
18003            // Safety:
18004            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18005            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18006            //   envelope_size bytes, there is always sufficient room.
18007            fidl::encoding::encode_in_envelope_optional::<DatagramSocketSendControlData, D>(
18008                self.control.as_ref().map(
18009                    <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow,
18010                ),
18011                encoder,
18012                offset + cur_offset,
18013                depth,
18014            )?;
18015
18016            _prev_end_offset = cur_offset + envelope_size;
18017
18018            Ok(())
18019        }
18020    }
18021
18022    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgMeta {
18023        #[inline(always)]
18024        fn new_empty() -> Self {
18025            Self::default()
18026        }
18027
18028        unsafe fn decode(
18029            &mut self,
18030            decoder: &mut fidl::encoding::Decoder<'_, D>,
18031            offset: usize,
18032            mut depth: fidl::encoding::Depth,
18033        ) -> fidl::Result<()> {
18034            decoder.debug_check_bounds::<Self>(offset);
18035            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18036                None => return Err(fidl::Error::NotNullable),
18037                Some(len) => len,
18038            };
18039            // Calling decoder.out_of_line_offset(0) is not allowed.
18040            if len == 0 {
18041                return Ok(());
18042            };
18043            depth.increment()?;
18044            let envelope_size = 8;
18045            let bytes_len = len * envelope_size;
18046            let offset = decoder.out_of_line_offset(bytes_len)?;
18047            // Decode the envelope for each type.
18048            let mut _next_ordinal_to_read = 0;
18049            let mut next_offset = offset;
18050            let end_offset = offset + bytes_len;
18051            _next_ordinal_to_read += 1;
18052            if next_offset >= end_offset {
18053                return Ok(());
18054            }
18055
18056            // Decode unknown envelopes for gaps in ordinals.
18057            while _next_ordinal_to_read < 1 {
18058                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18059                _next_ordinal_to_read += 1;
18060                next_offset += envelope_size;
18061            }
18062
18063            let next_out_of_line = decoder.next_out_of_line();
18064            let handles_before = decoder.remaining_handles();
18065            if let Some((inlined, num_bytes, num_handles)) =
18066                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18067            {
18068                let member_inline_size = <fidl_fuchsia_net_common::SocketAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18069                if inlined != (member_inline_size <= 4) {
18070                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18071                }
18072                let inner_offset;
18073                let mut inner_depth = depth.clone();
18074                if inlined {
18075                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18076                    inner_offset = next_offset;
18077                } else {
18078                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18079                    inner_depth.increment()?;
18080                }
18081                let val_ref = self.to.get_or_insert_with(|| {
18082                    fidl::new_empty!(fidl_fuchsia_net_common::SocketAddress, D)
18083                });
18084                fidl::decode!(
18085                    fidl_fuchsia_net_common::SocketAddress,
18086                    D,
18087                    val_ref,
18088                    decoder,
18089                    inner_offset,
18090                    inner_depth
18091                )?;
18092                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18093                {
18094                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18095                }
18096                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18097                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18098                }
18099            }
18100
18101            next_offset += envelope_size;
18102            _next_ordinal_to_read += 1;
18103            if next_offset >= end_offset {
18104                return Ok(());
18105            }
18106
18107            // Decode unknown envelopes for gaps in ordinals.
18108            while _next_ordinal_to_read < 2 {
18109                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18110                _next_ordinal_to_read += 1;
18111                next_offset += envelope_size;
18112            }
18113
18114            let next_out_of_line = decoder.next_out_of_line();
18115            let handles_before = decoder.remaining_handles();
18116            if let Some((inlined, num_bytes, num_handles)) =
18117                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18118            {
18119                let member_inline_size =
18120                    <DatagramSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
18121                        decoder.context,
18122                    );
18123                if inlined != (member_inline_size <= 4) {
18124                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18125                }
18126                let inner_offset;
18127                let mut inner_depth = depth.clone();
18128                if inlined {
18129                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18130                    inner_offset = next_offset;
18131                } else {
18132                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18133                    inner_depth.increment()?;
18134                }
18135                let val_ref = self
18136                    .control
18137                    .get_or_insert_with(|| fidl::new_empty!(DatagramSocketSendControlData, D));
18138                fidl::decode!(
18139                    DatagramSocketSendControlData,
18140                    D,
18141                    val_ref,
18142                    decoder,
18143                    inner_offset,
18144                    inner_depth
18145                )?;
18146                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18147                {
18148                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18149                }
18150                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18151                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18152                }
18153            }
18154
18155            next_offset += envelope_size;
18156
18157            // Decode the remaining unknown envelopes.
18158            while next_offset < end_offset {
18159                _next_ordinal_to_read += 1;
18160                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18161                next_offset += envelope_size;
18162            }
18163
18164            Ok(())
18165        }
18166    }
18167
18168    impl SocketRecvControlData {
18169        #[inline(always)]
18170        fn max_ordinal_present(&self) -> u64 {
18171            if let Some(_) = self.timestamp {
18172                return 3;
18173            }
18174            0
18175        }
18176    }
18177
18178    impl fidl::encoding::ValueTypeMarker for SocketRecvControlData {
18179        type Borrowed<'a> = &'a Self;
18180        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18181            value
18182        }
18183    }
18184
18185    unsafe impl fidl::encoding::TypeMarker for SocketRecvControlData {
18186        type Owned = Self;
18187
18188        #[inline(always)]
18189        fn inline_align(_context: fidl::encoding::Context) -> usize {
18190            8
18191        }
18192
18193        #[inline(always)]
18194        fn inline_size(_context: fidl::encoding::Context) -> usize {
18195            16
18196        }
18197    }
18198
18199    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketRecvControlData, D>
18200        for &SocketRecvControlData
18201    {
18202        unsafe fn encode(
18203            self,
18204            encoder: &mut fidl::encoding::Encoder<'_, D>,
18205            offset: usize,
18206            mut depth: fidl::encoding::Depth,
18207        ) -> fidl::Result<()> {
18208            encoder.debug_check_bounds::<SocketRecvControlData>(offset);
18209            // Vector header
18210            let max_ordinal: u64 = self.max_ordinal_present();
18211            encoder.write_num(max_ordinal, offset);
18212            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18213            // Calling encoder.out_of_line_offset(0) is not allowed.
18214            if max_ordinal == 0 {
18215                return Ok(());
18216            }
18217            depth.increment()?;
18218            let envelope_size = 8;
18219            let bytes_len = max_ordinal as usize * envelope_size;
18220            #[allow(unused_variables)]
18221            let offset = encoder.out_of_line_offset(bytes_len);
18222            let mut _prev_end_offset: usize = 0;
18223            if 3 > max_ordinal {
18224                return Ok(());
18225            }
18226
18227            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18228            // are envelope_size bytes.
18229            let cur_offset: usize = (3 - 1) * envelope_size;
18230
18231            // Zero reserved fields.
18232            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18233
18234            // Safety:
18235            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18236            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18237            //   envelope_size bytes, there is always sufficient room.
18238            fidl::encoding::encode_in_envelope_optional::<Timestamp, D>(
18239                self.timestamp.as_ref().map(<Timestamp as fidl::encoding::ValueTypeMarker>::borrow),
18240                encoder,
18241                offset + cur_offset,
18242                depth,
18243            )?;
18244
18245            _prev_end_offset = cur_offset + envelope_size;
18246
18247            Ok(())
18248        }
18249    }
18250
18251    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketRecvControlData {
18252        #[inline(always)]
18253        fn new_empty() -> Self {
18254            Self::default()
18255        }
18256
18257        unsafe fn decode(
18258            &mut self,
18259            decoder: &mut fidl::encoding::Decoder<'_, D>,
18260            offset: usize,
18261            mut depth: fidl::encoding::Depth,
18262        ) -> fidl::Result<()> {
18263            decoder.debug_check_bounds::<Self>(offset);
18264            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18265                None => return Err(fidl::Error::NotNullable),
18266                Some(len) => len,
18267            };
18268            // Calling decoder.out_of_line_offset(0) is not allowed.
18269            if len == 0 {
18270                return Ok(());
18271            };
18272            depth.increment()?;
18273            let envelope_size = 8;
18274            let bytes_len = len * envelope_size;
18275            let offset = decoder.out_of_line_offset(bytes_len)?;
18276            // Decode the envelope for each type.
18277            let mut _next_ordinal_to_read = 0;
18278            let mut next_offset = offset;
18279            let end_offset = offset + bytes_len;
18280            _next_ordinal_to_read += 1;
18281            if next_offset >= end_offset {
18282                return Ok(());
18283            }
18284
18285            // Decode unknown envelopes for gaps in ordinals.
18286            while _next_ordinal_to_read < 3 {
18287                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18288                _next_ordinal_to_read += 1;
18289                next_offset += envelope_size;
18290            }
18291
18292            let next_out_of_line = decoder.next_out_of_line();
18293            let handles_before = decoder.remaining_handles();
18294            if let Some((inlined, num_bytes, num_handles)) =
18295                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18296            {
18297                let member_inline_size =
18298                    <Timestamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18299                if inlined != (member_inline_size <= 4) {
18300                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18301                }
18302                let inner_offset;
18303                let mut inner_depth = depth.clone();
18304                if inlined {
18305                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18306                    inner_offset = next_offset;
18307                } else {
18308                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18309                    inner_depth.increment()?;
18310                }
18311                let val_ref = self.timestamp.get_or_insert_with(|| fidl::new_empty!(Timestamp, D));
18312                fidl::decode!(Timestamp, D, val_ref, decoder, inner_offset, inner_depth)?;
18313                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18314                {
18315                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18316                }
18317                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18318                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18319                }
18320            }
18321
18322            next_offset += envelope_size;
18323
18324            // Decode the remaining unknown envelopes.
18325            while next_offset < end_offset {
18326                _next_ordinal_to_read += 1;
18327                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18328                next_offset += envelope_size;
18329            }
18330
18331            Ok(())
18332        }
18333    }
18334
18335    impl SocketSendControlData {
18336        #[inline(always)]
18337        fn max_ordinal_present(&self) -> u64 {
18338            0
18339        }
18340    }
18341
18342    impl fidl::encoding::ValueTypeMarker for SocketSendControlData {
18343        type Borrowed<'a> = &'a Self;
18344        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18345            value
18346        }
18347    }
18348
18349    unsafe impl fidl::encoding::TypeMarker for SocketSendControlData {
18350        type Owned = Self;
18351
18352        #[inline(always)]
18353        fn inline_align(_context: fidl::encoding::Context) -> usize {
18354            8
18355        }
18356
18357        #[inline(always)]
18358        fn inline_size(_context: fidl::encoding::Context) -> usize {
18359            16
18360        }
18361    }
18362
18363    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketSendControlData, D>
18364        for &SocketSendControlData
18365    {
18366        unsafe fn encode(
18367            self,
18368            encoder: &mut fidl::encoding::Encoder<'_, D>,
18369            offset: usize,
18370            mut depth: fidl::encoding::Depth,
18371        ) -> fidl::Result<()> {
18372            encoder.debug_check_bounds::<SocketSendControlData>(offset);
18373            // Vector header
18374            let max_ordinal: u64 = self.max_ordinal_present();
18375            encoder.write_num(max_ordinal, offset);
18376            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18377            // Calling encoder.out_of_line_offset(0) is not allowed.
18378            if max_ordinal == 0 {
18379                return Ok(());
18380            }
18381            depth.increment()?;
18382            let envelope_size = 8;
18383            let bytes_len = max_ordinal as usize * envelope_size;
18384            #[allow(unused_variables)]
18385            let offset = encoder.out_of_line_offset(bytes_len);
18386            let mut _prev_end_offset: usize = 0;
18387
18388            Ok(())
18389        }
18390    }
18391
18392    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketSendControlData {
18393        #[inline(always)]
18394        fn new_empty() -> Self {
18395            Self::default()
18396        }
18397
18398        unsafe fn decode(
18399            &mut self,
18400            decoder: &mut fidl::encoding::Decoder<'_, D>,
18401            offset: usize,
18402            mut depth: fidl::encoding::Depth,
18403        ) -> fidl::Result<()> {
18404            decoder.debug_check_bounds::<Self>(offset);
18405            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18406                None => return Err(fidl::Error::NotNullable),
18407                Some(len) => len,
18408            };
18409            // Calling decoder.out_of_line_offset(0) is not allowed.
18410            if len == 0 {
18411                return Ok(());
18412            };
18413            depth.increment()?;
18414            let envelope_size = 8;
18415            let bytes_len = len * envelope_size;
18416            let offset = decoder.out_of_line_offset(bytes_len)?;
18417            // Decode the envelope for each type.
18418            let mut _next_ordinal_to_read = 0;
18419            let mut next_offset = offset;
18420            let end_offset = offset + bytes_len;
18421
18422            // Decode the remaining unknown envelopes.
18423            while next_offset < end_offset {
18424                _next_ordinal_to_read += 1;
18425                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18426                next_offset += envelope_size;
18427            }
18428
18429            Ok(())
18430        }
18431    }
18432
18433    impl fidl::encoding::ValueTypeMarker for OptionalUint32 {
18434        type Borrowed<'a> = &'a Self;
18435        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18436            value
18437        }
18438    }
18439
18440    unsafe impl fidl::encoding::TypeMarker for OptionalUint32 {
18441        type Owned = Self;
18442
18443        #[inline(always)]
18444        fn inline_align(_context: fidl::encoding::Context) -> usize {
18445            8
18446        }
18447
18448        #[inline(always)]
18449        fn inline_size(_context: fidl::encoding::Context) -> usize {
18450            16
18451        }
18452    }
18453
18454    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint32, D>
18455        for &OptionalUint32
18456    {
18457        #[inline]
18458        unsafe fn encode(
18459            self,
18460            encoder: &mut fidl::encoding::Encoder<'_, D>,
18461            offset: usize,
18462            _depth: fidl::encoding::Depth,
18463        ) -> fidl::Result<()> {
18464            encoder.debug_check_bounds::<OptionalUint32>(offset);
18465            encoder.write_num::<u64>(self.ordinal(), offset);
18466            match self {
18467                OptionalUint32::Value(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
18468                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
18469                    encoder,
18470                    offset + 8,
18471                    _depth,
18472                ),
18473                OptionalUint32::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
18474                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
18475                    encoder,
18476                    offset + 8,
18477                    _depth,
18478                ),
18479            }
18480        }
18481    }
18482
18483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint32 {
18484        #[inline(always)]
18485        fn new_empty() -> Self {
18486            Self::Value(fidl::new_empty!(u32, D))
18487        }
18488
18489        #[inline]
18490        unsafe fn decode(
18491            &mut self,
18492            decoder: &mut fidl::encoding::Decoder<'_, D>,
18493            offset: usize,
18494            mut depth: fidl::encoding::Depth,
18495        ) -> fidl::Result<()> {
18496            decoder.debug_check_bounds::<Self>(offset);
18497            #[allow(unused_variables)]
18498            let next_out_of_line = decoder.next_out_of_line();
18499            let handles_before = decoder.remaining_handles();
18500            let (ordinal, inlined, num_bytes, num_handles) =
18501                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
18502
18503            let member_inline_size = match ordinal {
18504                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18505                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18506                _ => return Err(fidl::Error::UnknownUnionTag),
18507            };
18508
18509            if inlined != (member_inline_size <= 4) {
18510                return Err(fidl::Error::InvalidInlineBitInEnvelope);
18511            }
18512            let _inner_offset;
18513            if inlined {
18514                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
18515                _inner_offset = offset + 8;
18516            } else {
18517                depth.increment()?;
18518                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18519            }
18520            match ordinal {
18521                1 => {
18522                    #[allow(irrefutable_let_patterns)]
18523                    if let OptionalUint32::Value(_) = self {
18524                        // Do nothing, read the value into the object
18525                    } else {
18526                        // Initialize `self` to the right variant
18527                        *self = OptionalUint32::Value(fidl::new_empty!(u32, D));
18528                    }
18529                    #[allow(irrefutable_let_patterns)]
18530                    if let OptionalUint32::Value(ref mut val) = self {
18531                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
18532                    } else {
18533                        unreachable!()
18534                    }
18535                }
18536                2 => {
18537                    #[allow(irrefutable_let_patterns)]
18538                    if let OptionalUint32::Unset(_) = self {
18539                        // Do nothing, read the value into the object
18540                    } else {
18541                        // Initialize `self` to the right variant
18542                        *self = OptionalUint32::Unset(fidl::new_empty!(Empty, D));
18543                    }
18544                    #[allow(irrefutable_let_patterns)]
18545                    if let OptionalUint32::Unset(ref mut val) = self {
18546                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
18547                    } else {
18548                        unreachable!()
18549                    }
18550                }
18551                ordinal => panic!("unexpected ordinal {:?}", ordinal),
18552            }
18553            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
18554                return Err(fidl::Error::InvalidNumBytesInEnvelope);
18555            }
18556            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18557                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18558            }
18559            Ok(())
18560        }
18561    }
18562
18563    impl fidl::encoding::ValueTypeMarker for OptionalUint8 {
18564        type Borrowed<'a> = &'a Self;
18565        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18566            value
18567        }
18568    }
18569
18570    unsafe impl fidl::encoding::TypeMarker for OptionalUint8 {
18571        type Owned = Self;
18572
18573        #[inline(always)]
18574        fn inline_align(_context: fidl::encoding::Context) -> usize {
18575            8
18576        }
18577
18578        #[inline(always)]
18579        fn inline_size(_context: fidl::encoding::Context) -> usize {
18580            16
18581        }
18582    }
18583
18584    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint8, D>
18585        for &OptionalUint8
18586    {
18587        #[inline]
18588        unsafe fn encode(
18589            self,
18590            encoder: &mut fidl::encoding::Encoder<'_, D>,
18591            offset: usize,
18592            _depth: fidl::encoding::Depth,
18593        ) -> fidl::Result<()> {
18594            encoder.debug_check_bounds::<OptionalUint8>(offset);
18595            encoder.write_num::<u64>(self.ordinal(), offset);
18596            match self {
18597                OptionalUint8::Value(ref val) => fidl::encoding::encode_in_envelope::<u8, D>(
18598                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
18599                    encoder,
18600                    offset + 8,
18601                    _depth,
18602                ),
18603                OptionalUint8::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
18604                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
18605                    encoder,
18606                    offset + 8,
18607                    _depth,
18608                ),
18609            }
18610        }
18611    }
18612
18613    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint8 {
18614        #[inline(always)]
18615        fn new_empty() -> Self {
18616            Self::Value(fidl::new_empty!(u8, D))
18617        }
18618
18619        #[inline]
18620        unsafe fn decode(
18621            &mut self,
18622            decoder: &mut fidl::encoding::Decoder<'_, D>,
18623            offset: usize,
18624            mut depth: fidl::encoding::Depth,
18625        ) -> fidl::Result<()> {
18626            decoder.debug_check_bounds::<Self>(offset);
18627            #[allow(unused_variables)]
18628            let next_out_of_line = decoder.next_out_of_line();
18629            let handles_before = decoder.remaining_handles();
18630            let (ordinal, inlined, num_bytes, num_handles) =
18631                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
18632
18633            let member_inline_size = match ordinal {
18634                1 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18635                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18636                _ => return Err(fidl::Error::UnknownUnionTag),
18637            };
18638
18639            if inlined != (member_inline_size <= 4) {
18640                return Err(fidl::Error::InvalidInlineBitInEnvelope);
18641            }
18642            let _inner_offset;
18643            if inlined {
18644                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
18645                _inner_offset = offset + 8;
18646            } else {
18647                depth.increment()?;
18648                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18649            }
18650            match ordinal {
18651                1 => {
18652                    #[allow(irrefutable_let_patterns)]
18653                    if let OptionalUint8::Value(_) = self {
18654                        // Do nothing, read the value into the object
18655                    } else {
18656                        // Initialize `self` to the right variant
18657                        *self = OptionalUint8::Value(fidl::new_empty!(u8, D));
18658                    }
18659                    #[allow(irrefutable_let_patterns)]
18660                    if let OptionalUint8::Value(ref mut val) = self {
18661                        fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
18662                    } else {
18663                        unreachable!()
18664                    }
18665                }
18666                2 => {
18667                    #[allow(irrefutable_let_patterns)]
18668                    if let OptionalUint8::Unset(_) = self {
18669                        // Do nothing, read the value into the object
18670                    } else {
18671                        // Initialize `self` to the right variant
18672                        *self = OptionalUint8::Unset(fidl::new_empty!(Empty, D));
18673                    }
18674                    #[allow(irrefutable_let_patterns)]
18675                    if let OptionalUint8::Unset(ref mut val) = self {
18676                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
18677                    } else {
18678                        unreachable!()
18679                    }
18680                }
18681                ordinal => panic!("unexpected ordinal {:?}", ordinal),
18682            }
18683            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
18684                return Err(fidl::Error::InvalidNumBytesInEnvelope);
18685            }
18686            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18687                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18688            }
18689            Ok(())
18690        }
18691    }
18692}