1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const DATAGRAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/DatagramSocket";
12
13pub const FAST_UDP_WAIT_MANY_MAXIMUM_ITEMS: u32 = 63;
21
22pub const SIGNAL_DATAGRAM_ERROR: u32 = USER_SIGNAL_2 as u32;
23
24pub const SIGNAL_DATAGRAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
25
26pub const SIGNAL_DATAGRAM_OUTGOING: u32 = USER_SIGNAL_1 as u32;
27
28pub const SIGNAL_DATAGRAM_SHUTDOWN_READ: u32 = USER_SIGNAL_4 as u32;
29
30pub const SIGNAL_DATAGRAM_SHUTDOWN_WRITE: u32 = USER_SIGNAL_5 as u32;
31
32pub const SIGNAL_STREAM_CONNECTED: u32 = USER_SIGNAL_3 as u32;
33
34pub const SIGNAL_STREAM_INCOMING: u32 = USER_SIGNAL_0 as u32;
35
36pub const STREAM_SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket/StreamSocket";
37
38pub const SYNCHRONOUS_DATAGRAM_SOCKET_PROTOCOL_NAME: &str =
39 "fuchsia.posix.socket/SynchronousDatagramSocket";
40
41pub const USER_SIGNAL_0: u32 = 16777216;
42
43pub const USER_SIGNAL_1: u32 = 33554432;
44
45pub const USER_SIGNAL_2: u32 = 67108864;
46
47pub const USER_SIGNAL_3: u32 = 134217728;
48
49pub const USER_SIGNAL_4: u32 = 268435456;
50
51pub const USER_SIGNAL_5: u32 = 536870912;
52
53bitflags! {
54 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
55 pub struct CmsgRequests: u32 {
56 const IP_TOS = 1;
58 const IP_TTL = 2;
60 const IPV6_TCLASS = 4;
62 const IPV6_HOPLIMIT = 8;
64 const IPV6_PKTINFO = 16;
66 const IP_RECVORIGDSTADDR = 32;
68 }
69}
70
71impl CmsgRequests {
72 #[inline(always)]
73 pub fn from_bits_allow_unknown(bits: u32) -> Self {
74 Self::from_bits_retain(bits)
75 }
76
77 #[inline(always)]
78 pub fn has_unknown_bits(&self) -> bool {
79 self.get_unknown_bits() != 0
80 }
81
82 #[inline(always)]
83 pub fn get_unknown_bits(&self) -> u32 {
84 self.bits() & !Self::all().bits()
85 }
86}
87
88bitflags! {
89 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
93 pub struct InterfaceFlags: u16 {
94 const UP = 1;
95 const BROADCAST = 2;
96 const DEBUG = 4;
97 const LOOPBACK = 8;
98 const POINTTOPOINT = 16;
99 const NOTRAILERS = 32;
100 const RUNNING = 64;
101 const NOARP = 128;
102 const PROMISC = 256;
103 const ALLMULTI = 512;
104 const LEADER = 1024;
105 const FOLLOWER = 2048;
106 const MULTICAST = 4096;
107 const PORTSEL = 8192;
108 const AUTOMEDIA = 16384;
109 const DYNAMIC = 32768;
110 }
111}
112
113impl InterfaceFlags {
114 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
115 #[inline(always)]
116 pub fn has_unknown_bits(&self) -> bool {
117 false
118 }
119
120 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
121 #[inline(always)]
122 pub fn get_unknown_bits(&self) -> u16 {
123 0
124 }
125}
126
127bitflags! {
128 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
130 pub struct RecvMsgFlags: u16 {
131 const PEEK = 2;
135 }
136}
137
138impl RecvMsgFlags {
139 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
140 #[inline(always)]
141 pub fn has_unknown_bits(&self) -> bool {
142 false
143 }
144
145 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
146 #[inline(always)]
147 pub fn get_unknown_bits(&self) -> u16 {
148 0
149 }
150}
151
152bitflags! {
153 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
154 pub struct SendMsgFlags: u16 {
155 const RESERVED = 32768;
156 }
157}
158
159impl SendMsgFlags {
160 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
161 #[inline(always)]
162 pub fn has_unknown_bits(&self) -> bool {
163 false
164 }
165
166 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
167 #[inline(always)]
168 pub fn get_unknown_bits(&self) -> u16 {
169 0
170 }
171}
172
173bitflags! {
174 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
176 pub struct ShutdownMode: u16 {
177 const READ = 1;
179 const WRITE = 2;
181 }
182}
183
184impl ShutdownMode {
185 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
186 #[inline(always)]
187 pub fn has_unknown_bits(&self) -> bool {
188 false
189 }
190
191 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
192 #[inline(always)]
193 pub fn get_unknown_bits(&self) -> u16 {
194 0
195 }
196}
197
198#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
203#[repr(u32)]
204pub enum DatagramSocketProtocol {
205 Udp = 1,
210 IcmpEcho = 2,
219}
220
221impl DatagramSocketProtocol {
222 #[inline]
223 pub fn from_primitive(prim: u32) -> Option<Self> {
224 match prim {
225 1 => Some(Self::Udp),
226 2 => Some(Self::IcmpEcho),
227 _ => None,
228 }
229 }
230
231 #[inline]
232 pub const fn into_primitive(self) -> u32 {
233 self as u32
234 }
235
236 #[deprecated = "Strict enums should not use `is_unknown`"]
237 #[inline]
238 pub fn is_unknown(&self) -> bool {
239 false
240 }
241}
242
243#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
247#[repr(i16)]
248pub enum Domain {
249 Ipv4 = 0,
251 Ipv6 = 1,
253}
254
255impl Domain {
256 #[inline]
257 pub fn from_primitive(prim: i16) -> Option<Self> {
258 match prim {
259 0 => Some(Self::Ipv4),
260 1 => Some(Self::Ipv6),
261 _ => None,
262 }
263 }
264
265 #[inline]
266 pub const fn into_primitive(self) -> i16 {
267 self as i16
268 }
269
270 #[deprecated = "Strict enums should not use `is_unknown`"]
271 #[inline]
272 pub fn is_unknown(&self) -> bool {
273 false
274 }
275}
276
277#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
282#[repr(u32)]
283pub enum StreamSocketProtocol {
284 Tcp = 0,
289}
290
291impl StreamSocketProtocol {
292 #[inline]
293 pub fn from_primitive(prim: u32) -> Option<Self> {
294 match prim {
295 0 => Some(Self::Tcp),
296 _ => None,
297 }
298 }
299
300 #[inline]
301 pub const fn into_primitive(self) -> u32 {
302 self as u32
303 }
304
305 #[deprecated = "Strict enums should not use `is_unknown`"]
306 #[inline]
307 pub fn is_unknown(&self) -> bool {
308 false
309 }
310}
311
312#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
314#[repr(u32)]
315pub enum TcpCongestionControl {
316 Reno = 1,
317 Cubic = 2,
318}
319
320impl TcpCongestionControl {
321 #[inline]
322 pub fn from_primitive(prim: u32) -> Option<Self> {
323 match prim {
324 1 => Some(Self::Reno),
325 2 => Some(Self::Cubic),
326 _ => None,
327 }
328 }
329
330 #[inline]
331 pub const fn into_primitive(self) -> u32 {
332 self as u32
333 }
334
335 #[deprecated = "Strict enums should not use `is_unknown`"]
336 #[inline]
337 pub fn is_unknown(&self) -> bool {
338 false
339 }
340}
341
342#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
344#[repr(u32)]
345pub enum TcpCongestionControlState {
346 Open = 0,
347 Disorder = 1,
348 CongestionWindowReduced = 2,
349 Recovery = 3,
350 Loss = 4,
351}
352
353impl TcpCongestionControlState {
354 #[inline]
355 pub fn from_primitive(prim: u32) -> Option<Self> {
356 match prim {
357 0 => Some(Self::Open),
358 1 => Some(Self::Disorder),
359 2 => Some(Self::CongestionWindowReduced),
360 3 => Some(Self::Recovery),
361 4 => Some(Self::Loss),
362 _ => None,
363 }
364 }
365
366 #[inline]
367 pub const fn into_primitive(self) -> u32 {
368 self as u32
369 }
370
371 #[deprecated = "Strict enums should not use `is_unknown`"]
372 #[inline]
373 pub fn is_unknown(&self) -> bool {
374 false
375 }
376}
377
378#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
380#[repr(u32)]
381pub enum TcpState {
382 Established = 1,
383 SynSent = 2,
384 SynRecv = 3,
385 FinWait1 = 4,
386 FinWait2 = 5,
387 TimeWait = 6,
388 Close = 7,
389 CloseWait = 8,
390 LastAck = 9,
391 Listen = 10,
392 Closing = 11,
393}
394
395impl TcpState {
396 #[inline]
397 pub fn from_primitive(prim: u32) -> Option<Self> {
398 match prim {
399 1 => Some(Self::Established),
400 2 => Some(Self::SynSent),
401 3 => Some(Self::SynRecv),
402 4 => Some(Self::FinWait1),
403 5 => Some(Self::FinWait2),
404 6 => Some(Self::TimeWait),
405 7 => Some(Self::Close),
406 8 => Some(Self::CloseWait),
407 9 => Some(Self::LastAck),
408 10 => Some(Self::Listen),
409 11 => Some(Self::Closing),
410 _ => None,
411 }
412 }
413
414 #[inline]
415 pub const fn into_primitive(self) -> u32 {
416 self as u32
417 }
418
419 #[deprecated = "Strict enums should not use `is_unknown`"]
420 #[inline]
421 pub fn is_unknown(&self) -> bool {
422 false
423 }
424}
425
426#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
428#[repr(u32)]
429pub enum TimestampOption {
430 Disabled = 0,
432 Nanosecond = 1,
434 Microsecond = 2,
436}
437
438impl TimestampOption {
439 #[inline]
440 pub fn from_primitive(prim: u32) -> Option<Self> {
441 match prim {
442 0 => Some(Self::Disabled),
443 1 => Some(Self::Nanosecond),
444 2 => Some(Self::Microsecond),
445 _ => None,
446 }
447 }
448
449 #[inline]
450 pub const fn into_primitive(self) -> u32 {
451 self as u32
452 }
453
454 #[deprecated = "Strict enums should not use `is_unknown`"]
455 #[inline]
456 pub fn is_unknown(&self) -> bool {
457 false
458 }
459}
460
461#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
462pub enum UdpMetadataEncodingProtocolVersion {
463 Zero,
464 #[doc(hidden)]
465 __SourceBreaking {
466 unknown_ordinal: u16,
467 },
468}
469
470#[macro_export]
472macro_rules! UdpMetadataEncodingProtocolVersionUnknown {
473 () => {
474 _
475 };
476}
477
478impl UdpMetadataEncodingProtocolVersion {
479 #[inline]
480 pub fn from_primitive(prim: u16) -> Option<Self> {
481 match prim {
482 0 => Some(Self::Zero),
483 _ => None,
484 }
485 }
486
487 #[inline]
488 pub fn from_primitive_allow_unknown(prim: u16) -> Self {
489 match prim {
490 0 => Self::Zero,
491 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
492 }
493 }
494
495 #[inline]
496 pub fn unknown() -> Self {
497 Self::__SourceBreaking { unknown_ordinal: 0xffff }
498 }
499
500 #[inline]
501 pub const fn into_primitive(self) -> u16 {
502 match self {
503 Self::Zero => 0,
504 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
505 }
506 }
507
508 #[inline]
509 pub fn is_unknown(&self) -> bool {
510 match self {
511 Self::__SourceBreaking { unknown_ordinal: _ } => true,
512 _ => false,
513 }
514 }
515}
516
517#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
518pub struct BaseDatagramSocketGetInfoResponse {
519 pub domain: Domain,
520 pub proto: DatagramSocketProtocol,
521}
522
523impl fidl::Persistable for BaseDatagramSocketGetInfoResponse {}
524
525#[derive(Clone, Debug, PartialEq)]
526pub struct BaseNetworkSocketAddIpMembershipRequest {
527 pub membership: IpMulticastMembership,
528}
529
530impl fidl::Persistable for BaseNetworkSocketAddIpMembershipRequest {}
531
532#[derive(Clone, Debug, PartialEq)]
533pub struct BaseNetworkSocketAddIpv6MembershipRequest {
534 pub membership: Ipv6MulticastMembership,
535}
536
537impl fidl::Persistable for BaseNetworkSocketAddIpv6MembershipRequest {}
538
539#[derive(Clone, Debug, PartialEq)]
540pub struct BaseNetworkSocketBindRequest {
541 pub addr: fidl_fuchsia_net::SocketAddress,
542}
543
544impl fidl::Persistable for BaseNetworkSocketBindRequest {}
545
546#[derive(Clone, Debug, PartialEq)]
547pub struct BaseNetworkSocketConnectRequest {
548 pub addr: fidl_fuchsia_net::SocketAddress,
549}
550
551impl fidl::Persistable for BaseNetworkSocketConnectRequest {}
552
553#[derive(Clone, Debug, PartialEq)]
554pub struct BaseNetworkSocketDropIpMembershipRequest {
555 pub membership: IpMulticastMembership,
556}
557
558impl fidl::Persistable for BaseNetworkSocketDropIpMembershipRequest {}
559
560#[derive(Clone, Debug, PartialEq)]
561pub struct BaseNetworkSocketDropIpv6MembershipRequest {
562 pub membership: Ipv6MulticastMembership,
563}
564
565impl fidl::Persistable for BaseNetworkSocketDropIpv6MembershipRequest {}
566
567#[derive(Clone, Debug, PartialEq)]
568pub struct BaseNetworkSocketSetIpMulticastInterfaceRequest {
569 pub iface: u64,
570 pub address: fidl_fuchsia_net::Ipv4Address,
571}
572
573impl fidl::Persistable for BaseNetworkSocketSetIpMulticastInterfaceRequest {}
574
575#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
576pub struct BaseNetworkSocketSetIpMulticastLoopbackRequest {
577 pub value: bool,
578}
579
580impl fidl::Persistable for BaseNetworkSocketSetIpMulticastLoopbackRequest {}
581
582#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
583pub struct BaseNetworkSocketSetIpMulticastTtlRequest {
584 pub value: OptionalUint8,
585}
586
587impl fidl::Persistable for BaseNetworkSocketSetIpMulticastTtlRequest {}
588
589#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
590pub struct BaseNetworkSocketSetIpPacketInfoRequest {
591 pub value: bool,
592}
593
594impl fidl::Persistable for BaseNetworkSocketSetIpPacketInfoRequest {}
595
596#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
597pub struct BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {
598 pub value: bool,
599}
600
601impl fidl::Persistable for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest {}
602
603#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
604pub struct BaseNetworkSocketSetIpReceiveTtlRequest {
605 pub value: bool,
606}
607
608impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTtlRequest {}
609
610#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
611pub struct BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
612 pub value: bool,
613}
614
615impl fidl::Persistable for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {}
616
617#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
618pub struct BaseNetworkSocketSetIpTransparentRequest {
619 pub value: bool,
620}
621
622impl fidl::Persistable for BaseNetworkSocketSetIpTransparentRequest {}
623
624#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
625pub struct BaseNetworkSocketSetIpTtlRequest {
626 pub value: OptionalUint8,
627}
628
629impl fidl::Persistable for BaseNetworkSocketSetIpTtlRequest {}
630
631#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
632#[repr(C)]
633pub struct BaseNetworkSocketSetIpTypeOfServiceRequest {
634 pub value: u8,
635}
636
637impl fidl::Persistable for BaseNetworkSocketSetIpTypeOfServiceRequest {}
638
639#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
640pub struct BaseNetworkSocketSetIpv6MulticastHopsRequest {
641 pub value: OptionalUint8,
642}
643
644impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastHopsRequest {}
645
646#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
647#[repr(C)]
648pub struct BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
649 pub value: u64,
650}
651
652impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {}
653
654#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
655pub struct BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
656 pub value: bool,
657}
658
659impl fidl::Persistable for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {}
660
661#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
662pub struct BaseNetworkSocketSetIpv6OnlyRequest {
663 pub value: bool,
664}
665
666impl fidl::Persistable for BaseNetworkSocketSetIpv6OnlyRequest {}
667
668#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
669pub struct BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
670 pub value: bool,
671}
672
673impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {}
674
675#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
676pub struct BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
677 pub value: bool,
678}
679
680impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {}
681
682#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
683pub struct BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
684 pub value: bool,
685}
686
687impl fidl::Persistable for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {}
688
689#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
690pub struct BaseNetworkSocketSetIpv6TrafficClassRequest {
691 pub value: OptionalUint8,
692}
693
694impl fidl::Persistable for BaseNetworkSocketSetIpv6TrafficClassRequest {}
695
696#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
697pub struct BaseNetworkSocketSetIpv6UnicastHopsRequest {
698 pub value: OptionalUint8,
699}
700
701impl fidl::Persistable for BaseNetworkSocketSetIpv6UnicastHopsRequest {}
702
703#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
704pub struct BaseNetworkSocketShutdownRequest {
705 pub mode: ShutdownMode,
706}
707
708impl fidl::Persistable for BaseNetworkSocketShutdownRequest {}
709
710#[derive(Clone, Debug, PartialEq)]
711pub struct BaseNetworkSocketGetIpMulticastInterfaceResponse {
712 pub value: fidl_fuchsia_net::Ipv4Address,
713}
714
715impl fidl::Persistable for BaseNetworkSocketGetIpMulticastInterfaceResponse {}
716
717#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
718pub struct BaseNetworkSocketGetIpMulticastLoopbackResponse {
719 pub value: bool,
720}
721
722impl fidl::Persistable for BaseNetworkSocketGetIpMulticastLoopbackResponse {}
723
724#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
725#[repr(C)]
726pub struct BaseNetworkSocketGetIpMulticastTtlResponse {
727 pub value: u8,
728}
729
730impl fidl::Persistable for BaseNetworkSocketGetIpMulticastTtlResponse {}
731
732#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
733pub struct BaseNetworkSocketGetIpPacketInfoResponse {
734 pub value: bool,
735}
736
737impl fidl::Persistable for BaseNetworkSocketGetIpPacketInfoResponse {}
738
739#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
740pub struct BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {
741 pub value: bool,
742}
743
744impl fidl::Persistable for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse {}
745
746#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
747pub struct BaseNetworkSocketGetIpReceiveTtlResponse {
748 pub value: bool,
749}
750
751impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTtlResponse {}
752
753#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
754pub struct BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
755 pub value: bool,
756}
757
758impl fidl::Persistable for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {}
759
760#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
761pub struct BaseNetworkSocketGetIpTransparentResponse {
762 pub value: bool,
763}
764
765impl fidl::Persistable for BaseNetworkSocketGetIpTransparentResponse {}
766
767#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
768#[repr(C)]
769pub struct BaseNetworkSocketGetIpTtlResponse {
770 pub value: u8,
771}
772
773impl fidl::Persistable for BaseNetworkSocketGetIpTtlResponse {}
774
775#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
776#[repr(C)]
777pub struct BaseNetworkSocketGetIpTypeOfServiceResponse {
778 pub value: u8,
779}
780
781impl fidl::Persistable for BaseNetworkSocketGetIpTypeOfServiceResponse {}
782
783#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
784#[repr(C)]
785pub struct BaseNetworkSocketGetIpv6MulticastHopsResponse {
786 pub value: u8,
787}
788
789impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastHopsResponse {}
790
791#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
792#[repr(C)]
793pub struct BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
794 pub value: u64,
795}
796
797impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {}
798
799#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
800pub struct BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
801 pub value: bool,
802}
803
804impl fidl::Persistable for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {}
805
806#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
807pub struct BaseNetworkSocketGetIpv6OnlyResponse {
808 pub value: bool,
809}
810
811impl fidl::Persistable for BaseNetworkSocketGetIpv6OnlyResponse {}
812
813#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
814pub struct BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
815 pub value: bool,
816}
817
818impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {}
819
820#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
821pub struct BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
822 pub value: bool,
823}
824
825impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {}
826
827#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
828pub struct BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
829 pub value: bool,
830}
831
832impl fidl::Persistable for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {}
833
834#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
835#[repr(C)]
836pub struct BaseNetworkSocketGetIpv6TrafficClassResponse {
837 pub value: u8,
838}
839
840impl fidl::Persistable for BaseNetworkSocketGetIpv6TrafficClassResponse {}
841
842#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
843#[repr(C)]
844pub struct BaseNetworkSocketGetIpv6UnicastHopsResponse {
845 pub value: u8,
846}
847
848impl fidl::Persistable for BaseNetworkSocketGetIpv6UnicastHopsResponse {}
849
850#[derive(Clone, Debug, PartialEq)]
851pub struct BaseNetworkSocketGetOriginalDestinationResponse {
852 pub value: fidl_fuchsia_net::SocketAddress,
853}
854
855impl fidl::Persistable for BaseNetworkSocketGetOriginalDestinationResponse {}
856
857#[derive(Clone, Debug, PartialEq)]
858pub struct BaseNetworkSocketGetPeerNameResponse {
859 pub addr: fidl_fuchsia_net::SocketAddress,
860}
861
862impl fidl::Persistable for BaseNetworkSocketGetPeerNameResponse {}
863
864#[derive(Clone, Debug, PartialEq)]
865pub struct BaseNetworkSocketGetSockNameResponse {
866 pub addr: fidl_fuchsia_net::SocketAddress,
867}
868
869impl fidl::Persistable for BaseNetworkSocketGetSockNameResponse {}
870
871#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
872pub struct BaseSocketGetMarkRequest {
873 pub domain: fidl_fuchsia_net::MarkDomain,
874}
875
876impl fidl::Persistable for BaseSocketGetMarkRequest {}
877
878#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
879pub struct BaseSocketSetBindToDeviceRequest {
880 pub value: String,
881}
882
883impl fidl::Persistable for BaseSocketSetBindToDeviceRequest {}
884
885#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
886#[repr(C)]
887pub struct BaseSocketSetBindToInterfaceIndexRequest {
888 pub value: u64,
889}
890
891impl fidl::Persistable for BaseSocketSetBindToInterfaceIndexRequest {}
892
893#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
894pub struct BaseSocketSetBroadcastRequest {
895 pub value: bool,
896}
897
898impl fidl::Persistable for BaseSocketSetBroadcastRequest {}
899
900#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
901pub struct BaseSocketSetKeepAliveRequest {
902 pub value: bool,
903}
904
905impl fidl::Persistable for BaseSocketSetKeepAliveRequest {}
906
907#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
908pub struct BaseSocketSetLingerRequest {
909 pub linger: bool,
910 pub length_secs: u32,
911}
912
913impl fidl::Persistable for BaseSocketSetLingerRequest {}
914
915#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
916pub struct BaseSocketSetMarkRequest {
917 pub domain: fidl_fuchsia_net::MarkDomain,
918 pub mark: OptionalUint32,
919}
920
921impl fidl::Persistable for BaseSocketSetMarkRequest {}
922
923#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
924pub struct BaseSocketSetNoCheckRequest {
925 pub value: bool,
926}
927
928impl fidl::Persistable for BaseSocketSetNoCheckRequest {}
929
930#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
931pub struct BaseSocketSetOutOfBandInlineRequest {
932 pub value: bool,
933}
934
935impl fidl::Persistable for BaseSocketSetOutOfBandInlineRequest {}
936
937#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
938#[repr(C)]
939pub struct BaseSocketSetReceiveBufferRequest {
940 pub value_bytes: u64,
941}
942
943impl fidl::Persistable for BaseSocketSetReceiveBufferRequest {}
944
945#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
946pub struct BaseSocketSetReuseAddressRequest {
947 pub value: bool,
948}
949
950impl fidl::Persistable for BaseSocketSetReuseAddressRequest {}
951
952#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
953pub struct BaseSocketSetReusePortRequest {
954 pub value: bool,
955}
956
957impl fidl::Persistable for BaseSocketSetReusePortRequest {}
958
959#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
960#[repr(C)]
961pub struct BaseSocketSetSendBufferRequest {
962 pub value_bytes: u64,
963}
964
965impl fidl::Persistable for BaseSocketSetSendBufferRequest {}
966
967#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
968pub struct BaseSocketSetTimestampRequest {
969 pub value: TimestampOption,
970}
971
972impl fidl::Persistable for BaseSocketSetTimestampRequest {}
973
974#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
975pub struct BaseSocketGetAcceptConnResponse {
976 pub value: bool,
977}
978
979impl fidl::Persistable for BaseSocketGetAcceptConnResponse {}
980
981#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
982pub struct BaseSocketGetBindToDeviceResponse {
983 pub value: String,
984}
985
986impl fidl::Persistable for BaseSocketGetBindToDeviceResponse {}
987
988#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
989#[repr(C)]
990pub struct BaseSocketGetBindToInterfaceIndexResponse {
991 pub value: u64,
992}
993
994impl fidl::Persistable for BaseSocketGetBindToInterfaceIndexResponse {}
995
996#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
997pub struct BaseSocketGetBroadcastResponse {
998 pub value: bool,
999}
1000
1001impl fidl::Persistable for BaseSocketGetBroadcastResponse {}
1002
1003#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1004pub struct BaseSocketGetKeepAliveResponse {
1005 pub value: bool,
1006}
1007
1008impl fidl::Persistable for BaseSocketGetKeepAliveResponse {}
1009
1010#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1011pub struct BaseSocketGetLingerResponse {
1012 pub linger: bool,
1013 pub length_secs: u32,
1014}
1015
1016impl fidl::Persistable for BaseSocketGetLingerResponse {}
1017
1018#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1019pub struct BaseSocketGetMarkResponse {
1020 pub mark: OptionalUint32,
1021}
1022
1023impl fidl::Persistable for BaseSocketGetMarkResponse {}
1024
1025#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1026pub struct BaseSocketGetNoCheckResponse {
1027 pub value: bool,
1028}
1029
1030impl fidl::Persistable for BaseSocketGetNoCheckResponse {}
1031
1032#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1033pub struct BaseSocketGetOutOfBandInlineResponse {
1034 pub value: bool,
1035}
1036
1037impl fidl::Persistable for BaseSocketGetOutOfBandInlineResponse {}
1038
1039#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1040#[repr(C)]
1041pub struct BaseSocketGetReceiveBufferResponse {
1042 pub value_bytes: u64,
1043}
1044
1045impl fidl::Persistable for BaseSocketGetReceiveBufferResponse {}
1046
1047#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1048pub struct BaseSocketGetReuseAddressResponse {
1049 pub value: bool,
1050}
1051
1052impl fidl::Persistable for BaseSocketGetReuseAddressResponse {}
1053
1054#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1055pub struct BaseSocketGetReusePortResponse {
1056 pub value: bool,
1057}
1058
1059impl fidl::Persistable for BaseSocketGetReusePortResponse {}
1060
1061#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1062#[repr(C)]
1063pub struct BaseSocketGetSendBufferResponse {
1064 pub value_bytes: u64,
1065}
1066
1067impl fidl::Persistable for BaseSocketGetSendBufferResponse {}
1068
1069#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1070pub struct BaseSocketGetTimestampResponse {
1071 pub value: TimestampOption,
1072}
1073
1074impl fidl::Persistable for BaseSocketGetTimestampResponse {}
1075
1076#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1077pub struct Empty;
1078
1079impl fidl::Persistable for Empty {}
1080
1081#[derive(Clone, Debug, PartialEq)]
1083pub struct IpMulticastMembership {
1084 pub iface: u64,
1086 pub local_addr: fidl_fuchsia_net::Ipv4Address,
1088 pub mcast_addr: fidl_fuchsia_net::Ipv4Address,
1090}
1091
1092impl fidl::Persistable for IpMulticastMembership {}
1093
1094#[derive(Clone, Debug, PartialEq)]
1096pub struct Ipv6MulticastMembership {
1097 pub iface: u64,
1099 pub mcast_addr: fidl_fuchsia_net::Ipv6Address,
1101}
1102
1103impl fidl::Persistable for Ipv6MulticastMembership {}
1104
1105#[derive(Clone, Debug, PartialEq)]
1106pub struct Ipv6PktInfoRecvControlData {
1107 pub iface: u64,
1109 pub header_destination_addr: fidl_fuchsia_net::Ipv6Address,
1112}
1113
1114impl fidl::Persistable for Ipv6PktInfoRecvControlData {}
1115
1116#[derive(Clone, Debug, PartialEq)]
1121pub struct Ipv6PktInfoSendControlData {
1122 pub iface: u64,
1127 pub local_addr: fidl_fuchsia_net::Ipv6Address,
1133}
1134
1135impl fidl::Persistable for Ipv6PktInfoSendControlData {}
1136
1137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1138pub struct ProviderDatagramSocketDeprecatedRequest {
1139 pub domain: Domain,
1140 pub proto: DatagramSocketProtocol,
1141}
1142
1143impl fidl::Persistable for ProviderDatagramSocketDeprecatedRequest {}
1144
1145#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1146pub struct ProviderDatagramSocketRequest {
1147 pub domain: Domain,
1148 pub proto: DatagramSocketProtocol,
1149}
1150
1151impl fidl::Persistable for ProviderDatagramSocketRequest {}
1152
1153#[derive(Clone, Debug, PartialEq)]
1154pub struct ProviderDatagramSocketWithOptionsRequest {
1155 pub domain: Domain,
1156 pub proto: DatagramSocketProtocol,
1157 pub opts: SocketCreationOptions,
1158}
1159
1160impl fidl::Persistable for ProviderDatagramSocketWithOptionsRequest {}
1161
1162#[derive(Clone, Debug, PartialEq)]
1163pub struct ProviderGetInterfaceAddressesResponse {
1164 pub interfaces: Vec<InterfaceAddresses>,
1165}
1166
1167impl fidl::Persistable for ProviderGetInterfaceAddressesResponse {}
1168
1169#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1170#[repr(C)]
1171pub struct ProviderInterfaceIndexToNameRequest {
1172 pub index: u64,
1173}
1174
1175impl fidl::Persistable for ProviderInterfaceIndexToNameRequest {}
1176
1177#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1178pub struct ProviderInterfaceNameToFlagsRequest {
1179 pub name: String,
1180}
1181
1182impl fidl::Persistable for ProviderInterfaceNameToFlagsRequest {}
1183
1184#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1185pub struct ProviderInterfaceNameToIndexRequest {
1186 pub name: String,
1187}
1188
1189impl fidl::Persistable for ProviderInterfaceNameToIndexRequest {}
1190
1191#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1192pub struct ProviderStreamSocketRequest {
1193 pub domain: Domain,
1194 pub proto: StreamSocketProtocol,
1195}
1196
1197impl fidl::Persistable for ProviderStreamSocketRequest {}
1198
1199#[derive(Clone, Debug, PartialEq)]
1200pub struct ProviderStreamSocketWithOptionsRequest {
1201 pub domain: Domain,
1202 pub proto: StreamSocketProtocol,
1203 pub opts: SocketCreationOptions,
1204}
1205
1206impl fidl::Persistable for ProviderStreamSocketWithOptionsRequest {}
1207
1208#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1209pub struct ProviderInterfaceIndexToNameResponse {
1210 pub name: String,
1211}
1212
1213impl fidl::Persistable for ProviderInterfaceIndexToNameResponse {}
1214
1215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1216pub struct ProviderInterfaceNameToFlagsResponse {
1217 pub flags: InterfaceFlags,
1218}
1219
1220impl fidl::Persistable for ProviderInterfaceNameToFlagsResponse {}
1221
1222#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1223#[repr(C)]
1224pub struct ProviderInterfaceNameToIndexResponse {
1225 pub index: u64,
1226}
1227
1228impl fidl::Persistable for ProviderInterfaceNameToIndexResponse {}
1229
1230#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1231pub struct StreamSocketAcceptRequest {
1232 pub want_addr: bool,
1233}
1234
1235impl fidl::Persistable for StreamSocketAcceptRequest {}
1236
1237#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1238#[repr(C)]
1239pub struct StreamSocketListenRequest {
1240 pub backlog: i16,
1241}
1242
1243impl fidl::Persistable for StreamSocketListenRequest {}
1244
1245#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1246pub struct StreamSocketSetTcpCongestionRequest {
1247 pub value: TcpCongestionControl,
1248}
1249
1250impl fidl::Persistable for StreamSocketSetTcpCongestionRequest {}
1251
1252#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1253pub struct StreamSocketSetTcpCorkRequest {
1254 pub value: bool,
1255}
1256
1257impl fidl::Persistable for StreamSocketSetTcpCorkRequest {}
1258
1259#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1260#[repr(C)]
1261pub struct StreamSocketSetTcpDeferAcceptRequest {
1262 pub value_secs: u32,
1263}
1264
1265impl fidl::Persistable for StreamSocketSetTcpDeferAcceptRequest {}
1266
1267#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1268#[repr(C)]
1269pub struct StreamSocketSetTcpKeepAliveCountRequest {
1270 pub value: u32,
1271}
1272
1273impl fidl::Persistable for StreamSocketSetTcpKeepAliveCountRequest {}
1274
1275#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1276#[repr(C)]
1277pub struct StreamSocketSetTcpKeepAliveIdleRequest {
1278 pub value_secs: u32,
1279}
1280
1281impl fidl::Persistable for StreamSocketSetTcpKeepAliveIdleRequest {}
1282
1283#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1284#[repr(C)]
1285pub struct StreamSocketSetTcpKeepAliveIntervalRequest {
1286 pub value_secs: u32,
1287}
1288
1289impl fidl::Persistable for StreamSocketSetTcpKeepAliveIntervalRequest {}
1290
1291#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1292pub struct StreamSocketSetTcpLingerRequest {
1293 pub value_secs: OptionalUint32,
1294}
1295
1296impl fidl::Persistable for StreamSocketSetTcpLingerRequest {}
1297
1298#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1299#[repr(C)]
1300pub struct StreamSocketSetTcpMaxSegmentRequest {
1301 pub value_bytes: u32,
1302}
1303
1304impl fidl::Persistable for StreamSocketSetTcpMaxSegmentRequest {}
1305
1306#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1307pub struct StreamSocketSetTcpNoDelayRequest {
1308 pub value: bool,
1309}
1310
1311impl fidl::Persistable for StreamSocketSetTcpNoDelayRequest {}
1312
1313#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1314pub struct StreamSocketSetTcpQuickAckRequest {
1315 pub value: bool,
1316}
1317
1318impl fidl::Persistable for StreamSocketSetTcpQuickAckRequest {}
1319
1320#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1321#[repr(C)]
1322pub struct StreamSocketSetTcpSynCountRequest {
1323 pub value: u32,
1324}
1325
1326impl fidl::Persistable for StreamSocketSetTcpSynCountRequest {}
1327
1328#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1329#[repr(C)]
1330pub struct StreamSocketSetTcpUserTimeoutRequest {
1331 pub value_millis: u32,
1332}
1333
1334impl fidl::Persistable for StreamSocketSetTcpUserTimeoutRequest {}
1335
1336#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1337#[repr(C)]
1338pub struct StreamSocketSetTcpWindowClampRequest {
1339 pub value: u32,
1340}
1341
1342impl fidl::Persistable for StreamSocketSetTcpWindowClampRequest {}
1343
1344#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1345pub struct StreamSocketGetInfoResponse {
1346 pub domain: Domain,
1347 pub proto: StreamSocketProtocol,
1348}
1349
1350impl fidl::Persistable for StreamSocketGetInfoResponse {}
1351
1352#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1353pub struct StreamSocketGetTcpCongestionResponse {
1354 pub value: TcpCongestionControl,
1355}
1356
1357impl fidl::Persistable for StreamSocketGetTcpCongestionResponse {}
1358
1359#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1360pub struct StreamSocketGetTcpCorkResponse {
1361 pub value: bool,
1362}
1363
1364impl fidl::Persistable for StreamSocketGetTcpCorkResponse {}
1365
1366#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1367#[repr(C)]
1368pub struct StreamSocketGetTcpDeferAcceptResponse {
1369 pub value_secs: u32,
1370}
1371
1372impl fidl::Persistable for StreamSocketGetTcpDeferAcceptResponse {}
1373
1374#[derive(Clone, Debug, PartialEq)]
1375pub struct StreamSocketGetTcpInfoResponse {
1376 pub info: TcpInfo,
1377}
1378
1379impl fidl::Persistable for StreamSocketGetTcpInfoResponse {}
1380
1381#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1382#[repr(C)]
1383pub struct StreamSocketGetTcpKeepAliveCountResponse {
1384 pub value: u32,
1385}
1386
1387impl fidl::Persistable for StreamSocketGetTcpKeepAliveCountResponse {}
1388
1389#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1390#[repr(C)]
1391pub struct StreamSocketGetTcpKeepAliveIdleResponse {
1392 pub value_secs: u32,
1393}
1394
1395impl fidl::Persistable for StreamSocketGetTcpKeepAliveIdleResponse {}
1396
1397#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1398#[repr(C)]
1399pub struct StreamSocketGetTcpKeepAliveIntervalResponse {
1400 pub value_secs: u32,
1401}
1402
1403impl fidl::Persistable for StreamSocketGetTcpKeepAliveIntervalResponse {}
1404
1405#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1406pub struct StreamSocketGetTcpLingerResponse {
1407 pub value_secs: OptionalUint32,
1408}
1409
1410impl fidl::Persistable for StreamSocketGetTcpLingerResponse {}
1411
1412#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1413#[repr(C)]
1414pub struct StreamSocketGetTcpMaxSegmentResponse {
1415 pub value_bytes: u32,
1416}
1417
1418impl fidl::Persistable for StreamSocketGetTcpMaxSegmentResponse {}
1419
1420#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1421pub struct StreamSocketGetTcpNoDelayResponse {
1422 pub value: bool,
1423}
1424
1425impl fidl::Persistable for StreamSocketGetTcpNoDelayResponse {}
1426
1427#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1428pub struct StreamSocketGetTcpQuickAckResponse {
1429 pub value: bool,
1430}
1431
1432impl fidl::Persistable for StreamSocketGetTcpQuickAckResponse {}
1433
1434#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1435#[repr(C)]
1436pub struct StreamSocketGetTcpSynCountResponse {
1437 pub value: u32,
1438}
1439
1440impl fidl::Persistable for StreamSocketGetTcpSynCountResponse {}
1441
1442#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1443#[repr(C)]
1444pub struct StreamSocketGetTcpUserTimeoutResponse {
1445 pub value_millis: u32,
1446}
1447
1448impl fidl::Persistable for StreamSocketGetTcpUserTimeoutResponse {}
1449
1450#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1451#[repr(C)]
1452pub struct StreamSocketGetTcpWindowClampResponse {
1453 pub value: u32,
1454}
1455
1456impl fidl::Persistable for StreamSocketGetTcpWindowClampResponse {}
1457
1458#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1459pub struct SynchronousDatagramSocketRecvMsgRequest {
1460 pub want_addr: bool,
1461 pub data_len: u32,
1462 pub want_control: bool,
1463 pub flags: RecvMsgFlags,
1464}
1465
1466impl fidl::Persistable for SynchronousDatagramSocketRecvMsgRequest {}
1467
1468#[derive(Clone, Debug, PartialEq)]
1469pub struct SynchronousDatagramSocketSendMsgRequest {
1470 pub addr: Option<Box<fidl_fuchsia_net::SocketAddress>>,
1471 pub data: Vec<u8>,
1472 pub control: DatagramSocketSendControlData,
1473 pub flags: SendMsgFlags,
1474}
1475
1476impl fidl::Persistable for SynchronousDatagramSocketSendMsgRequest {}
1477
1478#[derive(Clone, Debug, PartialEq)]
1479pub struct SynchronousDatagramSocketRecvMsgResponse {
1480 pub addr: Option<Box<fidl_fuchsia_net::SocketAddress>>,
1481 pub data: Vec<u8>,
1482 pub control: DatagramSocketRecvControlData,
1483 pub truncated: u32,
1484}
1485
1486impl fidl::Persistable for SynchronousDatagramSocketRecvMsgResponse {}
1487
1488#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1489#[repr(C)]
1490pub struct SynchronousDatagramSocketSendMsgResponse {
1491 pub len: i64,
1492}
1493
1494impl fidl::Persistable for SynchronousDatagramSocketSendMsgResponse {}
1495
1496#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1497pub struct Timestamp {
1498 pub nanoseconds: i64,
1500 pub requested: TimestampOption,
1503}
1504
1505impl fidl::Persistable for Timestamp {}
1506
1507#[derive(Clone, Debug, Default, PartialEq)]
1508pub struct DatagramSocketRecvControlData {
1509 pub network: Option<NetworkSocketRecvControlData>,
1511 #[doc(hidden)]
1512 pub __source_breaking: fidl::marker::SourceBreaking,
1513}
1514
1515impl fidl::Persistable for DatagramSocketRecvControlData {}
1516
1517#[derive(Clone, Debug, Default, PartialEq)]
1518pub struct DatagramSocketSendControlData {
1519 pub network: Option<NetworkSocketSendControlData>,
1521 #[doc(hidden)]
1522 pub __source_breaking: fidl::marker::SourceBreaking,
1523}
1524
1525impl fidl::Persistable for DatagramSocketSendControlData {}
1526
1527#[derive(Clone, Debug, Default, PartialEq)]
1528pub struct DatagramSocketSendMsgPreflightRequest {
1529 pub to: Option<fidl_fuchsia_net::SocketAddress>,
1536 pub ipv6_pktinfo: Option<Ipv6PktInfoSendControlData>,
1542 #[doc(hidden)]
1543 pub __source_breaking: fidl::marker::SourceBreaking,
1544}
1545
1546impl fidl::Persistable for DatagramSocketSendMsgPreflightRequest {}
1547
1548#[derive(Clone, Debug, Default, PartialEq)]
1550pub struct InterfaceAddresses {
1551 pub id: Option<u64>,
1553 pub name: Option<String>,
1555 pub addresses: Option<Vec<fidl_fuchsia_net::Subnet>>,
1557 pub interface_flags: Option<InterfaceFlags>,
1560 #[doc(hidden)]
1561 pub __source_breaking: fidl::marker::SourceBreaking,
1562}
1563
1564impl fidl::Persistable for InterfaceAddresses {}
1565
1566#[derive(Clone, Debug, Default, PartialEq)]
1567pub struct IpRecvControlData {
1568 pub tos: Option<u8>,
1572 pub ttl: Option<u8>,
1576 pub original_destination_address: Option<fidl_fuchsia_net::SocketAddress>,
1580 #[doc(hidden)]
1581 pub __source_breaking: fidl::marker::SourceBreaking,
1582}
1583
1584impl fidl::Persistable for IpRecvControlData {}
1585
1586#[derive(Clone, Debug, Default, PartialEq)]
1587pub struct IpSendControlData {
1588 pub ttl: Option<u8>,
1591 #[doc(hidden)]
1592 pub __source_breaking: fidl::marker::SourceBreaking,
1593}
1594
1595impl fidl::Persistable for IpSendControlData {}
1596
1597#[derive(Clone, Debug, Default, PartialEq)]
1598pub struct Ipv6RecvControlData {
1599 pub tclass: Option<u8>,
1603 pub hoplimit: Option<u8>,
1607 pub pktinfo: Option<Ipv6PktInfoRecvControlData>,
1611 #[doc(hidden)]
1612 pub __source_breaking: fidl::marker::SourceBreaking,
1613}
1614
1615impl fidl::Persistable for Ipv6RecvControlData {}
1616
1617#[derive(Clone, Debug, Default, PartialEq)]
1618pub struct Ipv6SendControlData {
1619 pub hoplimit: Option<u8>,
1622 pub pktinfo: Option<Ipv6PktInfoSendControlData>,
1625 #[doc(hidden)]
1626 pub __source_breaking: fidl::marker::SourceBreaking,
1627}
1628
1629impl fidl::Persistable for Ipv6SendControlData {}
1630
1631#[derive(Clone, Debug, Default, PartialEq)]
1633pub struct NetworkSocketRecvControlData {
1634 pub socket: Option<SocketRecvControlData>,
1636 pub ip: Option<IpRecvControlData>,
1640 pub ipv6: Option<Ipv6RecvControlData>,
1644 #[doc(hidden)]
1645 pub __source_breaking: fidl::marker::SourceBreaking,
1646}
1647
1648impl fidl::Persistable for NetworkSocketRecvControlData {}
1649
1650#[derive(Clone, Debug, Default, PartialEq)]
1652pub struct NetworkSocketSendControlData {
1653 pub socket: Option<SocketSendControlData>,
1655 pub ip: Option<IpSendControlData>,
1659 pub ipv6: Option<Ipv6SendControlData>,
1663 #[doc(hidden)]
1664 pub __source_breaking: fidl::marker::SourceBreaking,
1665}
1666
1667impl fidl::Persistable for NetworkSocketSendControlData {}
1668
1669#[derive(Clone, Debug, Default, PartialEq)]
1671pub struct RecvMsgMeta {
1672 pub from: Option<fidl_fuchsia_net::SocketAddress>,
1674 pub control: Option<DatagramSocketRecvControlData>,
1676 pub payload_len: Option<u16>,
1678 #[doc(hidden)]
1679 pub __source_breaking: fidl::marker::SourceBreaking,
1680}
1681
1682impl fidl::Persistable for RecvMsgMeta {}
1683
1684#[derive(Clone, Debug, Default, PartialEq)]
1686pub struct SendMsgMeta {
1687 pub to: Option<fidl_fuchsia_net::SocketAddress>,
1689 pub control: Option<DatagramSocketSendControlData>,
1691 #[doc(hidden)]
1692 pub __source_breaking: fidl::marker::SourceBreaking,
1693}
1694
1695impl fidl::Persistable for SendMsgMeta {}
1696
1697#[derive(Clone, Debug, Default, PartialEq)]
1699pub struct SocketCreationOptions {
1700 pub marks: Option<fidl_fuchsia_net::Marks>,
1703 #[doc(hidden)]
1704 pub __source_breaking: fidl::marker::SourceBreaking,
1705}
1706
1707impl fidl::Persistable for SocketCreationOptions {}
1708
1709#[derive(Clone, Debug, Default, PartialEq)]
1713pub struct SocketRecvControlData {
1714 pub timestamp: Option<Timestamp>,
1716 #[doc(hidden)]
1717 pub __source_breaking: fidl::marker::SourceBreaking,
1718}
1719
1720impl fidl::Persistable for SocketRecvControlData {}
1721
1722#[derive(Clone, Debug, Default, PartialEq)]
1726pub struct SocketSendControlData {
1727 #[doc(hidden)]
1728 pub __source_breaking: fidl::marker::SourceBreaking,
1729}
1730
1731impl fidl::Persistable for SocketSendControlData {}
1732
1733#[derive(Clone, Debug, Default, PartialEq)]
1735pub struct TcpInfo {
1736 pub state: Option<TcpState>,
1737 pub ca_state: Option<TcpCongestionControlState>,
1738 pub rto_usec: Option<u32>,
1739 pub rtt_usec: Option<u32>,
1740 pub rtt_var_usec: Option<u32>,
1741 pub snd_ssthresh: Option<u32>,
1742 pub snd_cwnd: Option<u32>,
1743 pub reorder_seen: Option<bool>,
1744 #[doc(hidden)]
1745 pub __source_breaking: fidl::marker::SourceBreaking,
1746}
1747
1748impl fidl::Persistable for TcpInfo {}
1749
1750#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1752pub enum OptionalUint32 {
1753 Value(u32),
1754 Unset(Empty),
1755}
1756
1757impl OptionalUint32 {
1758 #[inline]
1759 pub fn ordinal(&self) -> u64 {
1760 match *self {
1761 Self::Value(_) => 1,
1762 Self::Unset(_) => 2,
1763 }
1764 }
1765
1766 #[deprecated = "Strict unions should not use `is_unknown`"]
1767 #[inline]
1768 pub fn is_unknown(&self) -> bool {
1769 false
1770 }
1771}
1772
1773impl fidl::Persistable for OptionalUint32 {}
1774
1775#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1777pub enum OptionalUint8 {
1778 Value(u8),
1779 Unset(Empty),
1780}
1781
1782impl OptionalUint8 {
1783 #[inline]
1784 pub fn ordinal(&self) -> u64 {
1785 match *self {
1786 Self::Value(_) => 1,
1787 Self::Unset(_) => 2,
1788 }
1789 }
1790
1791 #[deprecated = "Strict unions should not use `is_unknown`"]
1792 #[inline]
1793 pub fn is_unknown(&self) -> bool {
1794 false
1795 }
1796}
1797
1798impl fidl::Persistable for OptionalUint8 {}
1799
1800mod internal {
1801 use super::*;
1802 unsafe impl fidl::encoding::TypeMarker for CmsgRequests {
1803 type Owned = Self;
1804
1805 #[inline(always)]
1806 fn inline_align(_context: fidl::encoding::Context) -> usize {
1807 4
1808 }
1809
1810 #[inline(always)]
1811 fn inline_size(_context: fidl::encoding::Context) -> usize {
1812 4
1813 }
1814 }
1815
1816 impl fidl::encoding::ValueTypeMarker for CmsgRequests {
1817 type Borrowed<'a> = Self;
1818 #[inline(always)]
1819 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1820 *value
1821 }
1822 }
1823
1824 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CmsgRequests {
1825 #[inline]
1826 unsafe fn encode(
1827 self,
1828 encoder: &mut fidl::encoding::Encoder<'_, D>,
1829 offset: usize,
1830 _depth: fidl::encoding::Depth,
1831 ) -> fidl::Result<()> {
1832 encoder.debug_check_bounds::<Self>(offset);
1833 encoder.write_num(self.bits(), offset);
1834 Ok(())
1835 }
1836 }
1837
1838 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CmsgRequests {
1839 #[inline(always)]
1840 fn new_empty() -> Self {
1841 Self::empty()
1842 }
1843
1844 #[inline]
1845 unsafe fn decode(
1846 &mut self,
1847 decoder: &mut fidl::encoding::Decoder<'_, D>,
1848 offset: usize,
1849 _depth: fidl::encoding::Depth,
1850 ) -> fidl::Result<()> {
1851 decoder.debug_check_bounds::<Self>(offset);
1852 let prim = decoder.read_num::<u32>(offset);
1853 *self = Self::from_bits_allow_unknown(prim);
1854 Ok(())
1855 }
1856 }
1857 unsafe impl fidl::encoding::TypeMarker for InterfaceFlags {
1858 type Owned = Self;
1859
1860 #[inline(always)]
1861 fn inline_align(_context: fidl::encoding::Context) -> usize {
1862 2
1863 }
1864
1865 #[inline(always)]
1866 fn inline_size(_context: fidl::encoding::Context) -> usize {
1867 2
1868 }
1869 }
1870
1871 impl fidl::encoding::ValueTypeMarker for InterfaceFlags {
1872 type Borrowed<'a> = Self;
1873 #[inline(always)]
1874 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1875 *value
1876 }
1877 }
1878
1879 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for InterfaceFlags {
1880 #[inline]
1881 unsafe fn encode(
1882 self,
1883 encoder: &mut fidl::encoding::Encoder<'_, D>,
1884 offset: usize,
1885 _depth: fidl::encoding::Depth,
1886 ) -> fidl::Result<()> {
1887 encoder.debug_check_bounds::<Self>(offset);
1888 if self.bits() & Self::all().bits() != self.bits() {
1889 return Err(fidl::Error::InvalidBitsValue);
1890 }
1891 encoder.write_num(self.bits(), offset);
1892 Ok(())
1893 }
1894 }
1895
1896 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceFlags {
1897 #[inline(always)]
1898 fn new_empty() -> Self {
1899 Self::empty()
1900 }
1901
1902 #[inline]
1903 unsafe fn decode(
1904 &mut self,
1905 decoder: &mut fidl::encoding::Decoder<'_, D>,
1906 offset: usize,
1907 _depth: fidl::encoding::Depth,
1908 ) -> fidl::Result<()> {
1909 decoder.debug_check_bounds::<Self>(offset);
1910 let prim = decoder.read_num::<u16>(offset);
1911 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1912 Ok(())
1913 }
1914 }
1915 unsafe impl fidl::encoding::TypeMarker for RecvMsgFlags {
1916 type Owned = Self;
1917
1918 #[inline(always)]
1919 fn inline_align(_context: fidl::encoding::Context) -> usize {
1920 2
1921 }
1922
1923 #[inline(always)]
1924 fn inline_size(_context: fidl::encoding::Context) -> usize {
1925 2
1926 }
1927 }
1928
1929 impl fidl::encoding::ValueTypeMarker for RecvMsgFlags {
1930 type Borrowed<'a> = Self;
1931 #[inline(always)]
1932 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1933 *value
1934 }
1935 }
1936
1937 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RecvMsgFlags {
1938 #[inline]
1939 unsafe fn encode(
1940 self,
1941 encoder: &mut fidl::encoding::Encoder<'_, D>,
1942 offset: usize,
1943 _depth: fidl::encoding::Depth,
1944 ) -> fidl::Result<()> {
1945 encoder.debug_check_bounds::<Self>(offset);
1946 if self.bits() & Self::all().bits() != self.bits() {
1947 return Err(fidl::Error::InvalidBitsValue);
1948 }
1949 encoder.write_num(self.bits(), offset);
1950 Ok(())
1951 }
1952 }
1953
1954 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgFlags {
1955 #[inline(always)]
1956 fn new_empty() -> Self {
1957 Self::empty()
1958 }
1959
1960 #[inline]
1961 unsafe fn decode(
1962 &mut self,
1963 decoder: &mut fidl::encoding::Decoder<'_, D>,
1964 offset: usize,
1965 _depth: fidl::encoding::Depth,
1966 ) -> fidl::Result<()> {
1967 decoder.debug_check_bounds::<Self>(offset);
1968 let prim = decoder.read_num::<u16>(offset);
1969 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1970 Ok(())
1971 }
1972 }
1973 unsafe impl fidl::encoding::TypeMarker for SendMsgFlags {
1974 type Owned = Self;
1975
1976 #[inline(always)]
1977 fn inline_align(_context: fidl::encoding::Context) -> usize {
1978 2
1979 }
1980
1981 #[inline(always)]
1982 fn inline_size(_context: fidl::encoding::Context) -> usize {
1983 2
1984 }
1985 }
1986
1987 impl fidl::encoding::ValueTypeMarker for SendMsgFlags {
1988 type Borrowed<'a> = Self;
1989 #[inline(always)]
1990 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1991 *value
1992 }
1993 }
1994
1995 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SendMsgFlags {
1996 #[inline]
1997 unsafe fn encode(
1998 self,
1999 encoder: &mut fidl::encoding::Encoder<'_, D>,
2000 offset: usize,
2001 _depth: fidl::encoding::Depth,
2002 ) -> fidl::Result<()> {
2003 encoder.debug_check_bounds::<Self>(offset);
2004 if self.bits() & Self::all().bits() != self.bits() {
2005 return Err(fidl::Error::InvalidBitsValue);
2006 }
2007 encoder.write_num(self.bits(), offset);
2008 Ok(())
2009 }
2010 }
2011
2012 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgFlags {
2013 #[inline(always)]
2014 fn new_empty() -> Self {
2015 Self::empty()
2016 }
2017
2018 #[inline]
2019 unsafe fn decode(
2020 &mut self,
2021 decoder: &mut fidl::encoding::Decoder<'_, D>,
2022 offset: usize,
2023 _depth: fidl::encoding::Depth,
2024 ) -> fidl::Result<()> {
2025 decoder.debug_check_bounds::<Self>(offset);
2026 let prim = decoder.read_num::<u16>(offset);
2027 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2028 Ok(())
2029 }
2030 }
2031 unsafe impl fidl::encoding::TypeMarker for ShutdownMode {
2032 type Owned = Self;
2033
2034 #[inline(always)]
2035 fn inline_align(_context: fidl::encoding::Context) -> usize {
2036 2
2037 }
2038
2039 #[inline(always)]
2040 fn inline_size(_context: fidl::encoding::Context) -> usize {
2041 2
2042 }
2043 }
2044
2045 impl fidl::encoding::ValueTypeMarker for ShutdownMode {
2046 type Borrowed<'a> = Self;
2047 #[inline(always)]
2048 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2049 *value
2050 }
2051 }
2052
2053 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShutdownMode {
2054 #[inline]
2055 unsafe fn encode(
2056 self,
2057 encoder: &mut fidl::encoding::Encoder<'_, D>,
2058 offset: usize,
2059 _depth: fidl::encoding::Depth,
2060 ) -> fidl::Result<()> {
2061 encoder.debug_check_bounds::<Self>(offset);
2062 if self.bits() & Self::all().bits() != self.bits() {
2063 return Err(fidl::Error::InvalidBitsValue);
2064 }
2065 encoder.write_num(self.bits(), offset);
2066 Ok(())
2067 }
2068 }
2069
2070 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShutdownMode {
2071 #[inline(always)]
2072 fn new_empty() -> Self {
2073 Self::empty()
2074 }
2075
2076 #[inline]
2077 unsafe fn decode(
2078 &mut self,
2079 decoder: &mut fidl::encoding::Decoder<'_, D>,
2080 offset: usize,
2081 _depth: fidl::encoding::Depth,
2082 ) -> fidl::Result<()> {
2083 decoder.debug_check_bounds::<Self>(offset);
2084 let prim = decoder.read_num::<u16>(offset);
2085 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2086 Ok(())
2087 }
2088 }
2089 unsafe impl fidl::encoding::TypeMarker for DatagramSocketProtocol {
2090 type Owned = Self;
2091
2092 #[inline(always)]
2093 fn inline_align(_context: fidl::encoding::Context) -> usize {
2094 std::mem::align_of::<u32>()
2095 }
2096
2097 #[inline(always)]
2098 fn inline_size(_context: fidl::encoding::Context) -> usize {
2099 std::mem::size_of::<u32>()
2100 }
2101
2102 #[inline(always)]
2103 fn encode_is_copy() -> bool {
2104 true
2105 }
2106
2107 #[inline(always)]
2108 fn decode_is_copy() -> bool {
2109 false
2110 }
2111 }
2112
2113 impl fidl::encoding::ValueTypeMarker for DatagramSocketProtocol {
2114 type Borrowed<'a> = Self;
2115 #[inline(always)]
2116 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2117 *value
2118 }
2119 }
2120
2121 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2122 for DatagramSocketProtocol
2123 {
2124 #[inline]
2125 unsafe fn encode(
2126 self,
2127 encoder: &mut fidl::encoding::Encoder<'_, D>,
2128 offset: usize,
2129 _depth: fidl::encoding::Depth,
2130 ) -> fidl::Result<()> {
2131 encoder.debug_check_bounds::<Self>(offset);
2132 encoder.write_num(self.into_primitive(), offset);
2133 Ok(())
2134 }
2135 }
2136
2137 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2138 for DatagramSocketProtocol
2139 {
2140 #[inline(always)]
2141 fn new_empty() -> Self {
2142 Self::Udp
2143 }
2144
2145 #[inline]
2146 unsafe fn decode(
2147 &mut self,
2148 decoder: &mut fidl::encoding::Decoder<'_, D>,
2149 offset: usize,
2150 _depth: fidl::encoding::Depth,
2151 ) -> fidl::Result<()> {
2152 decoder.debug_check_bounds::<Self>(offset);
2153 let prim = decoder.read_num::<u32>(offset);
2154
2155 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2156 Ok(())
2157 }
2158 }
2159 unsafe impl fidl::encoding::TypeMarker for Domain {
2160 type Owned = Self;
2161
2162 #[inline(always)]
2163 fn inline_align(_context: fidl::encoding::Context) -> usize {
2164 std::mem::align_of::<i16>()
2165 }
2166
2167 #[inline(always)]
2168 fn inline_size(_context: fidl::encoding::Context) -> usize {
2169 std::mem::size_of::<i16>()
2170 }
2171
2172 #[inline(always)]
2173 fn encode_is_copy() -> bool {
2174 true
2175 }
2176
2177 #[inline(always)]
2178 fn decode_is_copy() -> bool {
2179 false
2180 }
2181 }
2182
2183 impl fidl::encoding::ValueTypeMarker for Domain {
2184 type Borrowed<'a> = Self;
2185 #[inline(always)]
2186 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2187 *value
2188 }
2189 }
2190
2191 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Domain {
2192 #[inline]
2193 unsafe fn encode(
2194 self,
2195 encoder: &mut fidl::encoding::Encoder<'_, D>,
2196 offset: usize,
2197 _depth: fidl::encoding::Depth,
2198 ) -> fidl::Result<()> {
2199 encoder.debug_check_bounds::<Self>(offset);
2200 encoder.write_num(self.into_primitive(), offset);
2201 Ok(())
2202 }
2203 }
2204
2205 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Domain {
2206 #[inline(always)]
2207 fn new_empty() -> Self {
2208 Self::Ipv4
2209 }
2210
2211 #[inline]
2212 unsafe fn decode(
2213 &mut self,
2214 decoder: &mut fidl::encoding::Decoder<'_, D>,
2215 offset: usize,
2216 _depth: fidl::encoding::Depth,
2217 ) -> fidl::Result<()> {
2218 decoder.debug_check_bounds::<Self>(offset);
2219 let prim = decoder.read_num::<i16>(offset);
2220
2221 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2222 Ok(())
2223 }
2224 }
2225 unsafe impl fidl::encoding::TypeMarker for StreamSocketProtocol {
2226 type Owned = Self;
2227
2228 #[inline(always)]
2229 fn inline_align(_context: fidl::encoding::Context) -> usize {
2230 std::mem::align_of::<u32>()
2231 }
2232
2233 #[inline(always)]
2234 fn inline_size(_context: fidl::encoding::Context) -> usize {
2235 std::mem::size_of::<u32>()
2236 }
2237
2238 #[inline(always)]
2239 fn encode_is_copy() -> bool {
2240 true
2241 }
2242
2243 #[inline(always)]
2244 fn decode_is_copy() -> bool {
2245 false
2246 }
2247 }
2248
2249 impl fidl::encoding::ValueTypeMarker for StreamSocketProtocol {
2250 type Borrowed<'a> = Self;
2251 #[inline(always)]
2252 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2253 *value
2254 }
2255 }
2256
2257 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2258 for StreamSocketProtocol
2259 {
2260 #[inline]
2261 unsafe fn encode(
2262 self,
2263 encoder: &mut fidl::encoding::Encoder<'_, D>,
2264 offset: usize,
2265 _depth: fidl::encoding::Depth,
2266 ) -> fidl::Result<()> {
2267 encoder.debug_check_bounds::<Self>(offset);
2268 encoder.write_num(self.into_primitive(), offset);
2269 Ok(())
2270 }
2271 }
2272
2273 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamSocketProtocol {
2274 #[inline(always)]
2275 fn new_empty() -> Self {
2276 Self::Tcp
2277 }
2278
2279 #[inline]
2280 unsafe fn decode(
2281 &mut self,
2282 decoder: &mut fidl::encoding::Decoder<'_, D>,
2283 offset: usize,
2284 _depth: fidl::encoding::Depth,
2285 ) -> fidl::Result<()> {
2286 decoder.debug_check_bounds::<Self>(offset);
2287 let prim = decoder.read_num::<u32>(offset);
2288
2289 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2290 Ok(())
2291 }
2292 }
2293 unsafe impl fidl::encoding::TypeMarker for TcpCongestionControl {
2294 type Owned = Self;
2295
2296 #[inline(always)]
2297 fn inline_align(_context: fidl::encoding::Context) -> usize {
2298 std::mem::align_of::<u32>()
2299 }
2300
2301 #[inline(always)]
2302 fn inline_size(_context: fidl::encoding::Context) -> usize {
2303 std::mem::size_of::<u32>()
2304 }
2305
2306 #[inline(always)]
2307 fn encode_is_copy() -> bool {
2308 true
2309 }
2310
2311 #[inline(always)]
2312 fn decode_is_copy() -> bool {
2313 false
2314 }
2315 }
2316
2317 impl fidl::encoding::ValueTypeMarker for TcpCongestionControl {
2318 type Borrowed<'a> = Self;
2319 #[inline(always)]
2320 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2321 *value
2322 }
2323 }
2324
2325 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2326 for TcpCongestionControl
2327 {
2328 #[inline]
2329 unsafe fn encode(
2330 self,
2331 encoder: &mut fidl::encoding::Encoder<'_, D>,
2332 offset: usize,
2333 _depth: fidl::encoding::Depth,
2334 ) -> fidl::Result<()> {
2335 encoder.debug_check_bounds::<Self>(offset);
2336 encoder.write_num(self.into_primitive(), offset);
2337 Ok(())
2338 }
2339 }
2340
2341 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpCongestionControl {
2342 #[inline(always)]
2343 fn new_empty() -> Self {
2344 Self::Reno
2345 }
2346
2347 #[inline]
2348 unsafe fn decode(
2349 &mut self,
2350 decoder: &mut fidl::encoding::Decoder<'_, D>,
2351 offset: usize,
2352 _depth: fidl::encoding::Depth,
2353 ) -> fidl::Result<()> {
2354 decoder.debug_check_bounds::<Self>(offset);
2355 let prim = decoder.read_num::<u32>(offset);
2356
2357 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2358 Ok(())
2359 }
2360 }
2361 unsafe impl fidl::encoding::TypeMarker for TcpCongestionControlState {
2362 type Owned = Self;
2363
2364 #[inline(always)]
2365 fn inline_align(_context: fidl::encoding::Context) -> usize {
2366 std::mem::align_of::<u32>()
2367 }
2368
2369 #[inline(always)]
2370 fn inline_size(_context: fidl::encoding::Context) -> usize {
2371 std::mem::size_of::<u32>()
2372 }
2373
2374 #[inline(always)]
2375 fn encode_is_copy() -> bool {
2376 true
2377 }
2378
2379 #[inline(always)]
2380 fn decode_is_copy() -> bool {
2381 false
2382 }
2383 }
2384
2385 impl fidl::encoding::ValueTypeMarker for TcpCongestionControlState {
2386 type Borrowed<'a> = Self;
2387 #[inline(always)]
2388 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2389 *value
2390 }
2391 }
2392
2393 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2394 for TcpCongestionControlState
2395 {
2396 #[inline]
2397 unsafe fn encode(
2398 self,
2399 encoder: &mut fidl::encoding::Encoder<'_, D>,
2400 offset: usize,
2401 _depth: fidl::encoding::Depth,
2402 ) -> fidl::Result<()> {
2403 encoder.debug_check_bounds::<Self>(offset);
2404 encoder.write_num(self.into_primitive(), offset);
2405 Ok(())
2406 }
2407 }
2408
2409 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2410 for TcpCongestionControlState
2411 {
2412 #[inline(always)]
2413 fn new_empty() -> Self {
2414 Self::Open
2415 }
2416
2417 #[inline]
2418 unsafe fn decode(
2419 &mut self,
2420 decoder: &mut fidl::encoding::Decoder<'_, D>,
2421 offset: usize,
2422 _depth: fidl::encoding::Depth,
2423 ) -> fidl::Result<()> {
2424 decoder.debug_check_bounds::<Self>(offset);
2425 let prim = decoder.read_num::<u32>(offset);
2426
2427 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2428 Ok(())
2429 }
2430 }
2431 unsafe impl fidl::encoding::TypeMarker for TcpState {
2432 type Owned = Self;
2433
2434 #[inline(always)]
2435 fn inline_align(_context: fidl::encoding::Context) -> usize {
2436 std::mem::align_of::<u32>()
2437 }
2438
2439 #[inline(always)]
2440 fn inline_size(_context: fidl::encoding::Context) -> usize {
2441 std::mem::size_of::<u32>()
2442 }
2443
2444 #[inline(always)]
2445 fn encode_is_copy() -> bool {
2446 true
2447 }
2448
2449 #[inline(always)]
2450 fn decode_is_copy() -> bool {
2451 false
2452 }
2453 }
2454
2455 impl fidl::encoding::ValueTypeMarker for TcpState {
2456 type Borrowed<'a> = Self;
2457 #[inline(always)]
2458 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2459 *value
2460 }
2461 }
2462
2463 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TcpState {
2464 #[inline]
2465 unsafe fn encode(
2466 self,
2467 encoder: &mut fidl::encoding::Encoder<'_, D>,
2468 offset: usize,
2469 _depth: fidl::encoding::Depth,
2470 ) -> fidl::Result<()> {
2471 encoder.debug_check_bounds::<Self>(offset);
2472 encoder.write_num(self.into_primitive(), offset);
2473 Ok(())
2474 }
2475 }
2476
2477 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpState {
2478 #[inline(always)]
2479 fn new_empty() -> Self {
2480 Self::Established
2481 }
2482
2483 #[inline]
2484 unsafe fn decode(
2485 &mut self,
2486 decoder: &mut fidl::encoding::Decoder<'_, D>,
2487 offset: usize,
2488 _depth: fidl::encoding::Depth,
2489 ) -> fidl::Result<()> {
2490 decoder.debug_check_bounds::<Self>(offset);
2491 let prim = decoder.read_num::<u32>(offset);
2492
2493 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2494 Ok(())
2495 }
2496 }
2497 unsafe impl fidl::encoding::TypeMarker for TimestampOption {
2498 type Owned = Self;
2499
2500 #[inline(always)]
2501 fn inline_align(_context: fidl::encoding::Context) -> usize {
2502 std::mem::align_of::<u32>()
2503 }
2504
2505 #[inline(always)]
2506 fn inline_size(_context: fidl::encoding::Context) -> usize {
2507 std::mem::size_of::<u32>()
2508 }
2509
2510 #[inline(always)]
2511 fn encode_is_copy() -> bool {
2512 true
2513 }
2514
2515 #[inline(always)]
2516 fn decode_is_copy() -> bool {
2517 false
2518 }
2519 }
2520
2521 impl fidl::encoding::ValueTypeMarker for TimestampOption {
2522 type Borrowed<'a> = Self;
2523 #[inline(always)]
2524 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2525 *value
2526 }
2527 }
2528
2529 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2530 for TimestampOption
2531 {
2532 #[inline]
2533 unsafe fn encode(
2534 self,
2535 encoder: &mut fidl::encoding::Encoder<'_, D>,
2536 offset: usize,
2537 _depth: fidl::encoding::Depth,
2538 ) -> fidl::Result<()> {
2539 encoder.debug_check_bounds::<Self>(offset);
2540 encoder.write_num(self.into_primitive(), offset);
2541 Ok(())
2542 }
2543 }
2544
2545 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimestampOption {
2546 #[inline(always)]
2547 fn new_empty() -> Self {
2548 Self::Disabled
2549 }
2550
2551 #[inline]
2552 unsafe fn decode(
2553 &mut self,
2554 decoder: &mut fidl::encoding::Decoder<'_, D>,
2555 offset: usize,
2556 _depth: fidl::encoding::Depth,
2557 ) -> fidl::Result<()> {
2558 decoder.debug_check_bounds::<Self>(offset);
2559 let prim = decoder.read_num::<u32>(offset);
2560
2561 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2562 Ok(())
2563 }
2564 }
2565 unsafe impl fidl::encoding::TypeMarker for UdpMetadataEncodingProtocolVersion {
2566 type Owned = Self;
2567
2568 #[inline(always)]
2569 fn inline_align(_context: fidl::encoding::Context) -> usize {
2570 std::mem::align_of::<u16>()
2571 }
2572
2573 #[inline(always)]
2574 fn inline_size(_context: fidl::encoding::Context) -> usize {
2575 std::mem::size_of::<u16>()
2576 }
2577
2578 #[inline(always)]
2579 fn encode_is_copy() -> bool {
2580 false
2581 }
2582
2583 #[inline(always)]
2584 fn decode_is_copy() -> bool {
2585 false
2586 }
2587 }
2588
2589 impl fidl::encoding::ValueTypeMarker for UdpMetadataEncodingProtocolVersion {
2590 type Borrowed<'a> = Self;
2591 #[inline(always)]
2592 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2593 *value
2594 }
2595 }
2596
2597 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2598 for UdpMetadataEncodingProtocolVersion
2599 {
2600 #[inline]
2601 unsafe fn encode(
2602 self,
2603 encoder: &mut fidl::encoding::Encoder<'_, D>,
2604 offset: usize,
2605 _depth: fidl::encoding::Depth,
2606 ) -> fidl::Result<()> {
2607 encoder.debug_check_bounds::<Self>(offset);
2608 encoder.write_num(self.into_primitive(), offset);
2609 Ok(())
2610 }
2611 }
2612
2613 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2614 for UdpMetadataEncodingProtocolVersion
2615 {
2616 #[inline(always)]
2617 fn new_empty() -> Self {
2618 Self::unknown()
2619 }
2620
2621 #[inline]
2622 unsafe fn decode(
2623 &mut self,
2624 decoder: &mut fidl::encoding::Decoder<'_, D>,
2625 offset: usize,
2626 _depth: fidl::encoding::Depth,
2627 ) -> fidl::Result<()> {
2628 decoder.debug_check_bounds::<Self>(offset);
2629 let prim = decoder.read_num::<u16>(offset);
2630
2631 *self = Self::from_primitive_allow_unknown(prim);
2632 Ok(())
2633 }
2634 }
2635
2636 impl fidl::encoding::ValueTypeMarker for BaseDatagramSocketGetInfoResponse {
2637 type Borrowed<'a> = &'a Self;
2638 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2639 value
2640 }
2641 }
2642
2643 unsafe impl fidl::encoding::TypeMarker for BaseDatagramSocketGetInfoResponse {
2644 type Owned = Self;
2645
2646 #[inline(always)]
2647 fn inline_align(_context: fidl::encoding::Context) -> usize {
2648 4
2649 }
2650
2651 #[inline(always)]
2652 fn inline_size(_context: fidl::encoding::Context) -> usize {
2653 8
2654 }
2655 }
2656
2657 unsafe impl<D: fidl::encoding::ResourceDialect>
2658 fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D>
2659 for &BaseDatagramSocketGetInfoResponse
2660 {
2661 #[inline]
2662 unsafe fn encode(
2663 self,
2664 encoder: &mut fidl::encoding::Encoder<'_, D>,
2665 offset: usize,
2666 _depth: fidl::encoding::Depth,
2667 ) -> fidl::Result<()> {
2668 encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2669 fidl::encoding::Encode::<BaseDatagramSocketGetInfoResponse, D>::encode(
2671 (
2672 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
2673 <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
2674 &self.proto,
2675 ),
2676 ),
2677 encoder,
2678 offset,
2679 _depth,
2680 )
2681 }
2682 }
2683 unsafe impl<
2684 D: fidl::encoding::ResourceDialect,
2685 T0: fidl::encoding::Encode<Domain, D>,
2686 T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
2687 > fidl::encoding::Encode<BaseDatagramSocketGetInfoResponse, D> for (T0, T1)
2688 {
2689 #[inline]
2690 unsafe fn encode(
2691 self,
2692 encoder: &mut fidl::encoding::Encoder<'_, D>,
2693 offset: usize,
2694 depth: fidl::encoding::Depth,
2695 ) -> fidl::Result<()> {
2696 encoder.debug_check_bounds::<BaseDatagramSocketGetInfoResponse>(offset);
2697 unsafe {
2700 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2701 (ptr as *mut u32).write_unaligned(0);
2702 }
2703 self.0.encode(encoder, offset + 0, depth)?;
2705 self.1.encode(encoder, offset + 4, depth)?;
2706 Ok(())
2707 }
2708 }
2709
2710 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2711 for BaseDatagramSocketGetInfoResponse
2712 {
2713 #[inline(always)]
2714 fn new_empty() -> Self {
2715 Self {
2716 domain: fidl::new_empty!(Domain, D),
2717 proto: fidl::new_empty!(DatagramSocketProtocol, D),
2718 }
2719 }
2720
2721 #[inline]
2722 unsafe fn decode(
2723 &mut self,
2724 decoder: &mut fidl::encoding::Decoder<'_, D>,
2725 offset: usize,
2726 _depth: fidl::encoding::Depth,
2727 ) -> fidl::Result<()> {
2728 decoder.debug_check_bounds::<Self>(offset);
2729 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2731 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2732 let mask = 0xffff0000u32;
2733 let maskedval = padval & mask;
2734 if maskedval != 0 {
2735 return Err(fidl::Error::NonZeroPadding {
2736 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2737 });
2738 }
2739 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
2740 fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
2741 Ok(())
2742 }
2743 }
2744
2745 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2746 type Borrowed<'a> = &'a Self;
2747 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2748 value
2749 }
2750 }
2751
2752 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpMembershipRequest {
2753 type Owned = Self;
2754
2755 #[inline(always)]
2756 fn inline_align(_context: fidl::encoding::Context) -> usize {
2757 8
2758 }
2759
2760 #[inline(always)]
2761 fn inline_size(_context: fidl::encoding::Context) -> usize {
2762 16
2763 }
2764 }
2765
2766 unsafe impl<D: fidl::encoding::ResourceDialect>
2767 fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D>
2768 for &BaseNetworkSocketAddIpMembershipRequest
2769 {
2770 #[inline]
2771 unsafe fn encode(
2772 self,
2773 encoder: &mut fidl::encoding::Encoder<'_, D>,
2774 offset: usize,
2775 _depth: fidl::encoding::Depth,
2776 ) -> fidl::Result<()> {
2777 encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2778 fidl::encoding::Encode::<BaseNetworkSocketAddIpMembershipRequest, D>::encode(
2780 (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
2781 &self.membership,
2782 ),),
2783 encoder,
2784 offset,
2785 _depth,
2786 )
2787 }
2788 }
2789 unsafe impl<
2790 D: fidl::encoding::ResourceDialect,
2791 T0: fidl::encoding::Encode<IpMulticastMembership, D>,
2792 > fidl::encoding::Encode<BaseNetworkSocketAddIpMembershipRequest, D> for (T0,)
2793 {
2794 #[inline]
2795 unsafe fn encode(
2796 self,
2797 encoder: &mut fidl::encoding::Encoder<'_, D>,
2798 offset: usize,
2799 depth: fidl::encoding::Depth,
2800 ) -> fidl::Result<()> {
2801 encoder.debug_check_bounds::<BaseNetworkSocketAddIpMembershipRequest>(offset);
2802 self.0.encode(encoder, offset + 0, depth)?;
2806 Ok(())
2807 }
2808 }
2809
2810 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2811 for BaseNetworkSocketAddIpMembershipRequest
2812 {
2813 #[inline(always)]
2814 fn new_empty() -> Self {
2815 Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
2816 }
2817
2818 #[inline]
2819 unsafe fn decode(
2820 &mut self,
2821 decoder: &mut fidl::encoding::Decoder<'_, D>,
2822 offset: usize,
2823 _depth: fidl::encoding::Depth,
2824 ) -> fidl::Result<()> {
2825 decoder.debug_check_bounds::<Self>(offset);
2826 fidl::decode!(
2828 IpMulticastMembership,
2829 D,
2830 &mut self.membership,
2831 decoder,
2832 offset + 0,
2833 _depth
2834 )?;
2835 Ok(())
2836 }
2837 }
2838
2839 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
2840 type Borrowed<'a> = &'a Self;
2841 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2842 value
2843 }
2844 }
2845
2846 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketAddIpv6MembershipRequest {
2847 type Owned = Self;
2848
2849 #[inline(always)]
2850 fn inline_align(_context: fidl::encoding::Context) -> usize {
2851 8
2852 }
2853
2854 #[inline(always)]
2855 fn inline_size(_context: fidl::encoding::Context) -> usize {
2856 24
2857 }
2858 }
2859
2860 unsafe impl<D: fidl::encoding::ResourceDialect>
2861 fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D>
2862 for &BaseNetworkSocketAddIpv6MembershipRequest
2863 {
2864 #[inline]
2865 unsafe fn encode(
2866 self,
2867 encoder: &mut fidl::encoding::Encoder<'_, D>,
2868 offset: usize,
2869 _depth: fidl::encoding::Depth,
2870 ) -> fidl::Result<()> {
2871 encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
2872 fidl::encoding::Encode::<BaseNetworkSocketAddIpv6MembershipRequest, D>::encode(
2874 (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
2875 &self.membership,
2876 ),),
2877 encoder,
2878 offset,
2879 _depth,
2880 )
2881 }
2882 }
2883 unsafe impl<
2884 D: fidl::encoding::ResourceDialect,
2885 T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
2886 > fidl::encoding::Encode<BaseNetworkSocketAddIpv6MembershipRequest, D> for (T0,)
2887 {
2888 #[inline]
2889 unsafe fn encode(
2890 self,
2891 encoder: &mut fidl::encoding::Encoder<'_, D>,
2892 offset: usize,
2893 depth: fidl::encoding::Depth,
2894 ) -> fidl::Result<()> {
2895 encoder.debug_check_bounds::<BaseNetworkSocketAddIpv6MembershipRequest>(offset);
2896 self.0.encode(encoder, offset + 0, depth)?;
2900 Ok(())
2901 }
2902 }
2903
2904 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2905 for BaseNetworkSocketAddIpv6MembershipRequest
2906 {
2907 #[inline(always)]
2908 fn new_empty() -> Self {
2909 Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
2910 }
2911
2912 #[inline]
2913 unsafe fn decode(
2914 &mut self,
2915 decoder: &mut fidl::encoding::Decoder<'_, D>,
2916 offset: usize,
2917 _depth: fidl::encoding::Depth,
2918 ) -> fidl::Result<()> {
2919 decoder.debug_check_bounds::<Self>(offset);
2920 fidl::decode!(
2922 Ipv6MulticastMembership,
2923 D,
2924 &mut self.membership,
2925 decoder,
2926 offset + 0,
2927 _depth
2928 )?;
2929 Ok(())
2930 }
2931 }
2932
2933 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketBindRequest {
2934 type Borrowed<'a> = &'a Self;
2935 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2936 value
2937 }
2938 }
2939
2940 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketBindRequest {
2941 type Owned = Self;
2942
2943 #[inline(always)]
2944 fn inline_align(_context: fidl::encoding::Context) -> usize {
2945 8
2946 }
2947
2948 #[inline(always)]
2949 fn inline_size(_context: fidl::encoding::Context) -> usize {
2950 16
2951 }
2952 }
2953
2954 unsafe impl<D: fidl::encoding::ResourceDialect>
2955 fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for &BaseNetworkSocketBindRequest
2956 {
2957 #[inline]
2958 unsafe fn encode(
2959 self,
2960 encoder: &mut fidl::encoding::Encoder<'_, D>,
2961 offset: usize,
2962 _depth: fidl::encoding::Depth,
2963 ) -> fidl::Result<()> {
2964 encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
2965 fidl::encoding::Encode::<BaseNetworkSocketBindRequest, D>::encode(
2967 (<fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(
2968 &self.addr,
2969 ),),
2970 encoder,
2971 offset,
2972 _depth,
2973 )
2974 }
2975 }
2976 unsafe impl<
2977 D: fidl::encoding::ResourceDialect,
2978 T0: fidl::encoding::Encode<fidl_fuchsia_net::SocketAddress, D>,
2979 > fidl::encoding::Encode<BaseNetworkSocketBindRequest, D> for (T0,)
2980 {
2981 #[inline]
2982 unsafe fn encode(
2983 self,
2984 encoder: &mut fidl::encoding::Encoder<'_, D>,
2985 offset: usize,
2986 depth: fidl::encoding::Depth,
2987 ) -> fidl::Result<()> {
2988 encoder.debug_check_bounds::<BaseNetworkSocketBindRequest>(offset);
2989 self.0.encode(encoder, offset + 0, depth)?;
2993 Ok(())
2994 }
2995 }
2996
2997 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2998 for BaseNetworkSocketBindRequest
2999 {
3000 #[inline(always)]
3001 fn new_empty() -> Self {
3002 Self { addr: fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D) }
3003 }
3004
3005 #[inline]
3006 unsafe fn decode(
3007 &mut self,
3008 decoder: &mut fidl::encoding::Decoder<'_, D>,
3009 offset: usize,
3010 _depth: fidl::encoding::Depth,
3011 ) -> fidl::Result<()> {
3012 decoder.debug_check_bounds::<Self>(offset);
3013 fidl::decode!(
3015 fidl_fuchsia_net::SocketAddress,
3016 D,
3017 &mut self.addr,
3018 decoder,
3019 offset + 0,
3020 _depth
3021 )?;
3022 Ok(())
3023 }
3024 }
3025
3026 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketConnectRequest {
3027 type Borrowed<'a> = &'a Self;
3028 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3029 value
3030 }
3031 }
3032
3033 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketConnectRequest {
3034 type Owned = Self;
3035
3036 #[inline(always)]
3037 fn inline_align(_context: fidl::encoding::Context) -> usize {
3038 8
3039 }
3040
3041 #[inline(always)]
3042 fn inline_size(_context: fidl::encoding::Context) -> usize {
3043 16
3044 }
3045 }
3046
3047 unsafe impl<D: fidl::encoding::ResourceDialect>
3048 fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D>
3049 for &BaseNetworkSocketConnectRequest
3050 {
3051 #[inline]
3052 unsafe fn encode(
3053 self,
3054 encoder: &mut fidl::encoding::Encoder<'_, D>,
3055 offset: usize,
3056 _depth: fidl::encoding::Depth,
3057 ) -> fidl::Result<()> {
3058 encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3059 fidl::encoding::Encode::<BaseNetworkSocketConnectRequest, D>::encode(
3061 (<fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(
3062 &self.addr,
3063 ),),
3064 encoder,
3065 offset,
3066 _depth,
3067 )
3068 }
3069 }
3070 unsafe impl<
3071 D: fidl::encoding::ResourceDialect,
3072 T0: fidl::encoding::Encode<fidl_fuchsia_net::SocketAddress, D>,
3073 > fidl::encoding::Encode<BaseNetworkSocketConnectRequest, D> for (T0,)
3074 {
3075 #[inline]
3076 unsafe fn encode(
3077 self,
3078 encoder: &mut fidl::encoding::Encoder<'_, D>,
3079 offset: usize,
3080 depth: fidl::encoding::Depth,
3081 ) -> fidl::Result<()> {
3082 encoder.debug_check_bounds::<BaseNetworkSocketConnectRequest>(offset);
3083 self.0.encode(encoder, offset + 0, depth)?;
3087 Ok(())
3088 }
3089 }
3090
3091 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3092 for BaseNetworkSocketConnectRequest
3093 {
3094 #[inline(always)]
3095 fn new_empty() -> Self {
3096 Self { addr: fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D) }
3097 }
3098
3099 #[inline]
3100 unsafe fn decode(
3101 &mut self,
3102 decoder: &mut fidl::encoding::Decoder<'_, D>,
3103 offset: usize,
3104 _depth: fidl::encoding::Depth,
3105 ) -> fidl::Result<()> {
3106 decoder.debug_check_bounds::<Self>(offset);
3107 fidl::decode!(
3109 fidl_fuchsia_net::SocketAddress,
3110 D,
3111 &mut self.addr,
3112 decoder,
3113 offset + 0,
3114 _depth
3115 )?;
3116 Ok(())
3117 }
3118 }
3119
3120 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3121 type Borrowed<'a> = &'a Self;
3122 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3123 value
3124 }
3125 }
3126
3127 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpMembershipRequest {
3128 type Owned = Self;
3129
3130 #[inline(always)]
3131 fn inline_align(_context: fidl::encoding::Context) -> usize {
3132 8
3133 }
3134
3135 #[inline(always)]
3136 fn inline_size(_context: fidl::encoding::Context) -> usize {
3137 16
3138 }
3139 }
3140
3141 unsafe impl<D: fidl::encoding::ResourceDialect>
3142 fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D>
3143 for &BaseNetworkSocketDropIpMembershipRequest
3144 {
3145 #[inline]
3146 unsafe fn encode(
3147 self,
3148 encoder: &mut fidl::encoding::Encoder<'_, D>,
3149 offset: usize,
3150 _depth: fidl::encoding::Depth,
3151 ) -> fidl::Result<()> {
3152 encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3153 fidl::encoding::Encode::<BaseNetworkSocketDropIpMembershipRequest, D>::encode(
3155 (<IpMulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3156 &self.membership,
3157 ),),
3158 encoder,
3159 offset,
3160 _depth,
3161 )
3162 }
3163 }
3164 unsafe impl<
3165 D: fidl::encoding::ResourceDialect,
3166 T0: fidl::encoding::Encode<IpMulticastMembership, D>,
3167 > fidl::encoding::Encode<BaseNetworkSocketDropIpMembershipRequest, D> for (T0,)
3168 {
3169 #[inline]
3170 unsafe fn encode(
3171 self,
3172 encoder: &mut fidl::encoding::Encoder<'_, D>,
3173 offset: usize,
3174 depth: fidl::encoding::Depth,
3175 ) -> fidl::Result<()> {
3176 encoder.debug_check_bounds::<BaseNetworkSocketDropIpMembershipRequest>(offset);
3177 self.0.encode(encoder, offset + 0, depth)?;
3181 Ok(())
3182 }
3183 }
3184
3185 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3186 for BaseNetworkSocketDropIpMembershipRequest
3187 {
3188 #[inline(always)]
3189 fn new_empty() -> Self {
3190 Self { membership: fidl::new_empty!(IpMulticastMembership, D) }
3191 }
3192
3193 #[inline]
3194 unsafe fn decode(
3195 &mut self,
3196 decoder: &mut fidl::encoding::Decoder<'_, D>,
3197 offset: usize,
3198 _depth: fidl::encoding::Depth,
3199 ) -> fidl::Result<()> {
3200 decoder.debug_check_bounds::<Self>(offset);
3201 fidl::decode!(
3203 IpMulticastMembership,
3204 D,
3205 &mut self.membership,
3206 decoder,
3207 offset + 0,
3208 _depth
3209 )?;
3210 Ok(())
3211 }
3212 }
3213
3214 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3215 type Borrowed<'a> = &'a Self;
3216 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3217 value
3218 }
3219 }
3220
3221 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketDropIpv6MembershipRequest {
3222 type Owned = Self;
3223
3224 #[inline(always)]
3225 fn inline_align(_context: fidl::encoding::Context) -> usize {
3226 8
3227 }
3228
3229 #[inline(always)]
3230 fn inline_size(_context: fidl::encoding::Context) -> usize {
3231 24
3232 }
3233 }
3234
3235 unsafe impl<D: fidl::encoding::ResourceDialect>
3236 fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D>
3237 for &BaseNetworkSocketDropIpv6MembershipRequest
3238 {
3239 #[inline]
3240 unsafe fn encode(
3241 self,
3242 encoder: &mut fidl::encoding::Encoder<'_, D>,
3243 offset: usize,
3244 _depth: fidl::encoding::Depth,
3245 ) -> fidl::Result<()> {
3246 encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3247 fidl::encoding::Encode::<BaseNetworkSocketDropIpv6MembershipRequest, D>::encode(
3249 (<Ipv6MulticastMembership as fidl::encoding::ValueTypeMarker>::borrow(
3250 &self.membership,
3251 ),),
3252 encoder,
3253 offset,
3254 _depth,
3255 )
3256 }
3257 }
3258 unsafe impl<
3259 D: fidl::encoding::ResourceDialect,
3260 T0: fidl::encoding::Encode<Ipv6MulticastMembership, D>,
3261 > fidl::encoding::Encode<BaseNetworkSocketDropIpv6MembershipRequest, D> for (T0,)
3262 {
3263 #[inline]
3264 unsafe fn encode(
3265 self,
3266 encoder: &mut fidl::encoding::Encoder<'_, D>,
3267 offset: usize,
3268 depth: fidl::encoding::Depth,
3269 ) -> fidl::Result<()> {
3270 encoder.debug_check_bounds::<BaseNetworkSocketDropIpv6MembershipRequest>(offset);
3271 self.0.encode(encoder, offset + 0, depth)?;
3275 Ok(())
3276 }
3277 }
3278
3279 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3280 for BaseNetworkSocketDropIpv6MembershipRequest
3281 {
3282 #[inline(always)]
3283 fn new_empty() -> Self {
3284 Self { membership: fidl::new_empty!(Ipv6MulticastMembership, D) }
3285 }
3286
3287 #[inline]
3288 unsafe fn decode(
3289 &mut self,
3290 decoder: &mut fidl::encoding::Decoder<'_, D>,
3291 offset: usize,
3292 _depth: fidl::encoding::Depth,
3293 ) -> fidl::Result<()> {
3294 decoder.debug_check_bounds::<Self>(offset);
3295 fidl::decode!(
3297 Ipv6MulticastMembership,
3298 D,
3299 &mut self.membership,
3300 decoder,
3301 offset + 0,
3302 _depth
3303 )?;
3304 Ok(())
3305 }
3306 }
3307
3308 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3309 type Borrowed<'a> = &'a Self;
3310 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3311 value
3312 }
3313 }
3314
3315 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastInterfaceRequest {
3316 type Owned = Self;
3317
3318 #[inline(always)]
3319 fn inline_align(_context: fidl::encoding::Context) -> usize {
3320 8
3321 }
3322
3323 #[inline(always)]
3324 fn inline_size(_context: fidl::encoding::Context) -> usize {
3325 16
3326 }
3327 }
3328
3329 unsafe impl<D: fidl::encoding::ResourceDialect>
3330 fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>
3331 for &BaseNetworkSocketSetIpMulticastInterfaceRequest
3332 {
3333 #[inline]
3334 unsafe fn encode(
3335 self,
3336 encoder: &mut fidl::encoding::Encoder<'_, D>,
3337 offset: usize,
3338 _depth: fidl::encoding::Depth,
3339 ) -> fidl::Result<()> {
3340 encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3341 fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastInterfaceRequest, D>::encode(
3343 (
3344 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
3345 <fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(
3346 &self.address,
3347 ),
3348 ),
3349 encoder,
3350 offset,
3351 _depth,
3352 )
3353 }
3354 }
3355 unsafe impl<
3356 D: fidl::encoding::ResourceDialect,
3357 T0: fidl::encoding::Encode<u64, D>,
3358 T1: fidl::encoding::Encode<fidl_fuchsia_net::Ipv4Address, D>,
3359 > fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastInterfaceRequest, D> for (T0, T1)
3360 {
3361 #[inline]
3362 unsafe fn encode(
3363 self,
3364 encoder: &mut fidl::encoding::Encoder<'_, D>,
3365 offset: usize,
3366 depth: fidl::encoding::Depth,
3367 ) -> fidl::Result<()> {
3368 encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastInterfaceRequest>(offset);
3369 unsafe {
3372 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3373 (ptr as *mut u64).write_unaligned(0);
3374 }
3375 self.0.encode(encoder, offset + 0, depth)?;
3377 self.1.encode(encoder, offset + 8, depth)?;
3378 Ok(())
3379 }
3380 }
3381
3382 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3383 for BaseNetworkSocketSetIpMulticastInterfaceRequest
3384 {
3385 #[inline(always)]
3386 fn new_empty() -> Self {
3387 Self {
3388 iface: fidl::new_empty!(u64, D),
3389 address: fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D),
3390 }
3391 }
3392
3393 #[inline]
3394 unsafe fn decode(
3395 &mut self,
3396 decoder: &mut fidl::encoding::Decoder<'_, D>,
3397 offset: usize,
3398 _depth: fidl::encoding::Depth,
3399 ) -> fidl::Result<()> {
3400 decoder.debug_check_bounds::<Self>(offset);
3401 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3403 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3404 let mask = 0xffffffff00000000u64;
3405 let maskedval = padval & mask;
3406 if maskedval != 0 {
3407 return Err(fidl::Error::NonZeroPadding {
3408 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3409 });
3410 }
3411 fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
3412 fidl::decode!(
3413 fidl_fuchsia_net::Ipv4Address,
3414 D,
3415 &mut self.address,
3416 decoder,
3417 offset + 8,
3418 _depth
3419 )?;
3420 Ok(())
3421 }
3422 }
3423
3424 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3425 type Borrowed<'a> = &'a Self;
3426 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3427 value
3428 }
3429 }
3430
3431 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastLoopbackRequest {
3432 type Owned = Self;
3433
3434 #[inline(always)]
3435 fn inline_align(_context: fidl::encoding::Context) -> usize {
3436 1
3437 }
3438
3439 #[inline(always)]
3440 fn inline_size(_context: fidl::encoding::Context) -> usize {
3441 1
3442 }
3443 }
3444
3445 unsafe impl<D: fidl::encoding::ResourceDialect>
3446 fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>
3447 for &BaseNetworkSocketSetIpMulticastLoopbackRequest
3448 {
3449 #[inline]
3450 unsafe fn encode(
3451 self,
3452 encoder: &mut fidl::encoding::Encoder<'_, D>,
3453 offset: usize,
3454 _depth: fidl::encoding::Depth,
3455 ) -> fidl::Result<()> {
3456 encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3457 fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastLoopbackRequest, D>::encode(
3459 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3460 encoder,
3461 offset,
3462 _depth,
3463 )
3464 }
3465 }
3466 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3467 fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastLoopbackRequest, D> for (T0,)
3468 {
3469 #[inline]
3470 unsafe fn encode(
3471 self,
3472 encoder: &mut fidl::encoding::Encoder<'_, D>,
3473 offset: usize,
3474 depth: fidl::encoding::Depth,
3475 ) -> fidl::Result<()> {
3476 encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastLoopbackRequest>(offset);
3477 self.0.encode(encoder, offset + 0, depth)?;
3481 Ok(())
3482 }
3483 }
3484
3485 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3486 for BaseNetworkSocketSetIpMulticastLoopbackRequest
3487 {
3488 #[inline(always)]
3489 fn new_empty() -> Self {
3490 Self { value: fidl::new_empty!(bool, D) }
3491 }
3492
3493 #[inline]
3494 unsafe fn decode(
3495 &mut self,
3496 decoder: &mut fidl::encoding::Decoder<'_, D>,
3497 offset: usize,
3498 _depth: fidl::encoding::Depth,
3499 ) -> fidl::Result<()> {
3500 decoder.debug_check_bounds::<Self>(offset);
3501 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3503 Ok(())
3504 }
3505 }
3506
3507 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3508 type Borrowed<'a> = &'a Self;
3509 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3510 value
3511 }
3512 }
3513
3514 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpMulticastTtlRequest {
3515 type Owned = Self;
3516
3517 #[inline(always)]
3518 fn inline_align(_context: fidl::encoding::Context) -> usize {
3519 8
3520 }
3521
3522 #[inline(always)]
3523 fn inline_size(_context: fidl::encoding::Context) -> usize {
3524 16
3525 }
3526 }
3527
3528 unsafe impl<D: fidl::encoding::ResourceDialect>
3529 fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D>
3530 for &BaseNetworkSocketSetIpMulticastTtlRequest
3531 {
3532 #[inline]
3533 unsafe fn encode(
3534 self,
3535 encoder: &mut fidl::encoding::Encoder<'_, D>,
3536 offset: usize,
3537 _depth: fidl::encoding::Depth,
3538 ) -> fidl::Result<()> {
3539 encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3540 fidl::encoding::Encode::<BaseNetworkSocketSetIpMulticastTtlRequest, D>::encode(
3542 (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3543 encoder,
3544 offset,
3545 _depth,
3546 )
3547 }
3548 }
3549 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
3550 fidl::encoding::Encode<BaseNetworkSocketSetIpMulticastTtlRequest, D> for (T0,)
3551 {
3552 #[inline]
3553 unsafe fn encode(
3554 self,
3555 encoder: &mut fidl::encoding::Encoder<'_, D>,
3556 offset: usize,
3557 depth: fidl::encoding::Depth,
3558 ) -> fidl::Result<()> {
3559 encoder.debug_check_bounds::<BaseNetworkSocketSetIpMulticastTtlRequest>(offset);
3560 self.0.encode(encoder, offset + 0, depth)?;
3564 Ok(())
3565 }
3566 }
3567
3568 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3569 for BaseNetworkSocketSetIpMulticastTtlRequest
3570 {
3571 #[inline(always)]
3572 fn new_empty() -> Self {
3573 Self { value: fidl::new_empty!(OptionalUint8, D) }
3574 }
3575
3576 #[inline]
3577 unsafe fn decode(
3578 &mut self,
3579 decoder: &mut fidl::encoding::Decoder<'_, D>,
3580 offset: usize,
3581 _depth: fidl::encoding::Depth,
3582 ) -> fidl::Result<()> {
3583 decoder.debug_check_bounds::<Self>(offset);
3584 fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
3586 Ok(())
3587 }
3588 }
3589
3590 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3591 type Borrowed<'a> = &'a Self;
3592 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3593 value
3594 }
3595 }
3596
3597 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpPacketInfoRequest {
3598 type Owned = Self;
3599
3600 #[inline(always)]
3601 fn inline_align(_context: fidl::encoding::Context) -> usize {
3602 1
3603 }
3604
3605 #[inline(always)]
3606 fn inline_size(_context: fidl::encoding::Context) -> usize {
3607 1
3608 }
3609 }
3610
3611 unsafe impl<D: fidl::encoding::ResourceDialect>
3612 fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D>
3613 for &BaseNetworkSocketSetIpPacketInfoRequest
3614 {
3615 #[inline]
3616 unsafe fn encode(
3617 self,
3618 encoder: &mut fidl::encoding::Encoder<'_, D>,
3619 offset: usize,
3620 _depth: fidl::encoding::Depth,
3621 ) -> fidl::Result<()> {
3622 encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3623 fidl::encoding::Encode::<BaseNetworkSocketSetIpPacketInfoRequest, D>::encode(
3625 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3626 encoder,
3627 offset,
3628 _depth,
3629 )
3630 }
3631 }
3632 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3633 fidl::encoding::Encode<BaseNetworkSocketSetIpPacketInfoRequest, D> for (T0,)
3634 {
3635 #[inline]
3636 unsafe fn encode(
3637 self,
3638 encoder: &mut fidl::encoding::Encoder<'_, D>,
3639 offset: usize,
3640 depth: fidl::encoding::Depth,
3641 ) -> fidl::Result<()> {
3642 encoder.debug_check_bounds::<BaseNetworkSocketSetIpPacketInfoRequest>(offset);
3643 self.0.encode(encoder, offset + 0, depth)?;
3647 Ok(())
3648 }
3649 }
3650
3651 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3652 for BaseNetworkSocketSetIpPacketInfoRequest
3653 {
3654 #[inline(always)]
3655 fn new_empty() -> Self {
3656 Self { value: fidl::new_empty!(bool, D) }
3657 }
3658
3659 #[inline]
3660 unsafe fn decode(
3661 &mut self,
3662 decoder: &mut fidl::encoding::Decoder<'_, D>,
3663 offset: usize,
3664 _depth: fidl::encoding::Depth,
3665 ) -> fidl::Result<()> {
3666 decoder.debug_check_bounds::<Self>(offset);
3667 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3669 Ok(())
3670 }
3671 }
3672
3673 impl fidl::encoding::ValueTypeMarker
3674 for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3675 {
3676 type Borrowed<'a> = &'a Self;
3677 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3678 value
3679 }
3680 }
3681
3682 unsafe impl fidl::encoding::TypeMarker
3683 for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3684 {
3685 type Owned = Self;
3686
3687 #[inline(always)]
3688 fn inline_align(_context: fidl::encoding::Context) -> usize {
3689 1
3690 }
3691
3692 #[inline(always)]
3693 fn inline_size(_context: fidl::encoding::Context) -> usize {
3694 1
3695 }
3696 }
3697
3698 unsafe impl<D: fidl::encoding::ResourceDialect>
3699 fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3700 for &BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3701 {
3702 #[inline]
3703 unsafe fn encode(
3704 self,
3705 encoder: &mut fidl::encoding::Encoder<'_, D>,
3706 offset: usize,
3707 _depth: fidl::encoding::Depth,
3708 ) -> fidl::Result<()> {
3709 encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3710 fidl::encoding::Encode::<
3712 BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest,
3713 D,
3714 >::encode(
3715 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3716 encoder,
3717 offset,
3718 _depth,
3719 )
3720 }
3721 }
3722 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3723 fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest, D>
3724 for (T0,)
3725 {
3726 #[inline]
3727 unsafe fn encode(
3728 self,
3729 encoder: &mut fidl::encoding::Encoder<'_, D>,
3730 offset: usize,
3731 depth: fidl::encoding::Depth,
3732 ) -> fidl::Result<()> {
3733 encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest>(offset);
3734 self.0.encode(encoder, offset + 0, depth)?;
3738 Ok(())
3739 }
3740 }
3741
3742 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3743 for BaseNetworkSocketSetIpReceiveOriginalDestinationAddressRequest
3744 {
3745 #[inline(always)]
3746 fn new_empty() -> Self {
3747 Self { value: fidl::new_empty!(bool, D) }
3748 }
3749
3750 #[inline]
3751 unsafe fn decode(
3752 &mut self,
3753 decoder: &mut fidl::encoding::Decoder<'_, D>,
3754 offset: usize,
3755 _depth: fidl::encoding::Depth,
3756 ) -> fidl::Result<()> {
3757 decoder.debug_check_bounds::<Self>(offset);
3758 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3760 Ok(())
3761 }
3762 }
3763
3764 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3765 type Borrowed<'a> = &'a Self;
3766 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3767 value
3768 }
3769 }
3770
3771 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTtlRequest {
3772 type Owned = Self;
3773
3774 #[inline(always)]
3775 fn inline_align(_context: fidl::encoding::Context) -> usize {
3776 1
3777 }
3778
3779 #[inline(always)]
3780 fn inline_size(_context: fidl::encoding::Context) -> usize {
3781 1
3782 }
3783 }
3784
3785 unsafe impl<D: fidl::encoding::ResourceDialect>
3786 fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D>
3787 for &BaseNetworkSocketSetIpReceiveTtlRequest
3788 {
3789 #[inline]
3790 unsafe fn encode(
3791 self,
3792 encoder: &mut fidl::encoding::Encoder<'_, D>,
3793 offset: usize,
3794 _depth: fidl::encoding::Depth,
3795 ) -> fidl::Result<()> {
3796 encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3797 fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTtlRequest, D>::encode(
3799 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3800 encoder,
3801 offset,
3802 _depth,
3803 )
3804 }
3805 }
3806 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3807 fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTtlRequest, D> for (T0,)
3808 {
3809 #[inline]
3810 unsafe fn encode(
3811 self,
3812 encoder: &mut fidl::encoding::Encoder<'_, D>,
3813 offset: usize,
3814 depth: fidl::encoding::Depth,
3815 ) -> fidl::Result<()> {
3816 encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTtlRequest>(offset);
3817 self.0.encode(encoder, offset + 0, depth)?;
3821 Ok(())
3822 }
3823 }
3824
3825 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3826 for BaseNetworkSocketSetIpReceiveTtlRequest
3827 {
3828 #[inline(always)]
3829 fn new_empty() -> Self {
3830 Self { value: fidl::new_empty!(bool, D) }
3831 }
3832
3833 #[inline]
3834 unsafe fn decode(
3835 &mut self,
3836 decoder: &mut fidl::encoding::Decoder<'_, D>,
3837 offset: usize,
3838 _depth: fidl::encoding::Depth,
3839 ) -> fidl::Result<()> {
3840 decoder.debug_check_bounds::<Self>(offset);
3841 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3843 Ok(())
3844 }
3845 }
3846
3847 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
3848 type Borrowed<'a> = &'a Self;
3849 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3850 value
3851 }
3852 }
3853
3854 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest {
3855 type Owned = Self;
3856
3857 #[inline(always)]
3858 fn inline_align(_context: fidl::encoding::Context) -> usize {
3859 1
3860 }
3861
3862 #[inline(always)]
3863 fn inline_size(_context: fidl::encoding::Context) -> usize {
3864 1
3865 }
3866 }
3867
3868 unsafe impl<D: fidl::encoding::ResourceDialect>
3869 fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>
3870 for &BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
3871 {
3872 #[inline]
3873 unsafe fn encode(
3874 self,
3875 encoder: &mut fidl::encoding::Encoder<'_, D>,
3876 offset: usize,
3877 _depth: fidl::encoding::Depth,
3878 ) -> fidl::Result<()> {
3879 encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
3880 fidl::encoding::Encode::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D>::encode(
3882 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3883 encoder,
3884 offset,
3885 _depth,
3886 )
3887 }
3888 }
3889 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3890 fidl::encoding::Encode<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest, D> for (T0,)
3891 {
3892 #[inline]
3893 unsafe fn encode(
3894 self,
3895 encoder: &mut fidl::encoding::Encoder<'_, D>,
3896 offset: usize,
3897 depth: fidl::encoding::Depth,
3898 ) -> fidl::Result<()> {
3899 encoder.debug_check_bounds::<BaseNetworkSocketSetIpReceiveTypeOfServiceRequest>(offset);
3900 self.0.encode(encoder, offset + 0, depth)?;
3904 Ok(())
3905 }
3906 }
3907
3908 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3909 for BaseNetworkSocketSetIpReceiveTypeOfServiceRequest
3910 {
3911 #[inline(always)]
3912 fn new_empty() -> Self {
3913 Self { value: fidl::new_empty!(bool, D) }
3914 }
3915
3916 #[inline]
3917 unsafe fn decode(
3918 &mut self,
3919 decoder: &mut fidl::encoding::Decoder<'_, D>,
3920 offset: usize,
3921 _depth: fidl::encoding::Depth,
3922 ) -> fidl::Result<()> {
3923 decoder.debug_check_bounds::<Self>(offset);
3924 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3926 Ok(())
3927 }
3928 }
3929
3930 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTransparentRequest {
3931 type Borrowed<'a> = &'a Self;
3932 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3933 value
3934 }
3935 }
3936
3937 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTransparentRequest {
3938 type Owned = Self;
3939
3940 #[inline(always)]
3941 fn inline_align(_context: fidl::encoding::Context) -> usize {
3942 1
3943 }
3944
3945 #[inline(always)]
3946 fn inline_size(_context: fidl::encoding::Context) -> usize {
3947 1
3948 }
3949 }
3950
3951 unsafe impl<D: fidl::encoding::ResourceDialect>
3952 fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D>
3953 for &BaseNetworkSocketSetIpTransparentRequest
3954 {
3955 #[inline]
3956 unsafe fn encode(
3957 self,
3958 encoder: &mut fidl::encoding::Encoder<'_, D>,
3959 offset: usize,
3960 _depth: fidl::encoding::Depth,
3961 ) -> fidl::Result<()> {
3962 encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
3963 fidl::encoding::Encode::<BaseNetworkSocketSetIpTransparentRequest, D>::encode(
3965 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3966 encoder,
3967 offset,
3968 _depth,
3969 )
3970 }
3971 }
3972 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3973 fidl::encoding::Encode<BaseNetworkSocketSetIpTransparentRequest, D> for (T0,)
3974 {
3975 #[inline]
3976 unsafe fn encode(
3977 self,
3978 encoder: &mut fidl::encoding::Encoder<'_, D>,
3979 offset: usize,
3980 depth: fidl::encoding::Depth,
3981 ) -> fidl::Result<()> {
3982 encoder.debug_check_bounds::<BaseNetworkSocketSetIpTransparentRequest>(offset);
3983 self.0.encode(encoder, offset + 0, depth)?;
3987 Ok(())
3988 }
3989 }
3990
3991 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3992 for BaseNetworkSocketSetIpTransparentRequest
3993 {
3994 #[inline(always)]
3995 fn new_empty() -> Self {
3996 Self { value: fidl::new_empty!(bool, D) }
3997 }
3998
3999 #[inline]
4000 unsafe fn decode(
4001 &mut self,
4002 decoder: &mut fidl::encoding::Decoder<'_, D>,
4003 offset: usize,
4004 _depth: fidl::encoding::Depth,
4005 ) -> fidl::Result<()> {
4006 decoder.debug_check_bounds::<Self>(offset);
4007 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4009 Ok(())
4010 }
4011 }
4012
4013 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTtlRequest {
4014 type Borrowed<'a> = &'a Self;
4015 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4016 value
4017 }
4018 }
4019
4020 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTtlRequest {
4021 type Owned = Self;
4022
4023 #[inline(always)]
4024 fn inline_align(_context: fidl::encoding::Context) -> usize {
4025 8
4026 }
4027
4028 #[inline(always)]
4029 fn inline_size(_context: fidl::encoding::Context) -> usize {
4030 16
4031 }
4032 }
4033
4034 unsafe impl<D: fidl::encoding::ResourceDialect>
4035 fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D>
4036 for &BaseNetworkSocketSetIpTtlRequest
4037 {
4038 #[inline]
4039 unsafe fn encode(
4040 self,
4041 encoder: &mut fidl::encoding::Encoder<'_, D>,
4042 offset: usize,
4043 _depth: fidl::encoding::Depth,
4044 ) -> fidl::Result<()> {
4045 encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4046 fidl::encoding::Encode::<BaseNetworkSocketSetIpTtlRequest, D>::encode(
4048 (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4049 encoder,
4050 offset,
4051 _depth,
4052 )
4053 }
4054 }
4055 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4056 fidl::encoding::Encode<BaseNetworkSocketSetIpTtlRequest, D> for (T0,)
4057 {
4058 #[inline]
4059 unsafe fn encode(
4060 self,
4061 encoder: &mut fidl::encoding::Encoder<'_, D>,
4062 offset: usize,
4063 depth: fidl::encoding::Depth,
4064 ) -> fidl::Result<()> {
4065 encoder.debug_check_bounds::<BaseNetworkSocketSetIpTtlRequest>(offset);
4066 self.0.encode(encoder, offset + 0, depth)?;
4070 Ok(())
4071 }
4072 }
4073
4074 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4075 for BaseNetworkSocketSetIpTtlRequest
4076 {
4077 #[inline(always)]
4078 fn new_empty() -> Self {
4079 Self { value: fidl::new_empty!(OptionalUint8, D) }
4080 }
4081
4082 #[inline]
4083 unsafe fn decode(
4084 &mut self,
4085 decoder: &mut fidl::encoding::Decoder<'_, D>,
4086 offset: usize,
4087 _depth: fidl::encoding::Depth,
4088 ) -> fidl::Result<()> {
4089 decoder.debug_check_bounds::<Self>(offset);
4090 fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4092 Ok(())
4093 }
4094 }
4095
4096 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4097 type Borrowed<'a> = &'a Self;
4098 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4099 value
4100 }
4101 }
4102
4103 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpTypeOfServiceRequest {
4104 type Owned = Self;
4105
4106 #[inline(always)]
4107 fn inline_align(_context: fidl::encoding::Context) -> usize {
4108 1
4109 }
4110
4111 #[inline(always)]
4112 fn inline_size(_context: fidl::encoding::Context) -> usize {
4113 1
4114 }
4115 #[inline(always)]
4116 fn encode_is_copy() -> bool {
4117 true
4118 }
4119
4120 #[inline(always)]
4121 fn decode_is_copy() -> bool {
4122 true
4123 }
4124 }
4125
4126 unsafe impl<D: fidl::encoding::ResourceDialect>
4127 fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D>
4128 for &BaseNetworkSocketSetIpTypeOfServiceRequest
4129 {
4130 #[inline]
4131 unsafe fn encode(
4132 self,
4133 encoder: &mut fidl::encoding::Encoder<'_, D>,
4134 offset: usize,
4135 _depth: fidl::encoding::Depth,
4136 ) -> fidl::Result<()> {
4137 encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4138 unsafe {
4139 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4141 (buf_ptr as *mut BaseNetworkSocketSetIpTypeOfServiceRequest).write_unaligned(
4142 (self as *const BaseNetworkSocketSetIpTypeOfServiceRequest).read(),
4143 );
4144 }
4147 Ok(())
4148 }
4149 }
4150 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
4151 fidl::encoding::Encode<BaseNetworkSocketSetIpTypeOfServiceRequest, D> for (T0,)
4152 {
4153 #[inline]
4154 unsafe fn encode(
4155 self,
4156 encoder: &mut fidl::encoding::Encoder<'_, D>,
4157 offset: usize,
4158 depth: fidl::encoding::Depth,
4159 ) -> fidl::Result<()> {
4160 encoder.debug_check_bounds::<BaseNetworkSocketSetIpTypeOfServiceRequest>(offset);
4161 self.0.encode(encoder, offset + 0, depth)?;
4165 Ok(())
4166 }
4167 }
4168
4169 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4170 for BaseNetworkSocketSetIpTypeOfServiceRequest
4171 {
4172 #[inline(always)]
4173 fn new_empty() -> Self {
4174 Self { value: fidl::new_empty!(u8, D) }
4175 }
4176
4177 #[inline]
4178 unsafe fn decode(
4179 &mut self,
4180 decoder: &mut fidl::encoding::Decoder<'_, D>,
4181 offset: usize,
4182 _depth: fidl::encoding::Depth,
4183 ) -> fidl::Result<()> {
4184 decoder.debug_check_bounds::<Self>(offset);
4185 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4186 unsafe {
4189 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
4190 }
4191 Ok(())
4192 }
4193 }
4194
4195 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4196 type Borrowed<'a> = &'a Self;
4197 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4198 value
4199 }
4200 }
4201
4202 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastHopsRequest {
4203 type Owned = Self;
4204
4205 #[inline(always)]
4206 fn inline_align(_context: fidl::encoding::Context) -> usize {
4207 8
4208 }
4209
4210 #[inline(always)]
4211 fn inline_size(_context: fidl::encoding::Context) -> usize {
4212 16
4213 }
4214 }
4215
4216 unsafe impl<D: fidl::encoding::ResourceDialect>
4217 fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>
4218 for &BaseNetworkSocketSetIpv6MulticastHopsRequest
4219 {
4220 #[inline]
4221 unsafe fn encode(
4222 self,
4223 encoder: &mut fidl::encoding::Encoder<'_, D>,
4224 offset: usize,
4225 _depth: fidl::encoding::Depth,
4226 ) -> fidl::Result<()> {
4227 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4228 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastHopsRequest, D>::encode(
4230 (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4231 encoder,
4232 offset,
4233 _depth,
4234 )
4235 }
4236 }
4237 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4238 fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastHopsRequest, D> for (T0,)
4239 {
4240 #[inline]
4241 unsafe fn encode(
4242 self,
4243 encoder: &mut fidl::encoding::Encoder<'_, D>,
4244 offset: usize,
4245 depth: fidl::encoding::Depth,
4246 ) -> fidl::Result<()> {
4247 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastHopsRequest>(offset);
4248 self.0.encode(encoder, offset + 0, depth)?;
4252 Ok(())
4253 }
4254 }
4255
4256 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4257 for BaseNetworkSocketSetIpv6MulticastHopsRequest
4258 {
4259 #[inline(always)]
4260 fn new_empty() -> Self {
4261 Self { value: fidl::new_empty!(OptionalUint8, D) }
4262 }
4263
4264 #[inline]
4265 unsafe fn decode(
4266 &mut self,
4267 decoder: &mut fidl::encoding::Decoder<'_, D>,
4268 offset: usize,
4269 _depth: fidl::encoding::Depth,
4270 ) -> fidl::Result<()> {
4271 decoder.debug_check_bounds::<Self>(offset);
4272 fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4274 Ok(())
4275 }
4276 }
4277
4278 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4279 type Borrowed<'a> = &'a Self;
4280 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4281 value
4282 }
4283 }
4284
4285 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastInterfaceRequest {
4286 type Owned = Self;
4287
4288 #[inline(always)]
4289 fn inline_align(_context: fidl::encoding::Context) -> usize {
4290 8
4291 }
4292
4293 #[inline(always)]
4294 fn inline_size(_context: fidl::encoding::Context) -> usize {
4295 8
4296 }
4297 #[inline(always)]
4298 fn encode_is_copy() -> bool {
4299 true
4300 }
4301
4302 #[inline(always)]
4303 fn decode_is_copy() -> bool {
4304 true
4305 }
4306 }
4307
4308 unsafe impl<D: fidl::encoding::ResourceDialect>
4309 fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D>
4310 for &BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4311 {
4312 #[inline]
4313 unsafe fn encode(
4314 self,
4315 encoder: &mut fidl::encoding::Encoder<'_, D>,
4316 offset: usize,
4317 _depth: fidl::encoding::Depth,
4318 ) -> fidl::Result<()> {
4319 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4320 unsafe {
4321 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4323 (buf_ptr as *mut BaseNetworkSocketSetIpv6MulticastInterfaceRequest)
4324 .write_unaligned(
4325 (self as *const BaseNetworkSocketSetIpv6MulticastInterfaceRequest).read(),
4326 );
4327 }
4330 Ok(())
4331 }
4332 }
4333 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4334 fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastInterfaceRequest, D> for (T0,)
4335 {
4336 #[inline]
4337 unsafe fn encode(
4338 self,
4339 encoder: &mut fidl::encoding::Encoder<'_, D>,
4340 offset: usize,
4341 depth: fidl::encoding::Depth,
4342 ) -> fidl::Result<()> {
4343 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastInterfaceRequest>(offset);
4344 self.0.encode(encoder, offset + 0, depth)?;
4348 Ok(())
4349 }
4350 }
4351
4352 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4353 for BaseNetworkSocketSetIpv6MulticastInterfaceRequest
4354 {
4355 #[inline(always)]
4356 fn new_empty() -> Self {
4357 Self { value: fidl::new_empty!(u64, D) }
4358 }
4359
4360 #[inline]
4361 unsafe fn decode(
4362 &mut self,
4363 decoder: &mut fidl::encoding::Decoder<'_, D>,
4364 offset: usize,
4365 _depth: fidl::encoding::Depth,
4366 ) -> fidl::Result<()> {
4367 decoder.debug_check_bounds::<Self>(offset);
4368 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4369 unsafe {
4372 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4373 }
4374 Ok(())
4375 }
4376 }
4377
4378 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4379 type Borrowed<'a> = &'a Self;
4380 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4381 value
4382 }
4383 }
4384
4385 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6MulticastLoopbackRequest {
4386 type Owned = Self;
4387
4388 #[inline(always)]
4389 fn inline_align(_context: fidl::encoding::Context) -> usize {
4390 1
4391 }
4392
4393 #[inline(always)]
4394 fn inline_size(_context: fidl::encoding::Context) -> usize {
4395 1
4396 }
4397 }
4398
4399 unsafe impl<D: fidl::encoding::ResourceDialect>
4400 fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>
4401 for &BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4402 {
4403 #[inline]
4404 unsafe fn encode(
4405 self,
4406 encoder: &mut fidl::encoding::Encoder<'_, D>,
4407 offset: usize,
4408 _depth: fidl::encoding::Depth,
4409 ) -> fidl::Result<()> {
4410 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4411 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D>::encode(
4413 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4414 encoder,
4415 offset,
4416 _depth,
4417 )
4418 }
4419 }
4420 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4421 fidl::encoding::Encode<BaseNetworkSocketSetIpv6MulticastLoopbackRequest, D> for (T0,)
4422 {
4423 #[inline]
4424 unsafe fn encode(
4425 self,
4426 encoder: &mut fidl::encoding::Encoder<'_, D>,
4427 offset: usize,
4428 depth: fidl::encoding::Depth,
4429 ) -> fidl::Result<()> {
4430 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6MulticastLoopbackRequest>(offset);
4431 self.0.encode(encoder, offset + 0, depth)?;
4435 Ok(())
4436 }
4437 }
4438
4439 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4440 for BaseNetworkSocketSetIpv6MulticastLoopbackRequest
4441 {
4442 #[inline(always)]
4443 fn new_empty() -> Self {
4444 Self { value: fidl::new_empty!(bool, D) }
4445 }
4446
4447 #[inline]
4448 unsafe fn decode(
4449 &mut self,
4450 decoder: &mut fidl::encoding::Decoder<'_, D>,
4451 offset: usize,
4452 _depth: fidl::encoding::Depth,
4453 ) -> fidl::Result<()> {
4454 decoder.debug_check_bounds::<Self>(offset);
4455 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4457 Ok(())
4458 }
4459 }
4460
4461 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4462 type Borrowed<'a> = &'a Self;
4463 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4464 value
4465 }
4466 }
4467
4468 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6OnlyRequest {
4469 type Owned = Self;
4470
4471 #[inline(always)]
4472 fn inline_align(_context: fidl::encoding::Context) -> usize {
4473 1
4474 }
4475
4476 #[inline(always)]
4477 fn inline_size(_context: fidl::encoding::Context) -> usize {
4478 1
4479 }
4480 }
4481
4482 unsafe impl<D: fidl::encoding::ResourceDialect>
4483 fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D>
4484 for &BaseNetworkSocketSetIpv6OnlyRequest
4485 {
4486 #[inline]
4487 unsafe fn encode(
4488 self,
4489 encoder: &mut fidl::encoding::Encoder<'_, D>,
4490 offset: usize,
4491 _depth: fidl::encoding::Depth,
4492 ) -> fidl::Result<()> {
4493 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4494 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6OnlyRequest, D>::encode(
4496 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4497 encoder,
4498 offset,
4499 _depth,
4500 )
4501 }
4502 }
4503 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4504 fidl::encoding::Encode<BaseNetworkSocketSetIpv6OnlyRequest, D> for (T0,)
4505 {
4506 #[inline]
4507 unsafe fn encode(
4508 self,
4509 encoder: &mut fidl::encoding::Encoder<'_, D>,
4510 offset: usize,
4511 depth: fidl::encoding::Depth,
4512 ) -> fidl::Result<()> {
4513 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6OnlyRequest>(offset);
4514 self.0.encode(encoder, offset + 0, depth)?;
4518 Ok(())
4519 }
4520 }
4521
4522 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4523 for BaseNetworkSocketSetIpv6OnlyRequest
4524 {
4525 #[inline(always)]
4526 fn new_empty() -> Self {
4527 Self { value: fidl::new_empty!(bool, D) }
4528 }
4529
4530 #[inline]
4531 unsafe fn decode(
4532 &mut self,
4533 decoder: &mut fidl::encoding::Decoder<'_, D>,
4534 offset: usize,
4535 _depth: fidl::encoding::Depth,
4536 ) -> fidl::Result<()> {
4537 decoder.debug_check_bounds::<Self>(offset);
4538 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4540 Ok(())
4541 }
4542 }
4543
4544 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4545 type Borrowed<'a> = &'a Self;
4546 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4547 value
4548 }
4549 }
4550
4551 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest {
4552 type Owned = Self;
4553
4554 #[inline(always)]
4555 fn inline_align(_context: fidl::encoding::Context) -> usize {
4556 1
4557 }
4558
4559 #[inline(always)]
4560 fn inline_size(_context: fidl::encoding::Context) -> usize {
4561 1
4562 }
4563 }
4564
4565 unsafe impl<D: fidl::encoding::ResourceDialect>
4566 fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>
4567 for &BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4568 {
4569 #[inline]
4570 unsafe fn encode(
4571 self,
4572 encoder: &mut fidl::encoding::Encoder<'_, D>,
4573 offset: usize,
4574 _depth: fidl::encoding::Depth,
4575 ) -> fidl::Result<()> {
4576 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4577 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D>::encode(
4579 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4580 encoder,
4581 offset,
4582 _depth,
4583 )
4584 }
4585 }
4586 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4587 fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest, D> for (T0,)
4588 {
4589 #[inline]
4590 unsafe fn encode(
4591 self,
4592 encoder: &mut fidl::encoding::Encoder<'_, D>,
4593 offset: usize,
4594 depth: fidl::encoding::Depth,
4595 ) -> fidl::Result<()> {
4596 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveHopLimitRequest>(offset);
4597 self.0.encode(encoder, offset + 0, depth)?;
4601 Ok(())
4602 }
4603 }
4604
4605 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4606 for BaseNetworkSocketSetIpv6ReceiveHopLimitRequest
4607 {
4608 #[inline(always)]
4609 fn new_empty() -> Self {
4610 Self { value: fidl::new_empty!(bool, D) }
4611 }
4612
4613 #[inline]
4614 unsafe fn decode(
4615 &mut self,
4616 decoder: &mut fidl::encoding::Decoder<'_, D>,
4617 offset: usize,
4618 _depth: fidl::encoding::Depth,
4619 ) -> fidl::Result<()> {
4620 decoder.debug_check_bounds::<Self>(offset);
4621 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4623 Ok(())
4624 }
4625 }
4626
4627 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4628 type Borrowed<'a> = &'a Self;
4629 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4630 value
4631 }
4632 }
4633
4634 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest {
4635 type Owned = Self;
4636
4637 #[inline(always)]
4638 fn inline_align(_context: fidl::encoding::Context) -> usize {
4639 1
4640 }
4641
4642 #[inline(always)]
4643 fn inline_size(_context: fidl::encoding::Context) -> usize {
4644 1
4645 }
4646 }
4647
4648 unsafe impl<D: fidl::encoding::ResourceDialect>
4649 fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>
4650 for &BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4651 {
4652 #[inline]
4653 unsafe fn encode(
4654 self,
4655 encoder: &mut fidl::encoding::Encoder<'_, D>,
4656 offset: usize,
4657 _depth: fidl::encoding::Depth,
4658 ) -> fidl::Result<()> {
4659 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4660 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D>::encode(
4662 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4663 encoder,
4664 offset,
4665 _depth,
4666 )
4667 }
4668 }
4669 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4670 fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest, D> for (T0,)
4671 {
4672 #[inline]
4673 unsafe fn encode(
4674 self,
4675 encoder: &mut fidl::encoding::Encoder<'_, D>,
4676 offset: usize,
4677 depth: fidl::encoding::Depth,
4678 ) -> fidl::Result<()> {
4679 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6ReceivePacketInfoRequest>(offset);
4680 self.0.encode(encoder, offset + 0, depth)?;
4684 Ok(())
4685 }
4686 }
4687
4688 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4689 for BaseNetworkSocketSetIpv6ReceivePacketInfoRequest
4690 {
4691 #[inline(always)]
4692 fn new_empty() -> Self {
4693 Self { value: fidl::new_empty!(bool, D) }
4694 }
4695
4696 #[inline]
4697 unsafe fn decode(
4698 &mut self,
4699 decoder: &mut fidl::encoding::Decoder<'_, D>,
4700 offset: usize,
4701 _depth: fidl::encoding::Depth,
4702 ) -> fidl::Result<()> {
4703 decoder.debug_check_bounds::<Self>(offset);
4704 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4706 Ok(())
4707 }
4708 }
4709
4710 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4711 type Borrowed<'a> = &'a Self;
4712 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4713 value
4714 }
4715 }
4716
4717 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest {
4718 type Owned = Self;
4719
4720 #[inline(always)]
4721 fn inline_align(_context: fidl::encoding::Context) -> usize {
4722 1
4723 }
4724
4725 #[inline(always)]
4726 fn inline_size(_context: fidl::encoding::Context) -> usize {
4727 1
4728 }
4729 }
4730
4731 unsafe impl<D: fidl::encoding::ResourceDialect>
4732 fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>
4733 for &BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4734 {
4735 #[inline]
4736 unsafe fn encode(
4737 self,
4738 encoder: &mut fidl::encoding::Encoder<'_, D>,
4739 offset: usize,
4740 _depth: fidl::encoding::Depth,
4741 ) -> fidl::Result<()> {
4742 encoder
4743 .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4744 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D>::encode(
4746 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4747 encoder,
4748 offset,
4749 _depth,
4750 )
4751 }
4752 }
4753 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4754 fidl::encoding::Encode<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest, D> for (T0,)
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
4764 .debug_check_bounds::<BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest>(offset);
4765 self.0.encode(encoder, offset + 0, depth)?;
4769 Ok(())
4770 }
4771 }
4772
4773 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4774 for BaseNetworkSocketSetIpv6ReceiveTrafficClassRequest
4775 {
4776 #[inline(always)]
4777 fn new_empty() -> Self {
4778 Self { value: fidl::new_empty!(bool, D) }
4779 }
4780
4781 #[inline]
4782 unsafe fn decode(
4783 &mut self,
4784 decoder: &mut fidl::encoding::Decoder<'_, D>,
4785 offset: usize,
4786 _depth: fidl::encoding::Depth,
4787 ) -> fidl::Result<()> {
4788 decoder.debug_check_bounds::<Self>(offset);
4789 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
4791 Ok(())
4792 }
4793 }
4794
4795 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4796 type Borrowed<'a> = &'a Self;
4797 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4798 value
4799 }
4800 }
4801
4802 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6TrafficClassRequest {
4803 type Owned = Self;
4804
4805 #[inline(always)]
4806 fn inline_align(_context: fidl::encoding::Context) -> usize {
4807 8
4808 }
4809
4810 #[inline(always)]
4811 fn inline_size(_context: fidl::encoding::Context) -> usize {
4812 16
4813 }
4814 }
4815
4816 unsafe impl<D: fidl::encoding::ResourceDialect>
4817 fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D>
4818 for &BaseNetworkSocketSetIpv6TrafficClassRequest
4819 {
4820 #[inline]
4821 unsafe fn encode(
4822 self,
4823 encoder: &mut fidl::encoding::Encoder<'_, D>,
4824 offset: usize,
4825 _depth: fidl::encoding::Depth,
4826 ) -> fidl::Result<()> {
4827 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
4828 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6TrafficClassRequest, D>::encode(
4830 (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4831 encoder,
4832 offset,
4833 _depth,
4834 )
4835 }
4836 }
4837 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4838 fidl::encoding::Encode<BaseNetworkSocketSetIpv6TrafficClassRequest, D> for (T0,)
4839 {
4840 #[inline]
4841 unsafe fn encode(
4842 self,
4843 encoder: &mut fidl::encoding::Encoder<'_, D>,
4844 offset: usize,
4845 depth: fidl::encoding::Depth,
4846 ) -> fidl::Result<()> {
4847 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6TrafficClassRequest>(offset);
4848 self.0.encode(encoder, offset + 0, depth)?;
4852 Ok(())
4853 }
4854 }
4855
4856 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4857 for BaseNetworkSocketSetIpv6TrafficClassRequest
4858 {
4859 #[inline(always)]
4860 fn new_empty() -> Self {
4861 Self { value: fidl::new_empty!(OptionalUint8, D) }
4862 }
4863
4864 #[inline]
4865 unsafe fn decode(
4866 &mut self,
4867 decoder: &mut fidl::encoding::Decoder<'_, D>,
4868 offset: usize,
4869 _depth: fidl::encoding::Depth,
4870 ) -> fidl::Result<()> {
4871 decoder.debug_check_bounds::<Self>(offset);
4872 fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4874 Ok(())
4875 }
4876 }
4877
4878 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
4879 type Borrowed<'a> = &'a Self;
4880 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4881 value
4882 }
4883 }
4884
4885 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketSetIpv6UnicastHopsRequest {
4886 type Owned = Self;
4887
4888 #[inline(always)]
4889 fn inline_align(_context: fidl::encoding::Context) -> usize {
4890 8
4891 }
4892
4893 #[inline(always)]
4894 fn inline_size(_context: fidl::encoding::Context) -> usize {
4895 16
4896 }
4897 }
4898
4899 unsafe impl<D: fidl::encoding::ResourceDialect>
4900 fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>
4901 for &BaseNetworkSocketSetIpv6UnicastHopsRequest
4902 {
4903 #[inline]
4904 unsafe fn encode(
4905 self,
4906 encoder: &mut fidl::encoding::Encoder<'_, D>,
4907 offset: usize,
4908 _depth: fidl::encoding::Depth,
4909 ) -> fidl::Result<()> {
4910 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
4911 fidl::encoding::Encode::<BaseNetworkSocketSetIpv6UnicastHopsRequest, D>::encode(
4913 (<OptionalUint8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
4914 encoder,
4915 offset,
4916 _depth,
4917 )
4918 }
4919 }
4920 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint8, D>>
4921 fidl::encoding::Encode<BaseNetworkSocketSetIpv6UnicastHopsRequest, D> for (T0,)
4922 {
4923 #[inline]
4924 unsafe fn encode(
4925 self,
4926 encoder: &mut fidl::encoding::Encoder<'_, D>,
4927 offset: usize,
4928 depth: fidl::encoding::Depth,
4929 ) -> fidl::Result<()> {
4930 encoder.debug_check_bounds::<BaseNetworkSocketSetIpv6UnicastHopsRequest>(offset);
4931 self.0.encode(encoder, offset + 0, depth)?;
4935 Ok(())
4936 }
4937 }
4938
4939 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4940 for BaseNetworkSocketSetIpv6UnicastHopsRequest
4941 {
4942 #[inline(always)]
4943 fn new_empty() -> Self {
4944 Self { value: fidl::new_empty!(OptionalUint8, D) }
4945 }
4946
4947 #[inline]
4948 unsafe fn decode(
4949 &mut self,
4950 decoder: &mut fidl::encoding::Decoder<'_, D>,
4951 offset: usize,
4952 _depth: fidl::encoding::Depth,
4953 ) -> fidl::Result<()> {
4954 decoder.debug_check_bounds::<Self>(offset);
4955 fidl::decode!(OptionalUint8, D, &mut self.value, decoder, offset + 0, _depth)?;
4957 Ok(())
4958 }
4959 }
4960
4961 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketShutdownRequest {
4962 type Borrowed<'a> = &'a Self;
4963 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4964 value
4965 }
4966 }
4967
4968 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketShutdownRequest {
4969 type Owned = Self;
4970
4971 #[inline(always)]
4972 fn inline_align(_context: fidl::encoding::Context) -> usize {
4973 2
4974 }
4975
4976 #[inline(always)]
4977 fn inline_size(_context: fidl::encoding::Context) -> usize {
4978 2
4979 }
4980 }
4981
4982 unsafe impl<D: fidl::encoding::ResourceDialect>
4983 fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D>
4984 for &BaseNetworkSocketShutdownRequest
4985 {
4986 #[inline]
4987 unsafe fn encode(
4988 self,
4989 encoder: &mut fidl::encoding::Encoder<'_, D>,
4990 offset: usize,
4991 _depth: fidl::encoding::Depth,
4992 ) -> fidl::Result<()> {
4993 encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
4994 fidl::encoding::Encode::<BaseNetworkSocketShutdownRequest, D>::encode(
4996 (<ShutdownMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
4997 encoder,
4998 offset,
4999 _depth,
5000 )
5001 }
5002 }
5003 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ShutdownMode, D>>
5004 fidl::encoding::Encode<BaseNetworkSocketShutdownRequest, D> for (T0,)
5005 {
5006 #[inline]
5007 unsafe fn encode(
5008 self,
5009 encoder: &mut fidl::encoding::Encoder<'_, D>,
5010 offset: usize,
5011 depth: fidl::encoding::Depth,
5012 ) -> fidl::Result<()> {
5013 encoder.debug_check_bounds::<BaseNetworkSocketShutdownRequest>(offset);
5014 self.0.encode(encoder, offset + 0, depth)?;
5018 Ok(())
5019 }
5020 }
5021
5022 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5023 for BaseNetworkSocketShutdownRequest
5024 {
5025 #[inline(always)]
5026 fn new_empty() -> Self {
5027 Self { mode: fidl::new_empty!(ShutdownMode, D) }
5028 }
5029
5030 #[inline]
5031 unsafe fn decode(
5032 &mut self,
5033 decoder: &mut fidl::encoding::Decoder<'_, D>,
5034 offset: usize,
5035 _depth: fidl::encoding::Depth,
5036 ) -> fidl::Result<()> {
5037 decoder.debug_check_bounds::<Self>(offset);
5038 fidl::decode!(ShutdownMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
5040 Ok(())
5041 }
5042 }
5043
5044 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5045 type Borrowed<'a> = &'a Self;
5046 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5047 value
5048 }
5049 }
5050
5051 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastInterfaceResponse {
5052 type Owned = Self;
5053
5054 #[inline(always)]
5055 fn inline_align(_context: fidl::encoding::Context) -> usize {
5056 1
5057 }
5058
5059 #[inline(always)]
5060 fn inline_size(_context: fidl::encoding::Context) -> usize {
5061 4
5062 }
5063 }
5064
5065 unsafe impl<D: fidl::encoding::ResourceDialect>
5066 fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>
5067 for &BaseNetworkSocketGetIpMulticastInterfaceResponse
5068 {
5069 #[inline]
5070 unsafe fn encode(
5071 self,
5072 encoder: &mut fidl::encoding::Encoder<'_, D>,
5073 offset: usize,
5074 _depth: fidl::encoding::Depth,
5075 ) -> fidl::Result<()> {
5076 encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5077 fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastInterfaceResponse, D>::encode(
5079 (<fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(
5080 &self.value,
5081 ),),
5082 encoder,
5083 offset,
5084 _depth,
5085 )
5086 }
5087 }
5088 unsafe impl<
5089 D: fidl::encoding::ResourceDialect,
5090 T0: fidl::encoding::Encode<fidl_fuchsia_net::Ipv4Address, D>,
5091 > fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastInterfaceResponse, D> for (T0,)
5092 {
5093 #[inline]
5094 unsafe fn encode(
5095 self,
5096 encoder: &mut fidl::encoding::Encoder<'_, D>,
5097 offset: usize,
5098 depth: fidl::encoding::Depth,
5099 ) -> fidl::Result<()> {
5100 encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastInterfaceResponse>(offset);
5101 self.0.encode(encoder, offset + 0, depth)?;
5105 Ok(())
5106 }
5107 }
5108
5109 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5110 for BaseNetworkSocketGetIpMulticastInterfaceResponse
5111 {
5112 #[inline(always)]
5113 fn new_empty() -> Self {
5114 Self { value: fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D) }
5115 }
5116
5117 #[inline]
5118 unsafe fn decode(
5119 &mut self,
5120 decoder: &mut fidl::encoding::Decoder<'_, D>,
5121 offset: usize,
5122 _depth: fidl::encoding::Depth,
5123 ) -> fidl::Result<()> {
5124 decoder.debug_check_bounds::<Self>(offset);
5125 fidl::decode!(
5127 fidl_fuchsia_net::Ipv4Address,
5128 D,
5129 &mut self.value,
5130 decoder,
5131 offset + 0,
5132 _depth
5133 )?;
5134 Ok(())
5135 }
5136 }
5137
5138 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5139 type Borrowed<'a> = &'a Self;
5140 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5141 value
5142 }
5143 }
5144
5145 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastLoopbackResponse {
5146 type Owned = Self;
5147
5148 #[inline(always)]
5149 fn inline_align(_context: fidl::encoding::Context) -> usize {
5150 1
5151 }
5152
5153 #[inline(always)]
5154 fn inline_size(_context: fidl::encoding::Context) -> usize {
5155 1
5156 }
5157 }
5158
5159 unsafe impl<D: fidl::encoding::ResourceDialect>
5160 fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>
5161 for &BaseNetworkSocketGetIpMulticastLoopbackResponse
5162 {
5163 #[inline]
5164 unsafe fn encode(
5165 self,
5166 encoder: &mut fidl::encoding::Encoder<'_, D>,
5167 offset: usize,
5168 _depth: fidl::encoding::Depth,
5169 ) -> fidl::Result<()> {
5170 encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5171 fidl::encoding::Encode::<BaseNetworkSocketGetIpMulticastLoopbackResponse, D>::encode(
5173 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5174 encoder,
5175 offset,
5176 _depth,
5177 )
5178 }
5179 }
5180 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5181 fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastLoopbackResponse, D> for (T0,)
5182 {
5183 #[inline]
5184 unsafe fn encode(
5185 self,
5186 encoder: &mut fidl::encoding::Encoder<'_, D>,
5187 offset: usize,
5188 depth: fidl::encoding::Depth,
5189 ) -> fidl::Result<()> {
5190 encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastLoopbackResponse>(offset);
5191 self.0.encode(encoder, offset + 0, depth)?;
5195 Ok(())
5196 }
5197 }
5198
5199 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5200 for BaseNetworkSocketGetIpMulticastLoopbackResponse
5201 {
5202 #[inline(always)]
5203 fn new_empty() -> Self {
5204 Self { value: fidl::new_empty!(bool, D) }
5205 }
5206
5207 #[inline]
5208 unsafe fn decode(
5209 &mut self,
5210 decoder: &mut fidl::encoding::Decoder<'_, D>,
5211 offset: usize,
5212 _depth: fidl::encoding::Depth,
5213 ) -> fidl::Result<()> {
5214 decoder.debug_check_bounds::<Self>(offset);
5215 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5217 Ok(())
5218 }
5219 }
5220
5221 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5222 type Borrowed<'a> = &'a Self;
5223 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5224 value
5225 }
5226 }
5227
5228 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpMulticastTtlResponse {
5229 type Owned = Self;
5230
5231 #[inline(always)]
5232 fn inline_align(_context: fidl::encoding::Context) -> usize {
5233 1
5234 }
5235
5236 #[inline(always)]
5237 fn inline_size(_context: fidl::encoding::Context) -> usize {
5238 1
5239 }
5240 #[inline(always)]
5241 fn encode_is_copy() -> bool {
5242 true
5243 }
5244
5245 #[inline(always)]
5246 fn decode_is_copy() -> bool {
5247 true
5248 }
5249 }
5250
5251 unsafe impl<D: fidl::encoding::ResourceDialect>
5252 fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, D>
5253 for &BaseNetworkSocketGetIpMulticastTtlResponse
5254 {
5255 #[inline]
5256 unsafe fn encode(
5257 self,
5258 encoder: &mut fidl::encoding::Encoder<'_, D>,
5259 offset: usize,
5260 _depth: fidl::encoding::Depth,
5261 ) -> fidl::Result<()> {
5262 encoder.debug_check_bounds::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5263 unsafe {
5264 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5266 (buf_ptr as *mut BaseNetworkSocketGetIpMulticastTtlResponse).write_unaligned(
5267 (self as *const BaseNetworkSocketGetIpMulticastTtlResponse).read(),
5268 );
5269 }
5272 Ok(())
5273 }
5274 }
5275 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5276 fidl::encoding::Encode<BaseNetworkSocketGetIpMulticastTtlResponse, 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::<BaseNetworkSocketGetIpMulticastTtlResponse>(offset);
5286 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 BaseNetworkSocketGetIpMulticastTtlResponse
5296 {
5297 #[inline(always)]
5298 fn new_empty() -> Self {
5299 Self { value: fidl::new_empty!(u8, 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 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5311 unsafe {
5314 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5315 }
5316 Ok(())
5317 }
5318 }
5319
5320 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5321 type Borrowed<'a> = &'a Self;
5322 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5323 value
5324 }
5325 }
5326
5327 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpPacketInfoResponse {
5328 type Owned = Self;
5329
5330 #[inline(always)]
5331 fn inline_align(_context: fidl::encoding::Context) -> usize {
5332 1
5333 }
5334
5335 #[inline(always)]
5336 fn inline_size(_context: fidl::encoding::Context) -> usize {
5337 1
5338 }
5339 }
5340
5341 unsafe impl<D: fidl::encoding::ResourceDialect>
5342 fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D>
5343 for &BaseNetworkSocketGetIpPacketInfoResponse
5344 {
5345 #[inline]
5346 unsafe fn encode(
5347 self,
5348 encoder: &mut fidl::encoding::Encoder<'_, D>,
5349 offset: usize,
5350 _depth: fidl::encoding::Depth,
5351 ) -> fidl::Result<()> {
5352 encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5353 fidl::encoding::Encode::<BaseNetworkSocketGetIpPacketInfoResponse, D>::encode(
5355 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5356 encoder,
5357 offset,
5358 _depth,
5359 )
5360 }
5361 }
5362 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5363 fidl::encoding::Encode<BaseNetworkSocketGetIpPacketInfoResponse, D> for (T0,)
5364 {
5365 #[inline]
5366 unsafe fn encode(
5367 self,
5368 encoder: &mut fidl::encoding::Encoder<'_, D>,
5369 offset: usize,
5370 depth: fidl::encoding::Depth,
5371 ) -> fidl::Result<()> {
5372 encoder.debug_check_bounds::<BaseNetworkSocketGetIpPacketInfoResponse>(offset);
5373 self.0.encode(encoder, offset + 0, depth)?;
5377 Ok(())
5378 }
5379 }
5380
5381 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5382 for BaseNetworkSocketGetIpPacketInfoResponse
5383 {
5384 #[inline(always)]
5385 fn new_empty() -> Self {
5386 Self { value: fidl::new_empty!(bool, D) }
5387 }
5388
5389 #[inline]
5390 unsafe fn decode(
5391 &mut self,
5392 decoder: &mut fidl::encoding::Decoder<'_, D>,
5393 offset: usize,
5394 _depth: fidl::encoding::Depth,
5395 ) -> fidl::Result<()> {
5396 decoder.debug_check_bounds::<Self>(offset);
5397 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5399 Ok(())
5400 }
5401 }
5402
5403 impl fidl::encoding::ValueTypeMarker
5404 for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5405 {
5406 type Borrowed<'a> = &'a Self;
5407 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5408 value
5409 }
5410 }
5411
5412 unsafe impl fidl::encoding::TypeMarker
5413 for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5414 {
5415 type Owned = Self;
5416
5417 #[inline(always)]
5418 fn inline_align(_context: fidl::encoding::Context) -> usize {
5419 1
5420 }
5421
5422 #[inline(always)]
5423 fn inline_size(_context: fidl::encoding::Context) -> usize {
5424 1
5425 }
5426 }
5427
5428 unsafe impl<D: fidl::encoding::ResourceDialect>
5429 fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5430 for &BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5431 {
5432 #[inline]
5433 unsafe fn encode(
5434 self,
5435 encoder: &mut fidl::encoding::Encoder<'_, D>,
5436 offset: usize,
5437 _depth: fidl::encoding::Depth,
5438 ) -> fidl::Result<()> {
5439 encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5440 fidl::encoding::Encode::<
5442 BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse,
5443 D,
5444 >::encode(
5445 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5446 encoder,
5447 offset,
5448 _depth,
5449 )
5450 }
5451 }
5452 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5453 fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse, D>
5454 for (T0,)
5455 {
5456 #[inline]
5457 unsafe fn encode(
5458 self,
5459 encoder: &mut fidl::encoding::Encoder<'_, D>,
5460 offset: usize,
5461 depth: fidl::encoding::Depth,
5462 ) -> fidl::Result<()> {
5463 encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse>(offset);
5464 self.0.encode(encoder, offset + 0, depth)?;
5468 Ok(())
5469 }
5470 }
5471
5472 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5473 for BaseNetworkSocketGetIpReceiveOriginalDestinationAddressResponse
5474 {
5475 #[inline(always)]
5476 fn new_empty() -> Self {
5477 Self { value: fidl::new_empty!(bool, D) }
5478 }
5479
5480 #[inline]
5481 unsafe fn decode(
5482 &mut self,
5483 decoder: &mut fidl::encoding::Decoder<'_, D>,
5484 offset: usize,
5485 _depth: fidl::encoding::Depth,
5486 ) -> fidl::Result<()> {
5487 decoder.debug_check_bounds::<Self>(offset);
5488 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5490 Ok(())
5491 }
5492 }
5493
5494 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5495 type Borrowed<'a> = &'a Self;
5496 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5497 value
5498 }
5499 }
5500
5501 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTtlResponse {
5502 type Owned = Self;
5503
5504 #[inline(always)]
5505 fn inline_align(_context: fidl::encoding::Context) -> usize {
5506 1
5507 }
5508
5509 #[inline(always)]
5510 fn inline_size(_context: fidl::encoding::Context) -> usize {
5511 1
5512 }
5513 }
5514
5515 unsafe impl<D: fidl::encoding::ResourceDialect>
5516 fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D>
5517 for &BaseNetworkSocketGetIpReceiveTtlResponse
5518 {
5519 #[inline]
5520 unsafe fn encode(
5521 self,
5522 encoder: &mut fidl::encoding::Encoder<'_, D>,
5523 offset: usize,
5524 _depth: fidl::encoding::Depth,
5525 ) -> fidl::Result<()> {
5526 encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5527 fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTtlResponse, D>::encode(
5529 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5530 encoder,
5531 offset,
5532 _depth,
5533 )
5534 }
5535 }
5536 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5537 fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTtlResponse, D> for (T0,)
5538 {
5539 #[inline]
5540 unsafe fn encode(
5541 self,
5542 encoder: &mut fidl::encoding::Encoder<'_, D>,
5543 offset: usize,
5544 depth: fidl::encoding::Depth,
5545 ) -> fidl::Result<()> {
5546 encoder.debug_check_bounds::<BaseNetworkSocketGetIpReceiveTtlResponse>(offset);
5547 self.0.encode(encoder, offset + 0, depth)?;
5551 Ok(())
5552 }
5553 }
5554
5555 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5556 for BaseNetworkSocketGetIpReceiveTtlResponse
5557 {
5558 #[inline(always)]
5559 fn new_empty() -> Self {
5560 Self { value: fidl::new_empty!(bool, D) }
5561 }
5562
5563 #[inline]
5564 unsafe fn decode(
5565 &mut self,
5566 decoder: &mut fidl::encoding::Decoder<'_, D>,
5567 offset: usize,
5568 _depth: fidl::encoding::Depth,
5569 ) -> fidl::Result<()> {
5570 decoder.debug_check_bounds::<Self>(offset);
5571 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5573 Ok(())
5574 }
5575 }
5576
5577 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5578 type Borrowed<'a> = &'a Self;
5579 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5580 value
5581 }
5582 }
5583
5584 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse {
5585 type Owned = Self;
5586
5587 #[inline(always)]
5588 fn inline_align(_context: fidl::encoding::Context) -> usize {
5589 1
5590 }
5591
5592 #[inline(always)]
5593 fn inline_size(_context: fidl::encoding::Context) -> usize {
5594 1
5595 }
5596 }
5597
5598 unsafe impl<D: fidl::encoding::ResourceDialect>
5599 fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>
5600 for &BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5601 {
5602 #[inline]
5603 unsafe fn encode(
5604 self,
5605 encoder: &mut fidl::encoding::Encoder<'_, D>,
5606 offset: usize,
5607 _depth: fidl::encoding::Depth,
5608 ) -> fidl::Result<()> {
5609 encoder
5610 .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5611 fidl::encoding::Encode::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D>::encode(
5613 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5614 encoder,
5615 offset,
5616 _depth,
5617 )
5618 }
5619 }
5620 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5621 fidl::encoding::Encode<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse, D> for (T0,)
5622 {
5623 #[inline]
5624 unsafe fn encode(
5625 self,
5626 encoder: &mut fidl::encoding::Encoder<'_, D>,
5627 offset: usize,
5628 depth: fidl::encoding::Depth,
5629 ) -> fidl::Result<()> {
5630 encoder
5631 .debug_check_bounds::<BaseNetworkSocketGetIpReceiveTypeOfServiceResponse>(offset);
5632 self.0.encode(encoder, offset + 0, depth)?;
5636 Ok(())
5637 }
5638 }
5639
5640 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5641 for BaseNetworkSocketGetIpReceiveTypeOfServiceResponse
5642 {
5643 #[inline(always)]
5644 fn new_empty() -> Self {
5645 Self { value: fidl::new_empty!(bool, D) }
5646 }
5647
5648 #[inline]
5649 unsafe fn decode(
5650 &mut self,
5651 decoder: &mut fidl::encoding::Decoder<'_, D>,
5652 offset: usize,
5653 _depth: fidl::encoding::Depth,
5654 ) -> fidl::Result<()> {
5655 decoder.debug_check_bounds::<Self>(offset);
5656 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5658 Ok(())
5659 }
5660 }
5661
5662 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5663 type Borrowed<'a> = &'a Self;
5664 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5665 value
5666 }
5667 }
5668
5669 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTransparentResponse {
5670 type Owned = Self;
5671
5672 #[inline(always)]
5673 fn inline_align(_context: fidl::encoding::Context) -> usize {
5674 1
5675 }
5676
5677 #[inline(always)]
5678 fn inline_size(_context: fidl::encoding::Context) -> usize {
5679 1
5680 }
5681 }
5682
5683 unsafe impl<D: fidl::encoding::ResourceDialect>
5684 fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D>
5685 for &BaseNetworkSocketGetIpTransparentResponse
5686 {
5687 #[inline]
5688 unsafe fn encode(
5689 self,
5690 encoder: &mut fidl::encoding::Encoder<'_, D>,
5691 offset: usize,
5692 _depth: fidl::encoding::Depth,
5693 ) -> fidl::Result<()> {
5694 encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5695 fidl::encoding::Encode::<BaseNetworkSocketGetIpTransparentResponse, D>::encode(
5697 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5698 encoder,
5699 offset,
5700 _depth,
5701 )
5702 }
5703 }
5704 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5705 fidl::encoding::Encode<BaseNetworkSocketGetIpTransparentResponse, D> for (T0,)
5706 {
5707 #[inline]
5708 unsafe fn encode(
5709 self,
5710 encoder: &mut fidl::encoding::Encoder<'_, D>,
5711 offset: usize,
5712 depth: fidl::encoding::Depth,
5713 ) -> fidl::Result<()> {
5714 encoder.debug_check_bounds::<BaseNetworkSocketGetIpTransparentResponse>(offset);
5715 self.0.encode(encoder, offset + 0, depth)?;
5719 Ok(())
5720 }
5721 }
5722
5723 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5724 for BaseNetworkSocketGetIpTransparentResponse
5725 {
5726 #[inline(always)]
5727 fn new_empty() -> Self {
5728 Self { value: fidl::new_empty!(bool, D) }
5729 }
5730
5731 #[inline]
5732 unsafe fn decode(
5733 &mut self,
5734 decoder: &mut fidl::encoding::Decoder<'_, D>,
5735 offset: usize,
5736 _depth: fidl::encoding::Depth,
5737 ) -> fidl::Result<()> {
5738 decoder.debug_check_bounds::<Self>(offset);
5739 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5741 Ok(())
5742 }
5743 }
5744
5745 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTtlResponse {
5746 type Borrowed<'a> = &'a Self;
5747 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5748 value
5749 }
5750 }
5751
5752 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTtlResponse {
5753 type Owned = Self;
5754
5755 #[inline(always)]
5756 fn inline_align(_context: fidl::encoding::Context) -> usize {
5757 1
5758 }
5759
5760 #[inline(always)]
5761 fn inline_size(_context: fidl::encoding::Context) -> usize {
5762 1
5763 }
5764 #[inline(always)]
5765 fn encode_is_copy() -> bool {
5766 true
5767 }
5768
5769 #[inline(always)]
5770 fn decode_is_copy() -> bool {
5771 true
5772 }
5773 }
5774
5775 unsafe impl<D: fidl::encoding::ResourceDialect>
5776 fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D>
5777 for &BaseNetworkSocketGetIpTtlResponse
5778 {
5779 #[inline]
5780 unsafe fn encode(
5781 self,
5782 encoder: &mut fidl::encoding::Encoder<'_, D>,
5783 offset: usize,
5784 _depth: fidl::encoding::Depth,
5785 ) -> fidl::Result<()> {
5786 encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5787 unsafe {
5788 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5790 (buf_ptr as *mut BaseNetworkSocketGetIpTtlResponse)
5791 .write_unaligned((self as *const BaseNetworkSocketGetIpTtlResponse).read());
5792 }
5795 Ok(())
5796 }
5797 }
5798 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5799 fidl::encoding::Encode<BaseNetworkSocketGetIpTtlResponse, D> for (T0,)
5800 {
5801 #[inline]
5802 unsafe fn encode(
5803 self,
5804 encoder: &mut fidl::encoding::Encoder<'_, D>,
5805 offset: usize,
5806 depth: fidl::encoding::Depth,
5807 ) -> fidl::Result<()> {
5808 encoder.debug_check_bounds::<BaseNetworkSocketGetIpTtlResponse>(offset);
5809 self.0.encode(encoder, offset + 0, depth)?;
5813 Ok(())
5814 }
5815 }
5816
5817 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5818 for BaseNetworkSocketGetIpTtlResponse
5819 {
5820 #[inline(always)]
5821 fn new_empty() -> Self {
5822 Self { value: fidl::new_empty!(u8, D) }
5823 }
5824
5825 #[inline]
5826 unsafe fn decode(
5827 &mut self,
5828 decoder: &mut fidl::encoding::Decoder<'_, D>,
5829 offset: usize,
5830 _depth: fidl::encoding::Depth,
5831 ) -> fidl::Result<()> {
5832 decoder.debug_check_bounds::<Self>(offset);
5833 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5834 unsafe {
5837 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5838 }
5839 Ok(())
5840 }
5841 }
5842
5843 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
5844 type Borrowed<'a> = &'a Self;
5845 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5846 value
5847 }
5848 }
5849
5850 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpTypeOfServiceResponse {
5851 type Owned = Self;
5852
5853 #[inline(always)]
5854 fn inline_align(_context: fidl::encoding::Context) -> usize {
5855 1
5856 }
5857
5858 #[inline(always)]
5859 fn inline_size(_context: fidl::encoding::Context) -> usize {
5860 1
5861 }
5862 #[inline(always)]
5863 fn encode_is_copy() -> bool {
5864 true
5865 }
5866
5867 #[inline(always)]
5868 fn decode_is_copy() -> bool {
5869 true
5870 }
5871 }
5872
5873 unsafe impl<D: fidl::encoding::ResourceDialect>
5874 fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D>
5875 for &BaseNetworkSocketGetIpTypeOfServiceResponse
5876 {
5877 #[inline]
5878 unsafe fn encode(
5879 self,
5880 encoder: &mut fidl::encoding::Encoder<'_, D>,
5881 offset: usize,
5882 _depth: fidl::encoding::Depth,
5883 ) -> fidl::Result<()> {
5884 encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
5885 unsafe {
5886 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5888 (buf_ptr as *mut BaseNetworkSocketGetIpTypeOfServiceResponse).write_unaligned(
5889 (self as *const BaseNetworkSocketGetIpTypeOfServiceResponse).read(),
5890 );
5891 }
5894 Ok(())
5895 }
5896 }
5897 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5898 fidl::encoding::Encode<BaseNetworkSocketGetIpTypeOfServiceResponse, D> for (T0,)
5899 {
5900 #[inline]
5901 unsafe fn encode(
5902 self,
5903 encoder: &mut fidl::encoding::Encoder<'_, D>,
5904 offset: usize,
5905 depth: fidl::encoding::Depth,
5906 ) -> fidl::Result<()> {
5907 encoder.debug_check_bounds::<BaseNetworkSocketGetIpTypeOfServiceResponse>(offset);
5908 self.0.encode(encoder, offset + 0, depth)?;
5912 Ok(())
5913 }
5914 }
5915
5916 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5917 for BaseNetworkSocketGetIpTypeOfServiceResponse
5918 {
5919 #[inline(always)]
5920 fn new_empty() -> Self {
5921 Self { value: fidl::new_empty!(u8, D) }
5922 }
5923
5924 #[inline]
5925 unsafe fn decode(
5926 &mut self,
5927 decoder: &mut fidl::encoding::Decoder<'_, D>,
5928 offset: usize,
5929 _depth: fidl::encoding::Depth,
5930 ) -> fidl::Result<()> {
5931 decoder.debug_check_bounds::<Self>(offset);
5932 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5933 unsafe {
5936 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5937 }
5938 Ok(())
5939 }
5940 }
5941
5942 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
5943 type Borrowed<'a> = &'a Self;
5944 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5945 value
5946 }
5947 }
5948
5949 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastHopsResponse {
5950 type Owned = Self;
5951
5952 #[inline(always)]
5953 fn inline_align(_context: fidl::encoding::Context) -> usize {
5954 1
5955 }
5956
5957 #[inline(always)]
5958 fn inline_size(_context: fidl::encoding::Context) -> usize {
5959 1
5960 }
5961 #[inline(always)]
5962 fn encode_is_copy() -> bool {
5963 true
5964 }
5965
5966 #[inline(always)]
5967 fn decode_is_copy() -> bool {
5968 true
5969 }
5970 }
5971
5972 unsafe impl<D: fidl::encoding::ResourceDialect>
5973 fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D>
5974 for &BaseNetworkSocketGetIpv6MulticastHopsResponse
5975 {
5976 #[inline]
5977 unsafe fn encode(
5978 self,
5979 encoder: &mut fidl::encoding::Encoder<'_, D>,
5980 offset: usize,
5981 _depth: fidl::encoding::Depth,
5982 ) -> fidl::Result<()> {
5983 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
5984 unsafe {
5985 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5987 (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastHopsResponse).write_unaligned(
5988 (self as *const BaseNetworkSocketGetIpv6MulticastHopsResponse).read(),
5989 );
5990 }
5993 Ok(())
5994 }
5995 }
5996 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5997 fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastHopsResponse, D> for (T0,)
5998 {
5999 #[inline]
6000 unsafe fn encode(
6001 self,
6002 encoder: &mut fidl::encoding::Encoder<'_, D>,
6003 offset: usize,
6004 depth: fidl::encoding::Depth,
6005 ) -> fidl::Result<()> {
6006 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastHopsResponse>(offset);
6007 self.0.encode(encoder, offset + 0, depth)?;
6011 Ok(())
6012 }
6013 }
6014
6015 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6016 for BaseNetworkSocketGetIpv6MulticastHopsResponse
6017 {
6018 #[inline(always)]
6019 fn new_empty() -> Self {
6020 Self { value: fidl::new_empty!(u8, D) }
6021 }
6022
6023 #[inline]
6024 unsafe fn decode(
6025 &mut self,
6026 decoder: &mut fidl::encoding::Decoder<'_, D>,
6027 offset: usize,
6028 _depth: fidl::encoding::Depth,
6029 ) -> fidl::Result<()> {
6030 decoder.debug_check_bounds::<Self>(offset);
6031 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6032 unsafe {
6035 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6036 }
6037 Ok(())
6038 }
6039 }
6040
6041 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6042 type Borrowed<'a> = &'a Self;
6043 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6044 value
6045 }
6046 }
6047
6048 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastInterfaceResponse {
6049 type Owned = Self;
6050
6051 #[inline(always)]
6052 fn inline_align(_context: fidl::encoding::Context) -> usize {
6053 8
6054 }
6055
6056 #[inline(always)]
6057 fn inline_size(_context: fidl::encoding::Context) -> usize {
6058 8
6059 }
6060 #[inline(always)]
6061 fn encode_is_copy() -> bool {
6062 true
6063 }
6064
6065 #[inline(always)]
6066 fn decode_is_copy() -> bool {
6067 true
6068 }
6069 }
6070
6071 unsafe impl<D: fidl::encoding::ResourceDialect>
6072 fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D>
6073 for &BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6074 {
6075 #[inline]
6076 unsafe fn encode(
6077 self,
6078 encoder: &mut fidl::encoding::Encoder<'_, D>,
6079 offset: usize,
6080 _depth: fidl::encoding::Depth,
6081 ) -> fidl::Result<()> {
6082 encoder
6083 .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6084 unsafe {
6085 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6087 (buf_ptr as *mut BaseNetworkSocketGetIpv6MulticastInterfaceResponse)
6088 .write_unaligned(
6089 (self as *const BaseNetworkSocketGetIpv6MulticastInterfaceResponse).read(),
6090 );
6091 }
6094 Ok(())
6095 }
6096 }
6097 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6098 fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastInterfaceResponse, D> for (T0,)
6099 {
6100 #[inline]
6101 unsafe fn encode(
6102 self,
6103 encoder: &mut fidl::encoding::Encoder<'_, D>,
6104 offset: usize,
6105 depth: fidl::encoding::Depth,
6106 ) -> fidl::Result<()> {
6107 encoder
6108 .debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastInterfaceResponse>(offset);
6109 self.0.encode(encoder, offset + 0, depth)?;
6113 Ok(())
6114 }
6115 }
6116
6117 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6118 for BaseNetworkSocketGetIpv6MulticastInterfaceResponse
6119 {
6120 #[inline(always)]
6121 fn new_empty() -> Self {
6122 Self { value: fidl::new_empty!(u64, D) }
6123 }
6124
6125 #[inline]
6126 unsafe fn decode(
6127 &mut self,
6128 decoder: &mut fidl::encoding::Decoder<'_, D>,
6129 offset: usize,
6130 _depth: fidl::encoding::Depth,
6131 ) -> fidl::Result<()> {
6132 decoder.debug_check_bounds::<Self>(offset);
6133 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6134 unsafe {
6137 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6138 }
6139 Ok(())
6140 }
6141 }
6142
6143 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6144 type Borrowed<'a> = &'a Self;
6145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6146 value
6147 }
6148 }
6149
6150 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6MulticastLoopbackResponse {
6151 type Owned = Self;
6152
6153 #[inline(always)]
6154 fn inline_align(_context: fidl::encoding::Context) -> usize {
6155 1
6156 }
6157
6158 #[inline(always)]
6159 fn inline_size(_context: fidl::encoding::Context) -> usize {
6160 1
6161 }
6162 }
6163
6164 unsafe impl<D: fidl::encoding::ResourceDialect>
6165 fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>
6166 for &BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6167 {
6168 #[inline]
6169 unsafe fn encode(
6170 self,
6171 encoder: &mut fidl::encoding::Encoder<'_, D>,
6172 offset: usize,
6173 _depth: fidl::encoding::Depth,
6174 ) -> fidl::Result<()> {
6175 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6176 fidl::encoding::Encode::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D>::encode(
6178 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6179 encoder,
6180 offset,
6181 _depth,
6182 )
6183 }
6184 }
6185 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6186 fidl::encoding::Encode<BaseNetworkSocketGetIpv6MulticastLoopbackResponse, D> for (T0,)
6187 {
6188 #[inline]
6189 unsafe fn encode(
6190 self,
6191 encoder: &mut fidl::encoding::Encoder<'_, D>,
6192 offset: usize,
6193 depth: fidl::encoding::Depth,
6194 ) -> fidl::Result<()> {
6195 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6MulticastLoopbackResponse>(offset);
6196 self.0.encode(encoder, offset + 0, depth)?;
6200 Ok(())
6201 }
6202 }
6203
6204 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6205 for BaseNetworkSocketGetIpv6MulticastLoopbackResponse
6206 {
6207 #[inline(always)]
6208 fn new_empty() -> Self {
6209 Self { value: fidl::new_empty!(bool, D) }
6210 }
6211
6212 #[inline]
6213 unsafe fn decode(
6214 &mut self,
6215 decoder: &mut fidl::encoding::Decoder<'_, D>,
6216 offset: usize,
6217 _depth: fidl::encoding::Depth,
6218 ) -> fidl::Result<()> {
6219 decoder.debug_check_bounds::<Self>(offset);
6220 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6222 Ok(())
6223 }
6224 }
6225
6226 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6OnlyResponse {
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 BaseNetworkSocketGetIpv6OnlyResponse {
6234 type Owned = Self;
6235
6236 #[inline(always)]
6237 fn inline_align(_context: fidl::encoding::Context) -> usize {
6238 1
6239 }
6240
6241 #[inline(always)]
6242 fn inline_size(_context: fidl::encoding::Context) -> usize {
6243 1
6244 }
6245 }
6246
6247 unsafe impl<D: fidl::encoding::ResourceDialect>
6248 fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D>
6249 for &BaseNetworkSocketGetIpv6OnlyResponse
6250 {
6251 #[inline]
6252 unsafe fn encode(
6253 self,
6254 encoder: &mut fidl::encoding::Encoder<'_, D>,
6255 offset: usize,
6256 _depth: fidl::encoding::Depth,
6257 ) -> fidl::Result<()> {
6258 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6259 fidl::encoding::Encode::<BaseNetworkSocketGetIpv6OnlyResponse, D>::encode(
6261 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6262 encoder,
6263 offset,
6264 _depth,
6265 )
6266 }
6267 }
6268 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6269 fidl::encoding::Encode<BaseNetworkSocketGetIpv6OnlyResponse, D> for (T0,)
6270 {
6271 #[inline]
6272 unsafe fn encode(
6273 self,
6274 encoder: &mut fidl::encoding::Encoder<'_, D>,
6275 offset: usize,
6276 depth: fidl::encoding::Depth,
6277 ) -> fidl::Result<()> {
6278 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6OnlyResponse>(offset);
6279 self.0.encode(encoder, offset + 0, depth)?;
6283 Ok(())
6284 }
6285 }
6286
6287 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6288 for BaseNetworkSocketGetIpv6OnlyResponse
6289 {
6290 #[inline(always)]
6291 fn new_empty() -> Self {
6292 Self { value: fidl::new_empty!(bool, D) }
6293 }
6294
6295 #[inline]
6296 unsafe fn decode(
6297 &mut self,
6298 decoder: &mut fidl::encoding::Decoder<'_, D>,
6299 offset: usize,
6300 _depth: fidl::encoding::Depth,
6301 ) -> fidl::Result<()> {
6302 decoder.debug_check_bounds::<Self>(offset);
6303 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6305 Ok(())
6306 }
6307 }
6308
6309 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6310 type Borrowed<'a> = &'a Self;
6311 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6312 value
6313 }
6314 }
6315
6316 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse {
6317 type Owned = Self;
6318
6319 #[inline(always)]
6320 fn inline_align(_context: fidl::encoding::Context) -> usize {
6321 1
6322 }
6323
6324 #[inline(always)]
6325 fn inline_size(_context: fidl::encoding::Context) -> usize {
6326 1
6327 }
6328 }
6329
6330 unsafe impl<D: fidl::encoding::ResourceDialect>
6331 fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>
6332 for &BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6333 {
6334 #[inline]
6335 unsafe fn encode(
6336 self,
6337 encoder: &mut fidl::encoding::Encoder<'_, D>,
6338 offset: usize,
6339 _depth: fidl::encoding::Depth,
6340 ) -> fidl::Result<()> {
6341 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6342 fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D>::encode(
6344 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6345 encoder,
6346 offset,
6347 _depth,
6348 )
6349 }
6350 }
6351 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6352 fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse, D> for (T0,)
6353 {
6354 #[inline]
6355 unsafe fn encode(
6356 self,
6357 encoder: &mut fidl::encoding::Encoder<'_, D>,
6358 offset: usize,
6359 depth: fidl::encoding::Depth,
6360 ) -> fidl::Result<()> {
6361 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveHopLimitResponse>(offset);
6362 self.0.encode(encoder, offset + 0, depth)?;
6366 Ok(())
6367 }
6368 }
6369
6370 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6371 for BaseNetworkSocketGetIpv6ReceiveHopLimitResponse
6372 {
6373 #[inline(always)]
6374 fn new_empty() -> Self {
6375 Self { value: fidl::new_empty!(bool, D) }
6376 }
6377
6378 #[inline]
6379 unsafe fn decode(
6380 &mut self,
6381 decoder: &mut fidl::encoding::Decoder<'_, D>,
6382 offset: usize,
6383 _depth: fidl::encoding::Depth,
6384 ) -> fidl::Result<()> {
6385 decoder.debug_check_bounds::<Self>(offset);
6386 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6388 Ok(())
6389 }
6390 }
6391
6392 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6393 type Borrowed<'a> = &'a Self;
6394 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6395 value
6396 }
6397 }
6398
6399 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse {
6400 type Owned = Self;
6401
6402 #[inline(always)]
6403 fn inline_align(_context: fidl::encoding::Context) -> usize {
6404 1
6405 }
6406
6407 #[inline(always)]
6408 fn inline_size(_context: fidl::encoding::Context) -> usize {
6409 1
6410 }
6411 }
6412
6413 unsafe impl<D: fidl::encoding::ResourceDialect>
6414 fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>
6415 for &BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6416 {
6417 #[inline]
6418 unsafe fn encode(
6419 self,
6420 encoder: &mut fidl::encoding::Encoder<'_, D>,
6421 offset: usize,
6422 _depth: fidl::encoding::Depth,
6423 ) -> fidl::Result<()> {
6424 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6425 fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D>::encode(
6427 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6428 encoder,
6429 offset,
6430 _depth,
6431 )
6432 }
6433 }
6434 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6435 fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse, D> for (T0,)
6436 {
6437 #[inline]
6438 unsafe fn encode(
6439 self,
6440 encoder: &mut fidl::encoding::Encoder<'_, D>,
6441 offset: usize,
6442 depth: fidl::encoding::Depth,
6443 ) -> fidl::Result<()> {
6444 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6ReceivePacketInfoResponse>(offset);
6445 self.0.encode(encoder, offset + 0, depth)?;
6449 Ok(())
6450 }
6451 }
6452
6453 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6454 for BaseNetworkSocketGetIpv6ReceivePacketInfoResponse
6455 {
6456 #[inline(always)]
6457 fn new_empty() -> Self {
6458 Self { value: fidl::new_empty!(bool, D) }
6459 }
6460
6461 #[inline]
6462 unsafe fn decode(
6463 &mut self,
6464 decoder: &mut fidl::encoding::Decoder<'_, D>,
6465 offset: usize,
6466 _depth: fidl::encoding::Depth,
6467 ) -> fidl::Result<()> {
6468 decoder.debug_check_bounds::<Self>(offset);
6469 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6471 Ok(())
6472 }
6473 }
6474
6475 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6476 type Borrowed<'a> = &'a Self;
6477 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6478 value
6479 }
6480 }
6481
6482 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse {
6483 type Owned = Self;
6484
6485 #[inline(always)]
6486 fn inline_align(_context: fidl::encoding::Context) -> usize {
6487 1
6488 }
6489
6490 #[inline(always)]
6491 fn inline_size(_context: fidl::encoding::Context) -> usize {
6492 1
6493 }
6494 }
6495
6496 unsafe impl<D: fidl::encoding::ResourceDialect>
6497 fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>
6498 for &BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6499 {
6500 #[inline]
6501 unsafe fn encode(
6502 self,
6503 encoder: &mut fidl::encoding::Encoder<'_, D>,
6504 offset: usize,
6505 _depth: fidl::encoding::Depth,
6506 ) -> fidl::Result<()> {
6507 encoder
6508 .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6509 fidl::encoding::Encode::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D>::encode(
6511 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
6512 encoder,
6513 offset,
6514 _depth,
6515 )
6516 }
6517 }
6518 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6519 fidl::encoding::Encode<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse, D> for (T0,)
6520 {
6521 #[inline]
6522 unsafe fn encode(
6523 self,
6524 encoder: &mut fidl::encoding::Encoder<'_, D>,
6525 offset: usize,
6526 depth: fidl::encoding::Depth,
6527 ) -> fidl::Result<()> {
6528 encoder
6529 .debug_check_bounds::<BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse>(offset);
6530 self.0.encode(encoder, offset + 0, depth)?;
6534 Ok(())
6535 }
6536 }
6537
6538 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6539 for BaseNetworkSocketGetIpv6ReceiveTrafficClassResponse
6540 {
6541 #[inline(always)]
6542 fn new_empty() -> Self {
6543 Self { value: fidl::new_empty!(bool, D) }
6544 }
6545
6546 #[inline]
6547 unsafe fn decode(
6548 &mut self,
6549 decoder: &mut fidl::encoding::Decoder<'_, D>,
6550 offset: usize,
6551 _depth: fidl::encoding::Depth,
6552 ) -> fidl::Result<()> {
6553 decoder.debug_check_bounds::<Self>(offset);
6554 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
6556 Ok(())
6557 }
6558 }
6559
6560 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6561 type Borrowed<'a> = &'a Self;
6562 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6563 value
6564 }
6565 }
6566
6567 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6TrafficClassResponse {
6568 type Owned = Self;
6569
6570 #[inline(always)]
6571 fn inline_align(_context: fidl::encoding::Context) -> usize {
6572 1
6573 }
6574
6575 #[inline(always)]
6576 fn inline_size(_context: fidl::encoding::Context) -> usize {
6577 1
6578 }
6579 #[inline(always)]
6580 fn encode_is_copy() -> bool {
6581 true
6582 }
6583
6584 #[inline(always)]
6585 fn decode_is_copy() -> bool {
6586 true
6587 }
6588 }
6589
6590 unsafe impl<D: fidl::encoding::ResourceDialect>
6591 fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D>
6592 for &BaseNetworkSocketGetIpv6TrafficClassResponse
6593 {
6594 #[inline]
6595 unsafe fn encode(
6596 self,
6597 encoder: &mut fidl::encoding::Encoder<'_, D>,
6598 offset: usize,
6599 _depth: fidl::encoding::Depth,
6600 ) -> fidl::Result<()> {
6601 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6602 unsafe {
6603 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6605 (buf_ptr as *mut BaseNetworkSocketGetIpv6TrafficClassResponse).write_unaligned(
6606 (self as *const BaseNetworkSocketGetIpv6TrafficClassResponse).read(),
6607 );
6608 }
6611 Ok(())
6612 }
6613 }
6614 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6615 fidl::encoding::Encode<BaseNetworkSocketGetIpv6TrafficClassResponse, D> for (T0,)
6616 {
6617 #[inline]
6618 unsafe fn encode(
6619 self,
6620 encoder: &mut fidl::encoding::Encoder<'_, D>,
6621 offset: usize,
6622 depth: fidl::encoding::Depth,
6623 ) -> fidl::Result<()> {
6624 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6TrafficClassResponse>(offset);
6625 self.0.encode(encoder, offset + 0, depth)?;
6629 Ok(())
6630 }
6631 }
6632
6633 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6634 for BaseNetworkSocketGetIpv6TrafficClassResponse
6635 {
6636 #[inline(always)]
6637 fn new_empty() -> Self {
6638 Self { value: fidl::new_empty!(u8, D) }
6639 }
6640
6641 #[inline]
6642 unsafe fn decode(
6643 &mut self,
6644 decoder: &mut fidl::encoding::Decoder<'_, D>,
6645 offset: usize,
6646 _depth: fidl::encoding::Depth,
6647 ) -> fidl::Result<()> {
6648 decoder.debug_check_bounds::<Self>(offset);
6649 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6650 unsafe {
6653 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6654 }
6655 Ok(())
6656 }
6657 }
6658
6659 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6660 type Borrowed<'a> = &'a Self;
6661 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6662 value
6663 }
6664 }
6665
6666 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetIpv6UnicastHopsResponse {
6667 type Owned = Self;
6668
6669 #[inline(always)]
6670 fn inline_align(_context: fidl::encoding::Context) -> usize {
6671 1
6672 }
6673
6674 #[inline(always)]
6675 fn inline_size(_context: fidl::encoding::Context) -> usize {
6676 1
6677 }
6678 #[inline(always)]
6679 fn encode_is_copy() -> bool {
6680 true
6681 }
6682
6683 #[inline(always)]
6684 fn decode_is_copy() -> bool {
6685 true
6686 }
6687 }
6688
6689 unsafe impl<D: fidl::encoding::ResourceDialect>
6690 fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D>
6691 for &BaseNetworkSocketGetIpv6UnicastHopsResponse
6692 {
6693 #[inline]
6694 unsafe fn encode(
6695 self,
6696 encoder: &mut fidl::encoding::Encoder<'_, D>,
6697 offset: usize,
6698 _depth: fidl::encoding::Depth,
6699 ) -> fidl::Result<()> {
6700 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6701 unsafe {
6702 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6704 (buf_ptr as *mut BaseNetworkSocketGetIpv6UnicastHopsResponse).write_unaligned(
6705 (self as *const BaseNetworkSocketGetIpv6UnicastHopsResponse).read(),
6706 );
6707 }
6710 Ok(())
6711 }
6712 }
6713 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
6714 fidl::encoding::Encode<BaseNetworkSocketGetIpv6UnicastHopsResponse, D> for (T0,)
6715 {
6716 #[inline]
6717 unsafe fn encode(
6718 self,
6719 encoder: &mut fidl::encoding::Encoder<'_, D>,
6720 offset: usize,
6721 depth: fidl::encoding::Depth,
6722 ) -> fidl::Result<()> {
6723 encoder.debug_check_bounds::<BaseNetworkSocketGetIpv6UnicastHopsResponse>(offset);
6724 self.0.encode(encoder, offset + 0, depth)?;
6728 Ok(())
6729 }
6730 }
6731
6732 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6733 for BaseNetworkSocketGetIpv6UnicastHopsResponse
6734 {
6735 #[inline(always)]
6736 fn new_empty() -> Self {
6737 Self { value: fidl::new_empty!(u8, D) }
6738 }
6739
6740 #[inline]
6741 unsafe fn decode(
6742 &mut self,
6743 decoder: &mut fidl::encoding::Decoder<'_, D>,
6744 offset: usize,
6745 _depth: fidl::encoding::Depth,
6746 ) -> fidl::Result<()> {
6747 decoder.debug_check_bounds::<Self>(offset);
6748 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6749 unsafe {
6752 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
6753 }
6754 Ok(())
6755 }
6756 }
6757
6758 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6759 type Borrowed<'a> = &'a Self;
6760 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6761 value
6762 }
6763 }
6764
6765 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetOriginalDestinationResponse {
6766 type Owned = Self;
6767
6768 #[inline(always)]
6769 fn inline_align(_context: fidl::encoding::Context) -> usize {
6770 8
6771 }
6772
6773 #[inline(always)]
6774 fn inline_size(_context: fidl::encoding::Context) -> usize {
6775 16
6776 }
6777 }
6778
6779 unsafe impl<D: fidl::encoding::ResourceDialect>
6780 fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D>
6781 for &BaseNetworkSocketGetOriginalDestinationResponse
6782 {
6783 #[inline]
6784 unsafe fn encode(
6785 self,
6786 encoder: &mut fidl::encoding::Encoder<'_, D>,
6787 offset: usize,
6788 _depth: fidl::encoding::Depth,
6789 ) -> fidl::Result<()> {
6790 encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6791 fidl::encoding::Encode::<BaseNetworkSocketGetOriginalDestinationResponse, D>::encode(
6793 (<fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(
6794 &self.value,
6795 ),),
6796 encoder,
6797 offset,
6798 _depth,
6799 )
6800 }
6801 }
6802 unsafe impl<
6803 D: fidl::encoding::ResourceDialect,
6804 T0: fidl::encoding::Encode<fidl_fuchsia_net::SocketAddress, D>,
6805 > fidl::encoding::Encode<BaseNetworkSocketGetOriginalDestinationResponse, D> for (T0,)
6806 {
6807 #[inline]
6808 unsafe fn encode(
6809 self,
6810 encoder: &mut fidl::encoding::Encoder<'_, D>,
6811 offset: usize,
6812 depth: fidl::encoding::Depth,
6813 ) -> fidl::Result<()> {
6814 encoder.debug_check_bounds::<BaseNetworkSocketGetOriginalDestinationResponse>(offset);
6815 self.0.encode(encoder, offset + 0, depth)?;
6819 Ok(())
6820 }
6821 }
6822
6823 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6824 for BaseNetworkSocketGetOriginalDestinationResponse
6825 {
6826 #[inline(always)]
6827 fn new_empty() -> Self {
6828 Self { value: fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D) }
6829 }
6830
6831 #[inline]
6832 unsafe fn decode(
6833 &mut self,
6834 decoder: &mut fidl::encoding::Decoder<'_, D>,
6835 offset: usize,
6836 _depth: fidl::encoding::Depth,
6837 ) -> fidl::Result<()> {
6838 decoder.debug_check_bounds::<Self>(offset);
6839 fidl::decode!(
6841 fidl_fuchsia_net::SocketAddress,
6842 D,
6843 &mut self.value,
6844 decoder,
6845 offset + 0,
6846 _depth
6847 )?;
6848 Ok(())
6849 }
6850 }
6851
6852 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetPeerNameResponse {
6853 type Borrowed<'a> = &'a Self;
6854 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6855 value
6856 }
6857 }
6858
6859 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetPeerNameResponse {
6860 type Owned = Self;
6861
6862 #[inline(always)]
6863 fn inline_align(_context: fidl::encoding::Context) -> usize {
6864 8
6865 }
6866
6867 #[inline(always)]
6868 fn inline_size(_context: fidl::encoding::Context) -> usize {
6869 16
6870 }
6871 }
6872
6873 unsafe impl<D: fidl::encoding::ResourceDialect>
6874 fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, D>
6875 for &BaseNetworkSocketGetPeerNameResponse
6876 {
6877 #[inline]
6878 unsafe fn encode(
6879 self,
6880 encoder: &mut fidl::encoding::Encoder<'_, D>,
6881 offset: usize,
6882 _depth: fidl::encoding::Depth,
6883 ) -> fidl::Result<()> {
6884 encoder.debug_check_bounds::<BaseNetworkSocketGetPeerNameResponse>(offset);
6885 fidl::encoding::Encode::<BaseNetworkSocketGetPeerNameResponse, D>::encode(
6887 (<fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(
6888 &self.addr,
6889 ),),
6890 encoder,
6891 offset,
6892 _depth,
6893 )
6894 }
6895 }
6896 unsafe impl<
6897 D: fidl::encoding::ResourceDialect,
6898 T0: fidl::encoding::Encode<fidl_fuchsia_net::SocketAddress, D>,
6899 > fidl::encoding::Encode<BaseNetworkSocketGetPeerNameResponse, 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::<BaseNetworkSocketGetPeerNameResponse>(offset);
6909 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 BaseNetworkSocketGetPeerNameResponse
6919 {
6920 #[inline(always)]
6921 fn new_empty() -> Self {
6922 Self { addr: fidl::new_empty!(fidl_fuchsia_net::SocketAddress, 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 fidl::decode!(
6935 fidl_fuchsia_net::SocketAddress,
6936 D,
6937 &mut self.addr,
6938 decoder,
6939 offset + 0,
6940 _depth
6941 )?;
6942 Ok(())
6943 }
6944 }
6945
6946 impl fidl::encoding::ValueTypeMarker for BaseNetworkSocketGetSockNameResponse {
6947 type Borrowed<'a> = &'a Self;
6948 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6949 value
6950 }
6951 }
6952
6953 unsafe impl fidl::encoding::TypeMarker for BaseNetworkSocketGetSockNameResponse {
6954 type Owned = Self;
6955
6956 #[inline(always)]
6957 fn inline_align(_context: fidl::encoding::Context) -> usize {
6958 8
6959 }
6960
6961 #[inline(always)]
6962 fn inline_size(_context: fidl::encoding::Context) -> usize {
6963 16
6964 }
6965 }
6966
6967 unsafe impl<D: fidl::encoding::ResourceDialect>
6968 fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D>
6969 for &BaseNetworkSocketGetSockNameResponse
6970 {
6971 #[inline]
6972 unsafe fn encode(
6973 self,
6974 encoder: &mut fidl::encoding::Encoder<'_, D>,
6975 offset: usize,
6976 _depth: fidl::encoding::Depth,
6977 ) -> fidl::Result<()> {
6978 encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
6979 fidl::encoding::Encode::<BaseNetworkSocketGetSockNameResponse, D>::encode(
6981 (<fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(
6982 &self.addr,
6983 ),),
6984 encoder,
6985 offset,
6986 _depth,
6987 )
6988 }
6989 }
6990 unsafe impl<
6991 D: fidl::encoding::ResourceDialect,
6992 T0: fidl::encoding::Encode<fidl_fuchsia_net::SocketAddress, D>,
6993 > fidl::encoding::Encode<BaseNetworkSocketGetSockNameResponse, D> for (T0,)
6994 {
6995 #[inline]
6996 unsafe fn encode(
6997 self,
6998 encoder: &mut fidl::encoding::Encoder<'_, D>,
6999 offset: usize,
7000 depth: fidl::encoding::Depth,
7001 ) -> fidl::Result<()> {
7002 encoder.debug_check_bounds::<BaseNetworkSocketGetSockNameResponse>(offset);
7003 self.0.encode(encoder, offset + 0, depth)?;
7007 Ok(())
7008 }
7009 }
7010
7011 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7012 for BaseNetworkSocketGetSockNameResponse
7013 {
7014 #[inline(always)]
7015 fn new_empty() -> Self {
7016 Self { addr: fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D) }
7017 }
7018
7019 #[inline]
7020 unsafe fn decode(
7021 &mut self,
7022 decoder: &mut fidl::encoding::Decoder<'_, D>,
7023 offset: usize,
7024 _depth: fidl::encoding::Depth,
7025 ) -> fidl::Result<()> {
7026 decoder.debug_check_bounds::<Self>(offset);
7027 fidl::decode!(
7029 fidl_fuchsia_net::SocketAddress,
7030 D,
7031 &mut self.addr,
7032 decoder,
7033 offset + 0,
7034 _depth
7035 )?;
7036 Ok(())
7037 }
7038 }
7039
7040 impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkRequest {
7041 type Borrowed<'a> = &'a Self;
7042 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7043 value
7044 }
7045 }
7046
7047 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkRequest {
7048 type Owned = Self;
7049
7050 #[inline(always)]
7051 fn inline_align(_context: fidl::encoding::Context) -> usize {
7052 1
7053 }
7054
7055 #[inline(always)]
7056 fn inline_size(_context: fidl::encoding::Context) -> usize {
7057 1
7058 }
7059 }
7060
7061 unsafe impl<D: fidl::encoding::ResourceDialect>
7062 fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for &BaseSocketGetMarkRequest
7063 {
7064 #[inline]
7065 unsafe fn encode(
7066 self,
7067 encoder: &mut fidl::encoding::Encoder<'_, D>,
7068 offset: usize,
7069 _depth: fidl::encoding::Depth,
7070 ) -> fidl::Result<()> {
7071 encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7072 fidl::encoding::Encode::<BaseSocketGetMarkRequest, D>::encode(
7074 (<fidl_fuchsia_net::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(
7075 &self.domain,
7076 ),),
7077 encoder,
7078 offset,
7079 _depth,
7080 )
7081 }
7082 }
7083 unsafe impl<
7084 D: fidl::encoding::ResourceDialect,
7085 T0: fidl::encoding::Encode<fidl_fuchsia_net::MarkDomain, D>,
7086 > fidl::encoding::Encode<BaseSocketGetMarkRequest, D> for (T0,)
7087 {
7088 #[inline]
7089 unsafe fn encode(
7090 self,
7091 encoder: &mut fidl::encoding::Encoder<'_, D>,
7092 offset: usize,
7093 depth: fidl::encoding::Depth,
7094 ) -> fidl::Result<()> {
7095 encoder.debug_check_bounds::<BaseSocketGetMarkRequest>(offset);
7096 self.0.encode(encoder, offset + 0, depth)?;
7100 Ok(())
7101 }
7102 }
7103
7104 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7105 for BaseSocketGetMarkRequest
7106 {
7107 #[inline(always)]
7108 fn new_empty() -> Self {
7109 Self { domain: fidl::new_empty!(fidl_fuchsia_net::MarkDomain, D) }
7110 }
7111
7112 #[inline]
7113 unsafe fn decode(
7114 &mut self,
7115 decoder: &mut fidl::encoding::Decoder<'_, D>,
7116 offset: usize,
7117 _depth: fidl::encoding::Depth,
7118 ) -> fidl::Result<()> {
7119 decoder.debug_check_bounds::<Self>(offset);
7120 fidl::decode!(
7122 fidl_fuchsia_net::MarkDomain,
7123 D,
7124 &mut self.domain,
7125 decoder,
7126 offset + 0,
7127 _depth
7128 )?;
7129 Ok(())
7130 }
7131 }
7132
7133 impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToDeviceRequest {
7134 type Borrowed<'a> = &'a Self;
7135 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7136 value
7137 }
7138 }
7139
7140 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToDeviceRequest {
7141 type Owned = Self;
7142
7143 #[inline(always)]
7144 fn inline_align(_context: fidl::encoding::Context) -> usize {
7145 8
7146 }
7147
7148 #[inline(always)]
7149 fn inline_size(_context: fidl::encoding::Context) -> usize {
7150 16
7151 }
7152 }
7153
7154 unsafe impl<D: fidl::encoding::ResourceDialect>
7155 fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D>
7156 for &BaseSocketSetBindToDeviceRequest
7157 {
7158 #[inline]
7159 unsafe fn encode(
7160 self,
7161 encoder: &mut fidl::encoding::Encoder<'_, D>,
7162 offset: usize,
7163 _depth: fidl::encoding::Depth,
7164 ) -> fidl::Result<()> {
7165 encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7166 fidl::encoding::Encode::<BaseSocketSetBindToDeviceRequest, D>::encode(
7168 (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
7169 &self.value,
7170 ),),
7171 encoder,
7172 offset,
7173 _depth,
7174 )
7175 }
7176 }
7177 unsafe impl<
7178 D: fidl::encoding::ResourceDialect,
7179 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
7180 > fidl::encoding::Encode<BaseSocketSetBindToDeviceRequest, D> for (T0,)
7181 {
7182 #[inline]
7183 unsafe fn encode(
7184 self,
7185 encoder: &mut fidl::encoding::Encoder<'_, D>,
7186 offset: usize,
7187 depth: fidl::encoding::Depth,
7188 ) -> fidl::Result<()> {
7189 encoder.debug_check_bounds::<BaseSocketSetBindToDeviceRequest>(offset);
7190 self.0.encode(encoder, offset + 0, depth)?;
7194 Ok(())
7195 }
7196 }
7197
7198 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7199 for BaseSocketSetBindToDeviceRequest
7200 {
7201 #[inline(always)]
7202 fn new_empty() -> Self {
7203 Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
7204 }
7205
7206 #[inline]
7207 unsafe fn decode(
7208 &mut self,
7209 decoder: &mut fidl::encoding::Decoder<'_, D>,
7210 offset: usize,
7211 _depth: fidl::encoding::Depth,
7212 ) -> fidl::Result<()> {
7213 decoder.debug_check_bounds::<Self>(offset);
7214 fidl::decode!(
7216 fidl::encoding::BoundedString<15>,
7217 D,
7218 &mut self.value,
7219 decoder,
7220 offset + 0,
7221 _depth
7222 )?;
7223 Ok(())
7224 }
7225 }
7226
7227 impl fidl::encoding::ValueTypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7228 type Borrowed<'a> = &'a Self;
7229 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7230 value
7231 }
7232 }
7233
7234 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBindToInterfaceIndexRequest {
7235 type Owned = Self;
7236
7237 #[inline(always)]
7238 fn inline_align(_context: fidl::encoding::Context) -> usize {
7239 8
7240 }
7241
7242 #[inline(always)]
7243 fn inline_size(_context: fidl::encoding::Context) -> usize {
7244 8
7245 }
7246 #[inline(always)]
7247 fn encode_is_copy() -> bool {
7248 true
7249 }
7250
7251 #[inline(always)]
7252 fn decode_is_copy() -> bool {
7253 true
7254 }
7255 }
7256
7257 unsafe impl<D: fidl::encoding::ResourceDialect>
7258 fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D>
7259 for &BaseSocketSetBindToInterfaceIndexRequest
7260 {
7261 #[inline]
7262 unsafe fn encode(
7263 self,
7264 encoder: &mut fidl::encoding::Encoder<'_, D>,
7265 offset: usize,
7266 _depth: fidl::encoding::Depth,
7267 ) -> fidl::Result<()> {
7268 encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7269 unsafe {
7270 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7272 (buf_ptr as *mut BaseSocketSetBindToInterfaceIndexRequest).write_unaligned(
7273 (self as *const BaseSocketSetBindToInterfaceIndexRequest).read(),
7274 );
7275 }
7278 Ok(())
7279 }
7280 }
7281 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7282 fidl::encoding::Encode<BaseSocketSetBindToInterfaceIndexRequest, D> for (T0,)
7283 {
7284 #[inline]
7285 unsafe fn encode(
7286 self,
7287 encoder: &mut fidl::encoding::Encoder<'_, D>,
7288 offset: usize,
7289 depth: fidl::encoding::Depth,
7290 ) -> fidl::Result<()> {
7291 encoder.debug_check_bounds::<BaseSocketSetBindToInterfaceIndexRequest>(offset);
7292 self.0.encode(encoder, offset + 0, depth)?;
7296 Ok(())
7297 }
7298 }
7299
7300 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7301 for BaseSocketSetBindToInterfaceIndexRequest
7302 {
7303 #[inline(always)]
7304 fn new_empty() -> Self {
7305 Self { value: fidl::new_empty!(u64, D) }
7306 }
7307
7308 #[inline]
7309 unsafe fn decode(
7310 &mut self,
7311 decoder: &mut fidl::encoding::Decoder<'_, D>,
7312 offset: usize,
7313 _depth: fidl::encoding::Depth,
7314 ) -> fidl::Result<()> {
7315 decoder.debug_check_bounds::<Self>(offset);
7316 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7317 unsafe {
7320 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7321 }
7322 Ok(())
7323 }
7324 }
7325
7326 impl fidl::encoding::ValueTypeMarker for BaseSocketSetBroadcastRequest {
7327 type Borrowed<'a> = &'a Self;
7328 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7329 value
7330 }
7331 }
7332
7333 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetBroadcastRequest {
7334 type Owned = Self;
7335
7336 #[inline(always)]
7337 fn inline_align(_context: fidl::encoding::Context) -> usize {
7338 1
7339 }
7340
7341 #[inline(always)]
7342 fn inline_size(_context: fidl::encoding::Context) -> usize {
7343 1
7344 }
7345 }
7346
7347 unsafe impl<D: fidl::encoding::ResourceDialect>
7348 fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D>
7349 for &BaseSocketSetBroadcastRequest
7350 {
7351 #[inline]
7352 unsafe fn encode(
7353 self,
7354 encoder: &mut fidl::encoding::Encoder<'_, D>,
7355 offset: usize,
7356 _depth: fidl::encoding::Depth,
7357 ) -> fidl::Result<()> {
7358 encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7359 fidl::encoding::Encode::<BaseSocketSetBroadcastRequest, D>::encode(
7361 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7362 encoder,
7363 offset,
7364 _depth,
7365 )
7366 }
7367 }
7368 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7369 fidl::encoding::Encode<BaseSocketSetBroadcastRequest, D> for (T0,)
7370 {
7371 #[inline]
7372 unsafe fn encode(
7373 self,
7374 encoder: &mut fidl::encoding::Encoder<'_, D>,
7375 offset: usize,
7376 depth: fidl::encoding::Depth,
7377 ) -> fidl::Result<()> {
7378 encoder.debug_check_bounds::<BaseSocketSetBroadcastRequest>(offset);
7379 self.0.encode(encoder, offset + 0, depth)?;
7383 Ok(())
7384 }
7385 }
7386
7387 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7388 for BaseSocketSetBroadcastRequest
7389 {
7390 #[inline(always)]
7391 fn new_empty() -> Self {
7392 Self { value: fidl::new_empty!(bool, D) }
7393 }
7394
7395 #[inline]
7396 unsafe fn decode(
7397 &mut self,
7398 decoder: &mut fidl::encoding::Decoder<'_, D>,
7399 offset: usize,
7400 _depth: fidl::encoding::Depth,
7401 ) -> fidl::Result<()> {
7402 decoder.debug_check_bounds::<Self>(offset);
7403 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7405 Ok(())
7406 }
7407 }
7408
7409 impl fidl::encoding::ValueTypeMarker for BaseSocketSetKeepAliveRequest {
7410 type Borrowed<'a> = &'a Self;
7411 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7412 value
7413 }
7414 }
7415
7416 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetKeepAliveRequest {
7417 type Owned = Self;
7418
7419 #[inline(always)]
7420 fn inline_align(_context: fidl::encoding::Context) -> usize {
7421 1
7422 }
7423
7424 #[inline(always)]
7425 fn inline_size(_context: fidl::encoding::Context) -> usize {
7426 1
7427 }
7428 }
7429
7430 unsafe impl<D: fidl::encoding::ResourceDialect>
7431 fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D>
7432 for &BaseSocketSetKeepAliveRequest
7433 {
7434 #[inline]
7435 unsafe fn encode(
7436 self,
7437 encoder: &mut fidl::encoding::Encoder<'_, D>,
7438 offset: usize,
7439 _depth: fidl::encoding::Depth,
7440 ) -> fidl::Result<()> {
7441 encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7442 fidl::encoding::Encode::<BaseSocketSetKeepAliveRequest, D>::encode(
7444 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7445 encoder,
7446 offset,
7447 _depth,
7448 )
7449 }
7450 }
7451 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7452 fidl::encoding::Encode<BaseSocketSetKeepAliveRequest, D> for (T0,)
7453 {
7454 #[inline]
7455 unsafe fn encode(
7456 self,
7457 encoder: &mut fidl::encoding::Encoder<'_, D>,
7458 offset: usize,
7459 depth: fidl::encoding::Depth,
7460 ) -> fidl::Result<()> {
7461 encoder.debug_check_bounds::<BaseSocketSetKeepAliveRequest>(offset);
7462 self.0.encode(encoder, offset + 0, depth)?;
7466 Ok(())
7467 }
7468 }
7469
7470 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7471 for BaseSocketSetKeepAliveRequest
7472 {
7473 #[inline(always)]
7474 fn new_empty() -> Self {
7475 Self { value: fidl::new_empty!(bool, D) }
7476 }
7477
7478 #[inline]
7479 unsafe fn decode(
7480 &mut self,
7481 decoder: &mut fidl::encoding::Decoder<'_, D>,
7482 offset: usize,
7483 _depth: fidl::encoding::Depth,
7484 ) -> fidl::Result<()> {
7485 decoder.debug_check_bounds::<Self>(offset);
7486 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7488 Ok(())
7489 }
7490 }
7491
7492 impl fidl::encoding::ValueTypeMarker for BaseSocketSetLingerRequest {
7493 type Borrowed<'a> = &'a Self;
7494 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7495 value
7496 }
7497 }
7498
7499 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetLingerRequest {
7500 type Owned = Self;
7501
7502 #[inline(always)]
7503 fn inline_align(_context: fidl::encoding::Context) -> usize {
7504 4
7505 }
7506
7507 #[inline(always)]
7508 fn inline_size(_context: fidl::encoding::Context) -> usize {
7509 8
7510 }
7511 }
7512
7513 unsafe impl<D: fidl::encoding::ResourceDialect>
7514 fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for &BaseSocketSetLingerRequest
7515 {
7516 #[inline]
7517 unsafe fn encode(
7518 self,
7519 encoder: &mut fidl::encoding::Encoder<'_, D>,
7520 offset: usize,
7521 _depth: fidl::encoding::Depth,
7522 ) -> fidl::Result<()> {
7523 encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7524 fidl::encoding::Encode::<BaseSocketSetLingerRequest, D>::encode(
7526 (
7527 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
7528 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
7529 ),
7530 encoder,
7531 offset,
7532 _depth,
7533 )
7534 }
7535 }
7536 unsafe impl<
7537 D: fidl::encoding::ResourceDialect,
7538 T0: fidl::encoding::Encode<bool, D>,
7539 T1: fidl::encoding::Encode<u32, D>,
7540 > fidl::encoding::Encode<BaseSocketSetLingerRequest, D> for (T0, T1)
7541 {
7542 #[inline]
7543 unsafe fn encode(
7544 self,
7545 encoder: &mut fidl::encoding::Encoder<'_, D>,
7546 offset: usize,
7547 depth: fidl::encoding::Depth,
7548 ) -> fidl::Result<()> {
7549 encoder.debug_check_bounds::<BaseSocketSetLingerRequest>(offset);
7550 unsafe {
7553 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7554 (ptr as *mut u32).write_unaligned(0);
7555 }
7556 self.0.encode(encoder, offset + 0, depth)?;
7558 self.1.encode(encoder, offset + 4, depth)?;
7559 Ok(())
7560 }
7561 }
7562
7563 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7564 for BaseSocketSetLingerRequest
7565 {
7566 #[inline(always)]
7567 fn new_empty() -> Self {
7568 Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
7569 }
7570
7571 #[inline]
7572 unsafe fn decode(
7573 &mut self,
7574 decoder: &mut fidl::encoding::Decoder<'_, D>,
7575 offset: usize,
7576 _depth: fidl::encoding::Depth,
7577 ) -> fidl::Result<()> {
7578 decoder.debug_check_bounds::<Self>(offset);
7579 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7581 let padval = unsafe { (ptr as *const u32).read_unaligned() };
7582 let mask = 0xffffff00u32;
7583 let maskedval = padval & mask;
7584 if maskedval != 0 {
7585 return Err(fidl::Error::NonZeroPadding {
7586 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7587 });
7588 }
7589 fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
7590 fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
7591 Ok(())
7592 }
7593 }
7594
7595 impl fidl::encoding::ValueTypeMarker for BaseSocketSetMarkRequest {
7596 type Borrowed<'a> = &'a Self;
7597 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7598 value
7599 }
7600 }
7601
7602 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetMarkRequest {
7603 type Owned = Self;
7604
7605 #[inline(always)]
7606 fn inline_align(_context: fidl::encoding::Context) -> usize {
7607 8
7608 }
7609
7610 #[inline(always)]
7611 fn inline_size(_context: fidl::encoding::Context) -> usize {
7612 24
7613 }
7614 }
7615
7616 unsafe impl<D: fidl::encoding::ResourceDialect>
7617 fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for &BaseSocketSetMarkRequest
7618 {
7619 #[inline]
7620 unsafe fn encode(
7621 self,
7622 encoder: &mut fidl::encoding::Encoder<'_, D>,
7623 offset: usize,
7624 _depth: fidl::encoding::Depth,
7625 ) -> fidl::Result<()> {
7626 encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7627 fidl::encoding::Encode::<BaseSocketSetMarkRequest, D>::encode(
7629 (
7630 <fidl_fuchsia_net::MarkDomain as fidl::encoding::ValueTypeMarker>::borrow(
7631 &self.domain,
7632 ),
7633 <OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),
7634 ),
7635 encoder,
7636 offset,
7637 _depth,
7638 )
7639 }
7640 }
7641 unsafe impl<
7642 D: fidl::encoding::ResourceDialect,
7643 T0: fidl::encoding::Encode<fidl_fuchsia_net::MarkDomain, D>,
7644 T1: fidl::encoding::Encode<OptionalUint32, D>,
7645 > fidl::encoding::Encode<BaseSocketSetMarkRequest, D> for (T0, T1)
7646 {
7647 #[inline]
7648 unsafe fn encode(
7649 self,
7650 encoder: &mut fidl::encoding::Encoder<'_, D>,
7651 offset: usize,
7652 depth: fidl::encoding::Depth,
7653 ) -> fidl::Result<()> {
7654 encoder.debug_check_bounds::<BaseSocketSetMarkRequest>(offset);
7655 unsafe {
7658 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7659 (ptr as *mut u64).write_unaligned(0);
7660 }
7661 self.0.encode(encoder, offset + 0, depth)?;
7663 self.1.encode(encoder, offset + 8, depth)?;
7664 Ok(())
7665 }
7666 }
7667
7668 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7669 for BaseSocketSetMarkRequest
7670 {
7671 #[inline(always)]
7672 fn new_empty() -> Self {
7673 Self {
7674 domain: fidl::new_empty!(fidl_fuchsia_net::MarkDomain, D),
7675 mark: fidl::new_empty!(OptionalUint32, D),
7676 }
7677 }
7678
7679 #[inline]
7680 unsafe fn decode(
7681 &mut self,
7682 decoder: &mut fidl::encoding::Decoder<'_, D>,
7683 offset: usize,
7684 _depth: fidl::encoding::Depth,
7685 ) -> fidl::Result<()> {
7686 decoder.debug_check_bounds::<Self>(offset);
7687 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7689 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7690 let mask = 0xffffffffffffff00u64;
7691 let maskedval = padval & mask;
7692 if maskedval != 0 {
7693 return Err(fidl::Error::NonZeroPadding {
7694 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7695 });
7696 }
7697 fidl::decode!(
7698 fidl_fuchsia_net::MarkDomain,
7699 D,
7700 &mut self.domain,
7701 decoder,
7702 offset + 0,
7703 _depth
7704 )?;
7705 fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 8, _depth)?;
7706 Ok(())
7707 }
7708 }
7709
7710 impl fidl::encoding::ValueTypeMarker for BaseSocketSetNoCheckRequest {
7711 type Borrowed<'a> = &'a Self;
7712 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7713 value
7714 }
7715 }
7716
7717 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetNoCheckRequest {
7718 type Owned = Self;
7719
7720 #[inline(always)]
7721 fn inline_align(_context: fidl::encoding::Context) -> usize {
7722 1
7723 }
7724
7725 #[inline(always)]
7726 fn inline_size(_context: fidl::encoding::Context) -> usize {
7727 1
7728 }
7729 }
7730
7731 unsafe impl<D: fidl::encoding::ResourceDialect>
7732 fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for &BaseSocketSetNoCheckRequest
7733 {
7734 #[inline]
7735 unsafe fn encode(
7736 self,
7737 encoder: &mut fidl::encoding::Encoder<'_, D>,
7738 offset: usize,
7739 _depth: fidl::encoding::Depth,
7740 ) -> fidl::Result<()> {
7741 encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7742 fidl::encoding::Encode::<BaseSocketSetNoCheckRequest, D>::encode(
7744 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7745 encoder,
7746 offset,
7747 _depth,
7748 )
7749 }
7750 }
7751 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7752 fidl::encoding::Encode<BaseSocketSetNoCheckRequest, D> for (T0,)
7753 {
7754 #[inline]
7755 unsafe fn encode(
7756 self,
7757 encoder: &mut fidl::encoding::Encoder<'_, D>,
7758 offset: usize,
7759 depth: fidl::encoding::Depth,
7760 ) -> fidl::Result<()> {
7761 encoder.debug_check_bounds::<BaseSocketSetNoCheckRequest>(offset);
7762 self.0.encode(encoder, offset + 0, depth)?;
7766 Ok(())
7767 }
7768 }
7769
7770 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7771 for BaseSocketSetNoCheckRequest
7772 {
7773 #[inline(always)]
7774 fn new_empty() -> Self {
7775 Self { value: fidl::new_empty!(bool, D) }
7776 }
7777
7778 #[inline]
7779 unsafe fn decode(
7780 &mut self,
7781 decoder: &mut fidl::encoding::Decoder<'_, D>,
7782 offset: usize,
7783 _depth: fidl::encoding::Depth,
7784 ) -> fidl::Result<()> {
7785 decoder.debug_check_bounds::<Self>(offset);
7786 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7788 Ok(())
7789 }
7790 }
7791
7792 impl fidl::encoding::ValueTypeMarker for BaseSocketSetOutOfBandInlineRequest {
7793 type Borrowed<'a> = &'a Self;
7794 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7795 value
7796 }
7797 }
7798
7799 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetOutOfBandInlineRequest {
7800 type Owned = Self;
7801
7802 #[inline(always)]
7803 fn inline_align(_context: fidl::encoding::Context) -> usize {
7804 1
7805 }
7806
7807 #[inline(always)]
7808 fn inline_size(_context: fidl::encoding::Context) -> usize {
7809 1
7810 }
7811 }
7812
7813 unsafe impl<D: fidl::encoding::ResourceDialect>
7814 fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D>
7815 for &BaseSocketSetOutOfBandInlineRequest
7816 {
7817 #[inline]
7818 unsafe fn encode(
7819 self,
7820 encoder: &mut fidl::encoding::Encoder<'_, D>,
7821 offset: usize,
7822 _depth: fidl::encoding::Depth,
7823 ) -> fidl::Result<()> {
7824 encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
7825 fidl::encoding::Encode::<BaseSocketSetOutOfBandInlineRequest, D>::encode(
7827 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
7828 encoder,
7829 offset,
7830 _depth,
7831 )
7832 }
7833 }
7834 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7835 fidl::encoding::Encode<BaseSocketSetOutOfBandInlineRequest, D> for (T0,)
7836 {
7837 #[inline]
7838 unsafe fn encode(
7839 self,
7840 encoder: &mut fidl::encoding::Encoder<'_, D>,
7841 offset: usize,
7842 depth: fidl::encoding::Depth,
7843 ) -> fidl::Result<()> {
7844 encoder.debug_check_bounds::<BaseSocketSetOutOfBandInlineRequest>(offset);
7845 self.0.encode(encoder, offset + 0, depth)?;
7849 Ok(())
7850 }
7851 }
7852
7853 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7854 for BaseSocketSetOutOfBandInlineRequest
7855 {
7856 #[inline(always)]
7857 fn new_empty() -> Self {
7858 Self { value: fidl::new_empty!(bool, D) }
7859 }
7860
7861 #[inline]
7862 unsafe fn decode(
7863 &mut self,
7864 decoder: &mut fidl::encoding::Decoder<'_, D>,
7865 offset: usize,
7866 _depth: fidl::encoding::Depth,
7867 ) -> fidl::Result<()> {
7868 decoder.debug_check_bounds::<Self>(offset);
7869 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
7871 Ok(())
7872 }
7873 }
7874
7875 impl fidl::encoding::ValueTypeMarker for BaseSocketSetReceiveBufferRequest {
7876 type Borrowed<'a> = &'a Self;
7877 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7878 value
7879 }
7880 }
7881
7882 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReceiveBufferRequest {
7883 type Owned = Self;
7884
7885 #[inline(always)]
7886 fn inline_align(_context: fidl::encoding::Context) -> usize {
7887 8
7888 }
7889
7890 #[inline(always)]
7891 fn inline_size(_context: fidl::encoding::Context) -> usize {
7892 8
7893 }
7894 #[inline(always)]
7895 fn encode_is_copy() -> bool {
7896 true
7897 }
7898
7899 #[inline(always)]
7900 fn decode_is_copy() -> bool {
7901 true
7902 }
7903 }
7904
7905 unsafe impl<D: fidl::encoding::ResourceDialect>
7906 fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D>
7907 for &BaseSocketSetReceiveBufferRequest
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::<BaseSocketSetReceiveBufferRequest>(offset);
7917 unsafe {
7918 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7920 (buf_ptr as *mut BaseSocketSetReceiveBufferRequest)
7921 .write_unaligned((self as *const BaseSocketSetReceiveBufferRequest).read());
7922 }
7925 Ok(())
7926 }
7927 }
7928 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7929 fidl::encoding::Encode<BaseSocketSetReceiveBufferRequest, D> for (T0,)
7930 {
7931 #[inline]
7932 unsafe fn encode(
7933 self,
7934 encoder: &mut fidl::encoding::Encoder<'_, D>,
7935 offset: usize,
7936 depth: fidl::encoding::Depth,
7937 ) -> fidl::Result<()> {
7938 encoder.debug_check_bounds::<BaseSocketSetReceiveBufferRequest>(offset);
7939 self.0.encode(encoder, offset + 0, depth)?;
7943 Ok(())
7944 }
7945 }
7946
7947 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7948 for BaseSocketSetReceiveBufferRequest
7949 {
7950 #[inline(always)]
7951 fn new_empty() -> Self {
7952 Self { value_bytes: fidl::new_empty!(u64, D) }
7953 }
7954
7955 #[inline]
7956 unsafe fn decode(
7957 &mut self,
7958 decoder: &mut fidl::encoding::Decoder<'_, D>,
7959 offset: usize,
7960 _depth: fidl::encoding::Depth,
7961 ) -> fidl::Result<()> {
7962 decoder.debug_check_bounds::<Self>(offset);
7963 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7964 unsafe {
7967 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7968 }
7969 Ok(())
7970 }
7971 }
7972
7973 impl fidl::encoding::ValueTypeMarker for BaseSocketSetReuseAddressRequest {
7974 type Borrowed<'a> = &'a Self;
7975 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7976 value
7977 }
7978 }
7979
7980 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReuseAddressRequest {
7981 type Owned = Self;
7982
7983 #[inline(always)]
7984 fn inline_align(_context: fidl::encoding::Context) -> usize {
7985 1
7986 }
7987
7988 #[inline(always)]
7989 fn inline_size(_context: fidl::encoding::Context) -> usize {
7990 1
7991 }
7992 }
7993
7994 unsafe impl<D: fidl::encoding::ResourceDialect>
7995 fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D>
7996 for &BaseSocketSetReuseAddressRequest
7997 {
7998 #[inline]
7999 unsafe fn encode(
8000 self,
8001 encoder: &mut fidl::encoding::Encoder<'_, D>,
8002 offset: usize,
8003 _depth: fidl::encoding::Depth,
8004 ) -> fidl::Result<()> {
8005 encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8006 fidl::encoding::Encode::<BaseSocketSetReuseAddressRequest, D>::encode(
8008 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8009 encoder,
8010 offset,
8011 _depth,
8012 )
8013 }
8014 }
8015 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8016 fidl::encoding::Encode<BaseSocketSetReuseAddressRequest, D> for (T0,)
8017 {
8018 #[inline]
8019 unsafe fn encode(
8020 self,
8021 encoder: &mut fidl::encoding::Encoder<'_, D>,
8022 offset: usize,
8023 depth: fidl::encoding::Depth,
8024 ) -> fidl::Result<()> {
8025 encoder.debug_check_bounds::<BaseSocketSetReuseAddressRequest>(offset);
8026 self.0.encode(encoder, offset + 0, depth)?;
8030 Ok(())
8031 }
8032 }
8033
8034 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8035 for BaseSocketSetReuseAddressRequest
8036 {
8037 #[inline(always)]
8038 fn new_empty() -> Self {
8039 Self { value: fidl::new_empty!(bool, D) }
8040 }
8041
8042 #[inline]
8043 unsafe fn decode(
8044 &mut self,
8045 decoder: &mut fidl::encoding::Decoder<'_, D>,
8046 offset: usize,
8047 _depth: fidl::encoding::Depth,
8048 ) -> fidl::Result<()> {
8049 decoder.debug_check_bounds::<Self>(offset);
8050 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8052 Ok(())
8053 }
8054 }
8055
8056 impl fidl::encoding::ValueTypeMarker for BaseSocketSetReusePortRequest {
8057 type Borrowed<'a> = &'a Self;
8058 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8059 value
8060 }
8061 }
8062
8063 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetReusePortRequest {
8064 type Owned = Self;
8065
8066 #[inline(always)]
8067 fn inline_align(_context: fidl::encoding::Context) -> usize {
8068 1
8069 }
8070
8071 #[inline(always)]
8072 fn inline_size(_context: fidl::encoding::Context) -> usize {
8073 1
8074 }
8075 }
8076
8077 unsafe impl<D: fidl::encoding::ResourceDialect>
8078 fidl::encoding::Encode<BaseSocketSetReusePortRequest, D>
8079 for &BaseSocketSetReusePortRequest
8080 {
8081 #[inline]
8082 unsafe fn encode(
8083 self,
8084 encoder: &mut fidl::encoding::Encoder<'_, D>,
8085 offset: usize,
8086 _depth: fidl::encoding::Depth,
8087 ) -> fidl::Result<()> {
8088 encoder.debug_check_bounds::<BaseSocketSetReusePortRequest>(offset);
8089 fidl::encoding::Encode::<BaseSocketSetReusePortRequest, D>::encode(
8091 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8092 encoder,
8093 offset,
8094 _depth,
8095 )
8096 }
8097 }
8098 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8099 fidl::encoding::Encode<BaseSocketSetReusePortRequest, D> for (T0,)
8100 {
8101 #[inline]
8102 unsafe fn encode(
8103 self,
8104 encoder: &mut fidl::encoding::Encoder<'_, D>,
8105 offset: usize,
8106 depth: fidl::encoding::Depth,
8107 ) -> fidl::Result<()> {
8108 encoder.debug_check_bounds::<BaseSocketSetReusePortRequest>(offset);
8109 self.0.encode(encoder, offset + 0, depth)?;
8113 Ok(())
8114 }
8115 }
8116
8117 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8118 for BaseSocketSetReusePortRequest
8119 {
8120 #[inline(always)]
8121 fn new_empty() -> Self {
8122 Self { value: fidl::new_empty!(bool, D) }
8123 }
8124
8125 #[inline]
8126 unsafe fn decode(
8127 &mut self,
8128 decoder: &mut fidl::encoding::Decoder<'_, D>,
8129 offset: usize,
8130 _depth: fidl::encoding::Depth,
8131 ) -> fidl::Result<()> {
8132 decoder.debug_check_bounds::<Self>(offset);
8133 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8135 Ok(())
8136 }
8137 }
8138
8139 impl fidl::encoding::ValueTypeMarker for BaseSocketSetSendBufferRequest {
8140 type Borrowed<'a> = &'a Self;
8141 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8142 value
8143 }
8144 }
8145
8146 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetSendBufferRequest {
8147 type Owned = Self;
8148
8149 #[inline(always)]
8150 fn inline_align(_context: fidl::encoding::Context) -> usize {
8151 8
8152 }
8153
8154 #[inline(always)]
8155 fn inline_size(_context: fidl::encoding::Context) -> usize {
8156 8
8157 }
8158 #[inline(always)]
8159 fn encode_is_copy() -> bool {
8160 true
8161 }
8162
8163 #[inline(always)]
8164 fn decode_is_copy() -> bool {
8165 true
8166 }
8167 }
8168
8169 unsafe impl<D: fidl::encoding::ResourceDialect>
8170 fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D>
8171 for &BaseSocketSetSendBufferRequest
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::<BaseSocketSetSendBufferRequest>(offset);
8181 unsafe {
8182 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8184 (buf_ptr as *mut BaseSocketSetSendBufferRequest)
8185 .write_unaligned((self as *const BaseSocketSetSendBufferRequest).read());
8186 }
8189 Ok(())
8190 }
8191 }
8192 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8193 fidl::encoding::Encode<BaseSocketSetSendBufferRequest, D> for (T0,)
8194 {
8195 #[inline]
8196 unsafe fn encode(
8197 self,
8198 encoder: &mut fidl::encoding::Encoder<'_, D>,
8199 offset: usize,
8200 depth: fidl::encoding::Depth,
8201 ) -> fidl::Result<()> {
8202 encoder.debug_check_bounds::<BaseSocketSetSendBufferRequest>(offset);
8203 self.0.encode(encoder, offset + 0, depth)?;
8207 Ok(())
8208 }
8209 }
8210
8211 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8212 for BaseSocketSetSendBufferRequest
8213 {
8214 #[inline(always)]
8215 fn new_empty() -> Self {
8216 Self { value_bytes: fidl::new_empty!(u64, D) }
8217 }
8218
8219 #[inline]
8220 unsafe fn decode(
8221 &mut self,
8222 decoder: &mut fidl::encoding::Decoder<'_, D>,
8223 offset: usize,
8224 _depth: fidl::encoding::Depth,
8225 ) -> fidl::Result<()> {
8226 decoder.debug_check_bounds::<Self>(offset);
8227 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8228 unsafe {
8231 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8232 }
8233 Ok(())
8234 }
8235 }
8236
8237 impl fidl::encoding::ValueTypeMarker for BaseSocketSetTimestampRequest {
8238 type Borrowed<'a> = &'a Self;
8239 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8240 value
8241 }
8242 }
8243
8244 unsafe impl fidl::encoding::TypeMarker for BaseSocketSetTimestampRequest {
8245 type Owned = Self;
8246
8247 #[inline(always)]
8248 fn inline_align(_context: fidl::encoding::Context) -> usize {
8249 4
8250 }
8251
8252 #[inline(always)]
8253 fn inline_size(_context: fidl::encoding::Context) -> usize {
8254 4
8255 }
8256 }
8257
8258 unsafe impl<D: fidl::encoding::ResourceDialect>
8259 fidl::encoding::Encode<BaseSocketSetTimestampRequest, D>
8260 for &BaseSocketSetTimestampRequest
8261 {
8262 #[inline]
8263 unsafe fn encode(
8264 self,
8265 encoder: &mut fidl::encoding::Encoder<'_, D>,
8266 offset: usize,
8267 _depth: fidl::encoding::Depth,
8268 ) -> fidl::Result<()> {
8269 encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8270 fidl::encoding::Encode::<BaseSocketSetTimestampRequest, D>::encode(
8272 (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8273 encoder,
8274 offset,
8275 _depth,
8276 )
8277 }
8278 }
8279 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
8280 fidl::encoding::Encode<BaseSocketSetTimestampRequest, D> for (T0,)
8281 {
8282 #[inline]
8283 unsafe fn encode(
8284 self,
8285 encoder: &mut fidl::encoding::Encoder<'_, D>,
8286 offset: usize,
8287 depth: fidl::encoding::Depth,
8288 ) -> fidl::Result<()> {
8289 encoder.debug_check_bounds::<BaseSocketSetTimestampRequest>(offset);
8290 self.0.encode(encoder, offset + 0, depth)?;
8294 Ok(())
8295 }
8296 }
8297
8298 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8299 for BaseSocketSetTimestampRequest
8300 {
8301 #[inline(always)]
8302 fn new_empty() -> Self {
8303 Self { value: fidl::new_empty!(TimestampOption, D) }
8304 }
8305
8306 #[inline]
8307 unsafe fn decode(
8308 &mut self,
8309 decoder: &mut fidl::encoding::Decoder<'_, D>,
8310 offset: usize,
8311 _depth: fidl::encoding::Depth,
8312 ) -> fidl::Result<()> {
8313 decoder.debug_check_bounds::<Self>(offset);
8314 fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
8316 Ok(())
8317 }
8318 }
8319
8320 impl fidl::encoding::ValueTypeMarker for BaseSocketGetAcceptConnResponse {
8321 type Borrowed<'a> = &'a Self;
8322 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8323 value
8324 }
8325 }
8326
8327 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetAcceptConnResponse {
8328 type Owned = Self;
8329
8330 #[inline(always)]
8331 fn inline_align(_context: fidl::encoding::Context) -> usize {
8332 1
8333 }
8334
8335 #[inline(always)]
8336 fn inline_size(_context: fidl::encoding::Context) -> usize {
8337 1
8338 }
8339 }
8340
8341 unsafe impl<D: fidl::encoding::ResourceDialect>
8342 fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D>
8343 for &BaseSocketGetAcceptConnResponse
8344 {
8345 #[inline]
8346 unsafe fn encode(
8347 self,
8348 encoder: &mut fidl::encoding::Encoder<'_, D>,
8349 offset: usize,
8350 _depth: fidl::encoding::Depth,
8351 ) -> fidl::Result<()> {
8352 encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8353 fidl::encoding::Encode::<BaseSocketGetAcceptConnResponse, D>::encode(
8355 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8356 encoder,
8357 offset,
8358 _depth,
8359 )
8360 }
8361 }
8362 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8363 fidl::encoding::Encode<BaseSocketGetAcceptConnResponse, D> for (T0,)
8364 {
8365 #[inline]
8366 unsafe fn encode(
8367 self,
8368 encoder: &mut fidl::encoding::Encoder<'_, D>,
8369 offset: usize,
8370 depth: fidl::encoding::Depth,
8371 ) -> fidl::Result<()> {
8372 encoder.debug_check_bounds::<BaseSocketGetAcceptConnResponse>(offset);
8373 self.0.encode(encoder, offset + 0, depth)?;
8377 Ok(())
8378 }
8379 }
8380
8381 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8382 for BaseSocketGetAcceptConnResponse
8383 {
8384 #[inline(always)]
8385 fn new_empty() -> Self {
8386 Self { value: fidl::new_empty!(bool, D) }
8387 }
8388
8389 #[inline]
8390 unsafe fn decode(
8391 &mut self,
8392 decoder: &mut fidl::encoding::Decoder<'_, D>,
8393 offset: usize,
8394 _depth: fidl::encoding::Depth,
8395 ) -> fidl::Result<()> {
8396 decoder.debug_check_bounds::<Self>(offset);
8397 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8399 Ok(())
8400 }
8401 }
8402
8403 impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToDeviceResponse {
8404 type Borrowed<'a> = &'a Self;
8405 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8406 value
8407 }
8408 }
8409
8410 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToDeviceResponse {
8411 type Owned = Self;
8412
8413 #[inline(always)]
8414 fn inline_align(_context: fidl::encoding::Context) -> usize {
8415 8
8416 }
8417
8418 #[inline(always)]
8419 fn inline_size(_context: fidl::encoding::Context) -> usize {
8420 16
8421 }
8422 }
8423
8424 unsafe impl<D: fidl::encoding::ResourceDialect>
8425 fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D>
8426 for &BaseSocketGetBindToDeviceResponse
8427 {
8428 #[inline]
8429 unsafe fn encode(
8430 self,
8431 encoder: &mut fidl::encoding::Encoder<'_, D>,
8432 offset: usize,
8433 _depth: fidl::encoding::Depth,
8434 ) -> fidl::Result<()> {
8435 encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8436 fidl::encoding::Encode::<BaseSocketGetBindToDeviceResponse, D>::encode(
8438 (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
8439 &self.value,
8440 ),),
8441 encoder,
8442 offset,
8443 _depth,
8444 )
8445 }
8446 }
8447 unsafe impl<
8448 D: fidl::encoding::ResourceDialect,
8449 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
8450 > fidl::encoding::Encode<BaseSocketGetBindToDeviceResponse, D> for (T0,)
8451 {
8452 #[inline]
8453 unsafe fn encode(
8454 self,
8455 encoder: &mut fidl::encoding::Encoder<'_, D>,
8456 offset: usize,
8457 depth: fidl::encoding::Depth,
8458 ) -> fidl::Result<()> {
8459 encoder.debug_check_bounds::<BaseSocketGetBindToDeviceResponse>(offset);
8460 self.0.encode(encoder, offset + 0, depth)?;
8464 Ok(())
8465 }
8466 }
8467
8468 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8469 for BaseSocketGetBindToDeviceResponse
8470 {
8471 #[inline(always)]
8472 fn new_empty() -> Self {
8473 Self { value: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
8474 }
8475
8476 #[inline]
8477 unsafe fn decode(
8478 &mut self,
8479 decoder: &mut fidl::encoding::Decoder<'_, D>,
8480 offset: usize,
8481 _depth: fidl::encoding::Depth,
8482 ) -> fidl::Result<()> {
8483 decoder.debug_check_bounds::<Self>(offset);
8484 fidl::decode!(
8486 fidl::encoding::BoundedString<15>,
8487 D,
8488 &mut self.value,
8489 decoder,
8490 offset + 0,
8491 _depth
8492 )?;
8493 Ok(())
8494 }
8495 }
8496
8497 impl fidl::encoding::ValueTypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8498 type Borrowed<'a> = &'a Self;
8499 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8500 value
8501 }
8502 }
8503
8504 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBindToInterfaceIndexResponse {
8505 type Owned = Self;
8506
8507 #[inline(always)]
8508 fn inline_align(_context: fidl::encoding::Context) -> usize {
8509 8
8510 }
8511
8512 #[inline(always)]
8513 fn inline_size(_context: fidl::encoding::Context) -> usize {
8514 8
8515 }
8516 #[inline(always)]
8517 fn encode_is_copy() -> bool {
8518 true
8519 }
8520
8521 #[inline(always)]
8522 fn decode_is_copy() -> bool {
8523 true
8524 }
8525 }
8526
8527 unsafe impl<D: fidl::encoding::ResourceDialect>
8528 fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D>
8529 for &BaseSocketGetBindToInterfaceIndexResponse
8530 {
8531 #[inline]
8532 unsafe fn encode(
8533 self,
8534 encoder: &mut fidl::encoding::Encoder<'_, D>,
8535 offset: usize,
8536 _depth: fidl::encoding::Depth,
8537 ) -> fidl::Result<()> {
8538 encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8539 unsafe {
8540 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8542 (buf_ptr as *mut BaseSocketGetBindToInterfaceIndexResponse).write_unaligned(
8543 (self as *const BaseSocketGetBindToInterfaceIndexResponse).read(),
8544 );
8545 }
8548 Ok(())
8549 }
8550 }
8551 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8552 fidl::encoding::Encode<BaseSocketGetBindToInterfaceIndexResponse, D> for (T0,)
8553 {
8554 #[inline]
8555 unsafe fn encode(
8556 self,
8557 encoder: &mut fidl::encoding::Encoder<'_, D>,
8558 offset: usize,
8559 depth: fidl::encoding::Depth,
8560 ) -> fidl::Result<()> {
8561 encoder.debug_check_bounds::<BaseSocketGetBindToInterfaceIndexResponse>(offset);
8562 self.0.encode(encoder, offset + 0, depth)?;
8566 Ok(())
8567 }
8568 }
8569
8570 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8571 for BaseSocketGetBindToInterfaceIndexResponse
8572 {
8573 #[inline(always)]
8574 fn new_empty() -> Self {
8575 Self { value: fidl::new_empty!(u64, D) }
8576 }
8577
8578 #[inline]
8579 unsafe fn decode(
8580 &mut self,
8581 decoder: &mut fidl::encoding::Decoder<'_, D>,
8582 offset: usize,
8583 _depth: fidl::encoding::Depth,
8584 ) -> fidl::Result<()> {
8585 decoder.debug_check_bounds::<Self>(offset);
8586 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8587 unsafe {
8590 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8591 }
8592 Ok(())
8593 }
8594 }
8595
8596 impl fidl::encoding::ValueTypeMarker for BaseSocketGetBroadcastResponse {
8597 type Borrowed<'a> = &'a Self;
8598 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8599 value
8600 }
8601 }
8602
8603 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetBroadcastResponse {
8604 type Owned = Self;
8605
8606 #[inline(always)]
8607 fn inline_align(_context: fidl::encoding::Context) -> usize {
8608 1
8609 }
8610
8611 #[inline(always)]
8612 fn inline_size(_context: fidl::encoding::Context) -> usize {
8613 1
8614 }
8615 }
8616
8617 unsafe impl<D: fidl::encoding::ResourceDialect>
8618 fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D>
8619 for &BaseSocketGetBroadcastResponse
8620 {
8621 #[inline]
8622 unsafe fn encode(
8623 self,
8624 encoder: &mut fidl::encoding::Encoder<'_, D>,
8625 offset: usize,
8626 _depth: fidl::encoding::Depth,
8627 ) -> fidl::Result<()> {
8628 encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8629 fidl::encoding::Encode::<BaseSocketGetBroadcastResponse, D>::encode(
8631 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8632 encoder,
8633 offset,
8634 _depth,
8635 )
8636 }
8637 }
8638 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8639 fidl::encoding::Encode<BaseSocketGetBroadcastResponse, D> for (T0,)
8640 {
8641 #[inline]
8642 unsafe fn encode(
8643 self,
8644 encoder: &mut fidl::encoding::Encoder<'_, D>,
8645 offset: usize,
8646 depth: fidl::encoding::Depth,
8647 ) -> fidl::Result<()> {
8648 encoder.debug_check_bounds::<BaseSocketGetBroadcastResponse>(offset);
8649 self.0.encode(encoder, offset + 0, depth)?;
8653 Ok(())
8654 }
8655 }
8656
8657 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8658 for BaseSocketGetBroadcastResponse
8659 {
8660 #[inline(always)]
8661 fn new_empty() -> Self {
8662 Self { value: fidl::new_empty!(bool, D) }
8663 }
8664
8665 #[inline]
8666 unsafe fn decode(
8667 &mut self,
8668 decoder: &mut fidl::encoding::Decoder<'_, D>,
8669 offset: usize,
8670 _depth: fidl::encoding::Depth,
8671 ) -> fidl::Result<()> {
8672 decoder.debug_check_bounds::<Self>(offset);
8673 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8675 Ok(())
8676 }
8677 }
8678
8679 impl fidl::encoding::ValueTypeMarker for BaseSocketGetKeepAliveResponse {
8680 type Borrowed<'a> = &'a Self;
8681 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8682 value
8683 }
8684 }
8685
8686 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetKeepAliveResponse {
8687 type Owned = Self;
8688
8689 #[inline(always)]
8690 fn inline_align(_context: fidl::encoding::Context) -> usize {
8691 1
8692 }
8693
8694 #[inline(always)]
8695 fn inline_size(_context: fidl::encoding::Context) -> usize {
8696 1
8697 }
8698 }
8699
8700 unsafe impl<D: fidl::encoding::ResourceDialect>
8701 fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D>
8702 for &BaseSocketGetKeepAliveResponse
8703 {
8704 #[inline]
8705 unsafe fn encode(
8706 self,
8707 encoder: &mut fidl::encoding::Encoder<'_, D>,
8708 offset: usize,
8709 _depth: fidl::encoding::Depth,
8710 ) -> fidl::Result<()> {
8711 encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8712 fidl::encoding::Encode::<BaseSocketGetKeepAliveResponse, D>::encode(
8714 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8715 encoder,
8716 offset,
8717 _depth,
8718 )
8719 }
8720 }
8721 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8722 fidl::encoding::Encode<BaseSocketGetKeepAliveResponse, D> for (T0,)
8723 {
8724 #[inline]
8725 unsafe fn encode(
8726 self,
8727 encoder: &mut fidl::encoding::Encoder<'_, D>,
8728 offset: usize,
8729 depth: fidl::encoding::Depth,
8730 ) -> fidl::Result<()> {
8731 encoder.debug_check_bounds::<BaseSocketGetKeepAliveResponse>(offset);
8732 self.0.encode(encoder, offset + 0, depth)?;
8736 Ok(())
8737 }
8738 }
8739
8740 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8741 for BaseSocketGetKeepAliveResponse
8742 {
8743 #[inline(always)]
8744 fn new_empty() -> Self {
8745 Self { value: fidl::new_empty!(bool, D) }
8746 }
8747
8748 #[inline]
8749 unsafe fn decode(
8750 &mut self,
8751 decoder: &mut fidl::encoding::Decoder<'_, D>,
8752 offset: usize,
8753 _depth: fidl::encoding::Depth,
8754 ) -> fidl::Result<()> {
8755 decoder.debug_check_bounds::<Self>(offset);
8756 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
8758 Ok(())
8759 }
8760 }
8761
8762 impl fidl::encoding::ValueTypeMarker for BaseSocketGetLingerResponse {
8763 type Borrowed<'a> = &'a Self;
8764 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8765 value
8766 }
8767 }
8768
8769 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetLingerResponse {
8770 type Owned = Self;
8771
8772 #[inline(always)]
8773 fn inline_align(_context: fidl::encoding::Context) -> usize {
8774 4
8775 }
8776
8777 #[inline(always)]
8778 fn inline_size(_context: fidl::encoding::Context) -> usize {
8779 8
8780 }
8781 }
8782
8783 unsafe impl<D: fidl::encoding::ResourceDialect>
8784 fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for &BaseSocketGetLingerResponse
8785 {
8786 #[inline]
8787 unsafe fn encode(
8788 self,
8789 encoder: &mut fidl::encoding::Encoder<'_, D>,
8790 offset: usize,
8791 _depth: fidl::encoding::Depth,
8792 ) -> fidl::Result<()> {
8793 encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
8794 fidl::encoding::Encode::<BaseSocketGetLingerResponse, D>::encode(
8796 (
8797 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.linger),
8798 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length_secs),
8799 ),
8800 encoder,
8801 offset,
8802 _depth,
8803 )
8804 }
8805 }
8806 unsafe impl<
8807 D: fidl::encoding::ResourceDialect,
8808 T0: fidl::encoding::Encode<bool, D>,
8809 T1: fidl::encoding::Encode<u32, D>,
8810 > fidl::encoding::Encode<BaseSocketGetLingerResponse, D> for (T0, T1)
8811 {
8812 #[inline]
8813 unsafe fn encode(
8814 self,
8815 encoder: &mut fidl::encoding::Encoder<'_, D>,
8816 offset: usize,
8817 depth: fidl::encoding::Depth,
8818 ) -> fidl::Result<()> {
8819 encoder.debug_check_bounds::<BaseSocketGetLingerResponse>(offset);
8820 unsafe {
8823 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8824 (ptr as *mut u32).write_unaligned(0);
8825 }
8826 self.0.encode(encoder, offset + 0, depth)?;
8828 self.1.encode(encoder, offset + 4, depth)?;
8829 Ok(())
8830 }
8831 }
8832
8833 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8834 for BaseSocketGetLingerResponse
8835 {
8836 #[inline(always)]
8837 fn new_empty() -> Self {
8838 Self { linger: fidl::new_empty!(bool, D), length_secs: fidl::new_empty!(u32, D) }
8839 }
8840
8841 #[inline]
8842 unsafe fn decode(
8843 &mut self,
8844 decoder: &mut fidl::encoding::Decoder<'_, D>,
8845 offset: usize,
8846 _depth: fidl::encoding::Depth,
8847 ) -> fidl::Result<()> {
8848 decoder.debug_check_bounds::<Self>(offset);
8849 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8851 let padval = unsafe { (ptr as *const u32).read_unaligned() };
8852 let mask = 0xffffff00u32;
8853 let maskedval = padval & mask;
8854 if maskedval != 0 {
8855 return Err(fidl::Error::NonZeroPadding {
8856 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8857 });
8858 }
8859 fidl::decode!(bool, D, &mut self.linger, decoder, offset + 0, _depth)?;
8860 fidl::decode!(u32, D, &mut self.length_secs, decoder, offset + 4, _depth)?;
8861 Ok(())
8862 }
8863 }
8864
8865 impl fidl::encoding::ValueTypeMarker for BaseSocketGetMarkResponse {
8866 type Borrowed<'a> = &'a Self;
8867 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8868 value
8869 }
8870 }
8871
8872 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetMarkResponse {
8873 type Owned = Self;
8874
8875 #[inline(always)]
8876 fn inline_align(_context: fidl::encoding::Context) -> usize {
8877 8
8878 }
8879
8880 #[inline(always)]
8881 fn inline_size(_context: fidl::encoding::Context) -> usize {
8882 16
8883 }
8884 }
8885
8886 unsafe impl<D: fidl::encoding::ResourceDialect>
8887 fidl::encoding::Encode<BaseSocketGetMarkResponse, D> for &BaseSocketGetMarkResponse
8888 {
8889 #[inline]
8890 unsafe fn encode(
8891 self,
8892 encoder: &mut fidl::encoding::Encoder<'_, D>,
8893 offset: usize,
8894 _depth: fidl::encoding::Depth,
8895 ) -> fidl::Result<()> {
8896 encoder.debug_check_bounds::<BaseSocketGetMarkResponse>(offset);
8897 fidl::encoding::Encode::<BaseSocketGetMarkResponse, D>::encode(
8899 (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mark),),
8900 encoder,
8901 offset,
8902 _depth,
8903 )
8904 }
8905 }
8906 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
8907 fidl::encoding::Encode<BaseSocketGetMarkResponse, 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::<BaseSocketGetMarkResponse>(offset);
8917 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 BaseSocketGetMarkResponse
8927 {
8928 #[inline(always)]
8929 fn new_empty() -> Self {
8930 Self { mark: fidl::new_empty!(OptionalUint32, 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 fidl::decode!(OptionalUint32, D, &mut self.mark, decoder, offset + 0, _depth)?;
8943 Ok(())
8944 }
8945 }
8946
8947 impl fidl::encoding::ValueTypeMarker for BaseSocketGetNoCheckResponse {
8948 type Borrowed<'a> = &'a Self;
8949 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8950 value
8951 }
8952 }
8953
8954 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetNoCheckResponse {
8955 type Owned = Self;
8956
8957 #[inline(always)]
8958 fn inline_align(_context: fidl::encoding::Context) -> usize {
8959 1
8960 }
8961
8962 #[inline(always)]
8963 fn inline_size(_context: fidl::encoding::Context) -> usize {
8964 1
8965 }
8966 }
8967
8968 unsafe impl<D: fidl::encoding::ResourceDialect>
8969 fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for &BaseSocketGetNoCheckResponse
8970 {
8971 #[inline]
8972 unsafe fn encode(
8973 self,
8974 encoder: &mut fidl::encoding::Encoder<'_, D>,
8975 offset: usize,
8976 _depth: fidl::encoding::Depth,
8977 ) -> fidl::Result<()> {
8978 encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
8979 fidl::encoding::Encode::<BaseSocketGetNoCheckResponse, D>::encode(
8981 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
8982 encoder,
8983 offset,
8984 _depth,
8985 )
8986 }
8987 }
8988 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
8989 fidl::encoding::Encode<BaseSocketGetNoCheckResponse, D> for (T0,)
8990 {
8991 #[inline]
8992 unsafe fn encode(
8993 self,
8994 encoder: &mut fidl::encoding::Encoder<'_, D>,
8995 offset: usize,
8996 depth: fidl::encoding::Depth,
8997 ) -> fidl::Result<()> {
8998 encoder.debug_check_bounds::<BaseSocketGetNoCheckResponse>(offset);
8999 self.0.encode(encoder, offset + 0, depth)?;
9003 Ok(())
9004 }
9005 }
9006
9007 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9008 for BaseSocketGetNoCheckResponse
9009 {
9010 #[inline(always)]
9011 fn new_empty() -> Self {
9012 Self { value: fidl::new_empty!(bool, D) }
9013 }
9014
9015 #[inline]
9016 unsafe fn decode(
9017 &mut self,
9018 decoder: &mut fidl::encoding::Decoder<'_, D>,
9019 offset: usize,
9020 _depth: fidl::encoding::Depth,
9021 ) -> fidl::Result<()> {
9022 decoder.debug_check_bounds::<Self>(offset);
9023 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9025 Ok(())
9026 }
9027 }
9028
9029 impl fidl::encoding::ValueTypeMarker for BaseSocketGetOutOfBandInlineResponse {
9030 type Borrowed<'a> = &'a Self;
9031 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9032 value
9033 }
9034 }
9035
9036 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetOutOfBandInlineResponse {
9037 type Owned = Self;
9038
9039 #[inline(always)]
9040 fn inline_align(_context: fidl::encoding::Context) -> usize {
9041 1
9042 }
9043
9044 #[inline(always)]
9045 fn inline_size(_context: fidl::encoding::Context) -> usize {
9046 1
9047 }
9048 }
9049
9050 unsafe impl<D: fidl::encoding::ResourceDialect>
9051 fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D>
9052 for &BaseSocketGetOutOfBandInlineResponse
9053 {
9054 #[inline]
9055 unsafe fn encode(
9056 self,
9057 encoder: &mut fidl::encoding::Encoder<'_, D>,
9058 offset: usize,
9059 _depth: fidl::encoding::Depth,
9060 ) -> fidl::Result<()> {
9061 encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9062 fidl::encoding::Encode::<BaseSocketGetOutOfBandInlineResponse, D>::encode(
9064 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9065 encoder,
9066 offset,
9067 _depth,
9068 )
9069 }
9070 }
9071 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9072 fidl::encoding::Encode<BaseSocketGetOutOfBandInlineResponse, D> for (T0,)
9073 {
9074 #[inline]
9075 unsafe fn encode(
9076 self,
9077 encoder: &mut fidl::encoding::Encoder<'_, D>,
9078 offset: usize,
9079 depth: fidl::encoding::Depth,
9080 ) -> fidl::Result<()> {
9081 encoder.debug_check_bounds::<BaseSocketGetOutOfBandInlineResponse>(offset);
9082 self.0.encode(encoder, offset + 0, depth)?;
9086 Ok(())
9087 }
9088 }
9089
9090 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9091 for BaseSocketGetOutOfBandInlineResponse
9092 {
9093 #[inline(always)]
9094 fn new_empty() -> Self {
9095 Self { value: fidl::new_empty!(bool, D) }
9096 }
9097
9098 #[inline]
9099 unsafe fn decode(
9100 &mut self,
9101 decoder: &mut fidl::encoding::Decoder<'_, D>,
9102 offset: usize,
9103 _depth: fidl::encoding::Depth,
9104 ) -> fidl::Result<()> {
9105 decoder.debug_check_bounds::<Self>(offset);
9106 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9108 Ok(())
9109 }
9110 }
9111
9112 impl fidl::encoding::ValueTypeMarker for BaseSocketGetReceiveBufferResponse {
9113 type Borrowed<'a> = &'a Self;
9114 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9115 value
9116 }
9117 }
9118
9119 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReceiveBufferResponse {
9120 type Owned = Self;
9121
9122 #[inline(always)]
9123 fn inline_align(_context: fidl::encoding::Context) -> usize {
9124 8
9125 }
9126
9127 #[inline(always)]
9128 fn inline_size(_context: fidl::encoding::Context) -> usize {
9129 8
9130 }
9131 #[inline(always)]
9132 fn encode_is_copy() -> bool {
9133 true
9134 }
9135
9136 #[inline(always)]
9137 fn decode_is_copy() -> bool {
9138 true
9139 }
9140 }
9141
9142 unsafe impl<D: fidl::encoding::ResourceDialect>
9143 fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D>
9144 for &BaseSocketGetReceiveBufferResponse
9145 {
9146 #[inline]
9147 unsafe fn encode(
9148 self,
9149 encoder: &mut fidl::encoding::Encoder<'_, D>,
9150 offset: usize,
9151 _depth: fidl::encoding::Depth,
9152 ) -> fidl::Result<()> {
9153 encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9154 unsafe {
9155 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9157 (buf_ptr as *mut BaseSocketGetReceiveBufferResponse)
9158 .write_unaligned((self as *const BaseSocketGetReceiveBufferResponse).read());
9159 }
9162 Ok(())
9163 }
9164 }
9165 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9166 fidl::encoding::Encode<BaseSocketGetReceiveBufferResponse, D> for (T0,)
9167 {
9168 #[inline]
9169 unsafe fn encode(
9170 self,
9171 encoder: &mut fidl::encoding::Encoder<'_, D>,
9172 offset: usize,
9173 depth: fidl::encoding::Depth,
9174 ) -> fidl::Result<()> {
9175 encoder.debug_check_bounds::<BaseSocketGetReceiveBufferResponse>(offset);
9176 self.0.encode(encoder, offset + 0, depth)?;
9180 Ok(())
9181 }
9182 }
9183
9184 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9185 for BaseSocketGetReceiveBufferResponse
9186 {
9187 #[inline(always)]
9188 fn new_empty() -> Self {
9189 Self { value_bytes: fidl::new_empty!(u64, D) }
9190 }
9191
9192 #[inline]
9193 unsafe fn decode(
9194 &mut self,
9195 decoder: &mut fidl::encoding::Decoder<'_, D>,
9196 offset: usize,
9197 _depth: fidl::encoding::Depth,
9198 ) -> fidl::Result<()> {
9199 decoder.debug_check_bounds::<Self>(offset);
9200 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9201 unsafe {
9204 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9205 }
9206 Ok(())
9207 }
9208 }
9209
9210 impl fidl::encoding::ValueTypeMarker for BaseSocketGetReuseAddressResponse {
9211 type Borrowed<'a> = &'a Self;
9212 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9213 value
9214 }
9215 }
9216
9217 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReuseAddressResponse {
9218 type Owned = Self;
9219
9220 #[inline(always)]
9221 fn inline_align(_context: fidl::encoding::Context) -> usize {
9222 1
9223 }
9224
9225 #[inline(always)]
9226 fn inline_size(_context: fidl::encoding::Context) -> usize {
9227 1
9228 }
9229 }
9230
9231 unsafe impl<D: fidl::encoding::ResourceDialect>
9232 fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D>
9233 for &BaseSocketGetReuseAddressResponse
9234 {
9235 #[inline]
9236 unsafe fn encode(
9237 self,
9238 encoder: &mut fidl::encoding::Encoder<'_, D>,
9239 offset: usize,
9240 _depth: fidl::encoding::Depth,
9241 ) -> fidl::Result<()> {
9242 encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9243 fidl::encoding::Encode::<BaseSocketGetReuseAddressResponse, D>::encode(
9245 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9246 encoder,
9247 offset,
9248 _depth,
9249 )
9250 }
9251 }
9252 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9253 fidl::encoding::Encode<BaseSocketGetReuseAddressResponse, D> for (T0,)
9254 {
9255 #[inline]
9256 unsafe fn encode(
9257 self,
9258 encoder: &mut fidl::encoding::Encoder<'_, D>,
9259 offset: usize,
9260 depth: fidl::encoding::Depth,
9261 ) -> fidl::Result<()> {
9262 encoder.debug_check_bounds::<BaseSocketGetReuseAddressResponse>(offset);
9263 self.0.encode(encoder, offset + 0, depth)?;
9267 Ok(())
9268 }
9269 }
9270
9271 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9272 for BaseSocketGetReuseAddressResponse
9273 {
9274 #[inline(always)]
9275 fn new_empty() -> Self {
9276 Self { value: fidl::new_empty!(bool, D) }
9277 }
9278
9279 #[inline]
9280 unsafe fn decode(
9281 &mut self,
9282 decoder: &mut fidl::encoding::Decoder<'_, D>,
9283 offset: usize,
9284 _depth: fidl::encoding::Depth,
9285 ) -> fidl::Result<()> {
9286 decoder.debug_check_bounds::<Self>(offset);
9287 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9289 Ok(())
9290 }
9291 }
9292
9293 impl fidl::encoding::ValueTypeMarker for BaseSocketGetReusePortResponse {
9294 type Borrowed<'a> = &'a Self;
9295 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9296 value
9297 }
9298 }
9299
9300 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetReusePortResponse {
9301 type Owned = Self;
9302
9303 #[inline(always)]
9304 fn inline_align(_context: fidl::encoding::Context) -> usize {
9305 1
9306 }
9307
9308 #[inline(always)]
9309 fn inline_size(_context: fidl::encoding::Context) -> usize {
9310 1
9311 }
9312 }
9313
9314 unsafe impl<D: fidl::encoding::ResourceDialect>
9315 fidl::encoding::Encode<BaseSocketGetReusePortResponse, D>
9316 for &BaseSocketGetReusePortResponse
9317 {
9318 #[inline]
9319 unsafe fn encode(
9320 self,
9321 encoder: &mut fidl::encoding::Encoder<'_, D>,
9322 offset: usize,
9323 _depth: fidl::encoding::Depth,
9324 ) -> fidl::Result<()> {
9325 encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9326 fidl::encoding::Encode::<BaseSocketGetReusePortResponse, D>::encode(
9328 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9329 encoder,
9330 offset,
9331 _depth,
9332 )
9333 }
9334 }
9335 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9336 fidl::encoding::Encode<BaseSocketGetReusePortResponse, D> for (T0,)
9337 {
9338 #[inline]
9339 unsafe fn encode(
9340 self,
9341 encoder: &mut fidl::encoding::Encoder<'_, D>,
9342 offset: usize,
9343 depth: fidl::encoding::Depth,
9344 ) -> fidl::Result<()> {
9345 encoder.debug_check_bounds::<BaseSocketGetReusePortResponse>(offset);
9346 self.0.encode(encoder, offset + 0, depth)?;
9350 Ok(())
9351 }
9352 }
9353
9354 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9355 for BaseSocketGetReusePortResponse
9356 {
9357 #[inline(always)]
9358 fn new_empty() -> Self {
9359 Self { value: fidl::new_empty!(bool, D) }
9360 }
9361
9362 #[inline]
9363 unsafe fn decode(
9364 &mut self,
9365 decoder: &mut fidl::encoding::Decoder<'_, D>,
9366 offset: usize,
9367 _depth: fidl::encoding::Depth,
9368 ) -> fidl::Result<()> {
9369 decoder.debug_check_bounds::<Self>(offset);
9370 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
9372 Ok(())
9373 }
9374 }
9375
9376 impl fidl::encoding::ValueTypeMarker for BaseSocketGetSendBufferResponse {
9377 type Borrowed<'a> = &'a Self;
9378 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9379 value
9380 }
9381 }
9382
9383 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetSendBufferResponse {
9384 type Owned = Self;
9385
9386 #[inline(always)]
9387 fn inline_align(_context: fidl::encoding::Context) -> usize {
9388 8
9389 }
9390
9391 #[inline(always)]
9392 fn inline_size(_context: fidl::encoding::Context) -> usize {
9393 8
9394 }
9395 #[inline(always)]
9396 fn encode_is_copy() -> bool {
9397 true
9398 }
9399
9400 #[inline(always)]
9401 fn decode_is_copy() -> bool {
9402 true
9403 }
9404 }
9405
9406 unsafe impl<D: fidl::encoding::ResourceDialect>
9407 fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D>
9408 for &BaseSocketGetSendBufferResponse
9409 {
9410 #[inline]
9411 unsafe fn encode(
9412 self,
9413 encoder: &mut fidl::encoding::Encoder<'_, D>,
9414 offset: usize,
9415 _depth: fidl::encoding::Depth,
9416 ) -> fidl::Result<()> {
9417 encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9418 unsafe {
9419 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9421 (buf_ptr as *mut BaseSocketGetSendBufferResponse)
9422 .write_unaligned((self as *const BaseSocketGetSendBufferResponse).read());
9423 }
9426 Ok(())
9427 }
9428 }
9429 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9430 fidl::encoding::Encode<BaseSocketGetSendBufferResponse, D> for (T0,)
9431 {
9432 #[inline]
9433 unsafe fn encode(
9434 self,
9435 encoder: &mut fidl::encoding::Encoder<'_, D>,
9436 offset: usize,
9437 depth: fidl::encoding::Depth,
9438 ) -> fidl::Result<()> {
9439 encoder.debug_check_bounds::<BaseSocketGetSendBufferResponse>(offset);
9440 self.0.encode(encoder, offset + 0, depth)?;
9444 Ok(())
9445 }
9446 }
9447
9448 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9449 for BaseSocketGetSendBufferResponse
9450 {
9451 #[inline(always)]
9452 fn new_empty() -> Self {
9453 Self { value_bytes: fidl::new_empty!(u64, D) }
9454 }
9455
9456 #[inline]
9457 unsafe fn decode(
9458 &mut self,
9459 decoder: &mut fidl::encoding::Decoder<'_, D>,
9460 offset: usize,
9461 _depth: fidl::encoding::Depth,
9462 ) -> fidl::Result<()> {
9463 decoder.debug_check_bounds::<Self>(offset);
9464 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9465 unsafe {
9468 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9469 }
9470 Ok(())
9471 }
9472 }
9473
9474 impl fidl::encoding::ValueTypeMarker for BaseSocketGetTimestampResponse {
9475 type Borrowed<'a> = &'a Self;
9476 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9477 value
9478 }
9479 }
9480
9481 unsafe impl fidl::encoding::TypeMarker for BaseSocketGetTimestampResponse {
9482 type Owned = Self;
9483
9484 #[inline(always)]
9485 fn inline_align(_context: fidl::encoding::Context) -> usize {
9486 4
9487 }
9488
9489 #[inline(always)]
9490 fn inline_size(_context: fidl::encoding::Context) -> usize {
9491 4
9492 }
9493 }
9494
9495 unsafe impl<D: fidl::encoding::ResourceDialect>
9496 fidl::encoding::Encode<BaseSocketGetTimestampResponse, D>
9497 for &BaseSocketGetTimestampResponse
9498 {
9499 #[inline]
9500 unsafe fn encode(
9501 self,
9502 encoder: &mut fidl::encoding::Encoder<'_, D>,
9503 offset: usize,
9504 _depth: fidl::encoding::Depth,
9505 ) -> fidl::Result<()> {
9506 encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9507 fidl::encoding::Encode::<BaseSocketGetTimestampResponse, D>::encode(
9509 (<TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
9510 encoder,
9511 offset,
9512 _depth,
9513 )
9514 }
9515 }
9516 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimestampOption, D>>
9517 fidl::encoding::Encode<BaseSocketGetTimestampResponse, D> for (T0,)
9518 {
9519 #[inline]
9520 unsafe fn encode(
9521 self,
9522 encoder: &mut fidl::encoding::Encoder<'_, D>,
9523 offset: usize,
9524 depth: fidl::encoding::Depth,
9525 ) -> fidl::Result<()> {
9526 encoder.debug_check_bounds::<BaseSocketGetTimestampResponse>(offset);
9527 self.0.encode(encoder, offset + 0, depth)?;
9531 Ok(())
9532 }
9533 }
9534
9535 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9536 for BaseSocketGetTimestampResponse
9537 {
9538 #[inline(always)]
9539 fn new_empty() -> Self {
9540 Self { value: fidl::new_empty!(TimestampOption, D) }
9541 }
9542
9543 #[inline]
9544 unsafe fn decode(
9545 &mut self,
9546 decoder: &mut fidl::encoding::Decoder<'_, D>,
9547 offset: usize,
9548 _depth: fidl::encoding::Depth,
9549 ) -> fidl::Result<()> {
9550 decoder.debug_check_bounds::<Self>(offset);
9551 fidl::decode!(TimestampOption, D, &mut self.value, decoder, offset + 0, _depth)?;
9553 Ok(())
9554 }
9555 }
9556
9557 impl fidl::encoding::ValueTypeMarker for Empty {
9558 type Borrowed<'a> = &'a Self;
9559 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9560 value
9561 }
9562 }
9563
9564 unsafe impl fidl::encoding::TypeMarker for Empty {
9565 type Owned = Self;
9566
9567 #[inline(always)]
9568 fn inline_align(_context: fidl::encoding::Context) -> usize {
9569 1
9570 }
9571
9572 #[inline(always)]
9573 fn inline_size(_context: fidl::encoding::Context) -> usize {
9574 1
9575 }
9576 }
9577
9578 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
9579 #[inline]
9580 unsafe fn encode(
9581 self,
9582 encoder: &mut fidl::encoding::Encoder<'_, D>,
9583 offset: usize,
9584 _depth: fidl::encoding::Depth,
9585 ) -> fidl::Result<()> {
9586 encoder.debug_check_bounds::<Empty>(offset);
9587 encoder.write_num(0u8, offset);
9588 Ok(())
9589 }
9590 }
9591
9592 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
9593 #[inline(always)]
9594 fn new_empty() -> Self {
9595 Self
9596 }
9597
9598 #[inline]
9599 unsafe fn decode(
9600 &mut self,
9601 decoder: &mut fidl::encoding::Decoder<'_, D>,
9602 offset: usize,
9603 _depth: fidl::encoding::Depth,
9604 ) -> fidl::Result<()> {
9605 decoder.debug_check_bounds::<Self>(offset);
9606 match decoder.read_num::<u8>(offset) {
9607 0 => Ok(()),
9608 _ => Err(fidl::Error::Invalid),
9609 }
9610 }
9611 }
9612
9613 impl fidl::encoding::ValueTypeMarker for IpMulticastMembership {
9614 type Borrowed<'a> = &'a Self;
9615 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9616 value
9617 }
9618 }
9619
9620 unsafe impl fidl::encoding::TypeMarker for IpMulticastMembership {
9621 type Owned = Self;
9622
9623 #[inline(always)]
9624 fn inline_align(_context: fidl::encoding::Context) -> usize {
9625 8
9626 }
9627
9628 #[inline(always)]
9629 fn inline_size(_context: fidl::encoding::Context) -> usize {
9630 16
9631 }
9632 }
9633
9634 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpMulticastMembership, D>
9635 for &IpMulticastMembership
9636 {
9637 #[inline]
9638 unsafe fn encode(
9639 self,
9640 encoder: &mut fidl::encoding::Encoder<'_, D>,
9641 offset: usize,
9642 _depth: fidl::encoding::Depth,
9643 ) -> fidl::Result<()> {
9644 encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9645 fidl::encoding::Encode::<IpMulticastMembership, D>::encode(
9647 (
9648 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9649 <fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(
9650 &self.local_addr,
9651 ),
9652 <fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(
9653 &self.mcast_addr,
9654 ),
9655 ),
9656 encoder,
9657 offset,
9658 _depth,
9659 )
9660 }
9661 }
9662 unsafe impl<
9663 D: fidl::encoding::ResourceDialect,
9664 T0: fidl::encoding::Encode<u64, D>,
9665 T1: fidl::encoding::Encode<fidl_fuchsia_net::Ipv4Address, D>,
9666 T2: fidl::encoding::Encode<fidl_fuchsia_net::Ipv4Address, D>,
9667 > fidl::encoding::Encode<IpMulticastMembership, D> for (T0, T1, T2)
9668 {
9669 #[inline]
9670 unsafe fn encode(
9671 self,
9672 encoder: &mut fidl::encoding::Encoder<'_, D>,
9673 offset: usize,
9674 depth: fidl::encoding::Depth,
9675 ) -> fidl::Result<()> {
9676 encoder.debug_check_bounds::<IpMulticastMembership>(offset);
9677 self.0.encode(encoder, offset + 0, depth)?;
9681 self.1.encode(encoder, offset + 8, depth)?;
9682 self.2.encode(encoder, offset + 12, depth)?;
9683 Ok(())
9684 }
9685 }
9686
9687 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpMulticastMembership {
9688 #[inline(always)]
9689 fn new_empty() -> Self {
9690 Self {
9691 iface: fidl::new_empty!(u64, D),
9692 local_addr: fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D),
9693 mcast_addr: fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D),
9694 }
9695 }
9696
9697 #[inline]
9698 unsafe fn decode(
9699 &mut self,
9700 decoder: &mut fidl::encoding::Decoder<'_, D>,
9701 offset: usize,
9702 _depth: fidl::encoding::Depth,
9703 ) -> fidl::Result<()> {
9704 decoder.debug_check_bounds::<Self>(offset);
9705 fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9707 fidl::decode!(
9708 fidl_fuchsia_net::Ipv4Address,
9709 D,
9710 &mut self.local_addr,
9711 decoder,
9712 offset + 8,
9713 _depth
9714 )?;
9715 fidl::decode!(
9716 fidl_fuchsia_net::Ipv4Address,
9717 D,
9718 &mut self.mcast_addr,
9719 decoder,
9720 offset + 12,
9721 _depth
9722 )?;
9723 Ok(())
9724 }
9725 }
9726
9727 impl fidl::encoding::ValueTypeMarker for Ipv6MulticastMembership {
9728 type Borrowed<'a> = &'a Self;
9729 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9730 value
9731 }
9732 }
9733
9734 unsafe impl fidl::encoding::TypeMarker for Ipv6MulticastMembership {
9735 type Owned = Self;
9736
9737 #[inline(always)]
9738 fn inline_align(_context: fidl::encoding::Context) -> usize {
9739 8
9740 }
9741
9742 #[inline(always)]
9743 fn inline_size(_context: fidl::encoding::Context) -> usize {
9744 24
9745 }
9746 }
9747
9748 unsafe impl<D: fidl::encoding::ResourceDialect>
9749 fidl::encoding::Encode<Ipv6MulticastMembership, D> for &Ipv6MulticastMembership
9750 {
9751 #[inline]
9752 unsafe fn encode(
9753 self,
9754 encoder: &mut fidl::encoding::Encoder<'_, D>,
9755 offset: usize,
9756 _depth: fidl::encoding::Depth,
9757 ) -> fidl::Result<()> {
9758 encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
9759 fidl::encoding::Encode::<Ipv6MulticastMembership, D>::encode(
9761 (
9762 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9763 <fidl_fuchsia_net::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(
9764 &self.mcast_addr,
9765 ),
9766 ),
9767 encoder,
9768 offset,
9769 _depth,
9770 )
9771 }
9772 }
9773 unsafe impl<
9774 D: fidl::encoding::ResourceDialect,
9775 T0: fidl::encoding::Encode<u64, D>,
9776 T1: fidl::encoding::Encode<fidl_fuchsia_net::Ipv6Address, D>,
9777 > fidl::encoding::Encode<Ipv6MulticastMembership, D> for (T0, T1)
9778 {
9779 #[inline]
9780 unsafe fn encode(
9781 self,
9782 encoder: &mut fidl::encoding::Encoder<'_, D>,
9783 offset: usize,
9784 depth: fidl::encoding::Depth,
9785 ) -> fidl::Result<()> {
9786 encoder.debug_check_bounds::<Ipv6MulticastMembership>(offset);
9787 self.0.encode(encoder, offset + 0, depth)?;
9791 self.1.encode(encoder, offset + 8, depth)?;
9792 Ok(())
9793 }
9794 }
9795
9796 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9797 for Ipv6MulticastMembership
9798 {
9799 #[inline(always)]
9800 fn new_empty() -> Self {
9801 Self {
9802 iface: fidl::new_empty!(u64, D),
9803 mcast_addr: fidl::new_empty!(fidl_fuchsia_net::Ipv6Address, D),
9804 }
9805 }
9806
9807 #[inline]
9808 unsafe fn decode(
9809 &mut self,
9810 decoder: &mut fidl::encoding::Decoder<'_, D>,
9811 offset: usize,
9812 _depth: fidl::encoding::Depth,
9813 ) -> fidl::Result<()> {
9814 decoder.debug_check_bounds::<Self>(offset);
9815 fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9817 fidl::decode!(
9818 fidl_fuchsia_net::Ipv6Address,
9819 D,
9820 &mut self.mcast_addr,
9821 decoder,
9822 offset + 8,
9823 _depth
9824 )?;
9825 Ok(())
9826 }
9827 }
9828
9829 impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoRecvControlData {
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 Ipv6PktInfoRecvControlData {
9837 type Owned = Self;
9838
9839 #[inline(always)]
9840 fn inline_align(_context: fidl::encoding::Context) -> usize {
9841 8
9842 }
9843
9844 #[inline(always)]
9845 fn inline_size(_context: fidl::encoding::Context) -> usize {
9846 24
9847 }
9848 }
9849
9850 unsafe impl<D: fidl::encoding::ResourceDialect>
9851 fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for &Ipv6PktInfoRecvControlData
9852 {
9853 #[inline]
9854 unsafe fn encode(
9855 self,
9856 encoder: &mut fidl::encoding::Encoder<'_, D>,
9857 offset: usize,
9858 _depth: fidl::encoding::Depth,
9859 ) -> fidl::Result<()> {
9860 encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
9861 fidl::encoding::Encode::<Ipv6PktInfoRecvControlData, D>::encode(
9863 (
9864 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9865 <fidl_fuchsia_net::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(
9866 &self.header_destination_addr,
9867 ),
9868 ),
9869 encoder,
9870 offset,
9871 _depth,
9872 )
9873 }
9874 }
9875 unsafe impl<
9876 D: fidl::encoding::ResourceDialect,
9877 T0: fidl::encoding::Encode<u64, D>,
9878 T1: fidl::encoding::Encode<fidl_fuchsia_net::Ipv6Address, D>,
9879 > fidl::encoding::Encode<Ipv6PktInfoRecvControlData, D> for (T0, T1)
9880 {
9881 #[inline]
9882 unsafe fn encode(
9883 self,
9884 encoder: &mut fidl::encoding::Encoder<'_, D>,
9885 offset: usize,
9886 depth: fidl::encoding::Depth,
9887 ) -> fidl::Result<()> {
9888 encoder.debug_check_bounds::<Ipv6PktInfoRecvControlData>(offset);
9889 self.0.encode(encoder, offset + 0, depth)?;
9893 self.1.encode(encoder, offset + 8, depth)?;
9894 Ok(())
9895 }
9896 }
9897
9898 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9899 for Ipv6PktInfoRecvControlData
9900 {
9901 #[inline(always)]
9902 fn new_empty() -> Self {
9903 Self {
9904 iface: fidl::new_empty!(u64, D),
9905 header_destination_addr: fidl::new_empty!(fidl_fuchsia_net::Ipv6Address, D),
9906 }
9907 }
9908
9909 #[inline]
9910 unsafe fn decode(
9911 &mut self,
9912 decoder: &mut fidl::encoding::Decoder<'_, D>,
9913 offset: usize,
9914 _depth: fidl::encoding::Depth,
9915 ) -> fidl::Result<()> {
9916 decoder.debug_check_bounds::<Self>(offset);
9917 fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
9919 fidl::decode!(
9920 fidl_fuchsia_net::Ipv6Address,
9921 D,
9922 &mut self.header_destination_addr,
9923 decoder,
9924 offset + 8,
9925 _depth
9926 )?;
9927 Ok(())
9928 }
9929 }
9930
9931 impl fidl::encoding::ValueTypeMarker for Ipv6PktInfoSendControlData {
9932 type Borrowed<'a> = &'a Self;
9933 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9934 value
9935 }
9936 }
9937
9938 unsafe impl fidl::encoding::TypeMarker for Ipv6PktInfoSendControlData {
9939 type Owned = Self;
9940
9941 #[inline(always)]
9942 fn inline_align(_context: fidl::encoding::Context) -> usize {
9943 8
9944 }
9945
9946 #[inline(always)]
9947 fn inline_size(_context: fidl::encoding::Context) -> usize {
9948 24
9949 }
9950 }
9951
9952 unsafe impl<D: fidl::encoding::ResourceDialect>
9953 fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for &Ipv6PktInfoSendControlData
9954 {
9955 #[inline]
9956 unsafe fn encode(
9957 self,
9958 encoder: &mut fidl::encoding::Encoder<'_, D>,
9959 offset: usize,
9960 _depth: fidl::encoding::Depth,
9961 ) -> fidl::Result<()> {
9962 encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
9963 fidl::encoding::Encode::<Ipv6PktInfoSendControlData, D>::encode(
9965 (
9966 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface),
9967 <fidl_fuchsia_net::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow(
9968 &self.local_addr,
9969 ),
9970 ),
9971 encoder,
9972 offset,
9973 _depth,
9974 )
9975 }
9976 }
9977 unsafe impl<
9978 D: fidl::encoding::ResourceDialect,
9979 T0: fidl::encoding::Encode<u64, D>,
9980 T1: fidl::encoding::Encode<fidl_fuchsia_net::Ipv6Address, D>,
9981 > fidl::encoding::Encode<Ipv6PktInfoSendControlData, D> for (T0, T1)
9982 {
9983 #[inline]
9984 unsafe fn encode(
9985 self,
9986 encoder: &mut fidl::encoding::Encoder<'_, D>,
9987 offset: usize,
9988 depth: fidl::encoding::Depth,
9989 ) -> fidl::Result<()> {
9990 encoder.debug_check_bounds::<Ipv6PktInfoSendControlData>(offset);
9991 self.0.encode(encoder, offset + 0, depth)?;
9995 self.1.encode(encoder, offset + 8, depth)?;
9996 Ok(())
9997 }
9998 }
9999
10000 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10001 for Ipv6PktInfoSendControlData
10002 {
10003 #[inline(always)]
10004 fn new_empty() -> Self {
10005 Self {
10006 iface: fidl::new_empty!(u64, D),
10007 local_addr: fidl::new_empty!(fidl_fuchsia_net::Ipv6Address, D),
10008 }
10009 }
10010
10011 #[inline]
10012 unsafe fn decode(
10013 &mut self,
10014 decoder: &mut fidl::encoding::Decoder<'_, D>,
10015 offset: usize,
10016 _depth: fidl::encoding::Depth,
10017 ) -> fidl::Result<()> {
10018 decoder.debug_check_bounds::<Self>(offset);
10019 fidl::decode!(u64, D, &mut self.iface, decoder, offset + 0, _depth)?;
10021 fidl::decode!(
10022 fidl_fuchsia_net::Ipv6Address,
10023 D,
10024 &mut self.local_addr,
10025 decoder,
10026 offset + 8,
10027 _depth
10028 )?;
10029 Ok(())
10030 }
10031 }
10032
10033 impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketDeprecatedRequest {
10034 type Borrowed<'a> = &'a Self;
10035 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10036 value
10037 }
10038 }
10039
10040 unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketDeprecatedRequest {
10041 type Owned = Self;
10042
10043 #[inline(always)]
10044 fn inline_align(_context: fidl::encoding::Context) -> usize {
10045 4
10046 }
10047
10048 #[inline(always)]
10049 fn inline_size(_context: fidl::encoding::Context) -> usize {
10050 8
10051 }
10052 }
10053
10054 unsafe impl<D: fidl::encoding::ResourceDialect>
10055 fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D>
10056 for &ProviderDatagramSocketDeprecatedRequest
10057 {
10058 #[inline]
10059 unsafe fn encode(
10060 self,
10061 encoder: &mut fidl::encoding::Encoder<'_, D>,
10062 offset: usize,
10063 _depth: fidl::encoding::Depth,
10064 ) -> fidl::Result<()> {
10065 encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10066 fidl::encoding::Encode::<ProviderDatagramSocketDeprecatedRequest, D>::encode(
10068 (
10069 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10070 <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10071 &self.proto,
10072 ),
10073 ),
10074 encoder,
10075 offset,
10076 _depth,
10077 )
10078 }
10079 }
10080 unsafe impl<
10081 D: fidl::encoding::ResourceDialect,
10082 T0: fidl::encoding::Encode<Domain, D>,
10083 T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10084 > fidl::encoding::Encode<ProviderDatagramSocketDeprecatedRequest, D> for (T0, T1)
10085 {
10086 #[inline]
10087 unsafe fn encode(
10088 self,
10089 encoder: &mut fidl::encoding::Encoder<'_, D>,
10090 offset: usize,
10091 depth: fidl::encoding::Depth,
10092 ) -> fidl::Result<()> {
10093 encoder.debug_check_bounds::<ProviderDatagramSocketDeprecatedRequest>(offset);
10094 unsafe {
10097 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10098 (ptr as *mut u32).write_unaligned(0);
10099 }
10100 self.0.encode(encoder, offset + 0, depth)?;
10102 self.1.encode(encoder, offset + 4, depth)?;
10103 Ok(())
10104 }
10105 }
10106
10107 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10108 for ProviderDatagramSocketDeprecatedRequest
10109 {
10110 #[inline(always)]
10111 fn new_empty() -> Self {
10112 Self {
10113 domain: fidl::new_empty!(Domain, D),
10114 proto: fidl::new_empty!(DatagramSocketProtocol, D),
10115 }
10116 }
10117
10118 #[inline]
10119 unsafe fn decode(
10120 &mut self,
10121 decoder: &mut fidl::encoding::Decoder<'_, D>,
10122 offset: usize,
10123 _depth: fidl::encoding::Depth,
10124 ) -> fidl::Result<()> {
10125 decoder.debug_check_bounds::<Self>(offset);
10126 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10128 let padval = unsafe { (ptr as *const u32).read_unaligned() };
10129 let mask = 0xffff0000u32;
10130 let maskedval = padval & mask;
10131 if maskedval != 0 {
10132 return Err(fidl::Error::NonZeroPadding {
10133 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10134 });
10135 }
10136 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10137 fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10138 Ok(())
10139 }
10140 }
10141
10142 impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketRequest {
10143 type Borrowed<'a> = &'a Self;
10144 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10145 value
10146 }
10147 }
10148
10149 unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketRequest {
10150 type Owned = Self;
10151
10152 #[inline(always)]
10153 fn inline_align(_context: fidl::encoding::Context) -> usize {
10154 4
10155 }
10156
10157 #[inline(always)]
10158 fn inline_size(_context: fidl::encoding::Context) -> usize {
10159 8
10160 }
10161 }
10162
10163 unsafe impl<D: fidl::encoding::ResourceDialect>
10164 fidl::encoding::Encode<ProviderDatagramSocketRequest, D>
10165 for &ProviderDatagramSocketRequest
10166 {
10167 #[inline]
10168 unsafe fn encode(
10169 self,
10170 encoder: &mut fidl::encoding::Encoder<'_, D>,
10171 offset: usize,
10172 _depth: fidl::encoding::Depth,
10173 ) -> fidl::Result<()> {
10174 encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10175 fidl::encoding::Encode::<ProviderDatagramSocketRequest, D>::encode(
10177 (
10178 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10179 <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10180 &self.proto,
10181 ),
10182 ),
10183 encoder,
10184 offset,
10185 _depth,
10186 )
10187 }
10188 }
10189 unsafe impl<
10190 D: fidl::encoding::ResourceDialect,
10191 T0: fidl::encoding::Encode<Domain, D>,
10192 T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10193 > fidl::encoding::Encode<ProviderDatagramSocketRequest, D> for (T0, T1)
10194 {
10195 #[inline]
10196 unsafe fn encode(
10197 self,
10198 encoder: &mut fidl::encoding::Encoder<'_, D>,
10199 offset: usize,
10200 depth: fidl::encoding::Depth,
10201 ) -> fidl::Result<()> {
10202 encoder.debug_check_bounds::<ProviderDatagramSocketRequest>(offset);
10203 unsafe {
10206 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10207 (ptr as *mut u32).write_unaligned(0);
10208 }
10209 self.0.encode(encoder, offset + 0, depth)?;
10211 self.1.encode(encoder, offset + 4, depth)?;
10212 Ok(())
10213 }
10214 }
10215
10216 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10217 for ProviderDatagramSocketRequest
10218 {
10219 #[inline(always)]
10220 fn new_empty() -> Self {
10221 Self {
10222 domain: fidl::new_empty!(Domain, D),
10223 proto: fidl::new_empty!(DatagramSocketProtocol, D),
10224 }
10225 }
10226
10227 #[inline]
10228 unsafe fn decode(
10229 &mut self,
10230 decoder: &mut fidl::encoding::Decoder<'_, D>,
10231 offset: usize,
10232 _depth: fidl::encoding::Depth,
10233 ) -> fidl::Result<()> {
10234 decoder.debug_check_bounds::<Self>(offset);
10235 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10237 let padval = unsafe { (ptr as *const u32).read_unaligned() };
10238 let mask = 0xffff0000u32;
10239 let maskedval = padval & mask;
10240 if maskedval != 0 {
10241 return Err(fidl::Error::NonZeroPadding {
10242 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10243 });
10244 }
10245 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10246 fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10247 Ok(())
10248 }
10249 }
10250
10251 impl fidl::encoding::ValueTypeMarker for ProviderDatagramSocketWithOptionsRequest {
10252 type Borrowed<'a> = &'a Self;
10253 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10254 value
10255 }
10256 }
10257
10258 unsafe impl fidl::encoding::TypeMarker for ProviderDatagramSocketWithOptionsRequest {
10259 type Owned = Self;
10260
10261 #[inline(always)]
10262 fn inline_align(_context: fidl::encoding::Context) -> usize {
10263 8
10264 }
10265
10266 #[inline(always)]
10267 fn inline_size(_context: fidl::encoding::Context) -> usize {
10268 24
10269 }
10270 }
10271
10272 unsafe impl<D: fidl::encoding::ResourceDialect>
10273 fidl::encoding::Encode<ProviderDatagramSocketWithOptionsRequest, D>
10274 for &ProviderDatagramSocketWithOptionsRequest
10275 {
10276 #[inline]
10277 unsafe fn encode(
10278 self,
10279 encoder: &mut fidl::encoding::Encoder<'_, D>,
10280 offset: usize,
10281 _depth: fidl::encoding::Depth,
10282 ) -> fidl::Result<()> {
10283 encoder.debug_check_bounds::<ProviderDatagramSocketWithOptionsRequest>(offset);
10284 fidl::encoding::Encode::<ProviderDatagramSocketWithOptionsRequest, D>::encode(
10286 (
10287 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10288 <DatagramSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(
10289 &self.proto,
10290 ),
10291 <SocketCreationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.opts),
10292 ),
10293 encoder,
10294 offset,
10295 _depth,
10296 )
10297 }
10298 }
10299 unsafe impl<
10300 D: fidl::encoding::ResourceDialect,
10301 T0: fidl::encoding::Encode<Domain, D>,
10302 T1: fidl::encoding::Encode<DatagramSocketProtocol, D>,
10303 T2: fidl::encoding::Encode<SocketCreationOptions, D>,
10304 > fidl::encoding::Encode<ProviderDatagramSocketWithOptionsRequest, D> for (T0, T1, T2)
10305 {
10306 #[inline]
10307 unsafe fn encode(
10308 self,
10309 encoder: &mut fidl::encoding::Encoder<'_, D>,
10310 offset: usize,
10311 depth: fidl::encoding::Depth,
10312 ) -> fidl::Result<()> {
10313 encoder.debug_check_bounds::<ProviderDatagramSocketWithOptionsRequest>(offset);
10314 unsafe {
10317 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10318 (ptr as *mut u64).write_unaligned(0);
10319 }
10320 self.0.encode(encoder, offset + 0, depth)?;
10322 self.1.encode(encoder, offset + 4, depth)?;
10323 self.2.encode(encoder, offset + 8, depth)?;
10324 Ok(())
10325 }
10326 }
10327
10328 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10329 for ProviderDatagramSocketWithOptionsRequest
10330 {
10331 #[inline(always)]
10332 fn new_empty() -> Self {
10333 Self {
10334 domain: fidl::new_empty!(Domain, D),
10335 proto: fidl::new_empty!(DatagramSocketProtocol, D),
10336 opts: fidl::new_empty!(SocketCreationOptions, D),
10337 }
10338 }
10339
10340 #[inline]
10341 unsafe fn decode(
10342 &mut self,
10343 decoder: &mut fidl::encoding::Decoder<'_, D>,
10344 offset: usize,
10345 _depth: fidl::encoding::Depth,
10346 ) -> fidl::Result<()> {
10347 decoder.debug_check_bounds::<Self>(offset);
10348 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10350 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10351 let mask = 0xffff0000u64;
10352 let maskedval = padval & mask;
10353 if maskedval != 0 {
10354 return Err(fidl::Error::NonZeroPadding {
10355 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10356 });
10357 }
10358 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10359 fidl::decode!(DatagramSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10360 fidl::decode!(SocketCreationOptions, D, &mut self.opts, decoder, offset + 8, _depth)?;
10361 Ok(())
10362 }
10363 }
10364
10365 impl fidl::encoding::ValueTypeMarker for ProviderGetInterfaceAddressesResponse {
10366 type Borrowed<'a> = &'a Self;
10367 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10368 value
10369 }
10370 }
10371
10372 unsafe impl fidl::encoding::TypeMarker for ProviderGetInterfaceAddressesResponse {
10373 type Owned = Self;
10374
10375 #[inline(always)]
10376 fn inline_align(_context: fidl::encoding::Context) -> usize {
10377 8
10378 }
10379
10380 #[inline(always)]
10381 fn inline_size(_context: fidl::encoding::Context) -> usize {
10382 16
10383 }
10384 }
10385
10386 unsafe impl<D: fidl::encoding::ResourceDialect>
10387 fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D>
10388 for &ProviderGetInterfaceAddressesResponse
10389 {
10390 #[inline]
10391 unsafe fn encode(
10392 self,
10393 encoder: &mut fidl::encoding::Encoder<'_, D>,
10394 offset: usize,
10395 _depth: fidl::encoding::Depth,
10396 ) -> fidl::Result<()> {
10397 encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10398 fidl::encoding::Encode::<ProviderGetInterfaceAddressesResponse, D>::encode(
10400 (
10401 <fidl::encoding::UnboundedVector<InterfaceAddresses> as fidl::encoding::ValueTypeMarker>::borrow(&self.interfaces),
10402 ),
10403 encoder, offset, _depth
10404 )
10405 }
10406 }
10407 unsafe impl<
10408 D: fidl::encoding::ResourceDialect,
10409 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<InterfaceAddresses>, D>,
10410 > fidl::encoding::Encode<ProviderGetInterfaceAddressesResponse, D> for (T0,)
10411 {
10412 #[inline]
10413 unsafe fn encode(
10414 self,
10415 encoder: &mut fidl::encoding::Encoder<'_, D>,
10416 offset: usize,
10417 depth: fidl::encoding::Depth,
10418 ) -> fidl::Result<()> {
10419 encoder.debug_check_bounds::<ProviderGetInterfaceAddressesResponse>(offset);
10420 self.0.encode(encoder, offset + 0, depth)?;
10424 Ok(())
10425 }
10426 }
10427
10428 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10429 for ProviderGetInterfaceAddressesResponse
10430 {
10431 #[inline(always)]
10432 fn new_empty() -> Self {
10433 Self {
10434 interfaces: fidl::new_empty!(
10435 fidl::encoding::UnboundedVector<InterfaceAddresses>,
10436 D
10437 ),
10438 }
10439 }
10440
10441 #[inline]
10442 unsafe fn decode(
10443 &mut self,
10444 decoder: &mut fidl::encoding::Decoder<'_, D>,
10445 offset: usize,
10446 _depth: fidl::encoding::Depth,
10447 ) -> fidl::Result<()> {
10448 decoder.debug_check_bounds::<Self>(offset);
10449 fidl::decode!(
10451 fidl::encoding::UnboundedVector<InterfaceAddresses>,
10452 D,
10453 &mut self.interfaces,
10454 decoder,
10455 offset + 0,
10456 _depth
10457 )?;
10458 Ok(())
10459 }
10460 }
10461
10462 impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameRequest {
10463 type Borrowed<'a> = &'a Self;
10464 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10465 value
10466 }
10467 }
10468
10469 unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameRequest {
10470 type Owned = Self;
10471
10472 #[inline(always)]
10473 fn inline_align(_context: fidl::encoding::Context) -> usize {
10474 8
10475 }
10476
10477 #[inline(always)]
10478 fn inline_size(_context: fidl::encoding::Context) -> usize {
10479 8
10480 }
10481 #[inline(always)]
10482 fn encode_is_copy() -> bool {
10483 true
10484 }
10485
10486 #[inline(always)]
10487 fn decode_is_copy() -> bool {
10488 true
10489 }
10490 }
10491
10492 unsafe impl<D: fidl::encoding::ResourceDialect>
10493 fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D>
10494 for &ProviderInterfaceIndexToNameRequest
10495 {
10496 #[inline]
10497 unsafe fn encode(
10498 self,
10499 encoder: &mut fidl::encoding::Encoder<'_, D>,
10500 offset: usize,
10501 _depth: fidl::encoding::Depth,
10502 ) -> fidl::Result<()> {
10503 encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10504 unsafe {
10505 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10507 (buf_ptr as *mut ProviderInterfaceIndexToNameRequest)
10508 .write_unaligned((self as *const ProviderInterfaceIndexToNameRequest).read());
10509 }
10512 Ok(())
10513 }
10514 }
10515 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
10516 fidl::encoding::Encode<ProviderInterfaceIndexToNameRequest, D> for (T0,)
10517 {
10518 #[inline]
10519 unsafe fn encode(
10520 self,
10521 encoder: &mut fidl::encoding::Encoder<'_, D>,
10522 offset: usize,
10523 depth: fidl::encoding::Depth,
10524 ) -> fidl::Result<()> {
10525 encoder.debug_check_bounds::<ProviderInterfaceIndexToNameRequest>(offset);
10526 self.0.encode(encoder, offset + 0, depth)?;
10530 Ok(())
10531 }
10532 }
10533
10534 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10535 for ProviderInterfaceIndexToNameRequest
10536 {
10537 #[inline(always)]
10538 fn new_empty() -> Self {
10539 Self { index: fidl::new_empty!(u64, D) }
10540 }
10541
10542 #[inline]
10543 unsafe fn decode(
10544 &mut self,
10545 decoder: &mut fidl::encoding::Decoder<'_, D>,
10546 offset: usize,
10547 _depth: fidl::encoding::Depth,
10548 ) -> fidl::Result<()> {
10549 decoder.debug_check_bounds::<Self>(offset);
10550 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10551 unsafe {
10554 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10555 }
10556 Ok(())
10557 }
10558 }
10559
10560 impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsRequest {
10561 type Borrowed<'a> = &'a Self;
10562 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10563 value
10564 }
10565 }
10566
10567 unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsRequest {
10568 type Owned = Self;
10569
10570 #[inline(always)]
10571 fn inline_align(_context: fidl::encoding::Context) -> usize {
10572 8
10573 }
10574
10575 #[inline(always)]
10576 fn inline_size(_context: fidl::encoding::Context) -> usize {
10577 16
10578 }
10579 }
10580
10581 unsafe impl<D: fidl::encoding::ResourceDialect>
10582 fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D>
10583 for &ProviderInterfaceNameToFlagsRequest
10584 {
10585 #[inline]
10586 unsafe fn encode(
10587 self,
10588 encoder: &mut fidl::encoding::Encoder<'_, D>,
10589 offset: usize,
10590 _depth: fidl::encoding::Depth,
10591 ) -> fidl::Result<()> {
10592 encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10593 fidl::encoding::Encode::<ProviderInterfaceNameToFlagsRequest, D>::encode(
10595 (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10596 &self.name,
10597 ),),
10598 encoder,
10599 offset,
10600 _depth,
10601 )
10602 }
10603 }
10604 unsafe impl<
10605 D: fidl::encoding::ResourceDialect,
10606 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10607 > fidl::encoding::Encode<ProviderInterfaceNameToFlagsRequest, D> for (T0,)
10608 {
10609 #[inline]
10610 unsafe fn encode(
10611 self,
10612 encoder: &mut fidl::encoding::Encoder<'_, D>,
10613 offset: usize,
10614 depth: fidl::encoding::Depth,
10615 ) -> fidl::Result<()> {
10616 encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsRequest>(offset);
10617 self.0.encode(encoder, offset + 0, depth)?;
10621 Ok(())
10622 }
10623 }
10624
10625 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10626 for ProviderInterfaceNameToFlagsRequest
10627 {
10628 #[inline(always)]
10629 fn new_empty() -> Self {
10630 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10631 }
10632
10633 #[inline]
10634 unsafe fn decode(
10635 &mut self,
10636 decoder: &mut fidl::encoding::Decoder<'_, D>,
10637 offset: usize,
10638 _depth: fidl::encoding::Depth,
10639 ) -> fidl::Result<()> {
10640 decoder.debug_check_bounds::<Self>(offset);
10641 fidl::decode!(
10643 fidl::encoding::BoundedString<15>,
10644 D,
10645 &mut self.name,
10646 decoder,
10647 offset + 0,
10648 _depth
10649 )?;
10650 Ok(())
10651 }
10652 }
10653
10654 impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexRequest {
10655 type Borrowed<'a> = &'a Self;
10656 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10657 value
10658 }
10659 }
10660
10661 unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexRequest {
10662 type Owned = Self;
10663
10664 #[inline(always)]
10665 fn inline_align(_context: fidl::encoding::Context) -> usize {
10666 8
10667 }
10668
10669 #[inline(always)]
10670 fn inline_size(_context: fidl::encoding::Context) -> usize {
10671 16
10672 }
10673 }
10674
10675 unsafe impl<D: fidl::encoding::ResourceDialect>
10676 fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D>
10677 for &ProviderInterfaceNameToIndexRequest
10678 {
10679 #[inline]
10680 unsafe fn encode(
10681 self,
10682 encoder: &mut fidl::encoding::Encoder<'_, D>,
10683 offset: usize,
10684 _depth: fidl::encoding::Depth,
10685 ) -> fidl::Result<()> {
10686 encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10687 fidl::encoding::Encode::<ProviderInterfaceNameToIndexRequest, D>::encode(
10689 (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
10690 &self.name,
10691 ),),
10692 encoder,
10693 offset,
10694 _depth,
10695 )
10696 }
10697 }
10698 unsafe impl<
10699 D: fidl::encoding::ResourceDialect,
10700 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
10701 > fidl::encoding::Encode<ProviderInterfaceNameToIndexRequest, D> for (T0,)
10702 {
10703 #[inline]
10704 unsafe fn encode(
10705 self,
10706 encoder: &mut fidl::encoding::Encoder<'_, D>,
10707 offset: usize,
10708 depth: fidl::encoding::Depth,
10709 ) -> fidl::Result<()> {
10710 encoder.debug_check_bounds::<ProviderInterfaceNameToIndexRequest>(offset);
10711 self.0.encode(encoder, offset + 0, depth)?;
10715 Ok(())
10716 }
10717 }
10718
10719 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10720 for ProviderInterfaceNameToIndexRequest
10721 {
10722 #[inline(always)]
10723 fn new_empty() -> Self {
10724 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
10725 }
10726
10727 #[inline]
10728 unsafe fn decode(
10729 &mut self,
10730 decoder: &mut fidl::encoding::Decoder<'_, D>,
10731 offset: usize,
10732 _depth: fidl::encoding::Depth,
10733 ) -> fidl::Result<()> {
10734 decoder.debug_check_bounds::<Self>(offset);
10735 fidl::decode!(
10737 fidl::encoding::BoundedString<15>,
10738 D,
10739 &mut self.name,
10740 decoder,
10741 offset + 0,
10742 _depth
10743 )?;
10744 Ok(())
10745 }
10746 }
10747
10748 impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketRequest {
10749 type Borrowed<'a> = &'a Self;
10750 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10751 value
10752 }
10753 }
10754
10755 unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketRequest {
10756 type Owned = Self;
10757
10758 #[inline(always)]
10759 fn inline_align(_context: fidl::encoding::Context) -> usize {
10760 4
10761 }
10762
10763 #[inline(always)]
10764 fn inline_size(_context: fidl::encoding::Context) -> usize {
10765 8
10766 }
10767 }
10768
10769 unsafe impl<D: fidl::encoding::ResourceDialect>
10770 fidl::encoding::Encode<ProviderStreamSocketRequest, D> for &ProviderStreamSocketRequest
10771 {
10772 #[inline]
10773 unsafe fn encode(
10774 self,
10775 encoder: &mut fidl::encoding::Encoder<'_, D>,
10776 offset: usize,
10777 _depth: fidl::encoding::Depth,
10778 ) -> fidl::Result<()> {
10779 encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
10780 fidl::encoding::Encode::<ProviderStreamSocketRequest, D>::encode(
10782 (
10783 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10784 <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
10785 ),
10786 encoder,
10787 offset,
10788 _depth,
10789 )
10790 }
10791 }
10792 unsafe impl<
10793 D: fidl::encoding::ResourceDialect,
10794 T0: fidl::encoding::Encode<Domain, D>,
10795 T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
10796 > fidl::encoding::Encode<ProviderStreamSocketRequest, D> for (T0, T1)
10797 {
10798 #[inline]
10799 unsafe fn encode(
10800 self,
10801 encoder: &mut fidl::encoding::Encoder<'_, D>,
10802 offset: usize,
10803 depth: fidl::encoding::Depth,
10804 ) -> fidl::Result<()> {
10805 encoder.debug_check_bounds::<ProviderStreamSocketRequest>(offset);
10806 unsafe {
10809 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10810 (ptr as *mut u32).write_unaligned(0);
10811 }
10812 self.0.encode(encoder, offset + 0, depth)?;
10814 self.1.encode(encoder, offset + 4, depth)?;
10815 Ok(())
10816 }
10817 }
10818
10819 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10820 for ProviderStreamSocketRequest
10821 {
10822 #[inline(always)]
10823 fn new_empty() -> Self {
10824 Self {
10825 domain: fidl::new_empty!(Domain, D),
10826 proto: fidl::new_empty!(StreamSocketProtocol, D),
10827 }
10828 }
10829
10830 #[inline]
10831 unsafe fn decode(
10832 &mut self,
10833 decoder: &mut fidl::encoding::Decoder<'_, D>,
10834 offset: usize,
10835 _depth: fidl::encoding::Depth,
10836 ) -> fidl::Result<()> {
10837 decoder.debug_check_bounds::<Self>(offset);
10838 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10840 let padval = unsafe { (ptr as *const u32).read_unaligned() };
10841 let mask = 0xffff0000u32;
10842 let maskedval = padval & mask;
10843 if maskedval != 0 {
10844 return Err(fidl::Error::NonZeroPadding {
10845 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10846 });
10847 }
10848 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10849 fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10850 Ok(())
10851 }
10852 }
10853
10854 impl fidl::encoding::ValueTypeMarker for ProviderStreamSocketWithOptionsRequest {
10855 type Borrowed<'a> = &'a Self;
10856 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10857 value
10858 }
10859 }
10860
10861 unsafe impl fidl::encoding::TypeMarker for ProviderStreamSocketWithOptionsRequest {
10862 type Owned = Self;
10863
10864 #[inline(always)]
10865 fn inline_align(_context: fidl::encoding::Context) -> usize {
10866 8
10867 }
10868
10869 #[inline(always)]
10870 fn inline_size(_context: fidl::encoding::Context) -> usize {
10871 24
10872 }
10873 }
10874
10875 unsafe impl<D: fidl::encoding::ResourceDialect>
10876 fidl::encoding::Encode<ProviderStreamSocketWithOptionsRequest, D>
10877 for &ProviderStreamSocketWithOptionsRequest
10878 {
10879 #[inline]
10880 unsafe fn encode(
10881 self,
10882 encoder: &mut fidl::encoding::Encoder<'_, D>,
10883 offset: usize,
10884 _depth: fidl::encoding::Depth,
10885 ) -> fidl::Result<()> {
10886 encoder.debug_check_bounds::<ProviderStreamSocketWithOptionsRequest>(offset);
10887 fidl::encoding::Encode::<ProviderStreamSocketWithOptionsRequest, D>::encode(
10889 (
10890 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
10891 <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
10892 <SocketCreationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.opts),
10893 ),
10894 encoder,
10895 offset,
10896 _depth,
10897 )
10898 }
10899 }
10900 unsafe impl<
10901 D: fidl::encoding::ResourceDialect,
10902 T0: fidl::encoding::Encode<Domain, D>,
10903 T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
10904 T2: fidl::encoding::Encode<SocketCreationOptions, D>,
10905 > fidl::encoding::Encode<ProviderStreamSocketWithOptionsRequest, D> for (T0, T1, T2)
10906 {
10907 #[inline]
10908 unsafe fn encode(
10909 self,
10910 encoder: &mut fidl::encoding::Encoder<'_, D>,
10911 offset: usize,
10912 depth: fidl::encoding::Depth,
10913 ) -> fidl::Result<()> {
10914 encoder.debug_check_bounds::<ProviderStreamSocketWithOptionsRequest>(offset);
10915 unsafe {
10918 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10919 (ptr as *mut u64).write_unaligned(0);
10920 }
10921 self.0.encode(encoder, offset + 0, depth)?;
10923 self.1.encode(encoder, offset + 4, depth)?;
10924 self.2.encode(encoder, offset + 8, depth)?;
10925 Ok(())
10926 }
10927 }
10928
10929 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10930 for ProviderStreamSocketWithOptionsRequest
10931 {
10932 #[inline(always)]
10933 fn new_empty() -> Self {
10934 Self {
10935 domain: fidl::new_empty!(Domain, D),
10936 proto: fidl::new_empty!(StreamSocketProtocol, D),
10937 opts: fidl::new_empty!(SocketCreationOptions, D),
10938 }
10939 }
10940
10941 #[inline]
10942 unsafe fn decode(
10943 &mut self,
10944 decoder: &mut fidl::encoding::Decoder<'_, D>,
10945 offset: usize,
10946 _depth: fidl::encoding::Depth,
10947 ) -> fidl::Result<()> {
10948 decoder.debug_check_bounds::<Self>(offset);
10949 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10951 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10952 let mask = 0xffff0000u64;
10953 let maskedval = padval & mask;
10954 if maskedval != 0 {
10955 return Err(fidl::Error::NonZeroPadding {
10956 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10957 });
10958 }
10959 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
10960 fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
10961 fidl::decode!(SocketCreationOptions, D, &mut self.opts, decoder, offset + 8, _depth)?;
10962 Ok(())
10963 }
10964 }
10965
10966 impl fidl::encoding::ValueTypeMarker for ProviderInterfaceIndexToNameResponse {
10967 type Borrowed<'a> = &'a Self;
10968 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10969 value
10970 }
10971 }
10972
10973 unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceIndexToNameResponse {
10974 type Owned = Self;
10975
10976 #[inline(always)]
10977 fn inline_align(_context: fidl::encoding::Context) -> usize {
10978 8
10979 }
10980
10981 #[inline(always)]
10982 fn inline_size(_context: fidl::encoding::Context) -> usize {
10983 16
10984 }
10985 }
10986
10987 unsafe impl<D: fidl::encoding::ResourceDialect>
10988 fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D>
10989 for &ProviderInterfaceIndexToNameResponse
10990 {
10991 #[inline]
10992 unsafe fn encode(
10993 self,
10994 encoder: &mut fidl::encoding::Encoder<'_, D>,
10995 offset: usize,
10996 _depth: fidl::encoding::Depth,
10997 ) -> fidl::Result<()> {
10998 encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
10999 fidl::encoding::Encode::<ProviderInterfaceIndexToNameResponse, D>::encode(
11001 (<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
11002 &self.name,
11003 ),),
11004 encoder,
11005 offset,
11006 _depth,
11007 )
11008 }
11009 }
11010 unsafe impl<
11011 D: fidl::encoding::ResourceDialect,
11012 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
11013 > fidl::encoding::Encode<ProviderInterfaceIndexToNameResponse, D> for (T0,)
11014 {
11015 #[inline]
11016 unsafe fn encode(
11017 self,
11018 encoder: &mut fidl::encoding::Encoder<'_, D>,
11019 offset: usize,
11020 depth: fidl::encoding::Depth,
11021 ) -> fidl::Result<()> {
11022 encoder.debug_check_bounds::<ProviderInterfaceIndexToNameResponse>(offset);
11023 self.0.encode(encoder, offset + 0, depth)?;
11027 Ok(())
11028 }
11029 }
11030
11031 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11032 for ProviderInterfaceIndexToNameResponse
11033 {
11034 #[inline(always)]
11035 fn new_empty() -> Self {
11036 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D) }
11037 }
11038
11039 #[inline]
11040 unsafe fn decode(
11041 &mut self,
11042 decoder: &mut fidl::encoding::Decoder<'_, D>,
11043 offset: usize,
11044 _depth: fidl::encoding::Depth,
11045 ) -> fidl::Result<()> {
11046 decoder.debug_check_bounds::<Self>(offset);
11047 fidl::decode!(
11049 fidl::encoding::BoundedString<15>,
11050 D,
11051 &mut self.name,
11052 decoder,
11053 offset + 0,
11054 _depth
11055 )?;
11056 Ok(())
11057 }
11058 }
11059
11060 impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToFlagsResponse {
11061 type Borrowed<'a> = &'a Self;
11062 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11063 value
11064 }
11065 }
11066
11067 unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToFlagsResponse {
11068 type Owned = Self;
11069
11070 #[inline(always)]
11071 fn inline_align(_context: fidl::encoding::Context) -> usize {
11072 2
11073 }
11074
11075 #[inline(always)]
11076 fn inline_size(_context: fidl::encoding::Context) -> usize {
11077 2
11078 }
11079 }
11080
11081 unsafe impl<D: fidl::encoding::ResourceDialect>
11082 fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D>
11083 for &ProviderInterfaceNameToFlagsResponse
11084 {
11085 #[inline]
11086 unsafe fn encode(
11087 self,
11088 encoder: &mut fidl::encoding::Encoder<'_, D>,
11089 offset: usize,
11090 _depth: fidl::encoding::Depth,
11091 ) -> fidl::Result<()> {
11092 encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11093 fidl::encoding::Encode::<ProviderInterfaceNameToFlagsResponse, D>::encode(
11095 (<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
11096 encoder,
11097 offset,
11098 _depth,
11099 )
11100 }
11101 }
11102 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<InterfaceFlags, D>>
11103 fidl::encoding::Encode<ProviderInterfaceNameToFlagsResponse, D> for (T0,)
11104 {
11105 #[inline]
11106 unsafe fn encode(
11107 self,
11108 encoder: &mut fidl::encoding::Encoder<'_, D>,
11109 offset: usize,
11110 depth: fidl::encoding::Depth,
11111 ) -> fidl::Result<()> {
11112 encoder.debug_check_bounds::<ProviderInterfaceNameToFlagsResponse>(offset);
11113 self.0.encode(encoder, offset + 0, depth)?;
11117 Ok(())
11118 }
11119 }
11120
11121 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11122 for ProviderInterfaceNameToFlagsResponse
11123 {
11124 #[inline(always)]
11125 fn new_empty() -> Self {
11126 Self { flags: fidl::new_empty!(InterfaceFlags, D) }
11127 }
11128
11129 #[inline]
11130 unsafe fn decode(
11131 &mut self,
11132 decoder: &mut fidl::encoding::Decoder<'_, D>,
11133 offset: usize,
11134 _depth: fidl::encoding::Depth,
11135 ) -> fidl::Result<()> {
11136 decoder.debug_check_bounds::<Self>(offset);
11137 fidl::decode!(InterfaceFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
11139 Ok(())
11140 }
11141 }
11142
11143 impl fidl::encoding::ValueTypeMarker for ProviderInterfaceNameToIndexResponse {
11144 type Borrowed<'a> = &'a Self;
11145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11146 value
11147 }
11148 }
11149
11150 unsafe impl fidl::encoding::TypeMarker for ProviderInterfaceNameToIndexResponse {
11151 type Owned = Self;
11152
11153 #[inline(always)]
11154 fn inline_align(_context: fidl::encoding::Context) -> usize {
11155 8
11156 }
11157
11158 #[inline(always)]
11159 fn inline_size(_context: fidl::encoding::Context) -> usize {
11160 8
11161 }
11162 #[inline(always)]
11163 fn encode_is_copy() -> bool {
11164 true
11165 }
11166
11167 #[inline(always)]
11168 fn decode_is_copy() -> bool {
11169 true
11170 }
11171 }
11172
11173 unsafe impl<D: fidl::encoding::ResourceDialect>
11174 fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D>
11175 for &ProviderInterfaceNameToIndexResponse
11176 {
11177 #[inline]
11178 unsafe fn encode(
11179 self,
11180 encoder: &mut fidl::encoding::Encoder<'_, D>,
11181 offset: usize,
11182 _depth: fidl::encoding::Depth,
11183 ) -> fidl::Result<()> {
11184 encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11185 unsafe {
11186 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11188 (buf_ptr as *mut ProviderInterfaceNameToIndexResponse)
11189 .write_unaligned((self as *const ProviderInterfaceNameToIndexResponse).read());
11190 }
11193 Ok(())
11194 }
11195 }
11196 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11197 fidl::encoding::Encode<ProviderInterfaceNameToIndexResponse, D> for (T0,)
11198 {
11199 #[inline]
11200 unsafe fn encode(
11201 self,
11202 encoder: &mut fidl::encoding::Encoder<'_, D>,
11203 offset: usize,
11204 depth: fidl::encoding::Depth,
11205 ) -> fidl::Result<()> {
11206 encoder.debug_check_bounds::<ProviderInterfaceNameToIndexResponse>(offset);
11207 self.0.encode(encoder, offset + 0, depth)?;
11211 Ok(())
11212 }
11213 }
11214
11215 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11216 for ProviderInterfaceNameToIndexResponse
11217 {
11218 #[inline(always)]
11219 fn new_empty() -> Self {
11220 Self { index: fidl::new_empty!(u64, D) }
11221 }
11222
11223 #[inline]
11224 unsafe fn decode(
11225 &mut self,
11226 decoder: &mut fidl::encoding::Decoder<'_, D>,
11227 offset: usize,
11228 _depth: fidl::encoding::Depth,
11229 ) -> fidl::Result<()> {
11230 decoder.debug_check_bounds::<Self>(offset);
11231 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11232 unsafe {
11235 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11236 }
11237 Ok(())
11238 }
11239 }
11240
11241 impl fidl::encoding::ValueTypeMarker for StreamSocketAcceptRequest {
11242 type Borrowed<'a> = &'a Self;
11243 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11244 value
11245 }
11246 }
11247
11248 unsafe impl fidl::encoding::TypeMarker for StreamSocketAcceptRequest {
11249 type Owned = Self;
11250
11251 #[inline(always)]
11252 fn inline_align(_context: fidl::encoding::Context) -> usize {
11253 1
11254 }
11255
11256 #[inline(always)]
11257 fn inline_size(_context: fidl::encoding::Context) -> usize {
11258 1
11259 }
11260 }
11261
11262 unsafe impl<D: fidl::encoding::ResourceDialect>
11263 fidl::encoding::Encode<StreamSocketAcceptRequest, D> for &StreamSocketAcceptRequest
11264 {
11265 #[inline]
11266 unsafe fn encode(
11267 self,
11268 encoder: &mut fidl::encoding::Encoder<'_, D>,
11269 offset: usize,
11270 _depth: fidl::encoding::Depth,
11271 ) -> fidl::Result<()> {
11272 encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11273 fidl::encoding::Encode::<StreamSocketAcceptRequest, D>::encode(
11275 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),),
11276 encoder,
11277 offset,
11278 _depth,
11279 )
11280 }
11281 }
11282 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11283 fidl::encoding::Encode<StreamSocketAcceptRequest, D> for (T0,)
11284 {
11285 #[inline]
11286 unsafe fn encode(
11287 self,
11288 encoder: &mut fidl::encoding::Encoder<'_, D>,
11289 offset: usize,
11290 depth: fidl::encoding::Depth,
11291 ) -> fidl::Result<()> {
11292 encoder.debug_check_bounds::<StreamSocketAcceptRequest>(offset);
11293 self.0.encode(encoder, offset + 0, depth)?;
11297 Ok(())
11298 }
11299 }
11300
11301 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11302 for StreamSocketAcceptRequest
11303 {
11304 #[inline(always)]
11305 fn new_empty() -> Self {
11306 Self { want_addr: fidl::new_empty!(bool, D) }
11307 }
11308
11309 #[inline]
11310 unsafe fn decode(
11311 &mut self,
11312 decoder: &mut fidl::encoding::Decoder<'_, D>,
11313 offset: usize,
11314 _depth: fidl::encoding::Depth,
11315 ) -> fidl::Result<()> {
11316 decoder.debug_check_bounds::<Self>(offset);
11317 fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
11319 Ok(())
11320 }
11321 }
11322
11323 impl fidl::encoding::ValueTypeMarker for StreamSocketListenRequest {
11324 type Borrowed<'a> = &'a Self;
11325 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11326 value
11327 }
11328 }
11329
11330 unsafe impl fidl::encoding::TypeMarker for StreamSocketListenRequest {
11331 type Owned = Self;
11332
11333 #[inline(always)]
11334 fn inline_align(_context: fidl::encoding::Context) -> usize {
11335 2
11336 }
11337
11338 #[inline(always)]
11339 fn inline_size(_context: fidl::encoding::Context) -> usize {
11340 2
11341 }
11342 #[inline(always)]
11343 fn encode_is_copy() -> bool {
11344 true
11345 }
11346
11347 #[inline(always)]
11348 fn decode_is_copy() -> bool {
11349 true
11350 }
11351 }
11352
11353 unsafe impl<D: fidl::encoding::ResourceDialect>
11354 fidl::encoding::Encode<StreamSocketListenRequest, D> for &StreamSocketListenRequest
11355 {
11356 #[inline]
11357 unsafe fn encode(
11358 self,
11359 encoder: &mut fidl::encoding::Encoder<'_, D>,
11360 offset: usize,
11361 _depth: fidl::encoding::Depth,
11362 ) -> fidl::Result<()> {
11363 encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11364 unsafe {
11365 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11367 (buf_ptr as *mut StreamSocketListenRequest)
11368 .write_unaligned((self as *const StreamSocketListenRequest).read());
11369 }
11372 Ok(())
11373 }
11374 }
11375 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i16, D>>
11376 fidl::encoding::Encode<StreamSocketListenRequest, D> for (T0,)
11377 {
11378 #[inline]
11379 unsafe fn encode(
11380 self,
11381 encoder: &mut fidl::encoding::Encoder<'_, D>,
11382 offset: usize,
11383 depth: fidl::encoding::Depth,
11384 ) -> fidl::Result<()> {
11385 encoder.debug_check_bounds::<StreamSocketListenRequest>(offset);
11386 self.0.encode(encoder, offset + 0, depth)?;
11390 Ok(())
11391 }
11392 }
11393
11394 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11395 for StreamSocketListenRequest
11396 {
11397 #[inline(always)]
11398 fn new_empty() -> Self {
11399 Self { backlog: fidl::new_empty!(i16, D) }
11400 }
11401
11402 #[inline]
11403 unsafe fn decode(
11404 &mut self,
11405 decoder: &mut fidl::encoding::Decoder<'_, D>,
11406 offset: usize,
11407 _depth: fidl::encoding::Depth,
11408 ) -> fidl::Result<()> {
11409 decoder.debug_check_bounds::<Self>(offset);
11410 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11411 unsafe {
11414 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
11415 }
11416 Ok(())
11417 }
11418 }
11419
11420 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCongestionRequest {
11421 type Borrowed<'a> = &'a Self;
11422 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11423 value
11424 }
11425 }
11426
11427 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCongestionRequest {
11428 type Owned = Self;
11429
11430 #[inline(always)]
11431 fn inline_align(_context: fidl::encoding::Context) -> usize {
11432 4
11433 }
11434
11435 #[inline(always)]
11436 fn inline_size(_context: fidl::encoding::Context) -> usize {
11437 4
11438 }
11439 }
11440
11441 unsafe impl<D: fidl::encoding::ResourceDialect>
11442 fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D>
11443 for &StreamSocketSetTcpCongestionRequest
11444 {
11445 #[inline]
11446 unsafe fn encode(
11447 self,
11448 encoder: &mut fidl::encoding::Encoder<'_, D>,
11449 offset: usize,
11450 _depth: fidl::encoding::Depth,
11451 ) -> fidl::Result<()> {
11452 encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11453 fidl::encoding::Encode::<StreamSocketSetTcpCongestionRequest, D>::encode(
11455 (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11456 encoder,
11457 offset,
11458 _depth,
11459 )
11460 }
11461 }
11462 unsafe impl<
11463 D: fidl::encoding::ResourceDialect,
11464 T0: fidl::encoding::Encode<TcpCongestionControl, D>,
11465 > fidl::encoding::Encode<StreamSocketSetTcpCongestionRequest, D> for (T0,)
11466 {
11467 #[inline]
11468 unsafe fn encode(
11469 self,
11470 encoder: &mut fidl::encoding::Encoder<'_, D>,
11471 offset: usize,
11472 depth: fidl::encoding::Depth,
11473 ) -> fidl::Result<()> {
11474 encoder.debug_check_bounds::<StreamSocketSetTcpCongestionRequest>(offset);
11475 self.0.encode(encoder, offset + 0, depth)?;
11479 Ok(())
11480 }
11481 }
11482
11483 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11484 for StreamSocketSetTcpCongestionRequest
11485 {
11486 #[inline(always)]
11487 fn new_empty() -> Self {
11488 Self { value: fidl::new_empty!(TcpCongestionControl, D) }
11489 }
11490
11491 #[inline]
11492 unsafe fn decode(
11493 &mut self,
11494 decoder: &mut fidl::encoding::Decoder<'_, D>,
11495 offset: usize,
11496 _depth: fidl::encoding::Depth,
11497 ) -> fidl::Result<()> {
11498 decoder.debug_check_bounds::<Self>(offset);
11499 fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
11501 Ok(())
11502 }
11503 }
11504
11505 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpCorkRequest {
11506 type Borrowed<'a> = &'a Self;
11507 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11508 value
11509 }
11510 }
11511
11512 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpCorkRequest {
11513 type Owned = Self;
11514
11515 #[inline(always)]
11516 fn inline_align(_context: fidl::encoding::Context) -> usize {
11517 1
11518 }
11519
11520 #[inline(always)]
11521 fn inline_size(_context: fidl::encoding::Context) -> usize {
11522 1
11523 }
11524 }
11525
11526 unsafe impl<D: fidl::encoding::ResourceDialect>
11527 fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D>
11528 for &StreamSocketSetTcpCorkRequest
11529 {
11530 #[inline]
11531 unsafe fn encode(
11532 self,
11533 encoder: &mut fidl::encoding::Encoder<'_, D>,
11534 offset: usize,
11535 _depth: fidl::encoding::Depth,
11536 ) -> fidl::Result<()> {
11537 encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11538 fidl::encoding::Encode::<StreamSocketSetTcpCorkRequest, D>::encode(
11540 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
11541 encoder,
11542 offset,
11543 _depth,
11544 )
11545 }
11546 }
11547 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
11548 fidl::encoding::Encode<StreamSocketSetTcpCorkRequest, D> for (T0,)
11549 {
11550 #[inline]
11551 unsafe fn encode(
11552 self,
11553 encoder: &mut fidl::encoding::Encoder<'_, D>,
11554 offset: usize,
11555 depth: fidl::encoding::Depth,
11556 ) -> fidl::Result<()> {
11557 encoder.debug_check_bounds::<StreamSocketSetTcpCorkRequest>(offset);
11558 self.0.encode(encoder, offset + 0, depth)?;
11562 Ok(())
11563 }
11564 }
11565
11566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11567 for StreamSocketSetTcpCorkRequest
11568 {
11569 #[inline(always)]
11570 fn new_empty() -> Self {
11571 Self { value: fidl::new_empty!(bool, D) }
11572 }
11573
11574 #[inline]
11575 unsafe fn decode(
11576 &mut self,
11577 decoder: &mut fidl::encoding::Decoder<'_, D>,
11578 offset: usize,
11579 _depth: fidl::encoding::Depth,
11580 ) -> fidl::Result<()> {
11581 decoder.debug_check_bounds::<Self>(offset);
11582 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
11584 Ok(())
11585 }
11586 }
11587
11588 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11589 type Borrowed<'a> = &'a Self;
11590 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11591 value
11592 }
11593 }
11594
11595 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpDeferAcceptRequest {
11596 type Owned = Self;
11597
11598 #[inline(always)]
11599 fn inline_align(_context: fidl::encoding::Context) -> usize {
11600 4
11601 }
11602
11603 #[inline(always)]
11604 fn inline_size(_context: fidl::encoding::Context) -> usize {
11605 4
11606 }
11607 #[inline(always)]
11608 fn encode_is_copy() -> bool {
11609 true
11610 }
11611
11612 #[inline(always)]
11613 fn decode_is_copy() -> bool {
11614 true
11615 }
11616 }
11617
11618 unsafe impl<D: fidl::encoding::ResourceDialect>
11619 fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D>
11620 for &StreamSocketSetTcpDeferAcceptRequest
11621 {
11622 #[inline]
11623 unsafe fn encode(
11624 self,
11625 encoder: &mut fidl::encoding::Encoder<'_, D>,
11626 offset: usize,
11627 _depth: fidl::encoding::Depth,
11628 ) -> fidl::Result<()> {
11629 encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11630 unsafe {
11631 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11633 (buf_ptr as *mut StreamSocketSetTcpDeferAcceptRequest)
11634 .write_unaligned((self as *const StreamSocketSetTcpDeferAcceptRequest).read());
11635 }
11638 Ok(())
11639 }
11640 }
11641 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11642 fidl::encoding::Encode<StreamSocketSetTcpDeferAcceptRequest, D> for (T0,)
11643 {
11644 #[inline]
11645 unsafe fn encode(
11646 self,
11647 encoder: &mut fidl::encoding::Encoder<'_, D>,
11648 offset: usize,
11649 depth: fidl::encoding::Depth,
11650 ) -> fidl::Result<()> {
11651 encoder.debug_check_bounds::<StreamSocketSetTcpDeferAcceptRequest>(offset);
11652 self.0.encode(encoder, offset + 0, depth)?;
11656 Ok(())
11657 }
11658 }
11659
11660 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11661 for StreamSocketSetTcpDeferAcceptRequest
11662 {
11663 #[inline(always)]
11664 fn new_empty() -> Self {
11665 Self { value_secs: fidl::new_empty!(u32, D) }
11666 }
11667
11668 #[inline]
11669 unsafe fn decode(
11670 &mut self,
11671 decoder: &mut fidl::encoding::Decoder<'_, D>,
11672 offset: usize,
11673 _depth: fidl::encoding::Depth,
11674 ) -> fidl::Result<()> {
11675 decoder.debug_check_bounds::<Self>(offset);
11676 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11677 unsafe {
11680 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11681 }
11682 Ok(())
11683 }
11684 }
11685
11686 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11687 type Borrowed<'a> = &'a Self;
11688 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11689 value
11690 }
11691 }
11692
11693 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveCountRequest {
11694 type Owned = Self;
11695
11696 #[inline(always)]
11697 fn inline_align(_context: fidl::encoding::Context) -> usize {
11698 4
11699 }
11700
11701 #[inline(always)]
11702 fn inline_size(_context: fidl::encoding::Context) -> usize {
11703 4
11704 }
11705 #[inline(always)]
11706 fn encode_is_copy() -> bool {
11707 true
11708 }
11709
11710 #[inline(always)]
11711 fn decode_is_copy() -> bool {
11712 true
11713 }
11714 }
11715
11716 unsafe impl<D: fidl::encoding::ResourceDialect>
11717 fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D>
11718 for &StreamSocketSetTcpKeepAliveCountRequest
11719 {
11720 #[inline]
11721 unsafe fn encode(
11722 self,
11723 encoder: &mut fidl::encoding::Encoder<'_, D>,
11724 offset: usize,
11725 _depth: fidl::encoding::Depth,
11726 ) -> fidl::Result<()> {
11727 encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11728 unsafe {
11729 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11731 (buf_ptr as *mut StreamSocketSetTcpKeepAliveCountRequest).write_unaligned(
11732 (self as *const StreamSocketSetTcpKeepAliveCountRequest).read(),
11733 );
11734 }
11737 Ok(())
11738 }
11739 }
11740 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11741 fidl::encoding::Encode<StreamSocketSetTcpKeepAliveCountRequest, D> for (T0,)
11742 {
11743 #[inline]
11744 unsafe fn encode(
11745 self,
11746 encoder: &mut fidl::encoding::Encoder<'_, D>,
11747 offset: usize,
11748 depth: fidl::encoding::Depth,
11749 ) -> fidl::Result<()> {
11750 encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveCountRequest>(offset);
11751 self.0.encode(encoder, offset + 0, depth)?;
11755 Ok(())
11756 }
11757 }
11758
11759 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11760 for StreamSocketSetTcpKeepAliveCountRequest
11761 {
11762 #[inline(always)]
11763 fn new_empty() -> Self {
11764 Self { value: fidl::new_empty!(u32, D) }
11765 }
11766
11767 #[inline]
11768 unsafe fn decode(
11769 &mut self,
11770 decoder: &mut fidl::encoding::Decoder<'_, D>,
11771 offset: usize,
11772 _depth: fidl::encoding::Depth,
11773 ) -> fidl::Result<()> {
11774 decoder.debug_check_bounds::<Self>(offset);
11775 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11776 unsafe {
11779 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11780 }
11781 Ok(())
11782 }
11783 }
11784
11785 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11786 type Borrowed<'a> = &'a Self;
11787 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11788 value
11789 }
11790 }
11791
11792 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIdleRequest {
11793 type Owned = Self;
11794
11795 #[inline(always)]
11796 fn inline_align(_context: fidl::encoding::Context) -> usize {
11797 4
11798 }
11799
11800 #[inline(always)]
11801 fn inline_size(_context: fidl::encoding::Context) -> usize {
11802 4
11803 }
11804 #[inline(always)]
11805 fn encode_is_copy() -> bool {
11806 true
11807 }
11808
11809 #[inline(always)]
11810 fn decode_is_copy() -> bool {
11811 true
11812 }
11813 }
11814
11815 unsafe impl<D: fidl::encoding::ResourceDialect>
11816 fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D>
11817 for &StreamSocketSetTcpKeepAliveIdleRequest
11818 {
11819 #[inline]
11820 unsafe fn encode(
11821 self,
11822 encoder: &mut fidl::encoding::Encoder<'_, D>,
11823 offset: usize,
11824 _depth: fidl::encoding::Depth,
11825 ) -> fidl::Result<()> {
11826 encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11827 unsafe {
11828 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11830 (buf_ptr as *mut StreamSocketSetTcpKeepAliveIdleRequest).write_unaligned(
11831 (self as *const StreamSocketSetTcpKeepAliveIdleRequest).read(),
11832 );
11833 }
11836 Ok(())
11837 }
11838 }
11839 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11840 fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIdleRequest, D> for (T0,)
11841 {
11842 #[inline]
11843 unsafe fn encode(
11844 self,
11845 encoder: &mut fidl::encoding::Encoder<'_, D>,
11846 offset: usize,
11847 depth: fidl::encoding::Depth,
11848 ) -> fidl::Result<()> {
11849 encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIdleRequest>(offset);
11850 self.0.encode(encoder, offset + 0, depth)?;
11854 Ok(())
11855 }
11856 }
11857
11858 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11859 for StreamSocketSetTcpKeepAliveIdleRequest
11860 {
11861 #[inline(always)]
11862 fn new_empty() -> Self {
11863 Self { value_secs: fidl::new_empty!(u32, D) }
11864 }
11865
11866 #[inline]
11867 unsafe fn decode(
11868 &mut self,
11869 decoder: &mut fidl::encoding::Decoder<'_, D>,
11870 offset: usize,
11871 _depth: fidl::encoding::Depth,
11872 ) -> fidl::Result<()> {
11873 decoder.debug_check_bounds::<Self>(offset);
11874 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11875 unsafe {
11878 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11879 }
11880 Ok(())
11881 }
11882 }
11883
11884 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
11885 type Borrowed<'a> = &'a Self;
11886 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11887 value
11888 }
11889 }
11890
11891 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpKeepAliveIntervalRequest {
11892 type Owned = Self;
11893
11894 #[inline(always)]
11895 fn inline_align(_context: fidl::encoding::Context) -> usize {
11896 4
11897 }
11898
11899 #[inline(always)]
11900 fn inline_size(_context: fidl::encoding::Context) -> usize {
11901 4
11902 }
11903 #[inline(always)]
11904 fn encode_is_copy() -> bool {
11905 true
11906 }
11907
11908 #[inline(always)]
11909 fn decode_is_copy() -> bool {
11910 true
11911 }
11912 }
11913
11914 unsafe impl<D: fidl::encoding::ResourceDialect>
11915 fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D>
11916 for &StreamSocketSetTcpKeepAliveIntervalRequest
11917 {
11918 #[inline]
11919 unsafe fn encode(
11920 self,
11921 encoder: &mut fidl::encoding::Encoder<'_, D>,
11922 offset: usize,
11923 _depth: fidl::encoding::Depth,
11924 ) -> fidl::Result<()> {
11925 encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
11926 unsafe {
11927 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11929 (buf_ptr as *mut StreamSocketSetTcpKeepAliveIntervalRequest).write_unaligned(
11930 (self as *const StreamSocketSetTcpKeepAliveIntervalRequest).read(),
11931 );
11932 }
11935 Ok(())
11936 }
11937 }
11938 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11939 fidl::encoding::Encode<StreamSocketSetTcpKeepAliveIntervalRequest, D> for (T0,)
11940 {
11941 #[inline]
11942 unsafe fn encode(
11943 self,
11944 encoder: &mut fidl::encoding::Encoder<'_, D>,
11945 offset: usize,
11946 depth: fidl::encoding::Depth,
11947 ) -> fidl::Result<()> {
11948 encoder.debug_check_bounds::<StreamSocketSetTcpKeepAliveIntervalRequest>(offset);
11949 self.0.encode(encoder, offset + 0, depth)?;
11953 Ok(())
11954 }
11955 }
11956
11957 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11958 for StreamSocketSetTcpKeepAliveIntervalRequest
11959 {
11960 #[inline(always)]
11961 fn new_empty() -> Self {
11962 Self { value_secs: fidl::new_empty!(u32, D) }
11963 }
11964
11965 #[inline]
11966 unsafe fn decode(
11967 &mut self,
11968 decoder: &mut fidl::encoding::Decoder<'_, D>,
11969 offset: usize,
11970 _depth: fidl::encoding::Depth,
11971 ) -> fidl::Result<()> {
11972 decoder.debug_check_bounds::<Self>(offset);
11973 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11974 unsafe {
11977 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11978 }
11979 Ok(())
11980 }
11981 }
11982
11983 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpLingerRequest {
11984 type Borrowed<'a> = &'a Self;
11985 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11986 value
11987 }
11988 }
11989
11990 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpLingerRequest {
11991 type Owned = Self;
11992
11993 #[inline(always)]
11994 fn inline_align(_context: fidl::encoding::Context) -> usize {
11995 8
11996 }
11997
11998 #[inline(always)]
11999 fn inline_size(_context: fidl::encoding::Context) -> usize {
12000 16
12001 }
12002 }
12003
12004 unsafe impl<D: fidl::encoding::ResourceDialect>
12005 fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D>
12006 for &StreamSocketSetTcpLingerRequest
12007 {
12008 #[inline]
12009 unsafe fn encode(
12010 self,
12011 encoder: &mut fidl::encoding::Encoder<'_, D>,
12012 offset: usize,
12013 _depth: fidl::encoding::Depth,
12014 ) -> fidl::Result<()> {
12015 encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12016 fidl::encoding::Encode::<StreamSocketSetTcpLingerRequest, D>::encode(
12018 (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
12019 encoder,
12020 offset,
12021 _depth,
12022 )
12023 }
12024 }
12025 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
12026 fidl::encoding::Encode<StreamSocketSetTcpLingerRequest, D> for (T0,)
12027 {
12028 #[inline]
12029 unsafe fn encode(
12030 self,
12031 encoder: &mut fidl::encoding::Encoder<'_, D>,
12032 offset: usize,
12033 depth: fidl::encoding::Depth,
12034 ) -> fidl::Result<()> {
12035 encoder.debug_check_bounds::<StreamSocketSetTcpLingerRequest>(offset);
12036 self.0.encode(encoder, offset + 0, depth)?;
12040 Ok(())
12041 }
12042 }
12043
12044 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12045 for StreamSocketSetTcpLingerRequest
12046 {
12047 #[inline(always)]
12048 fn new_empty() -> Self {
12049 Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
12050 }
12051
12052 #[inline]
12053 unsafe fn decode(
12054 &mut self,
12055 decoder: &mut fidl::encoding::Decoder<'_, D>,
12056 offset: usize,
12057 _depth: fidl::encoding::Depth,
12058 ) -> fidl::Result<()> {
12059 decoder.debug_check_bounds::<Self>(offset);
12060 fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
12062 Ok(())
12063 }
12064 }
12065
12066 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12067 type Borrowed<'a> = &'a Self;
12068 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12069 value
12070 }
12071 }
12072
12073 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpMaxSegmentRequest {
12074 type Owned = Self;
12075
12076 #[inline(always)]
12077 fn inline_align(_context: fidl::encoding::Context) -> usize {
12078 4
12079 }
12080
12081 #[inline(always)]
12082 fn inline_size(_context: fidl::encoding::Context) -> usize {
12083 4
12084 }
12085 #[inline(always)]
12086 fn encode_is_copy() -> bool {
12087 true
12088 }
12089
12090 #[inline(always)]
12091 fn decode_is_copy() -> bool {
12092 true
12093 }
12094 }
12095
12096 unsafe impl<D: fidl::encoding::ResourceDialect>
12097 fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D>
12098 for &StreamSocketSetTcpMaxSegmentRequest
12099 {
12100 #[inline]
12101 unsafe fn encode(
12102 self,
12103 encoder: &mut fidl::encoding::Encoder<'_, D>,
12104 offset: usize,
12105 _depth: fidl::encoding::Depth,
12106 ) -> fidl::Result<()> {
12107 encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12108 unsafe {
12109 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12111 (buf_ptr as *mut StreamSocketSetTcpMaxSegmentRequest)
12112 .write_unaligned((self as *const StreamSocketSetTcpMaxSegmentRequest).read());
12113 }
12116 Ok(())
12117 }
12118 }
12119 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12120 fidl::encoding::Encode<StreamSocketSetTcpMaxSegmentRequest, D> for (T0,)
12121 {
12122 #[inline]
12123 unsafe fn encode(
12124 self,
12125 encoder: &mut fidl::encoding::Encoder<'_, D>,
12126 offset: usize,
12127 depth: fidl::encoding::Depth,
12128 ) -> fidl::Result<()> {
12129 encoder.debug_check_bounds::<StreamSocketSetTcpMaxSegmentRequest>(offset);
12130 self.0.encode(encoder, offset + 0, depth)?;
12134 Ok(())
12135 }
12136 }
12137
12138 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12139 for StreamSocketSetTcpMaxSegmentRequest
12140 {
12141 #[inline(always)]
12142 fn new_empty() -> Self {
12143 Self { value_bytes: fidl::new_empty!(u32, D) }
12144 }
12145
12146 #[inline]
12147 unsafe fn decode(
12148 &mut self,
12149 decoder: &mut fidl::encoding::Decoder<'_, D>,
12150 offset: usize,
12151 _depth: fidl::encoding::Depth,
12152 ) -> fidl::Result<()> {
12153 decoder.debug_check_bounds::<Self>(offset);
12154 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12155 unsafe {
12158 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12159 }
12160 Ok(())
12161 }
12162 }
12163
12164 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpNoDelayRequest {
12165 type Borrowed<'a> = &'a Self;
12166 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12167 value
12168 }
12169 }
12170
12171 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpNoDelayRequest {
12172 type Owned = Self;
12173
12174 #[inline(always)]
12175 fn inline_align(_context: fidl::encoding::Context) -> usize {
12176 1
12177 }
12178
12179 #[inline(always)]
12180 fn inline_size(_context: fidl::encoding::Context) -> usize {
12181 1
12182 }
12183 }
12184
12185 unsafe impl<D: fidl::encoding::ResourceDialect>
12186 fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D>
12187 for &StreamSocketSetTcpNoDelayRequest
12188 {
12189 #[inline]
12190 unsafe fn encode(
12191 self,
12192 encoder: &mut fidl::encoding::Encoder<'_, D>,
12193 offset: usize,
12194 _depth: fidl::encoding::Depth,
12195 ) -> fidl::Result<()> {
12196 encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12197 fidl::encoding::Encode::<StreamSocketSetTcpNoDelayRequest, D>::encode(
12199 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12200 encoder,
12201 offset,
12202 _depth,
12203 )
12204 }
12205 }
12206 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12207 fidl::encoding::Encode<StreamSocketSetTcpNoDelayRequest, D> for (T0,)
12208 {
12209 #[inline]
12210 unsafe fn encode(
12211 self,
12212 encoder: &mut fidl::encoding::Encoder<'_, D>,
12213 offset: usize,
12214 depth: fidl::encoding::Depth,
12215 ) -> fidl::Result<()> {
12216 encoder.debug_check_bounds::<StreamSocketSetTcpNoDelayRequest>(offset);
12217 self.0.encode(encoder, offset + 0, depth)?;
12221 Ok(())
12222 }
12223 }
12224
12225 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12226 for StreamSocketSetTcpNoDelayRequest
12227 {
12228 #[inline(always)]
12229 fn new_empty() -> Self {
12230 Self { value: fidl::new_empty!(bool, D) }
12231 }
12232
12233 #[inline]
12234 unsafe fn decode(
12235 &mut self,
12236 decoder: &mut fidl::encoding::Decoder<'_, D>,
12237 offset: usize,
12238 _depth: fidl::encoding::Depth,
12239 ) -> fidl::Result<()> {
12240 decoder.debug_check_bounds::<Self>(offset);
12241 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12243 Ok(())
12244 }
12245 }
12246
12247 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpQuickAckRequest {
12248 type Borrowed<'a> = &'a Self;
12249 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12250 value
12251 }
12252 }
12253
12254 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpQuickAckRequest {
12255 type Owned = Self;
12256
12257 #[inline(always)]
12258 fn inline_align(_context: fidl::encoding::Context) -> usize {
12259 1
12260 }
12261
12262 #[inline(always)]
12263 fn inline_size(_context: fidl::encoding::Context) -> usize {
12264 1
12265 }
12266 }
12267
12268 unsafe impl<D: fidl::encoding::ResourceDialect>
12269 fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D>
12270 for &StreamSocketSetTcpQuickAckRequest
12271 {
12272 #[inline]
12273 unsafe fn encode(
12274 self,
12275 encoder: &mut fidl::encoding::Encoder<'_, D>,
12276 offset: usize,
12277 _depth: fidl::encoding::Depth,
12278 ) -> fidl::Result<()> {
12279 encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12280 fidl::encoding::Encode::<StreamSocketSetTcpQuickAckRequest, D>::encode(
12282 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12283 encoder,
12284 offset,
12285 _depth,
12286 )
12287 }
12288 }
12289 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12290 fidl::encoding::Encode<StreamSocketSetTcpQuickAckRequest, D> for (T0,)
12291 {
12292 #[inline]
12293 unsafe fn encode(
12294 self,
12295 encoder: &mut fidl::encoding::Encoder<'_, D>,
12296 offset: usize,
12297 depth: fidl::encoding::Depth,
12298 ) -> fidl::Result<()> {
12299 encoder.debug_check_bounds::<StreamSocketSetTcpQuickAckRequest>(offset);
12300 self.0.encode(encoder, offset + 0, depth)?;
12304 Ok(())
12305 }
12306 }
12307
12308 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12309 for StreamSocketSetTcpQuickAckRequest
12310 {
12311 #[inline(always)]
12312 fn new_empty() -> Self {
12313 Self { value: fidl::new_empty!(bool, D) }
12314 }
12315
12316 #[inline]
12317 unsafe fn decode(
12318 &mut self,
12319 decoder: &mut fidl::encoding::Decoder<'_, D>,
12320 offset: usize,
12321 _depth: fidl::encoding::Depth,
12322 ) -> fidl::Result<()> {
12323 decoder.debug_check_bounds::<Self>(offset);
12324 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12326 Ok(())
12327 }
12328 }
12329
12330 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpSynCountRequest {
12331 type Borrowed<'a> = &'a Self;
12332 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12333 value
12334 }
12335 }
12336
12337 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpSynCountRequest {
12338 type Owned = Self;
12339
12340 #[inline(always)]
12341 fn inline_align(_context: fidl::encoding::Context) -> usize {
12342 4
12343 }
12344
12345 #[inline(always)]
12346 fn inline_size(_context: fidl::encoding::Context) -> usize {
12347 4
12348 }
12349 #[inline(always)]
12350 fn encode_is_copy() -> bool {
12351 true
12352 }
12353
12354 #[inline(always)]
12355 fn decode_is_copy() -> bool {
12356 true
12357 }
12358 }
12359
12360 unsafe impl<D: fidl::encoding::ResourceDialect>
12361 fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D>
12362 for &StreamSocketSetTcpSynCountRequest
12363 {
12364 #[inline]
12365 unsafe fn encode(
12366 self,
12367 encoder: &mut fidl::encoding::Encoder<'_, D>,
12368 offset: usize,
12369 _depth: fidl::encoding::Depth,
12370 ) -> fidl::Result<()> {
12371 encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12372 unsafe {
12373 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12375 (buf_ptr as *mut StreamSocketSetTcpSynCountRequest)
12376 .write_unaligned((self as *const StreamSocketSetTcpSynCountRequest).read());
12377 }
12380 Ok(())
12381 }
12382 }
12383 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12384 fidl::encoding::Encode<StreamSocketSetTcpSynCountRequest, D> for (T0,)
12385 {
12386 #[inline]
12387 unsafe fn encode(
12388 self,
12389 encoder: &mut fidl::encoding::Encoder<'_, D>,
12390 offset: usize,
12391 depth: fidl::encoding::Depth,
12392 ) -> fidl::Result<()> {
12393 encoder.debug_check_bounds::<StreamSocketSetTcpSynCountRequest>(offset);
12394 self.0.encode(encoder, offset + 0, depth)?;
12398 Ok(())
12399 }
12400 }
12401
12402 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12403 for StreamSocketSetTcpSynCountRequest
12404 {
12405 #[inline(always)]
12406 fn new_empty() -> Self {
12407 Self { value: fidl::new_empty!(u32, D) }
12408 }
12409
12410 #[inline]
12411 unsafe fn decode(
12412 &mut self,
12413 decoder: &mut fidl::encoding::Decoder<'_, D>,
12414 offset: usize,
12415 _depth: fidl::encoding::Depth,
12416 ) -> fidl::Result<()> {
12417 decoder.debug_check_bounds::<Self>(offset);
12418 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12419 unsafe {
12422 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12423 }
12424 Ok(())
12425 }
12426 }
12427
12428 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12429 type Borrowed<'a> = &'a Self;
12430 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12431 value
12432 }
12433 }
12434
12435 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpUserTimeoutRequest {
12436 type Owned = Self;
12437
12438 #[inline(always)]
12439 fn inline_align(_context: fidl::encoding::Context) -> usize {
12440 4
12441 }
12442
12443 #[inline(always)]
12444 fn inline_size(_context: fidl::encoding::Context) -> usize {
12445 4
12446 }
12447 #[inline(always)]
12448 fn encode_is_copy() -> bool {
12449 true
12450 }
12451
12452 #[inline(always)]
12453 fn decode_is_copy() -> bool {
12454 true
12455 }
12456 }
12457
12458 unsafe impl<D: fidl::encoding::ResourceDialect>
12459 fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D>
12460 for &StreamSocketSetTcpUserTimeoutRequest
12461 {
12462 #[inline]
12463 unsafe fn encode(
12464 self,
12465 encoder: &mut fidl::encoding::Encoder<'_, D>,
12466 offset: usize,
12467 _depth: fidl::encoding::Depth,
12468 ) -> fidl::Result<()> {
12469 encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12470 unsafe {
12471 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12473 (buf_ptr as *mut StreamSocketSetTcpUserTimeoutRequest)
12474 .write_unaligned((self as *const StreamSocketSetTcpUserTimeoutRequest).read());
12475 }
12478 Ok(())
12479 }
12480 }
12481 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12482 fidl::encoding::Encode<StreamSocketSetTcpUserTimeoutRequest, D> for (T0,)
12483 {
12484 #[inline]
12485 unsafe fn encode(
12486 self,
12487 encoder: &mut fidl::encoding::Encoder<'_, D>,
12488 offset: usize,
12489 depth: fidl::encoding::Depth,
12490 ) -> fidl::Result<()> {
12491 encoder.debug_check_bounds::<StreamSocketSetTcpUserTimeoutRequest>(offset);
12492 self.0.encode(encoder, offset + 0, depth)?;
12496 Ok(())
12497 }
12498 }
12499
12500 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12501 for StreamSocketSetTcpUserTimeoutRequest
12502 {
12503 #[inline(always)]
12504 fn new_empty() -> Self {
12505 Self { value_millis: fidl::new_empty!(u32, D) }
12506 }
12507
12508 #[inline]
12509 unsafe fn decode(
12510 &mut self,
12511 decoder: &mut fidl::encoding::Decoder<'_, D>,
12512 offset: usize,
12513 _depth: fidl::encoding::Depth,
12514 ) -> fidl::Result<()> {
12515 decoder.debug_check_bounds::<Self>(offset);
12516 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12517 unsafe {
12520 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12521 }
12522 Ok(())
12523 }
12524 }
12525
12526 impl fidl::encoding::ValueTypeMarker for StreamSocketSetTcpWindowClampRequest {
12527 type Borrowed<'a> = &'a Self;
12528 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12529 value
12530 }
12531 }
12532
12533 unsafe impl fidl::encoding::TypeMarker for StreamSocketSetTcpWindowClampRequest {
12534 type Owned = Self;
12535
12536 #[inline(always)]
12537 fn inline_align(_context: fidl::encoding::Context) -> usize {
12538 4
12539 }
12540
12541 #[inline(always)]
12542 fn inline_size(_context: fidl::encoding::Context) -> usize {
12543 4
12544 }
12545 #[inline(always)]
12546 fn encode_is_copy() -> bool {
12547 true
12548 }
12549
12550 #[inline(always)]
12551 fn decode_is_copy() -> bool {
12552 true
12553 }
12554 }
12555
12556 unsafe impl<D: fidl::encoding::ResourceDialect>
12557 fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D>
12558 for &StreamSocketSetTcpWindowClampRequest
12559 {
12560 #[inline]
12561 unsafe fn encode(
12562 self,
12563 encoder: &mut fidl::encoding::Encoder<'_, D>,
12564 offset: usize,
12565 _depth: fidl::encoding::Depth,
12566 ) -> fidl::Result<()> {
12567 encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12568 unsafe {
12569 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12571 (buf_ptr as *mut StreamSocketSetTcpWindowClampRequest)
12572 .write_unaligned((self as *const StreamSocketSetTcpWindowClampRequest).read());
12573 }
12576 Ok(())
12577 }
12578 }
12579 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12580 fidl::encoding::Encode<StreamSocketSetTcpWindowClampRequest, D> for (T0,)
12581 {
12582 #[inline]
12583 unsafe fn encode(
12584 self,
12585 encoder: &mut fidl::encoding::Encoder<'_, D>,
12586 offset: usize,
12587 depth: fidl::encoding::Depth,
12588 ) -> fidl::Result<()> {
12589 encoder.debug_check_bounds::<StreamSocketSetTcpWindowClampRequest>(offset);
12590 self.0.encode(encoder, offset + 0, depth)?;
12594 Ok(())
12595 }
12596 }
12597
12598 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12599 for StreamSocketSetTcpWindowClampRequest
12600 {
12601 #[inline(always)]
12602 fn new_empty() -> Self {
12603 Self { value: fidl::new_empty!(u32, D) }
12604 }
12605
12606 #[inline]
12607 unsafe fn decode(
12608 &mut self,
12609 decoder: &mut fidl::encoding::Decoder<'_, D>,
12610 offset: usize,
12611 _depth: fidl::encoding::Depth,
12612 ) -> fidl::Result<()> {
12613 decoder.debug_check_bounds::<Self>(offset);
12614 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12615 unsafe {
12618 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12619 }
12620 Ok(())
12621 }
12622 }
12623
12624 impl fidl::encoding::ValueTypeMarker for StreamSocketGetInfoResponse {
12625 type Borrowed<'a> = &'a Self;
12626 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12627 value
12628 }
12629 }
12630
12631 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetInfoResponse {
12632 type Owned = Self;
12633
12634 #[inline(always)]
12635 fn inline_align(_context: fidl::encoding::Context) -> usize {
12636 4
12637 }
12638
12639 #[inline(always)]
12640 fn inline_size(_context: fidl::encoding::Context) -> usize {
12641 8
12642 }
12643 }
12644
12645 unsafe impl<D: fidl::encoding::ResourceDialect>
12646 fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for &StreamSocketGetInfoResponse
12647 {
12648 #[inline]
12649 unsafe fn encode(
12650 self,
12651 encoder: &mut fidl::encoding::Encoder<'_, D>,
12652 offset: usize,
12653 _depth: fidl::encoding::Depth,
12654 ) -> fidl::Result<()> {
12655 encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12656 fidl::encoding::Encode::<StreamSocketGetInfoResponse, D>::encode(
12658 (
12659 <Domain as fidl::encoding::ValueTypeMarker>::borrow(&self.domain),
12660 <StreamSocketProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.proto),
12661 ),
12662 encoder,
12663 offset,
12664 _depth,
12665 )
12666 }
12667 }
12668 unsafe impl<
12669 D: fidl::encoding::ResourceDialect,
12670 T0: fidl::encoding::Encode<Domain, D>,
12671 T1: fidl::encoding::Encode<StreamSocketProtocol, D>,
12672 > fidl::encoding::Encode<StreamSocketGetInfoResponse, D> for (T0, T1)
12673 {
12674 #[inline]
12675 unsafe fn encode(
12676 self,
12677 encoder: &mut fidl::encoding::Encoder<'_, D>,
12678 offset: usize,
12679 depth: fidl::encoding::Depth,
12680 ) -> fidl::Result<()> {
12681 encoder.debug_check_bounds::<StreamSocketGetInfoResponse>(offset);
12682 unsafe {
12685 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12686 (ptr as *mut u32).write_unaligned(0);
12687 }
12688 self.0.encode(encoder, offset + 0, depth)?;
12690 self.1.encode(encoder, offset + 4, depth)?;
12691 Ok(())
12692 }
12693 }
12694
12695 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12696 for StreamSocketGetInfoResponse
12697 {
12698 #[inline(always)]
12699 fn new_empty() -> Self {
12700 Self {
12701 domain: fidl::new_empty!(Domain, D),
12702 proto: fidl::new_empty!(StreamSocketProtocol, D),
12703 }
12704 }
12705
12706 #[inline]
12707 unsafe fn decode(
12708 &mut self,
12709 decoder: &mut fidl::encoding::Decoder<'_, D>,
12710 offset: usize,
12711 _depth: fidl::encoding::Depth,
12712 ) -> fidl::Result<()> {
12713 decoder.debug_check_bounds::<Self>(offset);
12714 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12716 let padval = unsafe { (ptr as *const u32).read_unaligned() };
12717 let mask = 0xffff0000u32;
12718 let maskedval = padval & mask;
12719 if maskedval != 0 {
12720 return Err(fidl::Error::NonZeroPadding {
12721 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12722 });
12723 }
12724 fidl::decode!(Domain, D, &mut self.domain, decoder, offset + 0, _depth)?;
12725 fidl::decode!(StreamSocketProtocol, D, &mut self.proto, decoder, offset + 4, _depth)?;
12726 Ok(())
12727 }
12728 }
12729
12730 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCongestionResponse {
12731 type Borrowed<'a> = &'a Self;
12732 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12733 value
12734 }
12735 }
12736
12737 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCongestionResponse {
12738 type Owned = Self;
12739
12740 #[inline(always)]
12741 fn inline_align(_context: fidl::encoding::Context) -> usize {
12742 4
12743 }
12744
12745 #[inline(always)]
12746 fn inline_size(_context: fidl::encoding::Context) -> usize {
12747 4
12748 }
12749 }
12750
12751 unsafe impl<D: fidl::encoding::ResourceDialect>
12752 fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D>
12753 for &StreamSocketGetTcpCongestionResponse
12754 {
12755 #[inline]
12756 unsafe fn encode(
12757 self,
12758 encoder: &mut fidl::encoding::Encoder<'_, D>,
12759 offset: usize,
12760 _depth: fidl::encoding::Depth,
12761 ) -> fidl::Result<()> {
12762 encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12763 fidl::encoding::Encode::<StreamSocketGetTcpCongestionResponse, D>::encode(
12765 (<TcpCongestionControl as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12766 encoder,
12767 offset,
12768 _depth,
12769 )
12770 }
12771 }
12772 unsafe impl<
12773 D: fidl::encoding::ResourceDialect,
12774 T0: fidl::encoding::Encode<TcpCongestionControl, D>,
12775 > fidl::encoding::Encode<StreamSocketGetTcpCongestionResponse, D> for (T0,)
12776 {
12777 #[inline]
12778 unsafe fn encode(
12779 self,
12780 encoder: &mut fidl::encoding::Encoder<'_, D>,
12781 offset: usize,
12782 depth: fidl::encoding::Depth,
12783 ) -> fidl::Result<()> {
12784 encoder.debug_check_bounds::<StreamSocketGetTcpCongestionResponse>(offset);
12785 self.0.encode(encoder, offset + 0, depth)?;
12789 Ok(())
12790 }
12791 }
12792
12793 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12794 for StreamSocketGetTcpCongestionResponse
12795 {
12796 #[inline(always)]
12797 fn new_empty() -> Self {
12798 Self { value: fidl::new_empty!(TcpCongestionControl, D) }
12799 }
12800
12801 #[inline]
12802 unsafe fn decode(
12803 &mut self,
12804 decoder: &mut fidl::encoding::Decoder<'_, D>,
12805 offset: usize,
12806 _depth: fidl::encoding::Depth,
12807 ) -> fidl::Result<()> {
12808 decoder.debug_check_bounds::<Self>(offset);
12809 fidl::decode!(TcpCongestionControl, D, &mut self.value, decoder, offset + 0, _depth)?;
12811 Ok(())
12812 }
12813 }
12814
12815 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpCorkResponse {
12816 type Borrowed<'a> = &'a Self;
12817 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12818 value
12819 }
12820 }
12821
12822 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpCorkResponse {
12823 type Owned = Self;
12824
12825 #[inline(always)]
12826 fn inline_align(_context: fidl::encoding::Context) -> usize {
12827 1
12828 }
12829
12830 #[inline(always)]
12831 fn inline_size(_context: fidl::encoding::Context) -> usize {
12832 1
12833 }
12834 }
12835
12836 unsafe impl<D: fidl::encoding::ResourceDialect>
12837 fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D>
12838 for &StreamSocketGetTcpCorkResponse
12839 {
12840 #[inline]
12841 unsafe fn encode(
12842 self,
12843 encoder: &mut fidl::encoding::Encoder<'_, D>,
12844 offset: usize,
12845 _depth: fidl::encoding::Depth,
12846 ) -> fidl::Result<()> {
12847 encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12848 fidl::encoding::Encode::<StreamSocketGetTcpCorkResponse, D>::encode(
12850 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
12851 encoder,
12852 offset,
12853 _depth,
12854 )
12855 }
12856 }
12857 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12858 fidl::encoding::Encode<StreamSocketGetTcpCorkResponse, D> for (T0,)
12859 {
12860 #[inline]
12861 unsafe fn encode(
12862 self,
12863 encoder: &mut fidl::encoding::Encoder<'_, D>,
12864 offset: usize,
12865 depth: fidl::encoding::Depth,
12866 ) -> fidl::Result<()> {
12867 encoder.debug_check_bounds::<StreamSocketGetTcpCorkResponse>(offset);
12868 self.0.encode(encoder, offset + 0, depth)?;
12872 Ok(())
12873 }
12874 }
12875
12876 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12877 for StreamSocketGetTcpCorkResponse
12878 {
12879 #[inline(always)]
12880 fn new_empty() -> Self {
12881 Self { value: fidl::new_empty!(bool, D) }
12882 }
12883
12884 #[inline]
12885 unsafe fn decode(
12886 &mut self,
12887 decoder: &mut fidl::encoding::Decoder<'_, D>,
12888 offset: usize,
12889 _depth: fidl::encoding::Depth,
12890 ) -> fidl::Result<()> {
12891 decoder.debug_check_bounds::<Self>(offset);
12892 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
12894 Ok(())
12895 }
12896 }
12897
12898 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpDeferAcceptResponse {
12899 type Borrowed<'a> = &'a Self;
12900 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12901 value
12902 }
12903 }
12904
12905 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpDeferAcceptResponse {
12906 type Owned = Self;
12907
12908 #[inline(always)]
12909 fn inline_align(_context: fidl::encoding::Context) -> usize {
12910 4
12911 }
12912
12913 #[inline(always)]
12914 fn inline_size(_context: fidl::encoding::Context) -> usize {
12915 4
12916 }
12917 #[inline(always)]
12918 fn encode_is_copy() -> bool {
12919 true
12920 }
12921
12922 #[inline(always)]
12923 fn decode_is_copy() -> bool {
12924 true
12925 }
12926 }
12927
12928 unsafe impl<D: fidl::encoding::ResourceDialect>
12929 fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D>
12930 for &StreamSocketGetTcpDeferAcceptResponse
12931 {
12932 #[inline]
12933 unsafe fn encode(
12934 self,
12935 encoder: &mut fidl::encoding::Encoder<'_, D>,
12936 offset: usize,
12937 _depth: fidl::encoding::Depth,
12938 ) -> fidl::Result<()> {
12939 encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
12940 unsafe {
12941 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12943 (buf_ptr as *mut StreamSocketGetTcpDeferAcceptResponse)
12944 .write_unaligned((self as *const StreamSocketGetTcpDeferAcceptResponse).read());
12945 }
12948 Ok(())
12949 }
12950 }
12951 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12952 fidl::encoding::Encode<StreamSocketGetTcpDeferAcceptResponse, D> for (T0,)
12953 {
12954 #[inline]
12955 unsafe fn encode(
12956 self,
12957 encoder: &mut fidl::encoding::Encoder<'_, D>,
12958 offset: usize,
12959 depth: fidl::encoding::Depth,
12960 ) -> fidl::Result<()> {
12961 encoder.debug_check_bounds::<StreamSocketGetTcpDeferAcceptResponse>(offset);
12962 self.0.encode(encoder, offset + 0, depth)?;
12966 Ok(())
12967 }
12968 }
12969
12970 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12971 for StreamSocketGetTcpDeferAcceptResponse
12972 {
12973 #[inline(always)]
12974 fn new_empty() -> Self {
12975 Self { value_secs: fidl::new_empty!(u32, D) }
12976 }
12977
12978 #[inline]
12979 unsafe fn decode(
12980 &mut self,
12981 decoder: &mut fidl::encoding::Decoder<'_, D>,
12982 offset: usize,
12983 _depth: fidl::encoding::Depth,
12984 ) -> fidl::Result<()> {
12985 decoder.debug_check_bounds::<Self>(offset);
12986 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12987 unsafe {
12990 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12991 }
12992 Ok(())
12993 }
12994 }
12995
12996 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpInfoResponse {
12997 type Borrowed<'a> = &'a Self;
12998 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12999 value
13000 }
13001 }
13002
13003 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpInfoResponse {
13004 type Owned = Self;
13005
13006 #[inline(always)]
13007 fn inline_align(_context: fidl::encoding::Context) -> usize {
13008 8
13009 }
13010
13011 #[inline(always)]
13012 fn inline_size(_context: fidl::encoding::Context) -> usize {
13013 16
13014 }
13015 }
13016
13017 unsafe impl<D: fidl::encoding::ResourceDialect>
13018 fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D>
13019 for &StreamSocketGetTcpInfoResponse
13020 {
13021 #[inline]
13022 unsafe fn encode(
13023 self,
13024 encoder: &mut fidl::encoding::Encoder<'_, D>,
13025 offset: usize,
13026 _depth: fidl::encoding::Depth,
13027 ) -> fidl::Result<()> {
13028 encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13029 fidl::encoding::Encode::<StreamSocketGetTcpInfoResponse, D>::encode(
13031 (<TcpInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
13032 encoder,
13033 offset,
13034 _depth,
13035 )
13036 }
13037 }
13038 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TcpInfo, D>>
13039 fidl::encoding::Encode<StreamSocketGetTcpInfoResponse, D> for (T0,)
13040 {
13041 #[inline]
13042 unsafe fn encode(
13043 self,
13044 encoder: &mut fidl::encoding::Encoder<'_, D>,
13045 offset: usize,
13046 depth: fidl::encoding::Depth,
13047 ) -> fidl::Result<()> {
13048 encoder.debug_check_bounds::<StreamSocketGetTcpInfoResponse>(offset);
13049 self.0.encode(encoder, offset + 0, depth)?;
13053 Ok(())
13054 }
13055 }
13056
13057 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13058 for StreamSocketGetTcpInfoResponse
13059 {
13060 #[inline(always)]
13061 fn new_empty() -> Self {
13062 Self { info: fidl::new_empty!(TcpInfo, D) }
13063 }
13064
13065 #[inline]
13066 unsafe fn decode(
13067 &mut self,
13068 decoder: &mut fidl::encoding::Decoder<'_, D>,
13069 offset: usize,
13070 _depth: fidl::encoding::Depth,
13071 ) -> fidl::Result<()> {
13072 decoder.debug_check_bounds::<Self>(offset);
13073 fidl::decode!(TcpInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
13075 Ok(())
13076 }
13077 }
13078
13079 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13080 type Borrowed<'a> = &'a Self;
13081 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13082 value
13083 }
13084 }
13085
13086 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveCountResponse {
13087 type Owned = Self;
13088
13089 #[inline(always)]
13090 fn inline_align(_context: fidl::encoding::Context) -> usize {
13091 4
13092 }
13093
13094 #[inline(always)]
13095 fn inline_size(_context: fidl::encoding::Context) -> usize {
13096 4
13097 }
13098 #[inline(always)]
13099 fn encode_is_copy() -> bool {
13100 true
13101 }
13102
13103 #[inline(always)]
13104 fn decode_is_copy() -> bool {
13105 true
13106 }
13107 }
13108
13109 unsafe impl<D: fidl::encoding::ResourceDialect>
13110 fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D>
13111 for &StreamSocketGetTcpKeepAliveCountResponse
13112 {
13113 #[inline]
13114 unsafe fn encode(
13115 self,
13116 encoder: &mut fidl::encoding::Encoder<'_, D>,
13117 offset: usize,
13118 _depth: fidl::encoding::Depth,
13119 ) -> fidl::Result<()> {
13120 encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13121 unsafe {
13122 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13124 (buf_ptr as *mut StreamSocketGetTcpKeepAliveCountResponse).write_unaligned(
13125 (self as *const StreamSocketGetTcpKeepAliveCountResponse).read(),
13126 );
13127 }
13130 Ok(())
13131 }
13132 }
13133 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13134 fidl::encoding::Encode<StreamSocketGetTcpKeepAliveCountResponse, D> for (T0,)
13135 {
13136 #[inline]
13137 unsafe fn encode(
13138 self,
13139 encoder: &mut fidl::encoding::Encoder<'_, D>,
13140 offset: usize,
13141 depth: fidl::encoding::Depth,
13142 ) -> fidl::Result<()> {
13143 encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveCountResponse>(offset);
13144 self.0.encode(encoder, offset + 0, depth)?;
13148 Ok(())
13149 }
13150 }
13151
13152 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13153 for StreamSocketGetTcpKeepAliveCountResponse
13154 {
13155 #[inline(always)]
13156 fn new_empty() -> Self {
13157 Self { value: fidl::new_empty!(u32, D) }
13158 }
13159
13160 #[inline]
13161 unsafe fn decode(
13162 &mut self,
13163 decoder: &mut fidl::encoding::Decoder<'_, D>,
13164 offset: usize,
13165 _depth: fidl::encoding::Depth,
13166 ) -> fidl::Result<()> {
13167 decoder.debug_check_bounds::<Self>(offset);
13168 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13169 unsafe {
13172 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13173 }
13174 Ok(())
13175 }
13176 }
13177
13178 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13179 type Borrowed<'a> = &'a Self;
13180 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13181 value
13182 }
13183 }
13184
13185 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIdleResponse {
13186 type Owned = Self;
13187
13188 #[inline(always)]
13189 fn inline_align(_context: fidl::encoding::Context) -> usize {
13190 4
13191 }
13192
13193 #[inline(always)]
13194 fn inline_size(_context: fidl::encoding::Context) -> usize {
13195 4
13196 }
13197 #[inline(always)]
13198 fn encode_is_copy() -> bool {
13199 true
13200 }
13201
13202 #[inline(always)]
13203 fn decode_is_copy() -> bool {
13204 true
13205 }
13206 }
13207
13208 unsafe impl<D: fidl::encoding::ResourceDialect>
13209 fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D>
13210 for &StreamSocketGetTcpKeepAliveIdleResponse
13211 {
13212 #[inline]
13213 unsafe fn encode(
13214 self,
13215 encoder: &mut fidl::encoding::Encoder<'_, D>,
13216 offset: usize,
13217 _depth: fidl::encoding::Depth,
13218 ) -> fidl::Result<()> {
13219 encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13220 unsafe {
13221 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13223 (buf_ptr as *mut StreamSocketGetTcpKeepAliveIdleResponse).write_unaligned(
13224 (self as *const StreamSocketGetTcpKeepAliveIdleResponse).read(),
13225 );
13226 }
13229 Ok(())
13230 }
13231 }
13232 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13233 fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIdleResponse, D> for (T0,)
13234 {
13235 #[inline]
13236 unsafe fn encode(
13237 self,
13238 encoder: &mut fidl::encoding::Encoder<'_, D>,
13239 offset: usize,
13240 depth: fidl::encoding::Depth,
13241 ) -> fidl::Result<()> {
13242 encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIdleResponse>(offset);
13243 self.0.encode(encoder, offset + 0, depth)?;
13247 Ok(())
13248 }
13249 }
13250
13251 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13252 for StreamSocketGetTcpKeepAliveIdleResponse
13253 {
13254 #[inline(always)]
13255 fn new_empty() -> Self {
13256 Self { value_secs: fidl::new_empty!(u32, D) }
13257 }
13258
13259 #[inline]
13260 unsafe fn decode(
13261 &mut self,
13262 decoder: &mut fidl::encoding::Decoder<'_, D>,
13263 offset: usize,
13264 _depth: fidl::encoding::Depth,
13265 ) -> fidl::Result<()> {
13266 decoder.debug_check_bounds::<Self>(offset);
13267 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13268 unsafe {
13271 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13272 }
13273 Ok(())
13274 }
13275 }
13276
13277 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13278 type Borrowed<'a> = &'a Self;
13279 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13280 value
13281 }
13282 }
13283
13284 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpKeepAliveIntervalResponse {
13285 type Owned = Self;
13286
13287 #[inline(always)]
13288 fn inline_align(_context: fidl::encoding::Context) -> usize {
13289 4
13290 }
13291
13292 #[inline(always)]
13293 fn inline_size(_context: fidl::encoding::Context) -> usize {
13294 4
13295 }
13296 #[inline(always)]
13297 fn encode_is_copy() -> bool {
13298 true
13299 }
13300
13301 #[inline(always)]
13302 fn decode_is_copy() -> bool {
13303 true
13304 }
13305 }
13306
13307 unsafe impl<D: fidl::encoding::ResourceDialect>
13308 fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D>
13309 for &StreamSocketGetTcpKeepAliveIntervalResponse
13310 {
13311 #[inline]
13312 unsafe fn encode(
13313 self,
13314 encoder: &mut fidl::encoding::Encoder<'_, D>,
13315 offset: usize,
13316 _depth: fidl::encoding::Depth,
13317 ) -> fidl::Result<()> {
13318 encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13319 unsafe {
13320 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13322 (buf_ptr as *mut StreamSocketGetTcpKeepAliveIntervalResponse).write_unaligned(
13323 (self as *const StreamSocketGetTcpKeepAliveIntervalResponse).read(),
13324 );
13325 }
13328 Ok(())
13329 }
13330 }
13331 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13332 fidl::encoding::Encode<StreamSocketGetTcpKeepAliveIntervalResponse, D> for (T0,)
13333 {
13334 #[inline]
13335 unsafe fn encode(
13336 self,
13337 encoder: &mut fidl::encoding::Encoder<'_, D>,
13338 offset: usize,
13339 depth: fidl::encoding::Depth,
13340 ) -> fidl::Result<()> {
13341 encoder.debug_check_bounds::<StreamSocketGetTcpKeepAliveIntervalResponse>(offset);
13342 self.0.encode(encoder, offset + 0, depth)?;
13346 Ok(())
13347 }
13348 }
13349
13350 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13351 for StreamSocketGetTcpKeepAliveIntervalResponse
13352 {
13353 #[inline(always)]
13354 fn new_empty() -> Self {
13355 Self { value_secs: fidl::new_empty!(u32, D) }
13356 }
13357
13358 #[inline]
13359 unsafe fn decode(
13360 &mut self,
13361 decoder: &mut fidl::encoding::Decoder<'_, D>,
13362 offset: usize,
13363 _depth: fidl::encoding::Depth,
13364 ) -> fidl::Result<()> {
13365 decoder.debug_check_bounds::<Self>(offset);
13366 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13367 unsafe {
13370 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13371 }
13372 Ok(())
13373 }
13374 }
13375
13376 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpLingerResponse {
13377 type Borrowed<'a> = &'a Self;
13378 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13379 value
13380 }
13381 }
13382
13383 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpLingerResponse {
13384 type Owned = Self;
13385
13386 #[inline(always)]
13387 fn inline_align(_context: fidl::encoding::Context) -> usize {
13388 8
13389 }
13390
13391 #[inline(always)]
13392 fn inline_size(_context: fidl::encoding::Context) -> usize {
13393 16
13394 }
13395 }
13396
13397 unsafe impl<D: fidl::encoding::ResourceDialect>
13398 fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D>
13399 for &StreamSocketGetTcpLingerResponse
13400 {
13401 #[inline]
13402 unsafe fn encode(
13403 self,
13404 encoder: &mut fidl::encoding::Encoder<'_, D>,
13405 offset: usize,
13406 _depth: fidl::encoding::Depth,
13407 ) -> fidl::Result<()> {
13408 encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13409 fidl::encoding::Encode::<StreamSocketGetTcpLingerResponse, D>::encode(
13411 (<OptionalUint32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value_secs),),
13412 encoder,
13413 offset,
13414 _depth,
13415 )
13416 }
13417 }
13418 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionalUint32, D>>
13419 fidl::encoding::Encode<StreamSocketGetTcpLingerResponse, D> for (T0,)
13420 {
13421 #[inline]
13422 unsafe fn encode(
13423 self,
13424 encoder: &mut fidl::encoding::Encoder<'_, D>,
13425 offset: usize,
13426 depth: fidl::encoding::Depth,
13427 ) -> fidl::Result<()> {
13428 encoder.debug_check_bounds::<StreamSocketGetTcpLingerResponse>(offset);
13429 self.0.encode(encoder, offset + 0, depth)?;
13433 Ok(())
13434 }
13435 }
13436
13437 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13438 for StreamSocketGetTcpLingerResponse
13439 {
13440 #[inline(always)]
13441 fn new_empty() -> Self {
13442 Self { value_secs: fidl::new_empty!(OptionalUint32, D) }
13443 }
13444
13445 #[inline]
13446 unsafe fn decode(
13447 &mut self,
13448 decoder: &mut fidl::encoding::Decoder<'_, D>,
13449 offset: usize,
13450 _depth: fidl::encoding::Depth,
13451 ) -> fidl::Result<()> {
13452 decoder.debug_check_bounds::<Self>(offset);
13453 fidl::decode!(OptionalUint32, D, &mut self.value_secs, decoder, offset + 0, _depth)?;
13455 Ok(())
13456 }
13457 }
13458
13459 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13460 type Borrowed<'a> = &'a Self;
13461 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13462 value
13463 }
13464 }
13465
13466 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpMaxSegmentResponse {
13467 type Owned = Self;
13468
13469 #[inline(always)]
13470 fn inline_align(_context: fidl::encoding::Context) -> usize {
13471 4
13472 }
13473
13474 #[inline(always)]
13475 fn inline_size(_context: fidl::encoding::Context) -> usize {
13476 4
13477 }
13478 #[inline(always)]
13479 fn encode_is_copy() -> bool {
13480 true
13481 }
13482
13483 #[inline(always)]
13484 fn decode_is_copy() -> bool {
13485 true
13486 }
13487 }
13488
13489 unsafe impl<D: fidl::encoding::ResourceDialect>
13490 fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D>
13491 for &StreamSocketGetTcpMaxSegmentResponse
13492 {
13493 #[inline]
13494 unsafe fn encode(
13495 self,
13496 encoder: &mut fidl::encoding::Encoder<'_, D>,
13497 offset: usize,
13498 _depth: fidl::encoding::Depth,
13499 ) -> fidl::Result<()> {
13500 encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13501 unsafe {
13502 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13504 (buf_ptr as *mut StreamSocketGetTcpMaxSegmentResponse)
13505 .write_unaligned((self as *const StreamSocketGetTcpMaxSegmentResponse).read());
13506 }
13509 Ok(())
13510 }
13511 }
13512 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13513 fidl::encoding::Encode<StreamSocketGetTcpMaxSegmentResponse, D> for (T0,)
13514 {
13515 #[inline]
13516 unsafe fn encode(
13517 self,
13518 encoder: &mut fidl::encoding::Encoder<'_, D>,
13519 offset: usize,
13520 depth: fidl::encoding::Depth,
13521 ) -> fidl::Result<()> {
13522 encoder.debug_check_bounds::<StreamSocketGetTcpMaxSegmentResponse>(offset);
13523 self.0.encode(encoder, offset + 0, depth)?;
13527 Ok(())
13528 }
13529 }
13530
13531 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13532 for StreamSocketGetTcpMaxSegmentResponse
13533 {
13534 #[inline(always)]
13535 fn new_empty() -> Self {
13536 Self { value_bytes: fidl::new_empty!(u32, D) }
13537 }
13538
13539 #[inline]
13540 unsafe fn decode(
13541 &mut self,
13542 decoder: &mut fidl::encoding::Decoder<'_, D>,
13543 offset: usize,
13544 _depth: fidl::encoding::Depth,
13545 ) -> fidl::Result<()> {
13546 decoder.debug_check_bounds::<Self>(offset);
13547 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13548 unsafe {
13551 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13552 }
13553 Ok(())
13554 }
13555 }
13556
13557 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpNoDelayResponse {
13558 type Borrowed<'a> = &'a Self;
13559 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13560 value
13561 }
13562 }
13563
13564 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpNoDelayResponse {
13565 type Owned = Self;
13566
13567 #[inline(always)]
13568 fn inline_align(_context: fidl::encoding::Context) -> usize {
13569 1
13570 }
13571
13572 #[inline(always)]
13573 fn inline_size(_context: fidl::encoding::Context) -> usize {
13574 1
13575 }
13576 }
13577
13578 unsafe impl<D: fidl::encoding::ResourceDialect>
13579 fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D>
13580 for &StreamSocketGetTcpNoDelayResponse
13581 {
13582 #[inline]
13583 unsafe fn encode(
13584 self,
13585 encoder: &mut fidl::encoding::Encoder<'_, D>,
13586 offset: usize,
13587 _depth: fidl::encoding::Depth,
13588 ) -> fidl::Result<()> {
13589 encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13590 fidl::encoding::Encode::<StreamSocketGetTcpNoDelayResponse, D>::encode(
13592 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13593 encoder,
13594 offset,
13595 _depth,
13596 )
13597 }
13598 }
13599 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13600 fidl::encoding::Encode<StreamSocketGetTcpNoDelayResponse, D> for (T0,)
13601 {
13602 #[inline]
13603 unsafe fn encode(
13604 self,
13605 encoder: &mut fidl::encoding::Encoder<'_, D>,
13606 offset: usize,
13607 depth: fidl::encoding::Depth,
13608 ) -> fidl::Result<()> {
13609 encoder.debug_check_bounds::<StreamSocketGetTcpNoDelayResponse>(offset);
13610 self.0.encode(encoder, offset + 0, depth)?;
13614 Ok(())
13615 }
13616 }
13617
13618 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13619 for StreamSocketGetTcpNoDelayResponse
13620 {
13621 #[inline(always)]
13622 fn new_empty() -> Self {
13623 Self { value: fidl::new_empty!(bool, D) }
13624 }
13625
13626 #[inline]
13627 unsafe fn decode(
13628 &mut self,
13629 decoder: &mut fidl::encoding::Decoder<'_, D>,
13630 offset: usize,
13631 _depth: fidl::encoding::Depth,
13632 ) -> fidl::Result<()> {
13633 decoder.debug_check_bounds::<Self>(offset);
13634 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13636 Ok(())
13637 }
13638 }
13639
13640 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpQuickAckResponse {
13641 type Borrowed<'a> = &'a Self;
13642 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13643 value
13644 }
13645 }
13646
13647 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpQuickAckResponse {
13648 type Owned = Self;
13649
13650 #[inline(always)]
13651 fn inline_align(_context: fidl::encoding::Context) -> usize {
13652 1
13653 }
13654
13655 #[inline(always)]
13656 fn inline_size(_context: fidl::encoding::Context) -> usize {
13657 1
13658 }
13659 }
13660
13661 unsafe impl<D: fidl::encoding::ResourceDialect>
13662 fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D>
13663 for &StreamSocketGetTcpQuickAckResponse
13664 {
13665 #[inline]
13666 unsafe fn encode(
13667 self,
13668 encoder: &mut fidl::encoding::Encoder<'_, D>,
13669 offset: usize,
13670 _depth: fidl::encoding::Depth,
13671 ) -> fidl::Result<()> {
13672 encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13673 fidl::encoding::Encode::<StreamSocketGetTcpQuickAckResponse, D>::encode(
13675 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
13676 encoder,
13677 offset,
13678 _depth,
13679 )
13680 }
13681 }
13682 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
13683 fidl::encoding::Encode<StreamSocketGetTcpQuickAckResponse, D> for (T0,)
13684 {
13685 #[inline]
13686 unsafe fn encode(
13687 self,
13688 encoder: &mut fidl::encoding::Encoder<'_, D>,
13689 offset: usize,
13690 depth: fidl::encoding::Depth,
13691 ) -> fidl::Result<()> {
13692 encoder.debug_check_bounds::<StreamSocketGetTcpQuickAckResponse>(offset);
13693 self.0.encode(encoder, offset + 0, depth)?;
13697 Ok(())
13698 }
13699 }
13700
13701 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13702 for StreamSocketGetTcpQuickAckResponse
13703 {
13704 #[inline(always)]
13705 fn new_empty() -> Self {
13706 Self { value: fidl::new_empty!(bool, D) }
13707 }
13708
13709 #[inline]
13710 unsafe fn decode(
13711 &mut self,
13712 decoder: &mut fidl::encoding::Decoder<'_, D>,
13713 offset: usize,
13714 _depth: fidl::encoding::Depth,
13715 ) -> fidl::Result<()> {
13716 decoder.debug_check_bounds::<Self>(offset);
13717 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
13719 Ok(())
13720 }
13721 }
13722
13723 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpSynCountResponse {
13724 type Borrowed<'a> = &'a Self;
13725 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13726 value
13727 }
13728 }
13729
13730 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpSynCountResponse {
13731 type Owned = Self;
13732
13733 #[inline(always)]
13734 fn inline_align(_context: fidl::encoding::Context) -> usize {
13735 4
13736 }
13737
13738 #[inline(always)]
13739 fn inline_size(_context: fidl::encoding::Context) -> usize {
13740 4
13741 }
13742 #[inline(always)]
13743 fn encode_is_copy() -> bool {
13744 true
13745 }
13746
13747 #[inline(always)]
13748 fn decode_is_copy() -> bool {
13749 true
13750 }
13751 }
13752
13753 unsafe impl<D: fidl::encoding::ResourceDialect>
13754 fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D>
13755 for &StreamSocketGetTcpSynCountResponse
13756 {
13757 #[inline]
13758 unsafe fn encode(
13759 self,
13760 encoder: &mut fidl::encoding::Encoder<'_, D>,
13761 offset: usize,
13762 _depth: fidl::encoding::Depth,
13763 ) -> fidl::Result<()> {
13764 encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13765 unsafe {
13766 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13768 (buf_ptr as *mut StreamSocketGetTcpSynCountResponse)
13769 .write_unaligned((self as *const StreamSocketGetTcpSynCountResponse).read());
13770 }
13773 Ok(())
13774 }
13775 }
13776 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13777 fidl::encoding::Encode<StreamSocketGetTcpSynCountResponse, D> for (T0,)
13778 {
13779 #[inline]
13780 unsafe fn encode(
13781 self,
13782 encoder: &mut fidl::encoding::Encoder<'_, D>,
13783 offset: usize,
13784 depth: fidl::encoding::Depth,
13785 ) -> fidl::Result<()> {
13786 encoder.debug_check_bounds::<StreamSocketGetTcpSynCountResponse>(offset);
13787 self.0.encode(encoder, offset + 0, depth)?;
13791 Ok(())
13792 }
13793 }
13794
13795 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13796 for StreamSocketGetTcpSynCountResponse
13797 {
13798 #[inline(always)]
13799 fn new_empty() -> Self {
13800 Self { value: fidl::new_empty!(u32, D) }
13801 }
13802
13803 #[inline]
13804 unsafe fn decode(
13805 &mut self,
13806 decoder: &mut fidl::encoding::Decoder<'_, D>,
13807 offset: usize,
13808 _depth: fidl::encoding::Depth,
13809 ) -> fidl::Result<()> {
13810 decoder.debug_check_bounds::<Self>(offset);
13811 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13812 unsafe {
13815 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13816 }
13817 Ok(())
13818 }
13819 }
13820
13821 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13822 type Borrowed<'a> = &'a Self;
13823 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13824 value
13825 }
13826 }
13827
13828 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpUserTimeoutResponse {
13829 type Owned = Self;
13830
13831 #[inline(always)]
13832 fn inline_align(_context: fidl::encoding::Context) -> usize {
13833 4
13834 }
13835
13836 #[inline(always)]
13837 fn inline_size(_context: fidl::encoding::Context) -> usize {
13838 4
13839 }
13840 #[inline(always)]
13841 fn encode_is_copy() -> bool {
13842 true
13843 }
13844
13845 #[inline(always)]
13846 fn decode_is_copy() -> bool {
13847 true
13848 }
13849 }
13850
13851 unsafe impl<D: fidl::encoding::ResourceDialect>
13852 fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D>
13853 for &StreamSocketGetTcpUserTimeoutResponse
13854 {
13855 #[inline]
13856 unsafe fn encode(
13857 self,
13858 encoder: &mut fidl::encoding::Encoder<'_, D>,
13859 offset: usize,
13860 _depth: fidl::encoding::Depth,
13861 ) -> fidl::Result<()> {
13862 encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
13863 unsafe {
13864 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13866 (buf_ptr as *mut StreamSocketGetTcpUserTimeoutResponse)
13867 .write_unaligned((self as *const StreamSocketGetTcpUserTimeoutResponse).read());
13868 }
13871 Ok(())
13872 }
13873 }
13874 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13875 fidl::encoding::Encode<StreamSocketGetTcpUserTimeoutResponse, D> for (T0,)
13876 {
13877 #[inline]
13878 unsafe fn encode(
13879 self,
13880 encoder: &mut fidl::encoding::Encoder<'_, D>,
13881 offset: usize,
13882 depth: fidl::encoding::Depth,
13883 ) -> fidl::Result<()> {
13884 encoder.debug_check_bounds::<StreamSocketGetTcpUserTimeoutResponse>(offset);
13885 self.0.encode(encoder, offset + 0, depth)?;
13889 Ok(())
13890 }
13891 }
13892
13893 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13894 for StreamSocketGetTcpUserTimeoutResponse
13895 {
13896 #[inline(always)]
13897 fn new_empty() -> Self {
13898 Self { value_millis: fidl::new_empty!(u32, D) }
13899 }
13900
13901 #[inline]
13902 unsafe fn decode(
13903 &mut self,
13904 decoder: &mut fidl::encoding::Decoder<'_, D>,
13905 offset: usize,
13906 _depth: fidl::encoding::Depth,
13907 ) -> fidl::Result<()> {
13908 decoder.debug_check_bounds::<Self>(offset);
13909 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13910 unsafe {
13913 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
13914 }
13915 Ok(())
13916 }
13917 }
13918
13919 impl fidl::encoding::ValueTypeMarker for StreamSocketGetTcpWindowClampResponse {
13920 type Borrowed<'a> = &'a Self;
13921 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13922 value
13923 }
13924 }
13925
13926 unsafe impl fidl::encoding::TypeMarker for StreamSocketGetTcpWindowClampResponse {
13927 type Owned = Self;
13928
13929 #[inline(always)]
13930 fn inline_align(_context: fidl::encoding::Context) -> usize {
13931 4
13932 }
13933
13934 #[inline(always)]
13935 fn inline_size(_context: fidl::encoding::Context) -> usize {
13936 4
13937 }
13938 #[inline(always)]
13939 fn encode_is_copy() -> bool {
13940 true
13941 }
13942
13943 #[inline(always)]
13944 fn decode_is_copy() -> bool {
13945 true
13946 }
13947 }
13948
13949 unsafe impl<D: fidl::encoding::ResourceDialect>
13950 fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D>
13951 for &StreamSocketGetTcpWindowClampResponse
13952 {
13953 #[inline]
13954 unsafe fn encode(
13955 self,
13956 encoder: &mut fidl::encoding::Encoder<'_, D>,
13957 offset: usize,
13958 _depth: fidl::encoding::Depth,
13959 ) -> fidl::Result<()> {
13960 encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
13961 unsafe {
13962 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13964 (buf_ptr as *mut StreamSocketGetTcpWindowClampResponse)
13965 .write_unaligned((self as *const StreamSocketGetTcpWindowClampResponse).read());
13966 }
13969 Ok(())
13970 }
13971 }
13972 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
13973 fidl::encoding::Encode<StreamSocketGetTcpWindowClampResponse, D> for (T0,)
13974 {
13975 #[inline]
13976 unsafe fn encode(
13977 self,
13978 encoder: &mut fidl::encoding::Encoder<'_, D>,
13979 offset: usize,
13980 depth: fidl::encoding::Depth,
13981 ) -> fidl::Result<()> {
13982 encoder.debug_check_bounds::<StreamSocketGetTcpWindowClampResponse>(offset);
13983 self.0.encode(encoder, offset + 0, depth)?;
13987 Ok(())
13988 }
13989 }
13990
13991 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13992 for StreamSocketGetTcpWindowClampResponse
13993 {
13994 #[inline(always)]
13995 fn new_empty() -> Self {
13996 Self { value: fidl::new_empty!(u32, D) }
13997 }
13998
13999 #[inline]
14000 unsafe fn decode(
14001 &mut self,
14002 decoder: &mut fidl::encoding::Decoder<'_, D>,
14003 offset: usize,
14004 _depth: fidl::encoding::Depth,
14005 ) -> fidl::Result<()> {
14006 decoder.debug_check_bounds::<Self>(offset);
14007 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14008 unsafe {
14011 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
14012 }
14013 Ok(())
14014 }
14015 }
14016
14017 impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14018 type Borrowed<'a> = &'a Self;
14019 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14020 value
14021 }
14022 }
14023
14024 unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgRequest {
14025 type Owned = Self;
14026
14027 #[inline(always)]
14028 fn inline_align(_context: fidl::encoding::Context) -> usize {
14029 4
14030 }
14031
14032 #[inline(always)]
14033 fn inline_size(_context: fidl::encoding::Context) -> usize {
14034 12
14035 }
14036 }
14037
14038 unsafe impl<D: fidl::encoding::ResourceDialect>
14039 fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D>
14040 for &SynchronousDatagramSocketRecvMsgRequest
14041 {
14042 #[inline]
14043 unsafe fn encode(
14044 self,
14045 encoder: &mut fidl::encoding::Encoder<'_, D>,
14046 offset: usize,
14047 _depth: fidl::encoding::Depth,
14048 ) -> fidl::Result<()> {
14049 encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14050 fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgRequest, D>::encode(
14052 (
14053 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_addr),
14054 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_len),
14055 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_control),
14056 <RecvMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14057 ),
14058 encoder,
14059 offset,
14060 _depth,
14061 )
14062 }
14063 }
14064 unsafe impl<
14065 D: fidl::encoding::ResourceDialect,
14066 T0: fidl::encoding::Encode<bool, D>,
14067 T1: fidl::encoding::Encode<u32, D>,
14068 T2: fidl::encoding::Encode<bool, D>,
14069 T3: fidl::encoding::Encode<RecvMsgFlags, D>,
14070 > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgRequest, D> for (T0, T1, T2, T3)
14071 {
14072 #[inline]
14073 unsafe fn encode(
14074 self,
14075 encoder: &mut fidl::encoding::Encoder<'_, D>,
14076 offset: usize,
14077 depth: fidl::encoding::Depth,
14078 ) -> fidl::Result<()> {
14079 encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgRequest>(offset);
14080 unsafe {
14083 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14084 (ptr as *mut u32).write_unaligned(0);
14085 }
14086 unsafe {
14087 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14088 (ptr as *mut u32).write_unaligned(0);
14089 }
14090 self.0.encode(encoder, offset + 0, depth)?;
14092 self.1.encode(encoder, offset + 4, depth)?;
14093 self.2.encode(encoder, offset + 8, depth)?;
14094 self.3.encode(encoder, offset + 10, depth)?;
14095 Ok(())
14096 }
14097 }
14098
14099 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14100 for SynchronousDatagramSocketRecvMsgRequest
14101 {
14102 #[inline(always)]
14103 fn new_empty() -> Self {
14104 Self {
14105 want_addr: fidl::new_empty!(bool, D),
14106 data_len: fidl::new_empty!(u32, D),
14107 want_control: fidl::new_empty!(bool, D),
14108 flags: fidl::new_empty!(RecvMsgFlags, D),
14109 }
14110 }
14111
14112 #[inline]
14113 unsafe fn decode(
14114 &mut self,
14115 decoder: &mut fidl::encoding::Decoder<'_, D>,
14116 offset: usize,
14117 _depth: fidl::encoding::Depth,
14118 ) -> fidl::Result<()> {
14119 decoder.debug_check_bounds::<Self>(offset);
14120 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14122 let padval = unsafe { (ptr as *const u32).read_unaligned() };
14123 let mask = 0xffffff00u32;
14124 let maskedval = padval & mask;
14125 if maskedval != 0 {
14126 return Err(fidl::Error::NonZeroPadding {
14127 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14128 });
14129 }
14130 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14131 let padval = unsafe { (ptr as *const u32).read_unaligned() };
14132 let mask = 0xff00u32;
14133 let maskedval = padval & mask;
14134 if maskedval != 0 {
14135 return Err(fidl::Error::NonZeroPadding {
14136 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14137 });
14138 }
14139 fidl::decode!(bool, D, &mut self.want_addr, decoder, offset + 0, _depth)?;
14140 fidl::decode!(u32, D, &mut self.data_len, decoder, offset + 4, _depth)?;
14141 fidl::decode!(bool, D, &mut self.want_control, decoder, offset + 8, _depth)?;
14142 fidl::decode!(RecvMsgFlags, D, &mut self.flags, decoder, offset + 10, _depth)?;
14143 Ok(())
14144 }
14145 }
14146
14147 impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgRequest {
14148 type Borrowed<'a> = &'a Self;
14149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14150 value
14151 }
14152 }
14153
14154 unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgRequest {
14155 type Owned = Self;
14156
14157 #[inline(always)]
14158 fn inline_align(_context: fidl::encoding::Context) -> usize {
14159 8
14160 }
14161
14162 #[inline(always)]
14163 fn inline_size(_context: fidl::encoding::Context) -> usize {
14164 56
14165 }
14166 }
14167
14168 unsafe impl<D: fidl::encoding::ResourceDialect>
14169 fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D>
14170 for &SynchronousDatagramSocketSendMsgRequest
14171 {
14172 #[inline]
14173 unsafe fn encode(
14174 self,
14175 encoder: &mut fidl::encoding::Encoder<'_, D>,
14176 offset: usize,
14177 _depth: fidl::encoding::Depth,
14178 ) -> fidl::Result<()> {
14179 encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14180 fidl::encoding::Encode::<SynchronousDatagramSocketSendMsgRequest, D>::encode(
14182 (
14183 <fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14184 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14185 <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14186 <SendMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
14187 ),
14188 encoder, offset, _depth
14189 )
14190 }
14191 }
14192 unsafe impl<
14193 D: fidl::encoding::ResourceDialect,
14194 T0: fidl::encoding::Encode<
14195 fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress>,
14196 D,
14197 >,
14198 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14199 T2: fidl::encoding::Encode<DatagramSocketSendControlData, D>,
14200 T3: fidl::encoding::Encode<SendMsgFlags, D>,
14201 > fidl::encoding::Encode<SynchronousDatagramSocketSendMsgRequest, D> for (T0, T1, T2, T3)
14202 {
14203 #[inline]
14204 unsafe fn encode(
14205 self,
14206 encoder: &mut fidl::encoding::Encoder<'_, D>,
14207 offset: usize,
14208 depth: fidl::encoding::Depth,
14209 ) -> fidl::Result<()> {
14210 encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgRequest>(offset);
14211 unsafe {
14214 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14215 (ptr as *mut u64).write_unaligned(0);
14216 }
14217 self.0.encode(encoder, offset + 0, depth)?;
14219 self.1.encode(encoder, offset + 16, depth)?;
14220 self.2.encode(encoder, offset + 32, depth)?;
14221 self.3.encode(encoder, offset + 48, depth)?;
14222 Ok(())
14223 }
14224 }
14225
14226 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14227 for SynchronousDatagramSocketSendMsgRequest
14228 {
14229 #[inline(always)]
14230 fn new_empty() -> Self {
14231 Self {
14232 addr: fidl::new_empty!(
14233 fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress>,
14234 D
14235 ),
14236 data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14237 control: fidl::new_empty!(DatagramSocketSendControlData, D),
14238 flags: fidl::new_empty!(SendMsgFlags, D),
14239 }
14240 }
14241
14242 #[inline]
14243 unsafe fn decode(
14244 &mut self,
14245 decoder: &mut fidl::encoding::Decoder<'_, D>,
14246 offset: usize,
14247 _depth: fidl::encoding::Depth,
14248 ) -> fidl::Result<()> {
14249 decoder.debug_check_bounds::<Self>(offset);
14250 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14252 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14253 let mask = 0xffffffffffff0000u64;
14254 let maskedval = padval & mask;
14255 if maskedval != 0 {
14256 return Err(fidl::Error::NonZeroPadding {
14257 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14258 });
14259 }
14260 fidl::decode!(
14261 fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress>,
14262 D,
14263 &mut self.addr,
14264 decoder,
14265 offset + 0,
14266 _depth
14267 )?;
14268 fidl::decode!(
14269 fidl::encoding::UnboundedVector<u8>,
14270 D,
14271 &mut self.data,
14272 decoder,
14273 offset + 16,
14274 _depth
14275 )?;
14276 fidl::decode!(
14277 DatagramSocketSendControlData,
14278 D,
14279 &mut self.control,
14280 decoder,
14281 offset + 32,
14282 _depth
14283 )?;
14284 fidl::decode!(SendMsgFlags, D, &mut self.flags, decoder, offset + 48, _depth)?;
14285 Ok(())
14286 }
14287 }
14288
14289 impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14290 type Borrowed<'a> = &'a Self;
14291 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14292 value
14293 }
14294 }
14295
14296 unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketRecvMsgResponse {
14297 type Owned = Self;
14298
14299 #[inline(always)]
14300 fn inline_align(_context: fidl::encoding::Context) -> usize {
14301 8
14302 }
14303
14304 #[inline(always)]
14305 fn inline_size(_context: fidl::encoding::Context) -> usize {
14306 56
14307 }
14308 }
14309
14310 unsafe impl<D: fidl::encoding::ResourceDialect>
14311 fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D>
14312 for &SynchronousDatagramSocketRecvMsgResponse
14313 {
14314 #[inline]
14315 unsafe fn encode(
14316 self,
14317 encoder: &mut fidl::encoding::Encoder<'_, D>,
14318 offset: usize,
14319 _depth: fidl::encoding::Depth,
14320 ) -> fidl::Result<()> {
14321 encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14322 fidl::encoding::Encode::<SynchronousDatagramSocketRecvMsgResponse, D>::encode(
14324 (
14325 <fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress> as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
14326 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14327 <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
14328 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.truncated),
14329 ),
14330 encoder, offset, _depth
14331 )
14332 }
14333 }
14334 unsafe impl<
14335 D: fidl::encoding::ResourceDialect,
14336 T0: fidl::encoding::Encode<
14337 fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress>,
14338 D,
14339 >,
14340 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
14341 T2: fidl::encoding::Encode<DatagramSocketRecvControlData, D>,
14342 T3: fidl::encoding::Encode<u32, D>,
14343 > fidl::encoding::Encode<SynchronousDatagramSocketRecvMsgResponse, D> for (T0, T1, T2, T3)
14344 {
14345 #[inline]
14346 unsafe fn encode(
14347 self,
14348 encoder: &mut fidl::encoding::Encoder<'_, D>,
14349 offset: usize,
14350 depth: fidl::encoding::Depth,
14351 ) -> fidl::Result<()> {
14352 encoder.debug_check_bounds::<SynchronousDatagramSocketRecvMsgResponse>(offset);
14353 unsafe {
14356 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
14357 (ptr as *mut u64).write_unaligned(0);
14358 }
14359 self.0.encode(encoder, offset + 0, depth)?;
14361 self.1.encode(encoder, offset + 16, depth)?;
14362 self.2.encode(encoder, offset + 32, depth)?;
14363 self.3.encode(encoder, offset + 48, depth)?;
14364 Ok(())
14365 }
14366 }
14367
14368 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14369 for SynchronousDatagramSocketRecvMsgResponse
14370 {
14371 #[inline(always)]
14372 fn new_empty() -> Self {
14373 Self {
14374 addr: fidl::new_empty!(
14375 fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress>,
14376 D
14377 ),
14378 data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
14379 control: fidl::new_empty!(DatagramSocketRecvControlData, D),
14380 truncated: fidl::new_empty!(u32, D),
14381 }
14382 }
14383
14384 #[inline]
14385 unsafe fn decode(
14386 &mut self,
14387 decoder: &mut fidl::encoding::Decoder<'_, D>,
14388 offset: usize,
14389 _depth: fidl::encoding::Depth,
14390 ) -> fidl::Result<()> {
14391 decoder.debug_check_bounds::<Self>(offset);
14392 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
14394 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14395 let mask = 0xffffffff00000000u64;
14396 let maskedval = padval & mask;
14397 if maskedval != 0 {
14398 return Err(fidl::Error::NonZeroPadding {
14399 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
14400 });
14401 }
14402 fidl::decode!(
14403 fidl::encoding::OptionalUnion<fidl_fuchsia_net::SocketAddress>,
14404 D,
14405 &mut self.addr,
14406 decoder,
14407 offset + 0,
14408 _depth
14409 )?;
14410 fidl::decode!(
14411 fidl::encoding::UnboundedVector<u8>,
14412 D,
14413 &mut self.data,
14414 decoder,
14415 offset + 16,
14416 _depth
14417 )?;
14418 fidl::decode!(
14419 DatagramSocketRecvControlData,
14420 D,
14421 &mut self.control,
14422 decoder,
14423 offset + 32,
14424 _depth
14425 )?;
14426 fidl::decode!(u32, D, &mut self.truncated, decoder, offset + 48, _depth)?;
14427 Ok(())
14428 }
14429 }
14430
14431 impl fidl::encoding::ValueTypeMarker for SynchronousDatagramSocketSendMsgResponse {
14432 type Borrowed<'a> = &'a Self;
14433 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14434 value
14435 }
14436 }
14437
14438 unsafe impl fidl::encoding::TypeMarker for SynchronousDatagramSocketSendMsgResponse {
14439 type Owned = Self;
14440
14441 #[inline(always)]
14442 fn inline_align(_context: fidl::encoding::Context) -> usize {
14443 8
14444 }
14445
14446 #[inline(always)]
14447 fn inline_size(_context: fidl::encoding::Context) -> usize {
14448 8
14449 }
14450 #[inline(always)]
14451 fn encode_is_copy() -> bool {
14452 true
14453 }
14454
14455 #[inline(always)]
14456 fn decode_is_copy() -> bool {
14457 true
14458 }
14459 }
14460
14461 unsafe impl<D: fidl::encoding::ResourceDialect>
14462 fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D>
14463 for &SynchronousDatagramSocketSendMsgResponse
14464 {
14465 #[inline]
14466 unsafe fn encode(
14467 self,
14468 encoder: &mut fidl::encoding::Encoder<'_, D>,
14469 offset: usize,
14470 _depth: fidl::encoding::Depth,
14471 ) -> fidl::Result<()> {
14472 encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14473 unsafe {
14474 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14476 (buf_ptr as *mut SynchronousDatagramSocketSendMsgResponse).write_unaligned(
14477 (self as *const SynchronousDatagramSocketSendMsgResponse).read(),
14478 );
14479 }
14482 Ok(())
14483 }
14484 }
14485 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
14486 fidl::encoding::Encode<SynchronousDatagramSocketSendMsgResponse, D> for (T0,)
14487 {
14488 #[inline]
14489 unsafe fn encode(
14490 self,
14491 encoder: &mut fidl::encoding::Encoder<'_, D>,
14492 offset: usize,
14493 depth: fidl::encoding::Depth,
14494 ) -> fidl::Result<()> {
14495 encoder.debug_check_bounds::<SynchronousDatagramSocketSendMsgResponse>(offset);
14496 self.0.encode(encoder, offset + 0, depth)?;
14500 Ok(())
14501 }
14502 }
14503
14504 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14505 for SynchronousDatagramSocketSendMsgResponse
14506 {
14507 #[inline(always)]
14508 fn new_empty() -> Self {
14509 Self { len: fidl::new_empty!(i64, D) }
14510 }
14511
14512 #[inline]
14513 unsafe fn decode(
14514 &mut self,
14515 decoder: &mut fidl::encoding::Decoder<'_, D>,
14516 offset: usize,
14517 _depth: fidl::encoding::Depth,
14518 ) -> fidl::Result<()> {
14519 decoder.debug_check_bounds::<Self>(offset);
14520 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14521 unsafe {
14524 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
14525 }
14526 Ok(())
14527 }
14528 }
14529
14530 impl fidl::encoding::ValueTypeMarker for Timestamp {
14531 type Borrowed<'a> = &'a Self;
14532 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14533 value
14534 }
14535 }
14536
14537 unsafe impl fidl::encoding::TypeMarker for Timestamp {
14538 type Owned = Self;
14539
14540 #[inline(always)]
14541 fn inline_align(_context: fidl::encoding::Context) -> usize {
14542 8
14543 }
14544
14545 #[inline(always)]
14546 fn inline_size(_context: fidl::encoding::Context) -> usize {
14547 16
14548 }
14549 }
14550
14551 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Timestamp, D>
14552 for &Timestamp
14553 {
14554 #[inline]
14555 unsafe fn encode(
14556 self,
14557 encoder: &mut fidl::encoding::Encoder<'_, D>,
14558 offset: usize,
14559 _depth: fidl::encoding::Depth,
14560 ) -> fidl::Result<()> {
14561 encoder.debug_check_bounds::<Timestamp>(offset);
14562 fidl::encoding::Encode::<Timestamp, D>::encode(
14564 (
14565 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.nanoseconds),
14566 <TimestampOption as fidl::encoding::ValueTypeMarker>::borrow(&self.requested),
14567 ),
14568 encoder,
14569 offset,
14570 _depth,
14571 )
14572 }
14573 }
14574 unsafe impl<
14575 D: fidl::encoding::ResourceDialect,
14576 T0: fidl::encoding::Encode<i64, D>,
14577 T1: fidl::encoding::Encode<TimestampOption, D>,
14578 > fidl::encoding::Encode<Timestamp, D> for (T0, T1)
14579 {
14580 #[inline]
14581 unsafe fn encode(
14582 self,
14583 encoder: &mut fidl::encoding::Encoder<'_, D>,
14584 offset: usize,
14585 depth: fidl::encoding::Depth,
14586 ) -> fidl::Result<()> {
14587 encoder.debug_check_bounds::<Timestamp>(offset);
14588 unsafe {
14591 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
14592 (ptr as *mut u64).write_unaligned(0);
14593 }
14594 self.0.encode(encoder, offset + 0, depth)?;
14596 self.1.encode(encoder, offset + 8, depth)?;
14597 Ok(())
14598 }
14599 }
14600
14601 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Timestamp {
14602 #[inline(always)]
14603 fn new_empty() -> Self {
14604 Self {
14605 nanoseconds: fidl::new_empty!(i64, D),
14606 requested: fidl::new_empty!(TimestampOption, D),
14607 }
14608 }
14609
14610 #[inline]
14611 unsafe fn decode(
14612 &mut self,
14613 decoder: &mut fidl::encoding::Decoder<'_, D>,
14614 offset: usize,
14615 _depth: fidl::encoding::Depth,
14616 ) -> fidl::Result<()> {
14617 decoder.debug_check_bounds::<Self>(offset);
14618 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
14620 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14621 let mask = 0xffffffff00000000u64;
14622 let maskedval = padval & mask;
14623 if maskedval != 0 {
14624 return Err(fidl::Error::NonZeroPadding {
14625 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14626 });
14627 }
14628 fidl::decode!(i64, D, &mut self.nanoseconds, decoder, offset + 0, _depth)?;
14629 fidl::decode!(TimestampOption, D, &mut self.requested, decoder, offset + 8, _depth)?;
14630 Ok(())
14631 }
14632 }
14633
14634 impl DatagramSocketRecvControlData {
14635 #[inline(always)]
14636 fn max_ordinal_present(&self) -> u64 {
14637 if let Some(_) = self.network {
14638 return 1;
14639 }
14640 0
14641 }
14642 }
14643
14644 impl fidl::encoding::ValueTypeMarker for DatagramSocketRecvControlData {
14645 type Borrowed<'a> = &'a Self;
14646 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14647 value
14648 }
14649 }
14650
14651 unsafe impl fidl::encoding::TypeMarker for DatagramSocketRecvControlData {
14652 type Owned = Self;
14653
14654 #[inline(always)]
14655 fn inline_align(_context: fidl::encoding::Context) -> usize {
14656 8
14657 }
14658
14659 #[inline(always)]
14660 fn inline_size(_context: fidl::encoding::Context) -> usize {
14661 16
14662 }
14663 }
14664
14665 unsafe impl<D: fidl::encoding::ResourceDialect>
14666 fidl::encoding::Encode<DatagramSocketRecvControlData, D>
14667 for &DatagramSocketRecvControlData
14668 {
14669 unsafe fn encode(
14670 self,
14671 encoder: &mut fidl::encoding::Encoder<'_, D>,
14672 offset: usize,
14673 mut depth: fidl::encoding::Depth,
14674 ) -> fidl::Result<()> {
14675 encoder.debug_check_bounds::<DatagramSocketRecvControlData>(offset);
14676 let max_ordinal: u64 = self.max_ordinal_present();
14678 encoder.write_num(max_ordinal, offset);
14679 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14680 if max_ordinal == 0 {
14682 return Ok(());
14683 }
14684 depth.increment()?;
14685 let envelope_size = 8;
14686 let bytes_len = max_ordinal as usize * envelope_size;
14687 #[allow(unused_variables)]
14688 let offset = encoder.out_of_line_offset(bytes_len);
14689 let mut _prev_end_offset: usize = 0;
14690 if 1 > max_ordinal {
14691 return Ok(());
14692 }
14693
14694 let cur_offset: usize = (1 - 1) * envelope_size;
14697
14698 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14700
14701 fidl::encoding::encode_in_envelope_optional::<NetworkSocketRecvControlData, D>(
14706 self.network
14707 .as_ref()
14708 .map(<NetworkSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
14709 encoder,
14710 offset + cur_offset,
14711 depth,
14712 )?;
14713
14714 _prev_end_offset = cur_offset + envelope_size;
14715
14716 Ok(())
14717 }
14718 }
14719
14720 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14721 for DatagramSocketRecvControlData
14722 {
14723 #[inline(always)]
14724 fn new_empty() -> Self {
14725 Self::default()
14726 }
14727
14728 unsafe fn decode(
14729 &mut self,
14730 decoder: &mut fidl::encoding::Decoder<'_, D>,
14731 offset: usize,
14732 mut depth: fidl::encoding::Depth,
14733 ) -> fidl::Result<()> {
14734 decoder.debug_check_bounds::<Self>(offset);
14735 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14736 None => return Err(fidl::Error::NotNullable),
14737 Some(len) => len,
14738 };
14739 if len == 0 {
14741 return Ok(());
14742 };
14743 depth.increment()?;
14744 let envelope_size = 8;
14745 let bytes_len = len * envelope_size;
14746 let offset = decoder.out_of_line_offset(bytes_len)?;
14747 let mut _next_ordinal_to_read = 0;
14749 let mut next_offset = offset;
14750 let end_offset = offset + bytes_len;
14751 _next_ordinal_to_read += 1;
14752 if next_offset >= end_offset {
14753 return Ok(());
14754 }
14755
14756 while _next_ordinal_to_read < 1 {
14758 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14759 _next_ordinal_to_read += 1;
14760 next_offset += envelope_size;
14761 }
14762
14763 let next_out_of_line = decoder.next_out_of_line();
14764 let handles_before = decoder.remaining_handles();
14765 if let Some((inlined, num_bytes, num_handles)) =
14766 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14767 {
14768 let member_inline_size =
14769 <NetworkSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
14770 decoder.context,
14771 );
14772 if inlined != (member_inline_size <= 4) {
14773 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14774 }
14775 let inner_offset;
14776 let mut inner_depth = depth.clone();
14777 if inlined {
14778 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14779 inner_offset = next_offset;
14780 } else {
14781 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14782 inner_depth.increment()?;
14783 }
14784 let val_ref = self
14785 .network
14786 .get_or_insert_with(|| fidl::new_empty!(NetworkSocketRecvControlData, D));
14787 fidl::decode!(
14788 NetworkSocketRecvControlData,
14789 D,
14790 val_ref,
14791 decoder,
14792 inner_offset,
14793 inner_depth
14794 )?;
14795 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14796 {
14797 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14798 }
14799 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14800 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14801 }
14802 }
14803
14804 next_offset += envelope_size;
14805
14806 while next_offset < end_offset {
14808 _next_ordinal_to_read += 1;
14809 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14810 next_offset += envelope_size;
14811 }
14812
14813 Ok(())
14814 }
14815 }
14816
14817 impl DatagramSocketSendControlData {
14818 #[inline(always)]
14819 fn max_ordinal_present(&self) -> u64 {
14820 if let Some(_) = self.network {
14821 return 1;
14822 }
14823 0
14824 }
14825 }
14826
14827 impl fidl::encoding::ValueTypeMarker for DatagramSocketSendControlData {
14828 type Borrowed<'a> = &'a Self;
14829 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14830 value
14831 }
14832 }
14833
14834 unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendControlData {
14835 type Owned = Self;
14836
14837 #[inline(always)]
14838 fn inline_align(_context: fidl::encoding::Context) -> usize {
14839 8
14840 }
14841
14842 #[inline(always)]
14843 fn inline_size(_context: fidl::encoding::Context) -> usize {
14844 16
14845 }
14846 }
14847
14848 unsafe impl<D: fidl::encoding::ResourceDialect>
14849 fidl::encoding::Encode<DatagramSocketSendControlData, D>
14850 for &DatagramSocketSendControlData
14851 {
14852 unsafe fn encode(
14853 self,
14854 encoder: &mut fidl::encoding::Encoder<'_, D>,
14855 offset: usize,
14856 mut depth: fidl::encoding::Depth,
14857 ) -> fidl::Result<()> {
14858 encoder.debug_check_bounds::<DatagramSocketSendControlData>(offset);
14859 let max_ordinal: u64 = self.max_ordinal_present();
14861 encoder.write_num(max_ordinal, offset);
14862 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14863 if max_ordinal == 0 {
14865 return Ok(());
14866 }
14867 depth.increment()?;
14868 let envelope_size = 8;
14869 let bytes_len = max_ordinal as usize * envelope_size;
14870 #[allow(unused_variables)]
14871 let offset = encoder.out_of_line_offset(bytes_len);
14872 let mut _prev_end_offset: usize = 0;
14873 if 1 > max_ordinal {
14874 return Ok(());
14875 }
14876
14877 let cur_offset: usize = (1 - 1) * envelope_size;
14880
14881 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14883
14884 fidl::encoding::encode_in_envelope_optional::<NetworkSocketSendControlData, D>(
14889 self.network
14890 .as_ref()
14891 .map(<NetworkSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
14892 encoder,
14893 offset + cur_offset,
14894 depth,
14895 )?;
14896
14897 _prev_end_offset = cur_offset + envelope_size;
14898
14899 Ok(())
14900 }
14901 }
14902
14903 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14904 for DatagramSocketSendControlData
14905 {
14906 #[inline(always)]
14907 fn new_empty() -> Self {
14908 Self::default()
14909 }
14910
14911 unsafe fn decode(
14912 &mut self,
14913 decoder: &mut fidl::encoding::Decoder<'_, D>,
14914 offset: usize,
14915 mut depth: fidl::encoding::Depth,
14916 ) -> fidl::Result<()> {
14917 decoder.debug_check_bounds::<Self>(offset);
14918 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14919 None => return Err(fidl::Error::NotNullable),
14920 Some(len) => len,
14921 };
14922 if len == 0 {
14924 return Ok(());
14925 };
14926 depth.increment()?;
14927 let envelope_size = 8;
14928 let bytes_len = len * envelope_size;
14929 let offset = decoder.out_of_line_offset(bytes_len)?;
14930 let mut _next_ordinal_to_read = 0;
14932 let mut next_offset = offset;
14933 let end_offset = offset + bytes_len;
14934 _next_ordinal_to_read += 1;
14935 if next_offset >= end_offset {
14936 return Ok(());
14937 }
14938
14939 while _next_ordinal_to_read < 1 {
14941 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14942 _next_ordinal_to_read += 1;
14943 next_offset += envelope_size;
14944 }
14945
14946 let next_out_of_line = decoder.next_out_of_line();
14947 let handles_before = decoder.remaining_handles();
14948 if let Some((inlined, num_bytes, num_handles)) =
14949 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14950 {
14951 let member_inline_size =
14952 <NetworkSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
14953 decoder.context,
14954 );
14955 if inlined != (member_inline_size <= 4) {
14956 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14957 }
14958 let inner_offset;
14959 let mut inner_depth = depth.clone();
14960 if inlined {
14961 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14962 inner_offset = next_offset;
14963 } else {
14964 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14965 inner_depth.increment()?;
14966 }
14967 let val_ref = self
14968 .network
14969 .get_or_insert_with(|| fidl::new_empty!(NetworkSocketSendControlData, D));
14970 fidl::decode!(
14971 NetworkSocketSendControlData,
14972 D,
14973 val_ref,
14974 decoder,
14975 inner_offset,
14976 inner_depth
14977 )?;
14978 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14979 {
14980 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14981 }
14982 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14983 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14984 }
14985 }
14986
14987 next_offset += envelope_size;
14988
14989 while next_offset < end_offset {
14991 _next_ordinal_to_read += 1;
14992 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14993 next_offset += envelope_size;
14994 }
14995
14996 Ok(())
14997 }
14998 }
14999
15000 impl DatagramSocketSendMsgPreflightRequest {
15001 #[inline(always)]
15002 fn max_ordinal_present(&self) -> u64 {
15003 if let Some(_) = self.ipv6_pktinfo {
15004 return 2;
15005 }
15006 if let Some(_) = self.to {
15007 return 1;
15008 }
15009 0
15010 }
15011 }
15012
15013 impl fidl::encoding::ValueTypeMarker for DatagramSocketSendMsgPreflightRequest {
15014 type Borrowed<'a> = &'a Self;
15015 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15016 value
15017 }
15018 }
15019
15020 unsafe impl fidl::encoding::TypeMarker for DatagramSocketSendMsgPreflightRequest {
15021 type Owned = Self;
15022
15023 #[inline(always)]
15024 fn inline_align(_context: fidl::encoding::Context) -> usize {
15025 8
15026 }
15027
15028 #[inline(always)]
15029 fn inline_size(_context: fidl::encoding::Context) -> usize {
15030 16
15031 }
15032 }
15033
15034 unsafe impl<D: fidl::encoding::ResourceDialect>
15035 fidl::encoding::Encode<DatagramSocketSendMsgPreflightRequest, D>
15036 for &DatagramSocketSendMsgPreflightRequest
15037 {
15038 unsafe fn encode(
15039 self,
15040 encoder: &mut fidl::encoding::Encoder<'_, D>,
15041 offset: usize,
15042 mut depth: fidl::encoding::Depth,
15043 ) -> fidl::Result<()> {
15044 encoder.debug_check_bounds::<DatagramSocketSendMsgPreflightRequest>(offset);
15045 let max_ordinal: u64 = self.max_ordinal_present();
15047 encoder.write_num(max_ordinal, offset);
15048 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15049 if max_ordinal == 0 {
15051 return Ok(());
15052 }
15053 depth.increment()?;
15054 let envelope_size = 8;
15055 let bytes_len = max_ordinal as usize * envelope_size;
15056 #[allow(unused_variables)]
15057 let offset = encoder.out_of_line_offset(bytes_len);
15058 let mut _prev_end_offset: usize = 0;
15059 if 1 > max_ordinal {
15060 return Ok(());
15061 }
15062
15063 let cur_offset: usize = (1 - 1) * envelope_size;
15066
15067 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15069
15070 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::SocketAddress, D>(
15075 self.to.as_ref().map(
15076 <fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow,
15077 ),
15078 encoder,
15079 offset + cur_offset,
15080 depth,
15081 )?;
15082
15083 _prev_end_offset = cur_offset + envelope_size;
15084 if 2 > max_ordinal {
15085 return Ok(());
15086 }
15087
15088 let cur_offset: usize = (2 - 1) * envelope_size;
15091
15092 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15094
15095 fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
15100 self.ipv6_pktinfo
15101 .as_ref()
15102 .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
15103 encoder,
15104 offset + cur_offset,
15105 depth,
15106 )?;
15107
15108 _prev_end_offset = cur_offset + envelope_size;
15109
15110 Ok(())
15111 }
15112 }
15113
15114 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15115 for DatagramSocketSendMsgPreflightRequest
15116 {
15117 #[inline(always)]
15118 fn new_empty() -> Self {
15119 Self::default()
15120 }
15121
15122 unsafe fn decode(
15123 &mut self,
15124 decoder: &mut fidl::encoding::Decoder<'_, D>,
15125 offset: usize,
15126 mut depth: fidl::encoding::Depth,
15127 ) -> fidl::Result<()> {
15128 decoder.debug_check_bounds::<Self>(offset);
15129 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15130 None => return Err(fidl::Error::NotNullable),
15131 Some(len) => len,
15132 };
15133 if len == 0 {
15135 return Ok(());
15136 };
15137 depth.increment()?;
15138 let envelope_size = 8;
15139 let bytes_len = len * envelope_size;
15140 let offset = decoder.out_of_line_offset(bytes_len)?;
15141 let mut _next_ordinal_to_read = 0;
15143 let mut next_offset = offset;
15144 let end_offset = offset + bytes_len;
15145 _next_ordinal_to_read += 1;
15146 if next_offset >= end_offset {
15147 return Ok(());
15148 }
15149
15150 while _next_ordinal_to_read < 1 {
15152 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15153 _next_ordinal_to_read += 1;
15154 next_offset += envelope_size;
15155 }
15156
15157 let next_out_of_line = decoder.next_out_of_line();
15158 let handles_before = decoder.remaining_handles();
15159 if let Some((inlined, num_bytes, num_handles)) =
15160 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15161 {
15162 let member_inline_size =
15163 <fidl_fuchsia_net::SocketAddress as fidl::encoding::TypeMarker>::inline_size(
15164 decoder.context,
15165 );
15166 if inlined != (member_inline_size <= 4) {
15167 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15168 }
15169 let inner_offset;
15170 let mut inner_depth = depth.clone();
15171 if inlined {
15172 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15173 inner_offset = next_offset;
15174 } else {
15175 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15176 inner_depth.increment()?;
15177 }
15178 let val_ref = self
15179 .to
15180 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D));
15181 fidl::decode!(
15182 fidl_fuchsia_net::SocketAddress,
15183 D,
15184 val_ref,
15185 decoder,
15186 inner_offset,
15187 inner_depth
15188 )?;
15189 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15190 {
15191 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15192 }
15193 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15194 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15195 }
15196 }
15197
15198 next_offset += envelope_size;
15199 _next_ordinal_to_read += 1;
15200 if next_offset >= end_offset {
15201 return Ok(());
15202 }
15203
15204 while _next_ordinal_to_read < 2 {
15206 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15207 _next_ordinal_to_read += 1;
15208 next_offset += envelope_size;
15209 }
15210
15211 let next_out_of_line = decoder.next_out_of_line();
15212 let handles_before = decoder.remaining_handles();
15213 if let Some((inlined, num_bytes, num_handles)) =
15214 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15215 {
15216 let member_inline_size =
15217 <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
15218 decoder.context,
15219 );
15220 if inlined != (member_inline_size <= 4) {
15221 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15222 }
15223 let inner_offset;
15224 let mut inner_depth = depth.clone();
15225 if inlined {
15226 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15227 inner_offset = next_offset;
15228 } else {
15229 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15230 inner_depth.increment()?;
15231 }
15232 let val_ref = self
15233 .ipv6_pktinfo
15234 .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
15235 fidl::decode!(
15236 Ipv6PktInfoSendControlData,
15237 D,
15238 val_ref,
15239 decoder,
15240 inner_offset,
15241 inner_depth
15242 )?;
15243 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15244 {
15245 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15246 }
15247 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15248 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15249 }
15250 }
15251
15252 next_offset += envelope_size;
15253
15254 while next_offset < end_offset {
15256 _next_ordinal_to_read += 1;
15257 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15258 next_offset += envelope_size;
15259 }
15260
15261 Ok(())
15262 }
15263 }
15264
15265 impl InterfaceAddresses {
15266 #[inline(always)]
15267 fn max_ordinal_present(&self) -> u64 {
15268 if let Some(_) = self.interface_flags {
15269 return 5;
15270 }
15271 if let Some(_) = self.addresses {
15272 return 4;
15273 }
15274 if let Some(_) = self.name {
15275 return 2;
15276 }
15277 if let Some(_) = self.id {
15278 return 1;
15279 }
15280 0
15281 }
15282 }
15283
15284 impl fidl::encoding::ValueTypeMarker for InterfaceAddresses {
15285 type Borrowed<'a> = &'a Self;
15286 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15287 value
15288 }
15289 }
15290
15291 unsafe impl fidl::encoding::TypeMarker for InterfaceAddresses {
15292 type Owned = Self;
15293
15294 #[inline(always)]
15295 fn inline_align(_context: fidl::encoding::Context) -> usize {
15296 8
15297 }
15298
15299 #[inline(always)]
15300 fn inline_size(_context: fidl::encoding::Context) -> usize {
15301 16
15302 }
15303 }
15304
15305 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterfaceAddresses, D>
15306 for &InterfaceAddresses
15307 {
15308 unsafe fn encode(
15309 self,
15310 encoder: &mut fidl::encoding::Encoder<'_, D>,
15311 offset: usize,
15312 mut depth: fidl::encoding::Depth,
15313 ) -> fidl::Result<()> {
15314 encoder.debug_check_bounds::<InterfaceAddresses>(offset);
15315 let max_ordinal: u64 = self.max_ordinal_present();
15317 encoder.write_num(max_ordinal, offset);
15318 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15319 if max_ordinal == 0 {
15321 return Ok(());
15322 }
15323 depth.increment()?;
15324 let envelope_size = 8;
15325 let bytes_len = max_ordinal as usize * envelope_size;
15326 #[allow(unused_variables)]
15327 let offset = encoder.out_of_line_offset(bytes_len);
15328 let mut _prev_end_offset: usize = 0;
15329 if 1 > max_ordinal {
15330 return Ok(());
15331 }
15332
15333 let cur_offset: usize = (1 - 1) * envelope_size;
15336
15337 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15339
15340 fidl::encoding::encode_in_envelope_optional::<u64, D>(
15345 self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15346 encoder,
15347 offset + cur_offset,
15348 depth,
15349 )?;
15350
15351 _prev_end_offset = cur_offset + envelope_size;
15352 if 2 > max_ordinal {
15353 return Ok(());
15354 }
15355
15356 let cur_offset: usize = (2 - 1) * envelope_size;
15359
15360 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15362
15363 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
15368 self.name.as_ref().map(
15369 <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow,
15370 ),
15371 encoder,
15372 offset + cur_offset,
15373 depth,
15374 )?;
15375
15376 _prev_end_offset = cur_offset + envelope_size;
15377 if 4 > max_ordinal {
15378 return Ok(());
15379 }
15380
15381 let cur_offset: usize = (4 - 1) * envelope_size;
15384
15385 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15387
15388 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>, D>(
15393 self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
15394 encoder, offset + cur_offset, depth
15395 )?;
15396
15397 _prev_end_offset = cur_offset + envelope_size;
15398 if 5 > max_ordinal {
15399 return Ok(());
15400 }
15401
15402 let cur_offset: usize = (5 - 1) * envelope_size;
15405
15406 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15408
15409 fidl::encoding::encode_in_envelope_optional::<InterfaceFlags, D>(
15414 self.interface_flags
15415 .as_ref()
15416 .map(<InterfaceFlags as fidl::encoding::ValueTypeMarker>::borrow),
15417 encoder,
15418 offset + cur_offset,
15419 depth,
15420 )?;
15421
15422 _prev_end_offset = cur_offset + envelope_size;
15423
15424 Ok(())
15425 }
15426 }
15427
15428 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceAddresses {
15429 #[inline(always)]
15430 fn new_empty() -> Self {
15431 Self::default()
15432 }
15433
15434 unsafe fn decode(
15435 &mut self,
15436 decoder: &mut fidl::encoding::Decoder<'_, D>,
15437 offset: usize,
15438 mut depth: fidl::encoding::Depth,
15439 ) -> fidl::Result<()> {
15440 decoder.debug_check_bounds::<Self>(offset);
15441 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15442 None => return Err(fidl::Error::NotNullable),
15443 Some(len) => len,
15444 };
15445 if len == 0 {
15447 return Ok(());
15448 };
15449 depth.increment()?;
15450 let envelope_size = 8;
15451 let bytes_len = len * envelope_size;
15452 let offset = decoder.out_of_line_offset(bytes_len)?;
15453 let mut _next_ordinal_to_read = 0;
15455 let mut next_offset = offset;
15456 let end_offset = offset + bytes_len;
15457 _next_ordinal_to_read += 1;
15458 if next_offset >= end_offset {
15459 return Ok(());
15460 }
15461
15462 while _next_ordinal_to_read < 1 {
15464 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15465 _next_ordinal_to_read += 1;
15466 next_offset += envelope_size;
15467 }
15468
15469 let next_out_of_line = decoder.next_out_of_line();
15470 let handles_before = decoder.remaining_handles();
15471 if let Some((inlined, num_bytes, num_handles)) =
15472 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15473 {
15474 let member_inline_size =
15475 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15476 if inlined != (member_inline_size <= 4) {
15477 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15478 }
15479 let inner_offset;
15480 let mut inner_depth = depth.clone();
15481 if inlined {
15482 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15483 inner_offset = next_offset;
15484 } else {
15485 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15486 inner_depth.increment()?;
15487 }
15488 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
15489 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15490 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15491 {
15492 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15493 }
15494 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15495 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15496 }
15497 }
15498
15499 next_offset += envelope_size;
15500 _next_ordinal_to_read += 1;
15501 if next_offset >= end_offset {
15502 return Ok(());
15503 }
15504
15505 while _next_ordinal_to_read < 2 {
15507 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15508 _next_ordinal_to_read += 1;
15509 next_offset += envelope_size;
15510 }
15511
15512 let next_out_of_line = decoder.next_out_of_line();
15513 let handles_before = decoder.remaining_handles();
15514 if let Some((inlined, num_bytes, num_handles)) =
15515 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15516 {
15517 let member_inline_size =
15518 <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
15519 decoder.context,
15520 );
15521 if inlined != (member_inline_size <= 4) {
15522 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15523 }
15524 let inner_offset;
15525 let mut inner_depth = depth.clone();
15526 if inlined {
15527 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15528 inner_offset = next_offset;
15529 } else {
15530 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15531 inner_depth.increment()?;
15532 }
15533 let val_ref = self
15534 .name
15535 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
15536 fidl::decode!(
15537 fidl::encoding::BoundedString<15>,
15538 D,
15539 val_ref,
15540 decoder,
15541 inner_offset,
15542 inner_depth
15543 )?;
15544 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15545 {
15546 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15547 }
15548 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15549 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15550 }
15551 }
15552
15553 next_offset += envelope_size;
15554 _next_ordinal_to_read += 1;
15555 if next_offset >= end_offset {
15556 return Ok(());
15557 }
15558
15559 while _next_ordinal_to_read < 4 {
15561 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15562 _next_ordinal_to_read += 1;
15563 next_offset += envelope_size;
15564 }
15565
15566 let next_out_of_line = decoder.next_out_of_line();
15567 let handles_before = decoder.remaining_handles();
15568 if let Some((inlined, num_bytes, num_handles)) =
15569 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15570 {
15571 let member_inline_size = <fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15572 if inlined != (member_inline_size <= 4) {
15573 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15574 }
15575 let inner_offset;
15576 let mut inner_depth = depth.clone();
15577 if inlined {
15578 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15579 inner_offset = next_offset;
15580 } else {
15581 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15582 inner_depth.increment()?;
15583 }
15584 let val_ref = self.addresses.get_or_insert_with(|| {
15585 fidl::new_empty!(fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>, D)
15586 });
15587 fidl::decode!(
15588 fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>,
15589 D,
15590 val_ref,
15591 decoder,
15592 inner_offset,
15593 inner_depth
15594 )?;
15595 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15596 {
15597 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15598 }
15599 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15600 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15601 }
15602 }
15603
15604 next_offset += envelope_size;
15605 _next_ordinal_to_read += 1;
15606 if next_offset >= end_offset {
15607 return Ok(());
15608 }
15609
15610 while _next_ordinal_to_read < 5 {
15612 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15613 _next_ordinal_to_read += 1;
15614 next_offset += envelope_size;
15615 }
15616
15617 let next_out_of_line = decoder.next_out_of_line();
15618 let handles_before = decoder.remaining_handles();
15619 if let Some((inlined, num_bytes, num_handles)) =
15620 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15621 {
15622 let member_inline_size =
15623 <InterfaceFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15624 if inlined != (member_inline_size <= 4) {
15625 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15626 }
15627 let inner_offset;
15628 let mut inner_depth = depth.clone();
15629 if inlined {
15630 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15631 inner_offset = next_offset;
15632 } else {
15633 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15634 inner_depth.increment()?;
15635 }
15636 let val_ref =
15637 self.interface_flags.get_or_insert_with(|| fidl::new_empty!(InterfaceFlags, D));
15638 fidl::decode!(InterfaceFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
15639 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15640 {
15641 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15642 }
15643 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15644 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15645 }
15646 }
15647
15648 next_offset += envelope_size;
15649
15650 while next_offset < end_offset {
15652 _next_ordinal_to_read += 1;
15653 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15654 next_offset += envelope_size;
15655 }
15656
15657 Ok(())
15658 }
15659 }
15660
15661 impl IpRecvControlData {
15662 #[inline(always)]
15663 fn max_ordinal_present(&self) -> u64 {
15664 if let Some(_) = self.original_destination_address {
15665 return 3;
15666 }
15667 if let Some(_) = self.ttl {
15668 return 2;
15669 }
15670 if let Some(_) = self.tos {
15671 return 1;
15672 }
15673 0
15674 }
15675 }
15676
15677 impl fidl::encoding::ValueTypeMarker for IpRecvControlData {
15678 type Borrowed<'a> = &'a Self;
15679 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15680 value
15681 }
15682 }
15683
15684 unsafe impl fidl::encoding::TypeMarker for IpRecvControlData {
15685 type Owned = Self;
15686
15687 #[inline(always)]
15688 fn inline_align(_context: fidl::encoding::Context) -> usize {
15689 8
15690 }
15691
15692 #[inline(always)]
15693 fn inline_size(_context: fidl::encoding::Context) -> usize {
15694 16
15695 }
15696 }
15697
15698 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpRecvControlData, D>
15699 for &IpRecvControlData
15700 {
15701 unsafe fn encode(
15702 self,
15703 encoder: &mut fidl::encoding::Encoder<'_, D>,
15704 offset: usize,
15705 mut depth: fidl::encoding::Depth,
15706 ) -> fidl::Result<()> {
15707 encoder.debug_check_bounds::<IpRecvControlData>(offset);
15708 let max_ordinal: u64 = self.max_ordinal_present();
15710 encoder.write_num(max_ordinal, offset);
15711 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15712 if max_ordinal == 0 {
15714 return Ok(());
15715 }
15716 depth.increment()?;
15717 let envelope_size = 8;
15718 let bytes_len = max_ordinal as usize * envelope_size;
15719 #[allow(unused_variables)]
15720 let offset = encoder.out_of_line_offset(bytes_len);
15721 let mut _prev_end_offset: usize = 0;
15722 if 1 > max_ordinal {
15723 return Ok(());
15724 }
15725
15726 let cur_offset: usize = (1 - 1) * envelope_size;
15729
15730 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15732
15733 fidl::encoding::encode_in_envelope_optional::<u8, D>(
15738 self.tos.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15739 encoder,
15740 offset + cur_offset,
15741 depth,
15742 )?;
15743
15744 _prev_end_offset = cur_offset + envelope_size;
15745 if 2 > max_ordinal {
15746 return Ok(());
15747 }
15748
15749 let cur_offset: usize = (2 - 1) * envelope_size;
15752
15753 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15755
15756 fidl::encoding::encode_in_envelope_optional::<u8, D>(
15761 self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15762 encoder,
15763 offset + cur_offset,
15764 depth,
15765 )?;
15766
15767 _prev_end_offset = cur_offset + envelope_size;
15768 if 3 > max_ordinal {
15769 return Ok(());
15770 }
15771
15772 let cur_offset: usize = (3 - 1) * envelope_size;
15775
15776 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15778
15779 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::SocketAddress, D>(
15784 self.original_destination_address.as_ref().map(
15785 <fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow,
15786 ),
15787 encoder,
15788 offset + cur_offset,
15789 depth,
15790 )?;
15791
15792 _prev_end_offset = cur_offset + envelope_size;
15793
15794 Ok(())
15795 }
15796 }
15797
15798 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpRecvControlData {
15799 #[inline(always)]
15800 fn new_empty() -> Self {
15801 Self::default()
15802 }
15803
15804 unsafe fn decode(
15805 &mut self,
15806 decoder: &mut fidl::encoding::Decoder<'_, D>,
15807 offset: usize,
15808 mut depth: fidl::encoding::Depth,
15809 ) -> fidl::Result<()> {
15810 decoder.debug_check_bounds::<Self>(offset);
15811 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15812 None => return Err(fidl::Error::NotNullable),
15813 Some(len) => len,
15814 };
15815 if len == 0 {
15817 return Ok(());
15818 };
15819 depth.increment()?;
15820 let envelope_size = 8;
15821 let bytes_len = len * envelope_size;
15822 let offset = decoder.out_of_line_offset(bytes_len)?;
15823 let mut _next_ordinal_to_read = 0;
15825 let mut next_offset = offset;
15826 let end_offset = offset + bytes_len;
15827 _next_ordinal_to_read += 1;
15828 if next_offset >= end_offset {
15829 return Ok(());
15830 }
15831
15832 while _next_ordinal_to_read < 1 {
15834 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15835 _next_ordinal_to_read += 1;
15836 next_offset += envelope_size;
15837 }
15838
15839 let next_out_of_line = decoder.next_out_of_line();
15840 let handles_before = decoder.remaining_handles();
15841 if let Some((inlined, num_bytes, num_handles)) =
15842 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15843 {
15844 let member_inline_size =
15845 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15846 if inlined != (member_inline_size <= 4) {
15847 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15848 }
15849 let inner_offset;
15850 let mut inner_depth = depth.clone();
15851 if inlined {
15852 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15853 inner_offset = next_offset;
15854 } else {
15855 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15856 inner_depth.increment()?;
15857 }
15858 let val_ref = self.tos.get_or_insert_with(|| fidl::new_empty!(u8, D));
15859 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15860 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15861 {
15862 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15863 }
15864 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15865 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15866 }
15867 }
15868
15869 next_offset += envelope_size;
15870 _next_ordinal_to_read += 1;
15871 if next_offset >= end_offset {
15872 return Ok(());
15873 }
15874
15875 while _next_ordinal_to_read < 2 {
15877 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15878 _next_ordinal_to_read += 1;
15879 next_offset += envelope_size;
15880 }
15881
15882 let next_out_of_line = decoder.next_out_of_line();
15883 let handles_before = decoder.remaining_handles();
15884 if let Some((inlined, num_bytes, num_handles)) =
15885 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15886 {
15887 let member_inline_size =
15888 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15889 if inlined != (member_inline_size <= 4) {
15890 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15891 }
15892 let inner_offset;
15893 let mut inner_depth = depth.clone();
15894 if inlined {
15895 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15896 inner_offset = next_offset;
15897 } else {
15898 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15899 inner_depth.increment()?;
15900 }
15901 let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
15902 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15903 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15904 {
15905 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15906 }
15907 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15908 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15909 }
15910 }
15911
15912 next_offset += envelope_size;
15913 _next_ordinal_to_read += 1;
15914 if next_offset >= end_offset {
15915 return Ok(());
15916 }
15917
15918 while _next_ordinal_to_read < 3 {
15920 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15921 _next_ordinal_to_read += 1;
15922 next_offset += envelope_size;
15923 }
15924
15925 let next_out_of_line = decoder.next_out_of_line();
15926 let handles_before = decoder.remaining_handles();
15927 if let Some((inlined, num_bytes, num_handles)) =
15928 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15929 {
15930 let member_inline_size =
15931 <fidl_fuchsia_net::SocketAddress as fidl::encoding::TypeMarker>::inline_size(
15932 decoder.context,
15933 );
15934 if inlined != (member_inline_size <= 4) {
15935 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15936 }
15937 let inner_offset;
15938 let mut inner_depth = depth.clone();
15939 if inlined {
15940 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15941 inner_offset = next_offset;
15942 } else {
15943 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15944 inner_depth.increment()?;
15945 }
15946 let val_ref = self
15947 .original_destination_address
15948 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D));
15949 fidl::decode!(
15950 fidl_fuchsia_net::SocketAddress,
15951 D,
15952 val_ref,
15953 decoder,
15954 inner_offset,
15955 inner_depth
15956 )?;
15957 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15958 {
15959 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15960 }
15961 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15962 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15963 }
15964 }
15965
15966 next_offset += envelope_size;
15967
15968 while next_offset < end_offset {
15970 _next_ordinal_to_read += 1;
15971 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15972 next_offset += envelope_size;
15973 }
15974
15975 Ok(())
15976 }
15977 }
15978
15979 impl IpSendControlData {
15980 #[inline(always)]
15981 fn max_ordinal_present(&self) -> u64 {
15982 if let Some(_) = self.ttl {
15983 return 2;
15984 }
15985 0
15986 }
15987 }
15988
15989 impl fidl::encoding::ValueTypeMarker for IpSendControlData {
15990 type Borrowed<'a> = &'a Self;
15991 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15992 value
15993 }
15994 }
15995
15996 unsafe impl fidl::encoding::TypeMarker for IpSendControlData {
15997 type Owned = Self;
15998
15999 #[inline(always)]
16000 fn inline_align(_context: fidl::encoding::Context) -> usize {
16001 8
16002 }
16003
16004 #[inline(always)]
16005 fn inline_size(_context: fidl::encoding::Context) -> usize {
16006 16
16007 }
16008 }
16009
16010 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IpSendControlData, D>
16011 for &IpSendControlData
16012 {
16013 unsafe fn encode(
16014 self,
16015 encoder: &mut fidl::encoding::Encoder<'_, D>,
16016 offset: usize,
16017 mut depth: fidl::encoding::Depth,
16018 ) -> fidl::Result<()> {
16019 encoder.debug_check_bounds::<IpSendControlData>(offset);
16020 let max_ordinal: u64 = self.max_ordinal_present();
16022 encoder.write_num(max_ordinal, offset);
16023 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16024 if max_ordinal == 0 {
16026 return Ok(());
16027 }
16028 depth.increment()?;
16029 let envelope_size = 8;
16030 let bytes_len = max_ordinal as usize * envelope_size;
16031 #[allow(unused_variables)]
16032 let offset = encoder.out_of_line_offset(bytes_len);
16033 let mut _prev_end_offset: usize = 0;
16034 if 2 > max_ordinal {
16035 return Ok(());
16036 }
16037
16038 let cur_offset: usize = (2 - 1) * envelope_size;
16041
16042 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16044
16045 fidl::encoding::encode_in_envelope_optional::<u8, D>(
16050 self.ttl.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16051 encoder,
16052 offset + cur_offset,
16053 depth,
16054 )?;
16055
16056 _prev_end_offset = cur_offset + envelope_size;
16057
16058 Ok(())
16059 }
16060 }
16061
16062 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IpSendControlData {
16063 #[inline(always)]
16064 fn new_empty() -> Self {
16065 Self::default()
16066 }
16067
16068 unsafe fn decode(
16069 &mut self,
16070 decoder: &mut fidl::encoding::Decoder<'_, D>,
16071 offset: usize,
16072 mut depth: fidl::encoding::Depth,
16073 ) -> fidl::Result<()> {
16074 decoder.debug_check_bounds::<Self>(offset);
16075 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16076 None => return Err(fidl::Error::NotNullable),
16077 Some(len) => len,
16078 };
16079 if len == 0 {
16081 return Ok(());
16082 };
16083 depth.increment()?;
16084 let envelope_size = 8;
16085 let bytes_len = len * envelope_size;
16086 let offset = decoder.out_of_line_offset(bytes_len)?;
16087 let mut _next_ordinal_to_read = 0;
16089 let mut next_offset = offset;
16090 let end_offset = offset + bytes_len;
16091 _next_ordinal_to_read += 1;
16092 if next_offset >= end_offset {
16093 return Ok(());
16094 }
16095
16096 while _next_ordinal_to_read < 2 {
16098 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16099 _next_ordinal_to_read += 1;
16100 next_offset += envelope_size;
16101 }
16102
16103 let next_out_of_line = decoder.next_out_of_line();
16104 let handles_before = decoder.remaining_handles();
16105 if let Some((inlined, num_bytes, num_handles)) =
16106 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16107 {
16108 let member_inline_size =
16109 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16110 if inlined != (member_inline_size <= 4) {
16111 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16112 }
16113 let inner_offset;
16114 let mut inner_depth = depth.clone();
16115 if inlined {
16116 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16117 inner_offset = next_offset;
16118 } else {
16119 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16120 inner_depth.increment()?;
16121 }
16122 let val_ref = self.ttl.get_or_insert_with(|| fidl::new_empty!(u8, D));
16123 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16124 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16125 {
16126 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16127 }
16128 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16129 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16130 }
16131 }
16132
16133 next_offset += envelope_size;
16134
16135 while next_offset < end_offset {
16137 _next_ordinal_to_read += 1;
16138 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16139 next_offset += envelope_size;
16140 }
16141
16142 Ok(())
16143 }
16144 }
16145
16146 impl Ipv6RecvControlData {
16147 #[inline(always)]
16148 fn max_ordinal_present(&self) -> u64 {
16149 if let Some(_) = self.pktinfo {
16150 return 3;
16151 }
16152 if let Some(_) = self.hoplimit {
16153 return 2;
16154 }
16155 if let Some(_) = self.tclass {
16156 return 1;
16157 }
16158 0
16159 }
16160 }
16161
16162 impl fidl::encoding::ValueTypeMarker for Ipv6RecvControlData {
16163 type Borrowed<'a> = &'a Self;
16164 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16165 value
16166 }
16167 }
16168
16169 unsafe impl fidl::encoding::TypeMarker for Ipv6RecvControlData {
16170 type Owned = Self;
16171
16172 #[inline(always)]
16173 fn inline_align(_context: fidl::encoding::Context) -> usize {
16174 8
16175 }
16176
16177 #[inline(always)]
16178 fn inline_size(_context: fidl::encoding::Context) -> usize {
16179 16
16180 }
16181 }
16182
16183 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6RecvControlData, D>
16184 for &Ipv6RecvControlData
16185 {
16186 unsafe fn encode(
16187 self,
16188 encoder: &mut fidl::encoding::Encoder<'_, D>,
16189 offset: usize,
16190 mut depth: fidl::encoding::Depth,
16191 ) -> fidl::Result<()> {
16192 encoder.debug_check_bounds::<Ipv6RecvControlData>(offset);
16193 let max_ordinal: u64 = self.max_ordinal_present();
16195 encoder.write_num(max_ordinal, offset);
16196 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16197 if max_ordinal == 0 {
16199 return Ok(());
16200 }
16201 depth.increment()?;
16202 let envelope_size = 8;
16203 let bytes_len = max_ordinal as usize * envelope_size;
16204 #[allow(unused_variables)]
16205 let offset = encoder.out_of_line_offset(bytes_len);
16206 let mut _prev_end_offset: usize = 0;
16207 if 1 > max_ordinal {
16208 return Ok(());
16209 }
16210
16211 let cur_offset: usize = (1 - 1) * envelope_size;
16214
16215 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16217
16218 fidl::encoding::encode_in_envelope_optional::<u8, D>(
16223 self.tclass.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16224 encoder,
16225 offset + cur_offset,
16226 depth,
16227 )?;
16228
16229 _prev_end_offset = cur_offset + envelope_size;
16230 if 2 > max_ordinal {
16231 return Ok(());
16232 }
16233
16234 let cur_offset: usize = (2 - 1) * envelope_size;
16237
16238 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16240
16241 fidl::encoding::encode_in_envelope_optional::<u8, D>(
16246 self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16247 encoder,
16248 offset + cur_offset,
16249 depth,
16250 )?;
16251
16252 _prev_end_offset = cur_offset + envelope_size;
16253 if 3 > max_ordinal {
16254 return Ok(());
16255 }
16256
16257 let cur_offset: usize = (3 - 1) * envelope_size;
16260
16261 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16263
16264 fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoRecvControlData, D>(
16269 self.pktinfo
16270 .as_ref()
16271 .map(<Ipv6PktInfoRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16272 encoder,
16273 offset + cur_offset,
16274 depth,
16275 )?;
16276
16277 _prev_end_offset = cur_offset + envelope_size;
16278
16279 Ok(())
16280 }
16281 }
16282
16283 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6RecvControlData {
16284 #[inline(always)]
16285 fn new_empty() -> Self {
16286 Self::default()
16287 }
16288
16289 unsafe fn decode(
16290 &mut self,
16291 decoder: &mut fidl::encoding::Decoder<'_, D>,
16292 offset: usize,
16293 mut depth: fidl::encoding::Depth,
16294 ) -> fidl::Result<()> {
16295 decoder.debug_check_bounds::<Self>(offset);
16296 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16297 None => return Err(fidl::Error::NotNullable),
16298 Some(len) => len,
16299 };
16300 if len == 0 {
16302 return Ok(());
16303 };
16304 depth.increment()?;
16305 let envelope_size = 8;
16306 let bytes_len = len * envelope_size;
16307 let offset = decoder.out_of_line_offset(bytes_len)?;
16308 let mut _next_ordinal_to_read = 0;
16310 let mut next_offset = offset;
16311 let end_offset = offset + bytes_len;
16312 _next_ordinal_to_read += 1;
16313 if next_offset >= end_offset {
16314 return Ok(());
16315 }
16316
16317 while _next_ordinal_to_read < 1 {
16319 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16320 _next_ordinal_to_read += 1;
16321 next_offset += envelope_size;
16322 }
16323
16324 let next_out_of_line = decoder.next_out_of_line();
16325 let handles_before = decoder.remaining_handles();
16326 if let Some((inlined, num_bytes, num_handles)) =
16327 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16328 {
16329 let member_inline_size =
16330 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16331 if inlined != (member_inline_size <= 4) {
16332 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16333 }
16334 let inner_offset;
16335 let mut inner_depth = depth.clone();
16336 if inlined {
16337 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16338 inner_offset = next_offset;
16339 } else {
16340 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16341 inner_depth.increment()?;
16342 }
16343 let val_ref = self.tclass.get_or_insert_with(|| fidl::new_empty!(u8, D));
16344 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16345 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16346 {
16347 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16348 }
16349 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16350 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16351 }
16352 }
16353
16354 next_offset += envelope_size;
16355 _next_ordinal_to_read += 1;
16356 if next_offset >= end_offset {
16357 return Ok(());
16358 }
16359
16360 while _next_ordinal_to_read < 2 {
16362 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16363 _next_ordinal_to_read += 1;
16364 next_offset += envelope_size;
16365 }
16366
16367 let next_out_of_line = decoder.next_out_of_line();
16368 let handles_before = decoder.remaining_handles();
16369 if let Some((inlined, num_bytes, num_handles)) =
16370 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16371 {
16372 let member_inline_size =
16373 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16374 if inlined != (member_inline_size <= 4) {
16375 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16376 }
16377 let inner_offset;
16378 let mut inner_depth = depth.clone();
16379 if inlined {
16380 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16381 inner_offset = next_offset;
16382 } else {
16383 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16384 inner_depth.increment()?;
16385 }
16386 let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16387 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16388 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16389 {
16390 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16391 }
16392 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16393 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16394 }
16395 }
16396
16397 next_offset += envelope_size;
16398 _next_ordinal_to_read += 1;
16399 if next_offset >= end_offset {
16400 return Ok(());
16401 }
16402
16403 while _next_ordinal_to_read < 3 {
16405 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16406 _next_ordinal_to_read += 1;
16407 next_offset += envelope_size;
16408 }
16409
16410 let next_out_of_line = decoder.next_out_of_line();
16411 let handles_before = decoder.remaining_handles();
16412 if let Some((inlined, num_bytes, num_handles)) =
16413 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16414 {
16415 let member_inline_size =
16416 <Ipv6PktInfoRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16417 decoder.context,
16418 );
16419 if inlined != (member_inline_size <= 4) {
16420 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16421 }
16422 let inner_offset;
16423 let mut inner_depth = depth.clone();
16424 if inlined {
16425 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16426 inner_offset = next_offset;
16427 } else {
16428 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16429 inner_depth.increment()?;
16430 }
16431 let val_ref = self
16432 .pktinfo
16433 .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoRecvControlData, D));
16434 fidl::decode!(
16435 Ipv6PktInfoRecvControlData,
16436 D,
16437 val_ref,
16438 decoder,
16439 inner_offset,
16440 inner_depth
16441 )?;
16442 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16443 {
16444 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16445 }
16446 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16447 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16448 }
16449 }
16450
16451 next_offset += envelope_size;
16452
16453 while next_offset < end_offset {
16455 _next_ordinal_to_read += 1;
16456 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16457 next_offset += envelope_size;
16458 }
16459
16460 Ok(())
16461 }
16462 }
16463
16464 impl Ipv6SendControlData {
16465 #[inline(always)]
16466 fn max_ordinal_present(&self) -> u64 {
16467 if let Some(_) = self.pktinfo {
16468 return 3;
16469 }
16470 if let Some(_) = self.hoplimit {
16471 return 2;
16472 }
16473 0
16474 }
16475 }
16476
16477 impl fidl::encoding::ValueTypeMarker for Ipv6SendControlData {
16478 type Borrowed<'a> = &'a Self;
16479 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16480 value
16481 }
16482 }
16483
16484 unsafe impl fidl::encoding::TypeMarker for Ipv6SendControlData {
16485 type Owned = Self;
16486
16487 #[inline(always)]
16488 fn inline_align(_context: fidl::encoding::Context) -> usize {
16489 8
16490 }
16491
16492 #[inline(always)]
16493 fn inline_size(_context: fidl::encoding::Context) -> usize {
16494 16
16495 }
16496 }
16497
16498 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6SendControlData, D>
16499 for &Ipv6SendControlData
16500 {
16501 unsafe fn encode(
16502 self,
16503 encoder: &mut fidl::encoding::Encoder<'_, D>,
16504 offset: usize,
16505 mut depth: fidl::encoding::Depth,
16506 ) -> fidl::Result<()> {
16507 encoder.debug_check_bounds::<Ipv6SendControlData>(offset);
16508 let max_ordinal: u64 = self.max_ordinal_present();
16510 encoder.write_num(max_ordinal, offset);
16511 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16512 if max_ordinal == 0 {
16514 return Ok(());
16515 }
16516 depth.increment()?;
16517 let envelope_size = 8;
16518 let bytes_len = max_ordinal as usize * envelope_size;
16519 #[allow(unused_variables)]
16520 let offset = encoder.out_of_line_offset(bytes_len);
16521 let mut _prev_end_offset: usize = 0;
16522 if 2 > max_ordinal {
16523 return Ok(());
16524 }
16525
16526 let cur_offset: usize = (2 - 1) * envelope_size;
16529
16530 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16532
16533 fidl::encoding::encode_in_envelope_optional::<u8, D>(
16538 self.hoplimit.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
16539 encoder,
16540 offset + cur_offset,
16541 depth,
16542 )?;
16543
16544 _prev_end_offset = cur_offset + envelope_size;
16545 if 3 > max_ordinal {
16546 return Ok(());
16547 }
16548
16549 let cur_offset: usize = (3 - 1) * envelope_size;
16552
16553 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16555
16556 fidl::encoding::encode_in_envelope_optional::<Ipv6PktInfoSendControlData, D>(
16561 self.pktinfo
16562 .as_ref()
16563 .map(<Ipv6PktInfoSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
16564 encoder,
16565 offset + cur_offset,
16566 depth,
16567 )?;
16568
16569 _prev_end_offset = cur_offset + envelope_size;
16570
16571 Ok(())
16572 }
16573 }
16574
16575 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6SendControlData {
16576 #[inline(always)]
16577 fn new_empty() -> Self {
16578 Self::default()
16579 }
16580
16581 unsafe fn decode(
16582 &mut self,
16583 decoder: &mut fidl::encoding::Decoder<'_, D>,
16584 offset: usize,
16585 mut depth: fidl::encoding::Depth,
16586 ) -> fidl::Result<()> {
16587 decoder.debug_check_bounds::<Self>(offset);
16588 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16589 None => return Err(fidl::Error::NotNullable),
16590 Some(len) => len,
16591 };
16592 if len == 0 {
16594 return Ok(());
16595 };
16596 depth.increment()?;
16597 let envelope_size = 8;
16598 let bytes_len = len * envelope_size;
16599 let offset = decoder.out_of_line_offset(bytes_len)?;
16600 let mut _next_ordinal_to_read = 0;
16602 let mut next_offset = offset;
16603 let end_offset = offset + bytes_len;
16604 _next_ordinal_to_read += 1;
16605 if next_offset >= end_offset {
16606 return Ok(());
16607 }
16608
16609 while _next_ordinal_to_read < 2 {
16611 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16612 _next_ordinal_to_read += 1;
16613 next_offset += envelope_size;
16614 }
16615
16616 let next_out_of_line = decoder.next_out_of_line();
16617 let handles_before = decoder.remaining_handles();
16618 if let Some((inlined, num_bytes, num_handles)) =
16619 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16620 {
16621 let member_inline_size =
16622 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16623 if inlined != (member_inline_size <= 4) {
16624 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16625 }
16626 let inner_offset;
16627 let mut inner_depth = depth.clone();
16628 if inlined {
16629 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16630 inner_offset = next_offset;
16631 } else {
16632 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16633 inner_depth.increment()?;
16634 }
16635 let val_ref = self.hoplimit.get_or_insert_with(|| fidl::new_empty!(u8, D));
16636 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
16637 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16638 {
16639 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16640 }
16641 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16642 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16643 }
16644 }
16645
16646 next_offset += envelope_size;
16647 _next_ordinal_to_read += 1;
16648 if next_offset >= end_offset {
16649 return Ok(());
16650 }
16651
16652 while _next_ordinal_to_read < 3 {
16654 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16655 _next_ordinal_to_read += 1;
16656 next_offset += envelope_size;
16657 }
16658
16659 let next_out_of_line = decoder.next_out_of_line();
16660 let handles_before = decoder.remaining_handles();
16661 if let Some((inlined, num_bytes, num_handles)) =
16662 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16663 {
16664 let member_inline_size =
16665 <Ipv6PktInfoSendControlData as fidl::encoding::TypeMarker>::inline_size(
16666 decoder.context,
16667 );
16668 if inlined != (member_inline_size <= 4) {
16669 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16670 }
16671 let inner_offset;
16672 let mut inner_depth = depth.clone();
16673 if inlined {
16674 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16675 inner_offset = next_offset;
16676 } else {
16677 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16678 inner_depth.increment()?;
16679 }
16680 let val_ref = self
16681 .pktinfo
16682 .get_or_insert_with(|| fidl::new_empty!(Ipv6PktInfoSendControlData, D));
16683 fidl::decode!(
16684 Ipv6PktInfoSendControlData,
16685 D,
16686 val_ref,
16687 decoder,
16688 inner_offset,
16689 inner_depth
16690 )?;
16691 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16692 {
16693 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16694 }
16695 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16696 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16697 }
16698 }
16699
16700 next_offset += envelope_size;
16701
16702 while next_offset < end_offset {
16704 _next_ordinal_to_read += 1;
16705 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16706 next_offset += envelope_size;
16707 }
16708
16709 Ok(())
16710 }
16711 }
16712
16713 impl NetworkSocketRecvControlData {
16714 #[inline(always)]
16715 fn max_ordinal_present(&self) -> u64 {
16716 if let Some(_) = self.ipv6 {
16717 return 3;
16718 }
16719 if let Some(_) = self.ip {
16720 return 2;
16721 }
16722 if let Some(_) = self.socket {
16723 return 1;
16724 }
16725 0
16726 }
16727 }
16728
16729 impl fidl::encoding::ValueTypeMarker for NetworkSocketRecvControlData {
16730 type Borrowed<'a> = &'a Self;
16731 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16732 value
16733 }
16734 }
16735
16736 unsafe impl fidl::encoding::TypeMarker for NetworkSocketRecvControlData {
16737 type Owned = Self;
16738
16739 #[inline(always)]
16740 fn inline_align(_context: fidl::encoding::Context) -> usize {
16741 8
16742 }
16743
16744 #[inline(always)]
16745 fn inline_size(_context: fidl::encoding::Context) -> usize {
16746 16
16747 }
16748 }
16749
16750 unsafe impl<D: fidl::encoding::ResourceDialect>
16751 fidl::encoding::Encode<NetworkSocketRecvControlData, D> for &NetworkSocketRecvControlData
16752 {
16753 unsafe fn encode(
16754 self,
16755 encoder: &mut fidl::encoding::Encoder<'_, D>,
16756 offset: usize,
16757 mut depth: fidl::encoding::Depth,
16758 ) -> fidl::Result<()> {
16759 encoder.debug_check_bounds::<NetworkSocketRecvControlData>(offset);
16760 let max_ordinal: u64 = self.max_ordinal_present();
16762 encoder.write_num(max_ordinal, offset);
16763 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16764 if max_ordinal == 0 {
16766 return Ok(());
16767 }
16768 depth.increment()?;
16769 let envelope_size = 8;
16770 let bytes_len = max_ordinal as usize * envelope_size;
16771 #[allow(unused_variables)]
16772 let offset = encoder.out_of_line_offset(bytes_len);
16773 let mut _prev_end_offset: usize = 0;
16774 if 1 > max_ordinal {
16775 return Ok(());
16776 }
16777
16778 let cur_offset: usize = (1 - 1) * envelope_size;
16781
16782 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16784
16785 fidl::encoding::encode_in_envelope_optional::<SocketRecvControlData, D>(
16790 self.socket
16791 .as_ref()
16792 .map(<SocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16793 encoder,
16794 offset + cur_offset,
16795 depth,
16796 )?;
16797
16798 _prev_end_offset = cur_offset + envelope_size;
16799 if 2 > max_ordinal {
16800 return Ok(());
16801 }
16802
16803 let cur_offset: usize = (2 - 1) * envelope_size;
16806
16807 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16809
16810 fidl::encoding::encode_in_envelope_optional::<IpRecvControlData, D>(
16815 self.ip
16816 .as_ref()
16817 .map(<IpRecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16818 encoder,
16819 offset + cur_offset,
16820 depth,
16821 )?;
16822
16823 _prev_end_offset = cur_offset + envelope_size;
16824 if 3 > max_ordinal {
16825 return Ok(());
16826 }
16827
16828 let cur_offset: usize = (3 - 1) * envelope_size;
16831
16832 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16834
16835 fidl::encoding::encode_in_envelope_optional::<Ipv6RecvControlData, D>(
16840 self.ipv6
16841 .as_ref()
16842 .map(<Ipv6RecvControlData as fidl::encoding::ValueTypeMarker>::borrow),
16843 encoder,
16844 offset + cur_offset,
16845 depth,
16846 )?;
16847
16848 _prev_end_offset = cur_offset + envelope_size;
16849
16850 Ok(())
16851 }
16852 }
16853
16854 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
16855 for NetworkSocketRecvControlData
16856 {
16857 #[inline(always)]
16858 fn new_empty() -> Self {
16859 Self::default()
16860 }
16861
16862 unsafe fn decode(
16863 &mut self,
16864 decoder: &mut fidl::encoding::Decoder<'_, D>,
16865 offset: usize,
16866 mut depth: fidl::encoding::Depth,
16867 ) -> fidl::Result<()> {
16868 decoder.debug_check_bounds::<Self>(offset);
16869 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16870 None => return Err(fidl::Error::NotNullable),
16871 Some(len) => len,
16872 };
16873 if len == 0 {
16875 return Ok(());
16876 };
16877 depth.increment()?;
16878 let envelope_size = 8;
16879 let bytes_len = len * envelope_size;
16880 let offset = decoder.out_of_line_offset(bytes_len)?;
16881 let mut _next_ordinal_to_read = 0;
16883 let mut next_offset = offset;
16884 let end_offset = offset + bytes_len;
16885 _next_ordinal_to_read += 1;
16886 if next_offset >= end_offset {
16887 return Ok(());
16888 }
16889
16890 while _next_ordinal_to_read < 1 {
16892 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16893 _next_ordinal_to_read += 1;
16894 next_offset += envelope_size;
16895 }
16896
16897 let next_out_of_line = decoder.next_out_of_line();
16898 let handles_before = decoder.remaining_handles();
16899 if let Some((inlined, num_bytes, num_handles)) =
16900 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16901 {
16902 let member_inline_size =
16903 <SocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
16904 decoder.context,
16905 );
16906 if inlined != (member_inline_size <= 4) {
16907 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16908 }
16909 let inner_offset;
16910 let mut inner_depth = depth.clone();
16911 if inlined {
16912 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16913 inner_offset = next_offset;
16914 } else {
16915 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16916 inner_depth.increment()?;
16917 }
16918 let val_ref =
16919 self.socket.get_or_insert_with(|| fidl::new_empty!(SocketRecvControlData, D));
16920 fidl::decode!(
16921 SocketRecvControlData,
16922 D,
16923 val_ref,
16924 decoder,
16925 inner_offset,
16926 inner_depth
16927 )?;
16928 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16929 {
16930 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16931 }
16932 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16933 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16934 }
16935 }
16936
16937 next_offset += envelope_size;
16938 _next_ordinal_to_read += 1;
16939 if next_offset >= end_offset {
16940 return Ok(());
16941 }
16942
16943 while _next_ordinal_to_read < 2 {
16945 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16946 _next_ordinal_to_read += 1;
16947 next_offset += envelope_size;
16948 }
16949
16950 let next_out_of_line = decoder.next_out_of_line();
16951 let handles_before = decoder.remaining_handles();
16952 if let Some((inlined, num_bytes, num_handles)) =
16953 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16954 {
16955 let member_inline_size =
16956 <IpRecvControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16957 if inlined != (member_inline_size <= 4) {
16958 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16959 }
16960 let inner_offset;
16961 let mut inner_depth = depth.clone();
16962 if inlined {
16963 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16964 inner_offset = next_offset;
16965 } else {
16966 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16967 inner_depth.increment()?;
16968 }
16969 let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpRecvControlData, D));
16970 fidl::decode!(IpRecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
16971 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16972 {
16973 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16974 }
16975 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16976 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16977 }
16978 }
16979
16980 next_offset += envelope_size;
16981 _next_ordinal_to_read += 1;
16982 if next_offset >= end_offset {
16983 return Ok(());
16984 }
16985
16986 while _next_ordinal_to_read < 3 {
16988 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16989 _next_ordinal_to_read += 1;
16990 next_offset += envelope_size;
16991 }
16992
16993 let next_out_of_line = decoder.next_out_of_line();
16994 let handles_before = decoder.remaining_handles();
16995 if let Some((inlined, num_bytes, num_handles)) =
16996 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16997 {
16998 let member_inline_size =
16999 <Ipv6RecvControlData as fidl::encoding::TypeMarker>::inline_size(
17000 decoder.context,
17001 );
17002 if inlined != (member_inline_size <= 4) {
17003 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17004 }
17005 let inner_offset;
17006 let mut inner_depth = depth.clone();
17007 if inlined {
17008 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17009 inner_offset = next_offset;
17010 } else {
17011 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17012 inner_depth.increment()?;
17013 }
17014 let val_ref =
17015 self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6RecvControlData, D));
17016 fidl::decode!(Ipv6RecvControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17017 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17018 {
17019 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17020 }
17021 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17022 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17023 }
17024 }
17025
17026 next_offset += envelope_size;
17027
17028 while next_offset < end_offset {
17030 _next_ordinal_to_read += 1;
17031 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17032 next_offset += envelope_size;
17033 }
17034
17035 Ok(())
17036 }
17037 }
17038
17039 impl NetworkSocketSendControlData {
17040 #[inline(always)]
17041 fn max_ordinal_present(&self) -> u64 {
17042 if let Some(_) = self.ipv6 {
17043 return 3;
17044 }
17045 if let Some(_) = self.ip {
17046 return 2;
17047 }
17048 if let Some(_) = self.socket {
17049 return 1;
17050 }
17051 0
17052 }
17053 }
17054
17055 impl fidl::encoding::ValueTypeMarker for NetworkSocketSendControlData {
17056 type Borrowed<'a> = &'a Self;
17057 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17058 value
17059 }
17060 }
17061
17062 unsafe impl fidl::encoding::TypeMarker for NetworkSocketSendControlData {
17063 type Owned = Self;
17064
17065 #[inline(always)]
17066 fn inline_align(_context: fidl::encoding::Context) -> usize {
17067 8
17068 }
17069
17070 #[inline(always)]
17071 fn inline_size(_context: fidl::encoding::Context) -> usize {
17072 16
17073 }
17074 }
17075
17076 unsafe impl<D: fidl::encoding::ResourceDialect>
17077 fidl::encoding::Encode<NetworkSocketSendControlData, D> for &NetworkSocketSendControlData
17078 {
17079 unsafe fn encode(
17080 self,
17081 encoder: &mut fidl::encoding::Encoder<'_, D>,
17082 offset: usize,
17083 mut depth: fidl::encoding::Depth,
17084 ) -> fidl::Result<()> {
17085 encoder.debug_check_bounds::<NetworkSocketSendControlData>(offset);
17086 let max_ordinal: u64 = self.max_ordinal_present();
17088 encoder.write_num(max_ordinal, offset);
17089 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17090 if max_ordinal == 0 {
17092 return Ok(());
17093 }
17094 depth.increment()?;
17095 let envelope_size = 8;
17096 let bytes_len = max_ordinal as usize * envelope_size;
17097 #[allow(unused_variables)]
17098 let offset = encoder.out_of_line_offset(bytes_len);
17099 let mut _prev_end_offset: usize = 0;
17100 if 1 > max_ordinal {
17101 return Ok(());
17102 }
17103
17104 let cur_offset: usize = (1 - 1) * envelope_size;
17107
17108 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17110
17111 fidl::encoding::encode_in_envelope_optional::<SocketSendControlData, D>(
17116 self.socket
17117 .as_ref()
17118 .map(<SocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17119 encoder,
17120 offset + cur_offset,
17121 depth,
17122 )?;
17123
17124 _prev_end_offset = cur_offset + envelope_size;
17125 if 2 > max_ordinal {
17126 return Ok(());
17127 }
17128
17129 let cur_offset: usize = (2 - 1) * envelope_size;
17132
17133 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17135
17136 fidl::encoding::encode_in_envelope_optional::<IpSendControlData, D>(
17141 self.ip
17142 .as_ref()
17143 .map(<IpSendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17144 encoder,
17145 offset + cur_offset,
17146 depth,
17147 )?;
17148
17149 _prev_end_offset = cur_offset + envelope_size;
17150 if 3 > max_ordinal {
17151 return Ok(());
17152 }
17153
17154 let cur_offset: usize = (3 - 1) * envelope_size;
17157
17158 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17160
17161 fidl::encoding::encode_in_envelope_optional::<Ipv6SendControlData, D>(
17166 self.ipv6
17167 .as_ref()
17168 .map(<Ipv6SendControlData as fidl::encoding::ValueTypeMarker>::borrow),
17169 encoder,
17170 offset + cur_offset,
17171 depth,
17172 )?;
17173
17174 _prev_end_offset = cur_offset + envelope_size;
17175
17176 Ok(())
17177 }
17178 }
17179
17180 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17181 for NetworkSocketSendControlData
17182 {
17183 #[inline(always)]
17184 fn new_empty() -> Self {
17185 Self::default()
17186 }
17187
17188 unsafe fn decode(
17189 &mut self,
17190 decoder: &mut fidl::encoding::Decoder<'_, D>,
17191 offset: usize,
17192 mut depth: fidl::encoding::Depth,
17193 ) -> fidl::Result<()> {
17194 decoder.debug_check_bounds::<Self>(offset);
17195 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17196 None => return Err(fidl::Error::NotNullable),
17197 Some(len) => len,
17198 };
17199 if len == 0 {
17201 return Ok(());
17202 };
17203 depth.increment()?;
17204 let envelope_size = 8;
17205 let bytes_len = len * envelope_size;
17206 let offset = decoder.out_of_line_offset(bytes_len)?;
17207 let mut _next_ordinal_to_read = 0;
17209 let mut next_offset = offset;
17210 let end_offset = offset + bytes_len;
17211 _next_ordinal_to_read += 1;
17212 if next_offset >= end_offset {
17213 return Ok(());
17214 }
17215
17216 while _next_ordinal_to_read < 1 {
17218 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17219 _next_ordinal_to_read += 1;
17220 next_offset += envelope_size;
17221 }
17222
17223 let next_out_of_line = decoder.next_out_of_line();
17224 let handles_before = decoder.remaining_handles();
17225 if let Some((inlined, num_bytes, num_handles)) =
17226 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17227 {
17228 let member_inline_size =
17229 <SocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17230 decoder.context,
17231 );
17232 if inlined != (member_inline_size <= 4) {
17233 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17234 }
17235 let inner_offset;
17236 let mut inner_depth = depth.clone();
17237 if inlined {
17238 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17239 inner_offset = next_offset;
17240 } else {
17241 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17242 inner_depth.increment()?;
17243 }
17244 let val_ref =
17245 self.socket.get_or_insert_with(|| fidl::new_empty!(SocketSendControlData, D));
17246 fidl::decode!(
17247 SocketSendControlData,
17248 D,
17249 val_ref,
17250 decoder,
17251 inner_offset,
17252 inner_depth
17253 )?;
17254 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17255 {
17256 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17257 }
17258 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17259 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17260 }
17261 }
17262
17263 next_offset += envelope_size;
17264 _next_ordinal_to_read += 1;
17265 if next_offset >= end_offset {
17266 return Ok(());
17267 }
17268
17269 while _next_ordinal_to_read < 2 {
17271 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17272 _next_ordinal_to_read += 1;
17273 next_offset += envelope_size;
17274 }
17275
17276 let next_out_of_line = decoder.next_out_of_line();
17277 let handles_before = decoder.remaining_handles();
17278 if let Some((inlined, num_bytes, num_handles)) =
17279 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17280 {
17281 let member_inline_size =
17282 <IpSendControlData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17283 if inlined != (member_inline_size <= 4) {
17284 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17285 }
17286 let inner_offset;
17287 let mut inner_depth = depth.clone();
17288 if inlined {
17289 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17290 inner_offset = next_offset;
17291 } else {
17292 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17293 inner_depth.increment()?;
17294 }
17295 let val_ref = self.ip.get_or_insert_with(|| fidl::new_empty!(IpSendControlData, D));
17296 fidl::decode!(IpSendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17297 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17298 {
17299 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17300 }
17301 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17302 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17303 }
17304 }
17305
17306 next_offset += envelope_size;
17307 _next_ordinal_to_read += 1;
17308 if next_offset >= end_offset {
17309 return Ok(());
17310 }
17311
17312 while _next_ordinal_to_read < 3 {
17314 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17315 _next_ordinal_to_read += 1;
17316 next_offset += envelope_size;
17317 }
17318
17319 let next_out_of_line = decoder.next_out_of_line();
17320 let handles_before = decoder.remaining_handles();
17321 if let Some((inlined, num_bytes, num_handles)) =
17322 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17323 {
17324 let member_inline_size =
17325 <Ipv6SendControlData as fidl::encoding::TypeMarker>::inline_size(
17326 decoder.context,
17327 );
17328 if inlined != (member_inline_size <= 4) {
17329 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17330 }
17331 let inner_offset;
17332 let mut inner_depth = depth.clone();
17333 if inlined {
17334 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17335 inner_offset = next_offset;
17336 } else {
17337 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17338 inner_depth.increment()?;
17339 }
17340 let val_ref =
17341 self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6SendControlData, D));
17342 fidl::decode!(Ipv6SendControlData, D, val_ref, decoder, inner_offset, inner_depth)?;
17343 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17344 {
17345 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17346 }
17347 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17348 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17349 }
17350 }
17351
17352 next_offset += envelope_size;
17353
17354 while next_offset < end_offset {
17356 _next_ordinal_to_read += 1;
17357 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17358 next_offset += envelope_size;
17359 }
17360
17361 Ok(())
17362 }
17363 }
17364
17365 impl RecvMsgMeta {
17366 #[inline(always)]
17367 fn max_ordinal_present(&self) -> u64 {
17368 if let Some(_) = self.payload_len {
17369 return 3;
17370 }
17371 if let Some(_) = self.control {
17372 return 2;
17373 }
17374 if let Some(_) = self.from {
17375 return 1;
17376 }
17377 0
17378 }
17379 }
17380
17381 impl fidl::encoding::ValueTypeMarker for RecvMsgMeta {
17382 type Borrowed<'a> = &'a Self;
17383 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17384 value
17385 }
17386 }
17387
17388 unsafe impl fidl::encoding::TypeMarker for RecvMsgMeta {
17389 type Owned = Self;
17390
17391 #[inline(always)]
17392 fn inline_align(_context: fidl::encoding::Context) -> usize {
17393 8
17394 }
17395
17396 #[inline(always)]
17397 fn inline_size(_context: fidl::encoding::Context) -> usize {
17398 16
17399 }
17400 }
17401
17402 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecvMsgMeta, D>
17403 for &RecvMsgMeta
17404 {
17405 unsafe fn encode(
17406 self,
17407 encoder: &mut fidl::encoding::Encoder<'_, D>,
17408 offset: usize,
17409 mut depth: fidl::encoding::Depth,
17410 ) -> fidl::Result<()> {
17411 encoder.debug_check_bounds::<RecvMsgMeta>(offset);
17412 let max_ordinal: u64 = self.max_ordinal_present();
17414 encoder.write_num(max_ordinal, offset);
17415 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17416 if max_ordinal == 0 {
17418 return Ok(());
17419 }
17420 depth.increment()?;
17421 let envelope_size = 8;
17422 let bytes_len = max_ordinal as usize * envelope_size;
17423 #[allow(unused_variables)]
17424 let offset = encoder.out_of_line_offset(bytes_len);
17425 let mut _prev_end_offset: usize = 0;
17426 if 1 > max_ordinal {
17427 return Ok(());
17428 }
17429
17430 let cur_offset: usize = (1 - 1) * envelope_size;
17433
17434 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17436
17437 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::SocketAddress, D>(
17442 self.from.as_ref().map(
17443 <fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow,
17444 ),
17445 encoder,
17446 offset + cur_offset,
17447 depth,
17448 )?;
17449
17450 _prev_end_offset = cur_offset + envelope_size;
17451 if 2 > max_ordinal {
17452 return Ok(());
17453 }
17454
17455 let cur_offset: usize = (2 - 1) * envelope_size;
17458
17459 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17461
17462 fidl::encoding::encode_in_envelope_optional::<DatagramSocketRecvControlData, D>(
17467 self.control.as_ref().map(
17468 <DatagramSocketRecvControlData as fidl::encoding::ValueTypeMarker>::borrow,
17469 ),
17470 encoder,
17471 offset + cur_offset,
17472 depth,
17473 )?;
17474
17475 _prev_end_offset = cur_offset + envelope_size;
17476 if 3 > max_ordinal {
17477 return Ok(());
17478 }
17479
17480 let cur_offset: usize = (3 - 1) * envelope_size;
17483
17484 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17486
17487 fidl::encoding::encode_in_envelope_optional::<u16, D>(
17492 self.payload_len.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17493 encoder,
17494 offset + cur_offset,
17495 depth,
17496 )?;
17497
17498 _prev_end_offset = cur_offset + envelope_size;
17499
17500 Ok(())
17501 }
17502 }
17503
17504 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvMsgMeta {
17505 #[inline(always)]
17506 fn new_empty() -> Self {
17507 Self::default()
17508 }
17509
17510 unsafe fn decode(
17511 &mut self,
17512 decoder: &mut fidl::encoding::Decoder<'_, D>,
17513 offset: usize,
17514 mut depth: fidl::encoding::Depth,
17515 ) -> fidl::Result<()> {
17516 decoder.debug_check_bounds::<Self>(offset);
17517 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17518 None => return Err(fidl::Error::NotNullable),
17519 Some(len) => len,
17520 };
17521 if len == 0 {
17523 return Ok(());
17524 };
17525 depth.increment()?;
17526 let envelope_size = 8;
17527 let bytes_len = len * envelope_size;
17528 let offset = decoder.out_of_line_offset(bytes_len)?;
17529 let mut _next_ordinal_to_read = 0;
17531 let mut next_offset = offset;
17532 let end_offset = offset + bytes_len;
17533 _next_ordinal_to_read += 1;
17534 if next_offset >= end_offset {
17535 return Ok(());
17536 }
17537
17538 while _next_ordinal_to_read < 1 {
17540 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17541 _next_ordinal_to_read += 1;
17542 next_offset += envelope_size;
17543 }
17544
17545 let next_out_of_line = decoder.next_out_of_line();
17546 let handles_before = decoder.remaining_handles();
17547 if let Some((inlined, num_bytes, num_handles)) =
17548 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17549 {
17550 let member_inline_size =
17551 <fidl_fuchsia_net::SocketAddress as fidl::encoding::TypeMarker>::inline_size(
17552 decoder.context,
17553 );
17554 if inlined != (member_inline_size <= 4) {
17555 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17556 }
17557 let inner_offset;
17558 let mut inner_depth = depth.clone();
17559 if inlined {
17560 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17561 inner_offset = next_offset;
17562 } else {
17563 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17564 inner_depth.increment()?;
17565 }
17566 let val_ref = self
17567 .from
17568 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D));
17569 fidl::decode!(
17570 fidl_fuchsia_net::SocketAddress,
17571 D,
17572 val_ref,
17573 decoder,
17574 inner_offset,
17575 inner_depth
17576 )?;
17577 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17578 {
17579 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17580 }
17581 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17582 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17583 }
17584 }
17585
17586 next_offset += envelope_size;
17587 _next_ordinal_to_read += 1;
17588 if next_offset >= end_offset {
17589 return Ok(());
17590 }
17591
17592 while _next_ordinal_to_read < 2 {
17594 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17595 _next_ordinal_to_read += 1;
17596 next_offset += envelope_size;
17597 }
17598
17599 let next_out_of_line = decoder.next_out_of_line();
17600 let handles_before = decoder.remaining_handles();
17601 if let Some((inlined, num_bytes, num_handles)) =
17602 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17603 {
17604 let member_inline_size =
17605 <DatagramSocketRecvControlData as fidl::encoding::TypeMarker>::inline_size(
17606 decoder.context,
17607 );
17608 if inlined != (member_inline_size <= 4) {
17609 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17610 }
17611 let inner_offset;
17612 let mut inner_depth = depth.clone();
17613 if inlined {
17614 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17615 inner_offset = next_offset;
17616 } else {
17617 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17618 inner_depth.increment()?;
17619 }
17620 let val_ref = self
17621 .control
17622 .get_or_insert_with(|| fidl::new_empty!(DatagramSocketRecvControlData, D));
17623 fidl::decode!(
17624 DatagramSocketRecvControlData,
17625 D,
17626 val_ref,
17627 decoder,
17628 inner_offset,
17629 inner_depth
17630 )?;
17631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17632 {
17633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17634 }
17635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17637 }
17638 }
17639
17640 next_offset += envelope_size;
17641 _next_ordinal_to_read += 1;
17642 if next_offset >= end_offset {
17643 return Ok(());
17644 }
17645
17646 while _next_ordinal_to_read < 3 {
17648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17649 _next_ordinal_to_read += 1;
17650 next_offset += envelope_size;
17651 }
17652
17653 let next_out_of_line = decoder.next_out_of_line();
17654 let handles_before = decoder.remaining_handles();
17655 if let Some((inlined, num_bytes, num_handles)) =
17656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17657 {
17658 let member_inline_size =
17659 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17660 if inlined != (member_inline_size <= 4) {
17661 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17662 }
17663 let inner_offset;
17664 let mut inner_depth = depth.clone();
17665 if inlined {
17666 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17667 inner_offset = next_offset;
17668 } else {
17669 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17670 inner_depth.increment()?;
17671 }
17672 let val_ref = self.payload_len.get_or_insert_with(|| fidl::new_empty!(u16, D));
17673 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
17674 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17675 {
17676 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17677 }
17678 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17679 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17680 }
17681 }
17682
17683 next_offset += envelope_size;
17684
17685 while next_offset < end_offset {
17687 _next_ordinal_to_read += 1;
17688 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17689 next_offset += envelope_size;
17690 }
17691
17692 Ok(())
17693 }
17694 }
17695
17696 impl SendMsgMeta {
17697 #[inline(always)]
17698 fn max_ordinal_present(&self) -> u64 {
17699 if let Some(_) = self.control {
17700 return 2;
17701 }
17702 if let Some(_) = self.to {
17703 return 1;
17704 }
17705 0
17706 }
17707 }
17708
17709 impl fidl::encoding::ValueTypeMarker for SendMsgMeta {
17710 type Borrowed<'a> = &'a Self;
17711 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17712 value
17713 }
17714 }
17715
17716 unsafe impl fidl::encoding::TypeMarker for SendMsgMeta {
17717 type Owned = Self;
17718
17719 #[inline(always)]
17720 fn inline_align(_context: fidl::encoding::Context) -> usize {
17721 8
17722 }
17723
17724 #[inline(always)]
17725 fn inline_size(_context: fidl::encoding::Context) -> usize {
17726 16
17727 }
17728 }
17729
17730 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SendMsgMeta, D>
17731 for &SendMsgMeta
17732 {
17733 unsafe fn encode(
17734 self,
17735 encoder: &mut fidl::encoding::Encoder<'_, D>,
17736 offset: usize,
17737 mut depth: fidl::encoding::Depth,
17738 ) -> fidl::Result<()> {
17739 encoder.debug_check_bounds::<SendMsgMeta>(offset);
17740 let max_ordinal: u64 = self.max_ordinal_present();
17742 encoder.write_num(max_ordinal, offset);
17743 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17744 if max_ordinal == 0 {
17746 return Ok(());
17747 }
17748 depth.increment()?;
17749 let envelope_size = 8;
17750 let bytes_len = max_ordinal as usize * envelope_size;
17751 #[allow(unused_variables)]
17752 let offset = encoder.out_of_line_offset(bytes_len);
17753 let mut _prev_end_offset: usize = 0;
17754 if 1 > max_ordinal {
17755 return Ok(());
17756 }
17757
17758 let cur_offset: usize = (1 - 1) * envelope_size;
17761
17762 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17764
17765 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::SocketAddress, D>(
17770 self.to.as_ref().map(
17771 <fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow,
17772 ),
17773 encoder,
17774 offset + cur_offset,
17775 depth,
17776 )?;
17777
17778 _prev_end_offset = cur_offset + envelope_size;
17779 if 2 > max_ordinal {
17780 return Ok(());
17781 }
17782
17783 let cur_offset: usize = (2 - 1) * envelope_size;
17786
17787 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17789
17790 fidl::encoding::encode_in_envelope_optional::<DatagramSocketSendControlData, D>(
17795 self.control.as_ref().map(
17796 <DatagramSocketSendControlData as fidl::encoding::ValueTypeMarker>::borrow,
17797 ),
17798 encoder,
17799 offset + cur_offset,
17800 depth,
17801 )?;
17802
17803 _prev_end_offset = cur_offset + envelope_size;
17804
17805 Ok(())
17806 }
17807 }
17808
17809 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SendMsgMeta {
17810 #[inline(always)]
17811 fn new_empty() -> Self {
17812 Self::default()
17813 }
17814
17815 unsafe fn decode(
17816 &mut self,
17817 decoder: &mut fidl::encoding::Decoder<'_, D>,
17818 offset: usize,
17819 mut depth: fidl::encoding::Depth,
17820 ) -> fidl::Result<()> {
17821 decoder.debug_check_bounds::<Self>(offset);
17822 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17823 None => return Err(fidl::Error::NotNullable),
17824 Some(len) => len,
17825 };
17826 if len == 0 {
17828 return Ok(());
17829 };
17830 depth.increment()?;
17831 let envelope_size = 8;
17832 let bytes_len = len * envelope_size;
17833 let offset = decoder.out_of_line_offset(bytes_len)?;
17834 let mut _next_ordinal_to_read = 0;
17836 let mut next_offset = offset;
17837 let end_offset = offset + bytes_len;
17838 _next_ordinal_to_read += 1;
17839 if next_offset >= end_offset {
17840 return Ok(());
17841 }
17842
17843 while _next_ordinal_to_read < 1 {
17845 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17846 _next_ordinal_to_read += 1;
17847 next_offset += envelope_size;
17848 }
17849
17850 let next_out_of_line = decoder.next_out_of_line();
17851 let handles_before = decoder.remaining_handles();
17852 if let Some((inlined, num_bytes, num_handles)) =
17853 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17854 {
17855 let member_inline_size =
17856 <fidl_fuchsia_net::SocketAddress as fidl::encoding::TypeMarker>::inline_size(
17857 decoder.context,
17858 );
17859 if inlined != (member_inline_size <= 4) {
17860 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17861 }
17862 let inner_offset;
17863 let mut inner_depth = depth.clone();
17864 if inlined {
17865 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17866 inner_offset = next_offset;
17867 } else {
17868 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17869 inner_depth.increment()?;
17870 }
17871 let val_ref = self
17872 .to
17873 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D));
17874 fidl::decode!(
17875 fidl_fuchsia_net::SocketAddress,
17876 D,
17877 val_ref,
17878 decoder,
17879 inner_offset,
17880 inner_depth
17881 )?;
17882 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17883 {
17884 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17885 }
17886 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17887 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17888 }
17889 }
17890
17891 next_offset += envelope_size;
17892 _next_ordinal_to_read += 1;
17893 if next_offset >= end_offset {
17894 return Ok(());
17895 }
17896
17897 while _next_ordinal_to_read < 2 {
17899 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17900 _next_ordinal_to_read += 1;
17901 next_offset += envelope_size;
17902 }
17903
17904 let next_out_of_line = decoder.next_out_of_line();
17905 let handles_before = decoder.remaining_handles();
17906 if let Some((inlined, num_bytes, num_handles)) =
17907 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17908 {
17909 let member_inline_size =
17910 <DatagramSocketSendControlData as fidl::encoding::TypeMarker>::inline_size(
17911 decoder.context,
17912 );
17913 if inlined != (member_inline_size <= 4) {
17914 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17915 }
17916 let inner_offset;
17917 let mut inner_depth = depth.clone();
17918 if inlined {
17919 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17920 inner_offset = next_offset;
17921 } else {
17922 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17923 inner_depth.increment()?;
17924 }
17925 let val_ref = self
17926 .control
17927 .get_or_insert_with(|| fidl::new_empty!(DatagramSocketSendControlData, D));
17928 fidl::decode!(
17929 DatagramSocketSendControlData,
17930 D,
17931 val_ref,
17932 decoder,
17933 inner_offset,
17934 inner_depth
17935 )?;
17936 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17937 {
17938 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17939 }
17940 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17941 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17942 }
17943 }
17944
17945 next_offset += envelope_size;
17946
17947 while next_offset < end_offset {
17949 _next_ordinal_to_read += 1;
17950 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17951 next_offset += envelope_size;
17952 }
17953
17954 Ok(())
17955 }
17956 }
17957
17958 impl SocketCreationOptions {
17959 #[inline(always)]
17960 fn max_ordinal_present(&self) -> u64 {
17961 if let Some(_) = self.marks {
17962 return 1;
17963 }
17964 0
17965 }
17966 }
17967
17968 impl fidl::encoding::ValueTypeMarker for SocketCreationOptions {
17969 type Borrowed<'a> = &'a Self;
17970 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17971 value
17972 }
17973 }
17974
17975 unsafe impl fidl::encoding::TypeMarker for SocketCreationOptions {
17976 type Owned = Self;
17977
17978 #[inline(always)]
17979 fn inline_align(_context: fidl::encoding::Context) -> usize {
17980 8
17981 }
17982
17983 #[inline(always)]
17984 fn inline_size(_context: fidl::encoding::Context) -> usize {
17985 16
17986 }
17987 }
17988
17989 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketCreationOptions, D>
17990 for &SocketCreationOptions
17991 {
17992 unsafe fn encode(
17993 self,
17994 encoder: &mut fidl::encoding::Encoder<'_, D>,
17995 offset: usize,
17996 mut depth: fidl::encoding::Depth,
17997 ) -> fidl::Result<()> {
17998 encoder.debug_check_bounds::<SocketCreationOptions>(offset);
17999 let max_ordinal: u64 = self.max_ordinal_present();
18001 encoder.write_num(max_ordinal, offset);
18002 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18003 if max_ordinal == 0 {
18005 return Ok(());
18006 }
18007 depth.increment()?;
18008 let envelope_size = 8;
18009 let bytes_len = max_ordinal as usize * envelope_size;
18010 #[allow(unused_variables)]
18011 let offset = encoder.out_of_line_offset(bytes_len);
18012 let mut _prev_end_offset: usize = 0;
18013 if 1 > max_ordinal {
18014 return Ok(());
18015 }
18016
18017 let cur_offset: usize = (1 - 1) * envelope_size;
18020
18021 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18023
18024 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::Marks, D>(
18029 self.marks
18030 .as_ref()
18031 .map(<fidl_fuchsia_net::Marks as fidl::encoding::ValueTypeMarker>::borrow),
18032 encoder,
18033 offset + cur_offset,
18034 depth,
18035 )?;
18036
18037 _prev_end_offset = cur_offset + envelope_size;
18038
18039 Ok(())
18040 }
18041 }
18042
18043 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketCreationOptions {
18044 #[inline(always)]
18045 fn new_empty() -> Self {
18046 Self::default()
18047 }
18048
18049 unsafe fn decode(
18050 &mut self,
18051 decoder: &mut fidl::encoding::Decoder<'_, D>,
18052 offset: usize,
18053 mut depth: fidl::encoding::Depth,
18054 ) -> fidl::Result<()> {
18055 decoder.debug_check_bounds::<Self>(offset);
18056 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18057 None => return Err(fidl::Error::NotNullable),
18058 Some(len) => len,
18059 };
18060 if len == 0 {
18062 return Ok(());
18063 };
18064 depth.increment()?;
18065 let envelope_size = 8;
18066 let bytes_len = len * envelope_size;
18067 let offset = decoder.out_of_line_offset(bytes_len)?;
18068 let mut _next_ordinal_to_read = 0;
18070 let mut next_offset = offset;
18071 let end_offset = offset + bytes_len;
18072 _next_ordinal_to_read += 1;
18073 if next_offset >= end_offset {
18074 return Ok(());
18075 }
18076
18077 while _next_ordinal_to_read < 1 {
18079 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18080 _next_ordinal_to_read += 1;
18081 next_offset += envelope_size;
18082 }
18083
18084 let next_out_of_line = decoder.next_out_of_line();
18085 let handles_before = decoder.remaining_handles();
18086 if let Some((inlined, num_bytes, num_handles)) =
18087 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18088 {
18089 let member_inline_size =
18090 <fidl_fuchsia_net::Marks as fidl::encoding::TypeMarker>::inline_size(
18091 decoder.context,
18092 );
18093 if inlined != (member_inline_size <= 4) {
18094 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18095 }
18096 let inner_offset;
18097 let mut inner_depth = depth.clone();
18098 if inlined {
18099 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18100 inner_offset = next_offset;
18101 } else {
18102 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18103 inner_depth.increment()?;
18104 }
18105 let val_ref =
18106 self.marks.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::Marks, D));
18107 fidl::decode!(
18108 fidl_fuchsia_net::Marks,
18109 D,
18110 val_ref,
18111 decoder,
18112 inner_offset,
18113 inner_depth
18114 )?;
18115 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18116 {
18117 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18118 }
18119 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18120 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18121 }
18122 }
18123
18124 next_offset += envelope_size;
18125
18126 while next_offset < end_offset {
18128 _next_ordinal_to_read += 1;
18129 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18130 next_offset += envelope_size;
18131 }
18132
18133 Ok(())
18134 }
18135 }
18136
18137 impl SocketRecvControlData {
18138 #[inline(always)]
18139 fn max_ordinal_present(&self) -> u64 {
18140 if let Some(_) = self.timestamp {
18141 return 3;
18142 }
18143 0
18144 }
18145 }
18146
18147 impl fidl::encoding::ValueTypeMarker for SocketRecvControlData {
18148 type Borrowed<'a> = &'a Self;
18149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18150 value
18151 }
18152 }
18153
18154 unsafe impl fidl::encoding::TypeMarker for SocketRecvControlData {
18155 type Owned = Self;
18156
18157 #[inline(always)]
18158 fn inline_align(_context: fidl::encoding::Context) -> usize {
18159 8
18160 }
18161
18162 #[inline(always)]
18163 fn inline_size(_context: fidl::encoding::Context) -> usize {
18164 16
18165 }
18166 }
18167
18168 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketRecvControlData, D>
18169 for &SocketRecvControlData
18170 {
18171 unsafe fn encode(
18172 self,
18173 encoder: &mut fidl::encoding::Encoder<'_, D>,
18174 offset: usize,
18175 mut depth: fidl::encoding::Depth,
18176 ) -> fidl::Result<()> {
18177 encoder.debug_check_bounds::<SocketRecvControlData>(offset);
18178 let max_ordinal: u64 = self.max_ordinal_present();
18180 encoder.write_num(max_ordinal, offset);
18181 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18182 if max_ordinal == 0 {
18184 return Ok(());
18185 }
18186 depth.increment()?;
18187 let envelope_size = 8;
18188 let bytes_len = max_ordinal as usize * envelope_size;
18189 #[allow(unused_variables)]
18190 let offset = encoder.out_of_line_offset(bytes_len);
18191 let mut _prev_end_offset: usize = 0;
18192 if 3 > max_ordinal {
18193 return Ok(());
18194 }
18195
18196 let cur_offset: usize = (3 - 1) * envelope_size;
18199
18200 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18202
18203 fidl::encoding::encode_in_envelope_optional::<Timestamp, D>(
18208 self.timestamp.as_ref().map(<Timestamp as fidl::encoding::ValueTypeMarker>::borrow),
18209 encoder,
18210 offset + cur_offset,
18211 depth,
18212 )?;
18213
18214 _prev_end_offset = cur_offset + envelope_size;
18215
18216 Ok(())
18217 }
18218 }
18219
18220 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketRecvControlData {
18221 #[inline(always)]
18222 fn new_empty() -> Self {
18223 Self::default()
18224 }
18225
18226 unsafe fn decode(
18227 &mut self,
18228 decoder: &mut fidl::encoding::Decoder<'_, D>,
18229 offset: usize,
18230 mut depth: fidl::encoding::Depth,
18231 ) -> fidl::Result<()> {
18232 decoder.debug_check_bounds::<Self>(offset);
18233 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18234 None => return Err(fidl::Error::NotNullable),
18235 Some(len) => len,
18236 };
18237 if len == 0 {
18239 return Ok(());
18240 };
18241 depth.increment()?;
18242 let envelope_size = 8;
18243 let bytes_len = len * envelope_size;
18244 let offset = decoder.out_of_line_offset(bytes_len)?;
18245 let mut _next_ordinal_to_read = 0;
18247 let mut next_offset = offset;
18248 let end_offset = offset + bytes_len;
18249 _next_ordinal_to_read += 1;
18250 if next_offset >= end_offset {
18251 return Ok(());
18252 }
18253
18254 while _next_ordinal_to_read < 3 {
18256 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18257 _next_ordinal_to_read += 1;
18258 next_offset += envelope_size;
18259 }
18260
18261 let next_out_of_line = decoder.next_out_of_line();
18262 let handles_before = decoder.remaining_handles();
18263 if let Some((inlined, num_bytes, num_handles)) =
18264 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18265 {
18266 let member_inline_size =
18267 <Timestamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18268 if inlined != (member_inline_size <= 4) {
18269 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18270 }
18271 let inner_offset;
18272 let mut inner_depth = depth.clone();
18273 if inlined {
18274 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18275 inner_offset = next_offset;
18276 } else {
18277 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18278 inner_depth.increment()?;
18279 }
18280 let val_ref = self.timestamp.get_or_insert_with(|| fidl::new_empty!(Timestamp, D));
18281 fidl::decode!(Timestamp, D, val_ref, decoder, inner_offset, inner_depth)?;
18282 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18283 {
18284 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18285 }
18286 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18287 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18288 }
18289 }
18290
18291 next_offset += envelope_size;
18292
18293 while next_offset < end_offset {
18295 _next_ordinal_to_read += 1;
18296 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18297 next_offset += envelope_size;
18298 }
18299
18300 Ok(())
18301 }
18302 }
18303
18304 impl SocketSendControlData {
18305 #[inline(always)]
18306 fn max_ordinal_present(&self) -> u64 {
18307 0
18308 }
18309 }
18310
18311 impl fidl::encoding::ValueTypeMarker for SocketSendControlData {
18312 type Borrowed<'a> = &'a Self;
18313 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18314 value
18315 }
18316 }
18317
18318 unsafe impl fidl::encoding::TypeMarker for SocketSendControlData {
18319 type Owned = Self;
18320
18321 #[inline(always)]
18322 fn inline_align(_context: fidl::encoding::Context) -> usize {
18323 8
18324 }
18325
18326 #[inline(always)]
18327 fn inline_size(_context: fidl::encoding::Context) -> usize {
18328 16
18329 }
18330 }
18331
18332 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketSendControlData, D>
18333 for &SocketSendControlData
18334 {
18335 unsafe fn encode(
18336 self,
18337 encoder: &mut fidl::encoding::Encoder<'_, D>,
18338 offset: usize,
18339 mut depth: fidl::encoding::Depth,
18340 ) -> fidl::Result<()> {
18341 encoder.debug_check_bounds::<SocketSendControlData>(offset);
18342 let max_ordinal: u64 = self.max_ordinal_present();
18344 encoder.write_num(max_ordinal, offset);
18345 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18346 if max_ordinal == 0 {
18348 return Ok(());
18349 }
18350 depth.increment()?;
18351 let envelope_size = 8;
18352 let bytes_len = max_ordinal as usize * envelope_size;
18353 #[allow(unused_variables)]
18354 let offset = encoder.out_of_line_offset(bytes_len);
18355 let mut _prev_end_offset: usize = 0;
18356
18357 Ok(())
18358 }
18359 }
18360
18361 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketSendControlData {
18362 #[inline(always)]
18363 fn new_empty() -> Self {
18364 Self::default()
18365 }
18366
18367 unsafe fn decode(
18368 &mut self,
18369 decoder: &mut fidl::encoding::Decoder<'_, D>,
18370 offset: usize,
18371 mut depth: fidl::encoding::Depth,
18372 ) -> fidl::Result<()> {
18373 decoder.debug_check_bounds::<Self>(offset);
18374 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18375 None => return Err(fidl::Error::NotNullable),
18376 Some(len) => len,
18377 };
18378 if len == 0 {
18380 return Ok(());
18381 };
18382 depth.increment()?;
18383 let envelope_size = 8;
18384 let bytes_len = len * envelope_size;
18385 let offset = decoder.out_of_line_offset(bytes_len)?;
18386 let mut _next_ordinal_to_read = 0;
18388 let mut next_offset = offset;
18389 let end_offset = offset + bytes_len;
18390
18391 while next_offset < end_offset {
18393 _next_ordinal_to_read += 1;
18394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18395 next_offset += envelope_size;
18396 }
18397
18398 Ok(())
18399 }
18400 }
18401
18402 impl TcpInfo {
18403 #[inline(always)]
18404 fn max_ordinal_present(&self) -> u64 {
18405 if let Some(_) = self.reorder_seen {
18406 return 54;
18407 }
18408 if let Some(_) = self.snd_cwnd {
18409 return 29;
18410 }
18411 if let Some(_) = self.snd_ssthresh {
18412 return 28;
18413 }
18414 if let Some(_) = self.rtt_var_usec {
18415 return 27;
18416 }
18417 if let Some(_) = self.rtt_usec {
18418 return 26;
18419 }
18420 if let Some(_) = self.rto_usec {
18421 return 11;
18422 }
18423 if let Some(_) = self.ca_state {
18424 return 2;
18425 }
18426 if let Some(_) = self.state {
18427 return 1;
18428 }
18429 0
18430 }
18431 }
18432
18433 impl fidl::encoding::ValueTypeMarker for TcpInfo {
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 TcpInfo {
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<TcpInfo, D> for &TcpInfo {
18455 unsafe fn encode(
18456 self,
18457 encoder: &mut fidl::encoding::Encoder<'_, D>,
18458 offset: usize,
18459 mut depth: fidl::encoding::Depth,
18460 ) -> fidl::Result<()> {
18461 encoder.debug_check_bounds::<TcpInfo>(offset);
18462 let max_ordinal: u64 = self.max_ordinal_present();
18464 encoder.write_num(max_ordinal, offset);
18465 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18466 if max_ordinal == 0 {
18468 return Ok(());
18469 }
18470 depth.increment()?;
18471 let envelope_size = 8;
18472 let bytes_len = max_ordinal as usize * envelope_size;
18473 #[allow(unused_variables)]
18474 let offset = encoder.out_of_line_offset(bytes_len);
18475 let mut _prev_end_offset: usize = 0;
18476 if 1 > max_ordinal {
18477 return Ok(());
18478 }
18479
18480 let cur_offset: usize = (1 - 1) * envelope_size;
18483
18484 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18486
18487 fidl::encoding::encode_in_envelope_optional::<TcpState, D>(
18492 self.state.as_ref().map(<TcpState as fidl::encoding::ValueTypeMarker>::borrow),
18493 encoder,
18494 offset + cur_offset,
18495 depth,
18496 )?;
18497
18498 _prev_end_offset = cur_offset + envelope_size;
18499 if 2 > max_ordinal {
18500 return Ok(());
18501 }
18502
18503 let cur_offset: usize = (2 - 1) * envelope_size;
18506
18507 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18509
18510 fidl::encoding::encode_in_envelope_optional::<TcpCongestionControlState, D>(
18515 self.ca_state
18516 .as_ref()
18517 .map(<TcpCongestionControlState as fidl::encoding::ValueTypeMarker>::borrow),
18518 encoder,
18519 offset + cur_offset,
18520 depth,
18521 )?;
18522
18523 _prev_end_offset = cur_offset + envelope_size;
18524 if 11 > max_ordinal {
18525 return Ok(());
18526 }
18527
18528 let cur_offset: usize = (11 - 1) * envelope_size;
18531
18532 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18534
18535 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18540 self.rto_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18541 encoder,
18542 offset + cur_offset,
18543 depth,
18544 )?;
18545
18546 _prev_end_offset = cur_offset + envelope_size;
18547 if 26 > max_ordinal {
18548 return Ok(());
18549 }
18550
18551 let cur_offset: usize = (26 - 1) * envelope_size;
18554
18555 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18557
18558 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18563 self.rtt_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18564 encoder,
18565 offset + cur_offset,
18566 depth,
18567 )?;
18568
18569 _prev_end_offset = cur_offset + envelope_size;
18570 if 27 > max_ordinal {
18571 return Ok(());
18572 }
18573
18574 let cur_offset: usize = (27 - 1) * envelope_size;
18577
18578 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18580
18581 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18586 self.rtt_var_usec.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18587 encoder,
18588 offset + cur_offset,
18589 depth,
18590 )?;
18591
18592 _prev_end_offset = cur_offset + envelope_size;
18593 if 28 > max_ordinal {
18594 return Ok(());
18595 }
18596
18597 let cur_offset: usize = (28 - 1) * envelope_size;
18600
18601 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18603
18604 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18609 self.snd_ssthresh.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18610 encoder,
18611 offset + cur_offset,
18612 depth,
18613 )?;
18614
18615 _prev_end_offset = cur_offset + envelope_size;
18616 if 29 > max_ordinal {
18617 return Ok(());
18618 }
18619
18620 let cur_offset: usize = (29 - 1) * envelope_size;
18623
18624 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18626
18627 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18632 self.snd_cwnd.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18633 encoder,
18634 offset + cur_offset,
18635 depth,
18636 )?;
18637
18638 _prev_end_offset = cur_offset + envelope_size;
18639 if 54 > max_ordinal {
18640 return Ok(());
18641 }
18642
18643 let cur_offset: usize = (54 - 1) * envelope_size;
18646
18647 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18649
18650 fidl::encoding::encode_in_envelope_optional::<bool, D>(
18655 self.reorder_seen.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
18656 encoder,
18657 offset + cur_offset,
18658 depth,
18659 )?;
18660
18661 _prev_end_offset = cur_offset + envelope_size;
18662
18663 Ok(())
18664 }
18665 }
18666
18667 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TcpInfo {
18668 #[inline(always)]
18669 fn new_empty() -> Self {
18670 Self::default()
18671 }
18672
18673 unsafe fn decode(
18674 &mut self,
18675 decoder: &mut fidl::encoding::Decoder<'_, D>,
18676 offset: usize,
18677 mut depth: fidl::encoding::Depth,
18678 ) -> fidl::Result<()> {
18679 decoder.debug_check_bounds::<Self>(offset);
18680 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18681 None => return Err(fidl::Error::NotNullable),
18682 Some(len) => len,
18683 };
18684 if len == 0 {
18686 return Ok(());
18687 };
18688 depth.increment()?;
18689 let envelope_size = 8;
18690 let bytes_len = len * envelope_size;
18691 let offset = decoder.out_of_line_offset(bytes_len)?;
18692 let mut _next_ordinal_to_read = 0;
18694 let mut next_offset = offset;
18695 let end_offset = offset + bytes_len;
18696 _next_ordinal_to_read += 1;
18697 if next_offset >= end_offset {
18698 return Ok(());
18699 }
18700
18701 while _next_ordinal_to_read < 1 {
18703 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18704 _next_ordinal_to_read += 1;
18705 next_offset += envelope_size;
18706 }
18707
18708 let next_out_of_line = decoder.next_out_of_line();
18709 let handles_before = decoder.remaining_handles();
18710 if let Some((inlined, num_bytes, num_handles)) =
18711 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18712 {
18713 let member_inline_size =
18714 <TcpState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18715 if inlined != (member_inline_size <= 4) {
18716 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18717 }
18718 let inner_offset;
18719 let mut inner_depth = depth.clone();
18720 if inlined {
18721 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18722 inner_offset = next_offset;
18723 } else {
18724 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18725 inner_depth.increment()?;
18726 }
18727 let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(TcpState, D));
18728 fidl::decode!(TcpState, D, val_ref, decoder, inner_offset, inner_depth)?;
18729 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18730 {
18731 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18732 }
18733 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18734 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18735 }
18736 }
18737
18738 next_offset += envelope_size;
18739 _next_ordinal_to_read += 1;
18740 if next_offset >= end_offset {
18741 return Ok(());
18742 }
18743
18744 while _next_ordinal_to_read < 2 {
18746 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18747 _next_ordinal_to_read += 1;
18748 next_offset += envelope_size;
18749 }
18750
18751 let next_out_of_line = decoder.next_out_of_line();
18752 let handles_before = decoder.remaining_handles();
18753 if let Some((inlined, num_bytes, num_handles)) =
18754 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18755 {
18756 let member_inline_size =
18757 <TcpCongestionControlState as fidl::encoding::TypeMarker>::inline_size(
18758 decoder.context,
18759 );
18760 if inlined != (member_inline_size <= 4) {
18761 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18762 }
18763 let inner_offset;
18764 let mut inner_depth = depth.clone();
18765 if inlined {
18766 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18767 inner_offset = next_offset;
18768 } else {
18769 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18770 inner_depth.increment()?;
18771 }
18772 let val_ref = self
18773 .ca_state
18774 .get_or_insert_with(|| fidl::new_empty!(TcpCongestionControlState, D));
18775 fidl::decode!(
18776 TcpCongestionControlState,
18777 D,
18778 val_ref,
18779 decoder,
18780 inner_offset,
18781 inner_depth
18782 )?;
18783 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18784 {
18785 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18786 }
18787 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18788 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18789 }
18790 }
18791
18792 next_offset += envelope_size;
18793 _next_ordinal_to_read += 1;
18794 if next_offset >= end_offset {
18795 return Ok(());
18796 }
18797
18798 while _next_ordinal_to_read < 11 {
18800 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18801 _next_ordinal_to_read += 1;
18802 next_offset += envelope_size;
18803 }
18804
18805 let next_out_of_line = decoder.next_out_of_line();
18806 let handles_before = decoder.remaining_handles();
18807 if let Some((inlined, num_bytes, num_handles)) =
18808 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18809 {
18810 let member_inline_size =
18811 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18812 if inlined != (member_inline_size <= 4) {
18813 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18814 }
18815 let inner_offset;
18816 let mut inner_depth = depth.clone();
18817 if inlined {
18818 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18819 inner_offset = next_offset;
18820 } else {
18821 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18822 inner_depth.increment()?;
18823 }
18824 let val_ref = self.rto_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
18825 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18826 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18827 {
18828 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18829 }
18830 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18831 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18832 }
18833 }
18834
18835 next_offset += envelope_size;
18836 _next_ordinal_to_read += 1;
18837 if next_offset >= end_offset {
18838 return Ok(());
18839 }
18840
18841 while _next_ordinal_to_read < 26 {
18843 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18844 _next_ordinal_to_read += 1;
18845 next_offset += envelope_size;
18846 }
18847
18848 let next_out_of_line = decoder.next_out_of_line();
18849 let handles_before = decoder.remaining_handles();
18850 if let Some((inlined, num_bytes, num_handles)) =
18851 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18852 {
18853 let member_inline_size =
18854 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18855 if inlined != (member_inline_size <= 4) {
18856 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18857 }
18858 let inner_offset;
18859 let mut inner_depth = depth.clone();
18860 if inlined {
18861 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18862 inner_offset = next_offset;
18863 } else {
18864 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18865 inner_depth.increment()?;
18866 }
18867 let val_ref = self.rtt_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
18868 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18869 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18870 {
18871 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18872 }
18873 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18874 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18875 }
18876 }
18877
18878 next_offset += envelope_size;
18879 _next_ordinal_to_read += 1;
18880 if next_offset >= end_offset {
18881 return Ok(());
18882 }
18883
18884 while _next_ordinal_to_read < 27 {
18886 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18887 _next_ordinal_to_read += 1;
18888 next_offset += envelope_size;
18889 }
18890
18891 let next_out_of_line = decoder.next_out_of_line();
18892 let handles_before = decoder.remaining_handles();
18893 if let Some((inlined, num_bytes, num_handles)) =
18894 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18895 {
18896 let member_inline_size =
18897 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18898 if inlined != (member_inline_size <= 4) {
18899 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18900 }
18901 let inner_offset;
18902 let mut inner_depth = depth.clone();
18903 if inlined {
18904 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18905 inner_offset = next_offset;
18906 } else {
18907 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18908 inner_depth.increment()?;
18909 }
18910 let val_ref = self.rtt_var_usec.get_or_insert_with(|| fidl::new_empty!(u32, D));
18911 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18912 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18913 {
18914 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18915 }
18916 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18917 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18918 }
18919 }
18920
18921 next_offset += envelope_size;
18922 _next_ordinal_to_read += 1;
18923 if next_offset >= end_offset {
18924 return Ok(());
18925 }
18926
18927 while _next_ordinal_to_read < 28 {
18929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18930 _next_ordinal_to_read += 1;
18931 next_offset += envelope_size;
18932 }
18933
18934 let next_out_of_line = decoder.next_out_of_line();
18935 let handles_before = decoder.remaining_handles();
18936 if let Some((inlined, num_bytes, num_handles)) =
18937 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18938 {
18939 let member_inline_size =
18940 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18941 if inlined != (member_inline_size <= 4) {
18942 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18943 }
18944 let inner_offset;
18945 let mut inner_depth = depth.clone();
18946 if inlined {
18947 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18948 inner_offset = next_offset;
18949 } else {
18950 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18951 inner_depth.increment()?;
18952 }
18953 let val_ref = self.snd_ssthresh.get_or_insert_with(|| fidl::new_empty!(u32, D));
18954 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18955 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18956 {
18957 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18958 }
18959 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18960 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18961 }
18962 }
18963
18964 next_offset += envelope_size;
18965 _next_ordinal_to_read += 1;
18966 if next_offset >= end_offset {
18967 return Ok(());
18968 }
18969
18970 while _next_ordinal_to_read < 29 {
18972 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18973 _next_ordinal_to_read += 1;
18974 next_offset += envelope_size;
18975 }
18976
18977 let next_out_of_line = decoder.next_out_of_line();
18978 let handles_before = decoder.remaining_handles();
18979 if let Some((inlined, num_bytes, num_handles)) =
18980 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18981 {
18982 let member_inline_size =
18983 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18984 if inlined != (member_inline_size <= 4) {
18985 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18986 }
18987 let inner_offset;
18988 let mut inner_depth = depth.clone();
18989 if inlined {
18990 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18991 inner_offset = next_offset;
18992 } else {
18993 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18994 inner_depth.increment()?;
18995 }
18996 let val_ref = self.snd_cwnd.get_or_insert_with(|| fidl::new_empty!(u32, D));
18997 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18998 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18999 {
19000 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19001 }
19002 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19003 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19004 }
19005 }
19006
19007 next_offset += envelope_size;
19008 _next_ordinal_to_read += 1;
19009 if next_offset >= end_offset {
19010 return Ok(());
19011 }
19012
19013 while _next_ordinal_to_read < 54 {
19015 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19016 _next_ordinal_to_read += 1;
19017 next_offset += envelope_size;
19018 }
19019
19020 let next_out_of_line = decoder.next_out_of_line();
19021 let handles_before = decoder.remaining_handles();
19022 if let Some((inlined, num_bytes, num_handles)) =
19023 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19024 {
19025 let member_inline_size =
19026 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19027 if inlined != (member_inline_size <= 4) {
19028 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19029 }
19030 let inner_offset;
19031 let mut inner_depth = depth.clone();
19032 if inlined {
19033 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19034 inner_offset = next_offset;
19035 } else {
19036 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19037 inner_depth.increment()?;
19038 }
19039 let val_ref = self.reorder_seen.get_or_insert_with(|| fidl::new_empty!(bool, D));
19040 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
19041 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19042 {
19043 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19044 }
19045 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19046 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19047 }
19048 }
19049
19050 next_offset += envelope_size;
19051
19052 while next_offset < end_offset {
19054 _next_ordinal_to_read += 1;
19055 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19056 next_offset += envelope_size;
19057 }
19058
19059 Ok(())
19060 }
19061 }
19062
19063 impl fidl::encoding::ValueTypeMarker for OptionalUint32 {
19064 type Borrowed<'a> = &'a Self;
19065 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19066 value
19067 }
19068 }
19069
19070 unsafe impl fidl::encoding::TypeMarker for OptionalUint32 {
19071 type Owned = Self;
19072
19073 #[inline(always)]
19074 fn inline_align(_context: fidl::encoding::Context) -> usize {
19075 8
19076 }
19077
19078 #[inline(always)]
19079 fn inline_size(_context: fidl::encoding::Context) -> usize {
19080 16
19081 }
19082 }
19083
19084 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint32, D>
19085 for &OptionalUint32
19086 {
19087 #[inline]
19088 unsafe fn encode(
19089 self,
19090 encoder: &mut fidl::encoding::Encoder<'_, D>,
19091 offset: usize,
19092 _depth: fidl::encoding::Depth,
19093 ) -> fidl::Result<()> {
19094 encoder.debug_check_bounds::<OptionalUint32>(offset);
19095 encoder.write_num::<u64>(self.ordinal(), offset);
19096 match self {
19097 OptionalUint32::Value(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
19098 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
19099 encoder,
19100 offset + 8,
19101 _depth,
19102 ),
19103 OptionalUint32::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
19104 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
19105 encoder,
19106 offset + 8,
19107 _depth,
19108 ),
19109 }
19110 }
19111 }
19112
19113 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint32 {
19114 #[inline(always)]
19115 fn new_empty() -> Self {
19116 Self::Value(fidl::new_empty!(u32, D))
19117 }
19118
19119 #[inline]
19120 unsafe fn decode(
19121 &mut self,
19122 decoder: &mut fidl::encoding::Decoder<'_, D>,
19123 offset: usize,
19124 mut depth: fidl::encoding::Depth,
19125 ) -> fidl::Result<()> {
19126 decoder.debug_check_bounds::<Self>(offset);
19127 #[allow(unused_variables)]
19128 let next_out_of_line = decoder.next_out_of_line();
19129 let handles_before = decoder.remaining_handles();
19130 let (ordinal, inlined, num_bytes, num_handles) =
19131 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19132
19133 let member_inline_size = match ordinal {
19134 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19135 2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19136 _ => return Err(fidl::Error::UnknownUnionTag),
19137 };
19138
19139 if inlined != (member_inline_size <= 4) {
19140 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19141 }
19142 let _inner_offset;
19143 if inlined {
19144 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19145 _inner_offset = offset + 8;
19146 } else {
19147 depth.increment()?;
19148 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19149 }
19150 match ordinal {
19151 1 => {
19152 #[allow(irrefutable_let_patterns)]
19153 if let OptionalUint32::Value(_) = self {
19154 } else {
19156 *self = OptionalUint32::Value(fidl::new_empty!(u32, D));
19158 }
19159 #[allow(irrefutable_let_patterns)]
19160 if let OptionalUint32::Value(ref mut val) = self {
19161 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
19162 } else {
19163 unreachable!()
19164 }
19165 }
19166 2 => {
19167 #[allow(irrefutable_let_patterns)]
19168 if let OptionalUint32::Unset(_) = self {
19169 } else {
19171 *self = OptionalUint32::Unset(fidl::new_empty!(Empty, D));
19173 }
19174 #[allow(irrefutable_let_patterns)]
19175 if let OptionalUint32::Unset(ref mut val) = self {
19176 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
19177 } else {
19178 unreachable!()
19179 }
19180 }
19181 ordinal => panic!("unexpected ordinal {:?}", ordinal),
19182 }
19183 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19184 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19185 }
19186 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19187 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19188 }
19189 Ok(())
19190 }
19191 }
19192
19193 impl fidl::encoding::ValueTypeMarker for OptionalUint8 {
19194 type Borrowed<'a> = &'a Self;
19195 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19196 value
19197 }
19198 }
19199
19200 unsafe impl fidl::encoding::TypeMarker for OptionalUint8 {
19201 type Owned = Self;
19202
19203 #[inline(always)]
19204 fn inline_align(_context: fidl::encoding::Context) -> usize {
19205 8
19206 }
19207
19208 #[inline(always)]
19209 fn inline_size(_context: fidl::encoding::Context) -> usize {
19210 16
19211 }
19212 }
19213
19214 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionalUint8, D>
19215 for &OptionalUint8
19216 {
19217 #[inline]
19218 unsafe fn encode(
19219 self,
19220 encoder: &mut fidl::encoding::Encoder<'_, D>,
19221 offset: usize,
19222 _depth: fidl::encoding::Depth,
19223 ) -> fidl::Result<()> {
19224 encoder.debug_check_bounds::<OptionalUint8>(offset);
19225 encoder.write_num::<u64>(self.ordinal(), offset);
19226 match self {
19227 OptionalUint8::Value(ref val) => fidl::encoding::encode_in_envelope::<u8, D>(
19228 <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
19229 encoder,
19230 offset + 8,
19231 _depth,
19232 ),
19233 OptionalUint8::Unset(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
19234 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
19235 encoder,
19236 offset + 8,
19237 _depth,
19238 ),
19239 }
19240 }
19241 }
19242
19243 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionalUint8 {
19244 #[inline(always)]
19245 fn new_empty() -> Self {
19246 Self::Value(fidl::new_empty!(u8, D))
19247 }
19248
19249 #[inline]
19250 unsafe fn decode(
19251 &mut self,
19252 decoder: &mut fidl::encoding::Decoder<'_, D>,
19253 offset: usize,
19254 mut depth: fidl::encoding::Depth,
19255 ) -> fidl::Result<()> {
19256 decoder.debug_check_bounds::<Self>(offset);
19257 #[allow(unused_variables)]
19258 let next_out_of_line = decoder.next_out_of_line();
19259 let handles_before = decoder.remaining_handles();
19260 let (ordinal, inlined, num_bytes, num_handles) =
19261 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19262
19263 let member_inline_size = match ordinal {
19264 1 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19265 2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19266 _ => return Err(fidl::Error::UnknownUnionTag),
19267 };
19268
19269 if inlined != (member_inline_size <= 4) {
19270 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19271 }
19272 let _inner_offset;
19273 if inlined {
19274 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19275 _inner_offset = offset + 8;
19276 } else {
19277 depth.increment()?;
19278 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19279 }
19280 match ordinal {
19281 1 => {
19282 #[allow(irrefutable_let_patterns)]
19283 if let OptionalUint8::Value(_) = self {
19284 } else {
19286 *self = OptionalUint8::Value(fidl::new_empty!(u8, D));
19288 }
19289 #[allow(irrefutable_let_patterns)]
19290 if let OptionalUint8::Value(ref mut val) = self {
19291 fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
19292 } else {
19293 unreachable!()
19294 }
19295 }
19296 2 => {
19297 #[allow(irrefutable_let_patterns)]
19298 if let OptionalUint8::Unset(_) = self {
19299 } else {
19301 *self = OptionalUint8::Unset(fidl::new_empty!(Empty, D));
19303 }
19304 #[allow(irrefutable_let_patterns)]
19305 if let OptionalUint8::Unset(ref mut val) = self {
19306 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
19307 } else {
19308 unreachable!()
19309 }
19310 }
19311 ordinal => panic!("unexpected ordinal {:?}", ordinal),
19312 }
19313 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19314 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19315 }
19316 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19317 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19318 }
19319 Ok(())
19320 }
19321 }
19322}