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 type BasePortId = u8;
14
15pub const FRAME_FEATURES_RAW: u32 = 1;
20
21pub const MAX_ACCEL_FLAGS: u32 = 16;
30
31pub const MAX_DESCRIPTOR_CHAIN: u8 = 4;
33
34pub const MAX_FRAME_TYPES: u32 = 4;
36
37pub const MAX_PORTS: u8 = 32;
39
40pub const MAX_SESSION_NAME: u32 = 64;
42
43pub const MAX_STATUS_BUFFER: u32 = 50;
46
47bitflags! {
48 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
50 pub struct EthernetFeatures: u32 {
51 const RAW = 1;
56 const ETHERNET_II = 2;
58 const E_802_1_Q = 4;
60 const E_802_1_Q_IN_Q = 8;
64 const E_802_3_LLC_SNAP = 16;
66 }
67}
68
69impl EthernetFeatures {}
70
71bitflags! {
72 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
76 pub struct RxFlags: u32 {
77 const RX_ACCEL_0 = 1;
83 const RX_ACCEL_1 = 2;
84 const RX_ACCEL_2 = 4;
85 const RX_ACCEL_3 = 8;
86 const RX_ACCEL_4 = 16;
87 const RX_ACCEL_5 = 32;
88 const RX_ACCEL_6 = 64;
89 const RX_ACCEL_7 = 128;
90 const RX_ACCEL_8 = 256;
91 const RX_ACCEL_9 = 512;
92 const RX_ACCEL_10 = 1024;
93 const RX_ACCEL_11 = 2048;
94 const RX_ACCEL_12 = 4096;
95 const RX_ACCEL_13 = 8192;
96 const RX_ACCEL_14 = 16384;
97 const RX_ACCEL_15 = 32768;
98 const RX_OVERRUN = 536870912;
105 const RX_VALIDATION_ERROR = 1073741824;
114 const RX_ECHOED_TX = 2147483648;
118 }
119}
120
121impl RxFlags {}
122
123bitflags! {
124 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
126 pub struct SessionFlags: u16 {
127 const PRIMARY = 1;
137 const LISTEN_TX = 2;
145 const REPORT_INVALID_RX = 4;
156 const RECEIVE_RX_POWER_LEASES = 8;
161 }
162}
163
164impl SessionFlags {}
165
166bitflags! {
167 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
169 pub struct StatusFlags: u32 {
170 const ONLINE = 1;
173 }
174}
175
176impl StatusFlags {}
177
178bitflags! {
179 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
183 pub struct TxFlags: u32 {
184 const TX_ACCEL_0 = 1;
190 const TX_ACCEL_1 = 2;
191 const TX_ACCEL_2 = 4;
192 const TX_ACCEL_3 = 8;
193 const TX_ACCEL_4 = 16;
194 const TX_ACCEL_5 = 32;
195 const TX_ACCEL_6 = 64;
196 const TX_ACCEL_7 = 128;
197 const TX_ACCEL_8 = 256;
198 const TX_ACCEL_9 = 512;
199 const TX_ACCEL_10 = 1024;
200 const TX_ACCEL_11 = 2048;
201 const TX_ACCEL_12 = 4096;
202 const TX_ACCEL_13 = 8192;
203 const TX_ACCEL_14 = 16384;
204 const TX_ACCEL_15 = 32768;
205 }
206}
207
208impl TxFlags {
209 #[inline(always)]
210 pub fn from_bits_allow_unknown(bits: u32) -> Self {
211 Self::from_bits_retain(bits)
212 }
213
214 #[inline(always)]
215 pub fn has_unknown_bits(&self) -> bool {
216 self.get_unknown_bits() != 0
217 }
218
219 #[inline(always)]
220 pub fn get_unknown_bits(&self) -> u32 {
221 self.bits() & !Self::all().bits()
222 }
223}
224
225bitflags! {
226 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
230 pub struct TxReturnFlags: u32 {
231 const TX_RET_NOT_SUPPORTED = 1;
236 const TX_RET_OUT_OF_RESOURCES = 2;
240 const TX_RET_NOT_AVAILABLE = 4;
245 const TX_RET_ERROR = 2147483648;
246 }
247}
248
249impl TxReturnFlags {
250 #[inline(always)]
251 pub fn from_bits_allow_unknown(bits: u32) -> Self {
252 Self::from_bits_retain(bits)
253 }
254
255 #[inline(always)]
256 pub fn has_unknown_bits(&self) -> bool {
257 self.get_unknown_bits() != 0
258 }
259
260 #[inline(always)]
261 pub fn get_unknown_bits(&self) -> u32 {
262 self.bits() & !Self::all().bits()
263 }
264}
265
266#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
268pub enum FrameType {
269 Ethernet,
270 Ipv4,
271 Ipv6,
272 #[doc(hidden)]
273 __SourceBreaking {
274 unknown_ordinal: u8,
275 },
276}
277
278#[macro_export]
280macro_rules! FrameTypeUnknown {
281 () => {
282 _
283 };
284}
285
286impl FrameType {
287 #[inline]
288 pub fn from_primitive(prim: u8) -> Option<Self> {
289 match prim {
290 1 => Some(Self::Ethernet),
291 2 => Some(Self::Ipv4),
292 3 => Some(Self::Ipv6),
293 _ => None,
294 }
295 }
296
297 #[inline]
298 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
299 match prim {
300 1 => Self::Ethernet,
301 2 => Self::Ipv4,
302 3 => Self::Ipv6,
303 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
304 }
305 }
306
307 #[inline]
308 pub fn unknown() -> Self {
309 Self::__SourceBreaking { unknown_ordinal: 0xff }
310 }
311
312 #[inline]
313 pub const fn into_primitive(self) -> u8 {
314 match self {
315 Self::Ethernet => 1,
316 Self::Ipv4 => 2,
317 Self::Ipv6 => 3,
318 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
319 }
320 }
321
322 #[inline]
323 pub fn is_unknown(&self) -> bool {
324 match self {
325 Self::__SourceBreaking { unknown_ordinal: _ } => true,
326 _ => false,
327 }
328 }
329}
330
331#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
333#[repr(u32)]
334pub enum InfoType {
335 NoInfo = 0,
337}
338
339impl InfoType {
340 #[inline]
341 pub fn from_primitive(prim: u32) -> Option<Self> {
342 match prim {
343 0 => Some(Self::NoInfo),
344 _ => None,
345 }
346 }
347
348 #[inline]
349 pub const fn into_primitive(self) -> u32 {
350 self as u32
351 }
352}
353
354#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
356pub enum MacFilterMode {
357 MulticastFilter,
360 MulticastPromiscuous,
363 Promiscuous,
365 #[doc(hidden)]
366 __SourceBreaking { unknown_ordinal: u32 },
367}
368
369#[macro_export]
371macro_rules! MacFilterModeUnknown {
372 () => {
373 _
374 };
375}
376
377impl MacFilterMode {
378 #[inline]
379 pub fn from_primitive(prim: u32) -> Option<Self> {
380 match prim {
381 0 => Some(Self::MulticastFilter),
382 1 => Some(Self::MulticastPromiscuous),
383 2 => Some(Self::Promiscuous),
384 _ => None,
385 }
386 }
387
388 #[inline]
389 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
390 match prim {
391 0 => Self::MulticastFilter,
392 1 => Self::MulticastPromiscuous,
393 2 => Self::Promiscuous,
394 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
395 }
396 }
397
398 #[inline]
399 pub fn unknown() -> Self {
400 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
401 }
402
403 #[inline]
404 pub const fn into_primitive(self) -> u32 {
405 match self {
406 Self::MulticastFilter => 0,
407 Self::MulticastPromiscuous => 1,
408 Self::Promiscuous => 2,
409 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
410 }
411 }
412
413 #[inline]
414 pub fn is_unknown(&self) -> bool {
415 match self {
416 Self::__SourceBreaking { unknown_ordinal: _ } => true,
417 _ => false,
418 }
419 }
420}
421
422#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
428pub enum PortClass {
429 Ethernet,
430 WlanClient,
431 Ppp,
432 Bridge,
433 WlanAp,
434 Virtual,
435 Lowpan,
436 #[doc(hidden)]
437 __SourceBreaking {
438 unknown_ordinal: u16,
439 },
440}
441
442#[macro_export]
444macro_rules! PortClassUnknown {
445 () => {
446 _
447 };
448}
449
450impl PortClass {
451 #[inline]
452 pub fn from_primitive(prim: u16) -> Option<Self> {
453 match prim {
454 1 => Some(Self::Ethernet),
455 2 => Some(Self::WlanClient),
456 3 => Some(Self::Ppp),
457 4 => Some(Self::Bridge),
458 5 => Some(Self::WlanAp),
459 6 => Some(Self::Virtual),
460 7 => Some(Self::Lowpan),
461 _ => None,
462 }
463 }
464
465 #[inline]
466 pub fn from_primitive_allow_unknown(prim: u16) -> Self {
467 match prim {
468 1 => Self::Ethernet,
469 2 => Self::WlanClient,
470 3 => Self::Ppp,
471 4 => Self::Bridge,
472 5 => Self::WlanAp,
473 6 => Self::Virtual,
474 7 => Self::Lowpan,
475 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
476 }
477 }
478
479 #[inline]
480 pub fn unknown() -> Self {
481 Self::__SourceBreaking { unknown_ordinal: 0xffff }
482 }
483
484 #[inline]
485 pub const fn into_primitive(self) -> u16 {
486 match self {
487 Self::Ethernet => 1,
488 Self::WlanClient => 2,
489 Self::Ppp => 3,
490 Self::Bridge => 4,
491 Self::WlanAp => 5,
492 Self::Virtual => 6,
493 Self::Lowpan => 7,
494 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
495 }
496 }
497
498 #[inline]
499 pub fn is_unknown(&self) -> bool {
500 match self {
501 Self::__SourceBreaking { unknown_ordinal: _ } => true,
502 _ => false,
503 }
504 }
505}
506
507#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
512pub enum RxAcceleration {
513 ValidatedEthernetFcs,
515 ValidatedIpv4Checksum,
517 ValidatedTcpChecksum,
519 ValidatedUdpChecksum,
521 #[doc(hidden)]
522 __SourceBreaking { unknown_ordinal: u8 },
523}
524
525#[macro_export]
527macro_rules! RxAccelerationUnknown {
528 () => {
529 _
530 };
531}
532
533impl RxAcceleration {
534 #[inline]
535 pub fn from_primitive(prim: u8) -> Option<Self> {
536 match prim {
537 0 => Some(Self::ValidatedEthernetFcs),
538 1 => Some(Self::ValidatedIpv4Checksum),
539 2 => Some(Self::ValidatedTcpChecksum),
540 3 => Some(Self::ValidatedUdpChecksum),
541 _ => None,
542 }
543 }
544
545 #[inline]
546 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
547 match prim {
548 0 => Self::ValidatedEthernetFcs,
549 1 => Self::ValidatedIpv4Checksum,
550 2 => Self::ValidatedTcpChecksum,
551 3 => Self::ValidatedUdpChecksum,
552 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
553 }
554 }
555
556 #[inline]
557 pub fn unknown() -> Self {
558 Self::__SourceBreaking { unknown_ordinal: 0xff }
559 }
560
561 #[inline]
562 pub const fn into_primitive(self) -> u8 {
563 match self {
564 Self::ValidatedEthernetFcs => 0,
565 Self::ValidatedIpv4Checksum => 1,
566 Self::ValidatedTcpChecksum => 2,
567 Self::ValidatedUdpChecksum => 3,
568 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
569 }
570 }
571
572 #[inline]
573 pub fn is_unknown(&self) -> bool {
574 match self {
575 Self::__SourceBreaking { unknown_ordinal: _ } => true,
576 _ => false,
577 }
578 }
579}
580
581#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
586pub enum TxAcceleration {
587 ComputeEthernetFcs,
590 ComputeIpv4Checksum,
593 ComputeTcpChecksum,
596 ComputeUdpChecksum,
599 #[doc(hidden)]
600 __SourceBreaking { unknown_ordinal: u8 },
601}
602
603#[macro_export]
605macro_rules! TxAccelerationUnknown {
606 () => {
607 _
608 };
609}
610
611impl TxAcceleration {
612 #[inline]
613 pub fn from_primitive(prim: u8) -> Option<Self> {
614 match prim {
615 0 => Some(Self::ComputeEthernetFcs),
616 1 => Some(Self::ComputeIpv4Checksum),
617 2 => Some(Self::ComputeTcpChecksum),
618 3 => Some(Self::ComputeUdpChecksum),
619 _ => None,
620 }
621 }
622
623 #[inline]
624 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
625 match prim {
626 0 => Self::ComputeEthernetFcs,
627 1 => Self::ComputeIpv4Checksum,
628 2 => Self::ComputeTcpChecksum,
629 3 => Self::ComputeUdpChecksum,
630 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
631 }
632 }
633
634 #[inline]
635 pub fn unknown() -> Self {
636 Self::__SourceBreaking { unknown_ordinal: 0xff }
637 }
638
639 #[inline]
640 pub const fn into_primitive(self) -> u8 {
641 match self {
642 Self::ComputeEthernetFcs => 0,
643 Self::ComputeIpv4Checksum => 1,
644 Self::ComputeTcpChecksum => 2,
645 Self::ComputeUdpChecksum => 3,
646 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
647 }
648 }
649
650 #[inline]
651 pub fn is_unknown(&self) -> bool {
652 match self {
653 Self::__SourceBreaking { unknown_ordinal: _ } => true,
654 _ => false,
655 }
656 }
657}
658
659#[derive(Clone, Debug, PartialEq)]
660pub struct DeviceGetInfoResponse {
661 pub info: DeviceInfo,
662}
663
664impl fidl::Persistable for DeviceGetInfoResponse {}
665
666#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
667pub struct Empty;
668
669impl fidl::Persistable for Empty {}
670
671#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
685pub struct FrameTypeSupport {
686 pub type_: FrameType,
688 pub features: u32,
690 pub supported_flags: TxFlags,
692}
693
694impl fidl::Persistable for FrameTypeSupport {}
695
696#[derive(Clone, Debug, PartialEq)]
697pub struct MacAddressingAddMulticastAddressRequest {
698 pub address: fidl_fuchsia_net__common::MacAddress,
699}
700
701impl fidl::Persistable for MacAddressingAddMulticastAddressRequest {}
702
703#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
704#[repr(C)]
705pub struct MacAddressingAddMulticastAddressResponse {
706 pub status: i32,
707}
708
709impl fidl::Persistable for MacAddressingAddMulticastAddressResponse {}
710
711#[derive(Clone, Debug, PartialEq)]
712pub struct MacAddressingGetUnicastAddressResponse {
713 pub address: fidl_fuchsia_net__common::MacAddress,
714}
715
716impl fidl::Persistable for MacAddressingGetUnicastAddressResponse {}
717
718#[derive(Clone, Debug, PartialEq)]
719pub struct MacAddressingRemoveMulticastAddressRequest {
720 pub address: fidl_fuchsia_net__common::MacAddress,
721}
722
723impl fidl::Persistable for MacAddressingRemoveMulticastAddressRequest {}
724
725#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
726#[repr(C)]
727pub struct MacAddressingRemoveMulticastAddressResponse {
728 pub status: i32,
729}
730
731impl fidl::Persistable for MacAddressingRemoveMulticastAddressResponse {}
732
733#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
734pub struct MacAddressingSetModeRequest {
735 pub mode: MacFilterMode,
736}
737
738impl fidl::Persistable for MacAddressingSetModeRequest {}
739
740#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
741#[repr(C)]
742pub struct MacAddressingSetModeResponse {
743 pub status: i32,
744}
745
746impl fidl::Persistable for MacAddressingSetModeResponse {}
747
748#[derive(Clone, Debug, PartialEq)]
749pub struct PortGetInfoResponse {
750 pub info: PortInfo,
751}
752
753impl fidl::Persistable for PortGetInfoResponse {}
754
755#[derive(Clone, Debug, PartialEq)]
756pub struct PortGetStatusResponse {
757 pub status: PortStatus,
758}
759
760impl fidl::Persistable for PortGetStatusResponse {}
761
762#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
764#[repr(C)]
765pub struct PortId {
766 pub base: u8,
770 pub salt: u8,
773}
774
775impl fidl::Persistable for PortId {}
776
777#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
778pub struct PortWatcherWatchResponse {
779 pub event: DevicePortEvent,
780}
781
782impl fidl::Persistable for PortWatcherWatchResponse {}
783
784#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
785pub struct SessionAttachRequest {
786 pub port: PortId,
787 pub rx_frames: Vec<FrameType>,
788}
789
790impl fidl::Persistable for SessionAttachRequest {}
791
792#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
793#[repr(C)]
794pub struct SessionDetachRequest {
795 pub port: PortId,
796}
797
798impl fidl::Persistable for SessionDetachRequest {}
799
800#[derive(Clone, Debug, PartialEq)]
801pub struct StatusWatcherWatchStatusResponse {
802 pub port_status: PortStatus,
803}
804
805impl fidl::Persistable for StatusWatcherWatchStatusResponse {}
806
807#[derive(Clone, Debug, Default, PartialEq)]
809pub struct DeviceBaseInfo {
810 pub rx_depth: Option<u16>,
815 pub tx_depth: Option<u16>,
820 pub buffer_alignment: Option<u32>,
826 pub max_buffer_length: Option<u32>,
830 pub min_rx_buffer_length: Option<u32>,
832 pub min_tx_buffer_length: Option<u32>,
840 pub min_tx_buffer_head: Option<u16>,
843 pub min_tx_buffer_tail: Option<u16>,
846 pub max_buffer_parts: Option<u8>,
848 pub rx_accel: Option<Vec<RxAcceleration>>,
856 pub tx_accel: Option<Vec<TxAcceleration>>,
864 #[doc(hidden)]
865 pub __source_breaking: fidl::marker::SourceBreaking,
866}
867
868impl fidl::Persistable for DeviceBaseInfo {}
869
870#[derive(Clone, Debug, Default, PartialEq)]
872pub struct DeviceInfo {
873 pub min_descriptor_length: Option<u8>,
880 pub descriptor_version: Option<u8>,
882 pub base_info: Option<DeviceBaseInfo>,
884 #[doc(hidden)]
885 pub __source_breaking: fidl::marker::SourceBreaking,
886}
887
888impl fidl::Persistable for DeviceInfo {}
889
890#[derive(Clone, Debug, Default, PartialEq)]
892pub struct PortBaseInfo {
893 pub port_class: Option<PortClass>,
895 pub rx_types: Option<Vec<FrameType>>,
900 pub tx_types: Option<Vec<FrameTypeSupport>>,
912 #[doc(hidden)]
913 pub __source_breaking: fidl::marker::SourceBreaking,
914}
915
916impl fidl::Persistable for PortBaseInfo {}
917
918#[derive(Clone, Debug, Default, PartialEq)]
919pub struct PortGetCountersResponse {
920 pub rx_frames: Option<u64>,
922 pub rx_bytes: Option<u64>,
924 pub tx_frames: Option<u64>,
926 pub tx_bytes: Option<u64>,
928 #[doc(hidden)]
929 pub __source_breaking: fidl::marker::SourceBreaking,
930}
931
932impl fidl::Persistable for PortGetCountersResponse {}
933
934#[derive(Clone, Debug, Default, PartialEq)]
936pub struct PortInfo {
937 pub id: Option<PortId>,
939 pub base_info: Option<PortBaseInfo>,
940 #[doc(hidden)]
941 pub __source_breaking: fidl::marker::SourceBreaking,
942}
943
944impl fidl::Persistable for PortInfo {}
945
946#[derive(Clone, Debug, Default, PartialEq)]
948pub struct PortStatus {
949 pub flags: Option<StatusFlags>,
951 pub mtu: Option<u32>,
956 #[doc(hidden)]
957 pub __source_breaking: fidl::marker::SourceBreaking,
958}
959
960impl fidl::Persistable for PortStatus {}
961
962#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
964pub enum DevicePortEvent {
965 Existing(PortId),
967 Added(PortId),
969 Removed(PortId),
971 Idle(Empty),
973}
974
975impl DevicePortEvent {
976 #[inline]
977 pub fn ordinal(&self) -> u64 {
978 match *self {
979 Self::Existing(_) => 1,
980 Self::Added(_) => 2,
981 Self::Removed(_) => 3,
982 Self::Idle(_) => 4,
983 }
984 }
985}
986
987impl fidl::Persistable for DevicePortEvent {}
988
989pub mod device_ordinals {
990 pub const GET_INFO: u64 = 0x3c500ca9341e8f56;
991 pub const OPEN_SESSION: u64 = 0x25940b82146dcf67;
992 pub const GET_PORT: u64 = 0x340a852c955ba2a6;
993 pub const GET_PORT_WATCHER: u64 = 0x104f43c937c39f0c;
994 pub const CLONE: u64 = 0x5882ea09b3809af4;
995}
996
997pub mod device_instance_ordinals {
998 pub const GET_DEVICE: u64 = 0x775270585575cef7;
999}
1000
1001pub mod diagnostics_ordinals {
1002 pub const LOG_DEBUG_INFO_TO_SYSLOG: u64 = 0x4222897dfe1f4b4a;
1003}
1004
1005pub mod mac_addressing_ordinals {
1006 pub const GET_UNICAST_ADDRESS: u64 = 0x2c60b82a4ecfaebe;
1007 pub const SET_MODE: u64 = 0x6297b8dbf03c58c;
1008 pub const ADD_MULTICAST_ADDRESS: u64 = 0xf5637ff11cf0c25;
1009 pub const REMOVE_MULTICAST_ADDRESS: u64 = 0x5dddf4e3ba4e2560;
1010}
1011
1012pub mod port_ordinals {
1013 pub const GET_INFO: u64 = 0x276cf65feb554ebd;
1014 pub const GET_STATUS: u64 = 0x4235650aacca60b2;
1015 pub const GET_STATUS_WATCHER: u64 = 0x65511ab81c1bd8d4;
1016 pub const GET_MAC: u64 = 0x2c6ec2988aefc0f6;
1017 pub const GET_DEVICE: u64 = 0x7de34747235d2d80;
1018 pub const CLONE: u64 = 0x4e4764150b4942d3;
1019 pub const GET_COUNTERS: u64 = 0x6a213b03c4fcbbac;
1020 pub const GET_DIAGNOSTICS: u64 = 0x381faa4ed75e399c;
1021 pub const GET_ID_EVENT: u64 = 0x2a466ceb0e9c0b06;
1022}
1023
1024pub mod port_watcher_ordinals {
1025 pub const WATCH: u64 = 0x3e87244b74fff55e;
1026}
1027
1028pub mod session_ordinals {
1029 pub const ATTACH: u64 = 0x1e89c9013e201379;
1030 pub const DETACH: u64 = 0x68c40cf8fb549867;
1031 pub const CLOSE: u64 = 0x393d5070394a92f6;
1032 pub const WATCH_DELEGATED_RX_LEASE: u64 = 0x764d823ee64803b5;
1033}
1034
1035pub mod status_watcher_ordinals {
1036 pub const WATCH_STATUS: u64 = 0x1369a8125c0862b9;
1037}
1038
1039mod internal {
1040 use super::*;
1041 unsafe impl fidl::encoding::TypeMarker for EthernetFeatures {
1042 type Owned = Self;
1043
1044 #[inline(always)]
1045 fn inline_align(_context: fidl::encoding::Context) -> usize {
1046 4
1047 }
1048
1049 #[inline(always)]
1050 fn inline_size(_context: fidl::encoding::Context) -> usize {
1051 4
1052 }
1053 }
1054
1055 impl fidl::encoding::ValueTypeMarker for EthernetFeatures {
1056 type Borrowed<'a> = Self;
1057 #[inline(always)]
1058 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1059 *value
1060 }
1061 }
1062
1063 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1064 for EthernetFeatures
1065 {
1066 #[inline]
1067 unsafe fn encode(
1068 self,
1069 encoder: &mut fidl::encoding::Encoder<'_, D>,
1070 offset: usize,
1071 _depth: fidl::encoding::Depth,
1072 ) -> fidl::Result<()> {
1073 encoder.debug_check_bounds::<Self>(offset);
1074 if self.bits() & Self::all().bits() != self.bits() {
1075 return Err(fidl::Error::InvalidBitsValue);
1076 }
1077 encoder.write_num(self.bits(), offset);
1078 Ok(())
1079 }
1080 }
1081
1082 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EthernetFeatures {
1083 #[inline(always)]
1084 fn new_empty() -> Self {
1085 Self::empty()
1086 }
1087
1088 #[inline]
1089 unsafe fn decode(
1090 &mut self,
1091 decoder: &mut fidl::encoding::Decoder<'_, D>,
1092 offset: usize,
1093 _depth: fidl::encoding::Depth,
1094 ) -> fidl::Result<()> {
1095 decoder.debug_check_bounds::<Self>(offset);
1096 let prim = decoder.read_num::<u32>(offset);
1097 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1098 Ok(())
1099 }
1100 }
1101 unsafe impl fidl::encoding::TypeMarker for RxFlags {
1102 type Owned = Self;
1103
1104 #[inline(always)]
1105 fn inline_align(_context: fidl::encoding::Context) -> usize {
1106 4
1107 }
1108
1109 #[inline(always)]
1110 fn inline_size(_context: fidl::encoding::Context) -> usize {
1111 4
1112 }
1113 }
1114
1115 impl fidl::encoding::ValueTypeMarker for RxFlags {
1116 type Borrowed<'a> = Self;
1117 #[inline(always)]
1118 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1119 *value
1120 }
1121 }
1122
1123 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RxFlags {
1124 #[inline]
1125 unsafe fn encode(
1126 self,
1127 encoder: &mut fidl::encoding::Encoder<'_, D>,
1128 offset: usize,
1129 _depth: fidl::encoding::Depth,
1130 ) -> fidl::Result<()> {
1131 encoder.debug_check_bounds::<Self>(offset);
1132 if self.bits() & Self::all().bits() != self.bits() {
1133 return Err(fidl::Error::InvalidBitsValue);
1134 }
1135 encoder.write_num(self.bits(), offset);
1136 Ok(())
1137 }
1138 }
1139
1140 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RxFlags {
1141 #[inline(always)]
1142 fn new_empty() -> Self {
1143 Self::empty()
1144 }
1145
1146 #[inline]
1147 unsafe fn decode(
1148 &mut self,
1149 decoder: &mut fidl::encoding::Decoder<'_, D>,
1150 offset: usize,
1151 _depth: fidl::encoding::Depth,
1152 ) -> fidl::Result<()> {
1153 decoder.debug_check_bounds::<Self>(offset);
1154 let prim = decoder.read_num::<u32>(offset);
1155 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1156 Ok(())
1157 }
1158 }
1159 unsafe impl fidl::encoding::TypeMarker for SessionFlags {
1160 type Owned = Self;
1161
1162 #[inline(always)]
1163 fn inline_align(_context: fidl::encoding::Context) -> usize {
1164 2
1165 }
1166
1167 #[inline(always)]
1168 fn inline_size(_context: fidl::encoding::Context) -> usize {
1169 2
1170 }
1171 }
1172
1173 impl fidl::encoding::ValueTypeMarker for SessionFlags {
1174 type Borrowed<'a> = Self;
1175 #[inline(always)]
1176 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1177 *value
1178 }
1179 }
1180
1181 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SessionFlags {
1182 #[inline]
1183 unsafe fn encode(
1184 self,
1185 encoder: &mut fidl::encoding::Encoder<'_, D>,
1186 offset: usize,
1187 _depth: fidl::encoding::Depth,
1188 ) -> fidl::Result<()> {
1189 encoder.debug_check_bounds::<Self>(offset);
1190 if self.bits() & Self::all().bits() != self.bits() {
1191 return Err(fidl::Error::InvalidBitsValue);
1192 }
1193 encoder.write_num(self.bits(), offset);
1194 Ok(())
1195 }
1196 }
1197
1198 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionFlags {
1199 #[inline(always)]
1200 fn new_empty() -> Self {
1201 Self::empty()
1202 }
1203
1204 #[inline]
1205 unsafe fn decode(
1206 &mut self,
1207 decoder: &mut fidl::encoding::Decoder<'_, D>,
1208 offset: usize,
1209 _depth: fidl::encoding::Depth,
1210 ) -> fidl::Result<()> {
1211 decoder.debug_check_bounds::<Self>(offset);
1212 let prim = decoder.read_num::<u16>(offset);
1213 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1214 Ok(())
1215 }
1216 }
1217 unsafe impl fidl::encoding::TypeMarker for StatusFlags {
1218 type Owned = Self;
1219
1220 #[inline(always)]
1221 fn inline_align(_context: fidl::encoding::Context) -> usize {
1222 4
1223 }
1224
1225 #[inline(always)]
1226 fn inline_size(_context: fidl::encoding::Context) -> usize {
1227 4
1228 }
1229 }
1230
1231 impl fidl::encoding::ValueTypeMarker for StatusFlags {
1232 type Borrowed<'a> = Self;
1233 #[inline(always)]
1234 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1235 *value
1236 }
1237 }
1238
1239 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StatusFlags {
1240 #[inline]
1241 unsafe fn encode(
1242 self,
1243 encoder: &mut fidl::encoding::Encoder<'_, D>,
1244 offset: usize,
1245 _depth: fidl::encoding::Depth,
1246 ) -> fidl::Result<()> {
1247 encoder.debug_check_bounds::<Self>(offset);
1248 if self.bits() & Self::all().bits() != self.bits() {
1249 return Err(fidl::Error::InvalidBitsValue);
1250 }
1251 encoder.write_num(self.bits(), offset);
1252 Ok(())
1253 }
1254 }
1255
1256 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StatusFlags {
1257 #[inline(always)]
1258 fn new_empty() -> Self {
1259 Self::empty()
1260 }
1261
1262 #[inline]
1263 unsafe fn decode(
1264 &mut self,
1265 decoder: &mut fidl::encoding::Decoder<'_, D>,
1266 offset: usize,
1267 _depth: fidl::encoding::Depth,
1268 ) -> fidl::Result<()> {
1269 decoder.debug_check_bounds::<Self>(offset);
1270 let prim = decoder.read_num::<u32>(offset);
1271 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1272 Ok(())
1273 }
1274 }
1275 unsafe impl fidl::encoding::TypeMarker for TxFlags {
1276 type Owned = Self;
1277
1278 #[inline(always)]
1279 fn inline_align(_context: fidl::encoding::Context) -> usize {
1280 4
1281 }
1282
1283 #[inline(always)]
1284 fn inline_size(_context: fidl::encoding::Context) -> usize {
1285 4
1286 }
1287 }
1288
1289 impl fidl::encoding::ValueTypeMarker for TxFlags {
1290 type Borrowed<'a> = Self;
1291 #[inline(always)]
1292 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1293 *value
1294 }
1295 }
1296
1297 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TxFlags {
1298 #[inline]
1299 unsafe fn encode(
1300 self,
1301 encoder: &mut fidl::encoding::Encoder<'_, D>,
1302 offset: usize,
1303 _depth: fidl::encoding::Depth,
1304 ) -> fidl::Result<()> {
1305 encoder.debug_check_bounds::<Self>(offset);
1306 encoder.write_num(self.bits(), offset);
1307 Ok(())
1308 }
1309 }
1310
1311 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxFlags {
1312 #[inline(always)]
1313 fn new_empty() -> Self {
1314 Self::empty()
1315 }
1316
1317 #[inline]
1318 unsafe fn decode(
1319 &mut self,
1320 decoder: &mut fidl::encoding::Decoder<'_, D>,
1321 offset: usize,
1322 _depth: fidl::encoding::Depth,
1323 ) -> fidl::Result<()> {
1324 decoder.debug_check_bounds::<Self>(offset);
1325 let prim = decoder.read_num::<u32>(offset);
1326 *self = Self::from_bits_allow_unknown(prim);
1327 Ok(())
1328 }
1329 }
1330 unsafe impl fidl::encoding::TypeMarker for TxReturnFlags {
1331 type Owned = Self;
1332
1333 #[inline(always)]
1334 fn inline_align(_context: fidl::encoding::Context) -> usize {
1335 4
1336 }
1337
1338 #[inline(always)]
1339 fn inline_size(_context: fidl::encoding::Context) -> usize {
1340 4
1341 }
1342 }
1343
1344 impl fidl::encoding::ValueTypeMarker for TxReturnFlags {
1345 type Borrowed<'a> = Self;
1346 #[inline(always)]
1347 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1348 *value
1349 }
1350 }
1351
1352 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TxReturnFlags {
1353 #[inline]
1354 unsafe fn encode(
1355 self,
1356 encoder: &mut fidl::encoding::Encoder<'_, D>,
1357 offset: usize,
1358 _depth: fidl::encoding::Depth,
1359 ) -> fidl::Result<()> {
1360 encoder.debug_check_bounds::<Self>(offset);
1361 encoder.write_num(self.bits(), offset);
1362 Ok(())
1363 }
1364 }
1365
1366 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxReturnFlags {
1367 #[inline(always)]
1368 fn new_empty() -> Self {
1369 Self::empty()
1370 }
1371
1372 #[inline]
1373 unsafe fn decode(
1374 &mut self,
1375 decoder: &mut fidl::encoding::Decoder<'_, D>,
1376 offset: usize,
1377 _depth: fidl::encoding::Depth,
1378 ) -> fidl::Result<()> {
1379 decoder.debug_check_bounds::<Self>(offset);
1380 let prim = decoder.read_num::<u32>(offset);
1381 *self = Self::from_bits_allow_unknown(prim);
1382 Ok(())
1383 }
1384 }
1385 unsafe impl fidl::encoding::TypeMarker for FrameType {
1386 type Owned = Self;
1387
1388 #[inline(always)]
1389 fn inline_align(_context: fidl::encoding::Context) -> usize {
1390 std::mem::align_of::<u8>()
1391 }
1392
1393 #[inline(always)]
1394 fn inline_size(_context: fidl::encoding::Context) -> usize {
1395 std::mem::size_of::<u8>()
1396 }
1397
1398 #[inline(always)]
1399 fn encode_is_copy() -> bool {
1400 false
1401 }
1402
1403 #[inline(always)]
1404 fn decode_is_copy() -> bool {
1405 false
1406 }
1407 }
1408
1409 impl fidl::encoding::ValueTypeMarker for FrameType {
1410 type Borrowed<'a> = Self;
1411 #[inline(always)]
1412 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1413 *value
1414 }
1415 }
1416
1417 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FrameType {
1418 #[inline]
1419 unsafe fn encode(
1420 self,
1421 encoder: &mut fidl::encoding::Encoder<'_, D>,
1422 offset: usize,
1423 _depth: fidl::encoding::Depth,
1424 ) -> fidl::Result<()> {
1425 encoder.debug_check_bounds::<Self>(offset);
1426 encoder.write_num(self.into_primitive(), offset);
1427 Ok(())
1428 }
1429 }
1430
1431 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FrameType {
1432 #[inline(always)]
1433 fn new_empty() -> Self {
1434 Self::unknown()
1435 }
1436
1437 #[inline]
1438 unsafe fn decode(
1439 &mut self,
1440 decoder: &mut fidl::encoding::Decoder<'_, D>,
1441 offset: usize,
1442 _depth: fidl::encoding::Depth,
1443 ) -> fidl::Result<()> {
1444 decoder.debug_check_bounds::<Self>(offset);
1445 let prim = decoder.read_num::<u8>(offset);
1446
1447 *self = Self::from_primitive_allow_unknown(prim);
1448 Ok(())
1449 }
1450 }
1451 unsafe impl fidl::encoding::TypeMarker for InfoType {
1452 type Owned = Self;
1453
1454 #[inline(always)]
1455 fn inline_align(_context: fidl::encoding::Context) -> usize {
1456 std::mem::align_of::<u32>()
1457 }
1458
1459 #[inline(always)]
1460 fn inline_size(_context: fidl::encoding::Context) -> usize {
1461 std::mem::size_of::<u32>()
1462 }
1463
1464 #[inline(always)]
1465 fn encode_is_copy() -> bool {
1466 true
1467 }
1468
1469 #[inline(always)]
1470 fn decode_is_copy() -> bool {
1471 false
1472 }
1473 }
1474
1475 impl fidl::encoding::ValueTypeMarker for InfoType {
1476 type Borrowed<'a> = Self;
1477 #[inline(always)]
1478 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1479 *value
1480 }
1481 }
1482
1483 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for InfoType {
1484 #[inline]
1485 unsafe fn encode(
1486 self,
1487 encoder: &mut fidl::encoding::Encoder<'_, D>,
1488 offset: usize,
1489 _depth: fidl::encoding::Depth,
1490 ) -> fidl::Result<()> {
1491 encoder.debug_check_bounds::<Self>(offset);
1492 encoder.write_num(self.into_primitive(), offset);
1493 Ok(())
1494 }
1495 }
1496
1497 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InfoType {
1498 #[inline(always)]
1499 fn new_empty() -> Self {
1500 Self::NoInfo
1501 }
1502
1503 #[inline]
1504 unsafe fn decode(
1505 &mut self,
1506 decoder: &mut fidl::encoding::Decoder<'_, D>,
1507 offset: usize,
1508 _depth: fidl::encoding::Depth,
1509 ) -> fidl::Result<()> {
1510 decoder.debug_check_bounds::<Self>(offset);
1511 let prim = decoder.read_num::<u32>(offset);
1512
1513 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1514 Ok(())
1515 }
1516 }
1517 unsafe impl fidl::encoding::TypeMarker for MacFilterMode {
1518 type Owned = Self;
1519
1520 #[inline(always)]
1521 fn inline_align(_context: fidl::encoding::Context) -> usize {
1522 std::mem::align_of::<u32>()
1523 }
1524
1525 #[inline(always)]
1526 fn inline_size(_context: fidl::encoding::Context) -> usize {
1527 std::mem::size_of::<u32>()
1528 }
1529
1530 #[inline(always)]
1531 fn encode_is_copy() -> bool {
1532 false
1533 }
1534
1535 #[inline(always)]
1536 fn decode_is_copy() -> bool {
1537 false
1538 }
1539 }
1540
1541 impl fidl::encoding::ValueTypeMarker for MacFilterMode {
1542 type Borrowed<'a> = Self;
1543 #[inline(always)]
1544 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1545 *value
1546 }
1547 }
1548
1549 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MacFilterMode {
1550 #[inline]
1551 unsafe fn encode(
1552 self,
1553 encoder: &mut fidl::encoding::Encoder<'_, D>,
1554 offset: usize,
1555 _depth: fidl::encoding::Depth,
1556 ) -> fidl::Result<()> {
1557 encoder.debug_check_bounds::<Self>(offset);
1558 encoder.write_num(self.into_primitive(), offset);
1559 Ok(())
1560 }
1561 }
1562
1563 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacFilterMode {
1564 #[inline(always)]
1565 fn new_empty() -> Self {
1566 Self::unknown()
1567 }
1568
1569 #[inline]
1570 unsafe fn decode(
1571 &mut self,
1572 decoder: &mut fidl::encoding::Decoder<'_, D>,
1573 offset: usize,
1574 _depth: fidl::encoding::Depth,
1575 ) -> fidl::Result<()> {
1576 decoder.debug_check_bounds::<Self>(offset);
1577 let prim = decoder.read_num::<u32>(offset);
1578
1579 *self = Self::from_primitive_allow_unknown(prim);
1580 Ok(())
1581 }
1582 }
1583 unsafe impl fidl::encoding::TypeMarker for PortClass {
1584 type Owned = Self;
1585
1586 #[inline(always)]
1587 fn inline_align(_context: fidl::encoding::Context) -> usize {
1588 std::mem::align_of::<u16>()
1589 }
1590
1591 #[inline(always)]
1592 fn inline_size(_context: fidl::encoding::Context) -> usize {
1593 std::mem::size_of::<u16>()
1594 }
1595
1596 #[inline(always)]
1597 fn encode_is_copy() -> bool {
1598 false
1599 }
1600
1601 #[inline(always)]
1602 fn decode_is_copy() -> bool {
1603 false
1604 }
1605 }
1606
1607 impl fidl::encoding::ValueTypeMarker for PortClass {
1608 type Borrowed<'a> = Self;
1609 #[inline(always)]
1610 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1611 *value
1612 }
1613 }
1614
1615 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PortClass {
1616 #[inline]
1617 unsafe fn encode(
1618 self,
1619 encoder: &mut fidl::encoding::Encoder<'_, D>,
1620 offset: usize,
1621 _depth: fidl::encoding::Depth,
1622 ) -> fidl::Result<()> {
1623 encoder.debug_check_bounds::<Self>(offset);
1624 encoder.write_num(self.into_primitive(), offset);
1625 Ok(())
1626 }
1627 }
1628
1629 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortClass {
1630 #[inline(always)]
1631 fn new_empty() -> Self {
1632 Self::unknown()
1633 }
1634
1635 #[inline]
1636 unsafe fn decode(
1637 &mut self,
1638 decoder: &mut fidl::encoding::Decoder<'_, D>,
1639 offset: usize,
1640 _depth: fidl::encoding::Depth,
1641 ) -> fidl::Result<()> {
1642 decoder.debug_check_bounds::<Self>(offset);
1643 let prim = decoder.read_num::<u16>(offset);
1644
1645 *self = Self::from_primitive_allow_unknown(prim);
1646 Ok(())
1647 }
1648 }
1649 unsafe impl fidl::encoding::TypeMarker for RxAcceleration {
1650 type Owned = Self;
1651
1652 #[inline(always)]
1653 fn inline_align(_context: fidl::encoding::Context) -> usize {
1654 std::mem::align_of::<u8>()
1655 }
1656
1657 #[inline(always)]
1658 fn inline_size(_context: fidl::encoding::Context) -> usize {
1659 std::mem::size_of::<u8>()
1660 }
1661
1662 #[inline(always)]
1663 fn encode_is_copy() -> bool {
1664 false
1665 }
1666
1667 #[inline(always)]
1668 fn decode_is_copy() -> bool {
1669 false
1670 }
1671 }
1672
1673 impl fidl::encoding::ValueTypeMarker for RxAcceleration {
1674 type Borrowed<'a> = Self;
1675 #[inline(always)]
1676 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1677 *value
1678 }
1679 }
1680
1681 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RxAcceleration {
1682 #[inline]
1683 unsafe fn encode(
1684 self,
1685 encoder: &mut fidl::encoding::Encoder<'_, D>,
1686 offset: usize,
1687 _depth: fidl::encoding::Depth,
1688 ) -> fidl::Result<()> {
1689 encoder.debug_check_bounds::<Self>(offset);
1690 encoder.write_num(self.into_primitive(), offset);
1691 Ok(())
1692 }
1693 }
1694
1695 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RxAcceleration {
1696 #[inline(always)]
1697 fn new_empty() -> Self {
1698 Self::unknown()
1699 }
1700
1701 #[inline]
1702 unsafe fn decode(
1703 &mut self,
1704 decoder: &mut fidl::encoding::Decoder<'_, D>,
1705 offset: usize,
1706 _depth: fidl::encoding::Depth,
1707 ) -> fidl::Result<()> {
1708 decoder.debug_check_bounds::<Self>(offset);
1709 let prim = decoder.read_num::<u8>(offset);
1710
1711 *self = Self::from_primitive_allow_unknown(prim);
1712 Ok(())
1713 }
1714 }
1715 unsafe impl fidl::encoding::TypeMarker for TxAcceleration {
1716 type Owned = Self;
1717
1718 #[inline(always)]
1719 fn inline_align(_context: fidl::encoding::Context) -> usize {
1720 std::mem::align_of::<u8>()
1721 }
1722
1723 #[inline(always)]
1724 fn inline_size(_context: fidl::encoding::Context) -> usize {
1725 std::mem::size_of::<u8>()
1726 }
1727
1728 #[inline(always)]
1729 fn encode_is_copy() -> bool {
1730 false
1731 }
1732
1733 #[inline(always)]
1734 fn decode_is_copy() -> bool {
1735 false
1736 }
1737 }
1738
1739 impl fidl::encoding::ValueTypeMarker for TxAcceleration {
1740 type Borrowed<'a> = Self;
1741 #[inline(always)]
1742 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1743 *value
1744 }
1745 }
1746
1747 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TxAcceleration {
1748 #[inline]
1749 unsafe fn encode(
1750 self,
1751 encoder: &mut fidl::encoding::Encoder<'_, D>,
1752 offset: usize,
1753 _depth: fidl::encoding::Depth,
1754 ) -> fidl::Result<()> {
1755 encoder.debug_check_bounds::<Self>(offset);
1756 encoder.write_num(self.into_primitive(), offset);
1757 Ok(())
1758 }
1759 }
1760
1761 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxAcceleration {
1762 #[inline(always)]
1763 fn new_empty() -> Self {
1764 Self::unknown()
1765 }
1766
1767 #[inline]
1768 unsafe fn decode(
1769 &mut self,
1770 decoder: &mut fidl::encoding::Decoder<'_, D>,
1771 offset: usize,
1772 _depth: fidl::encoding::Depth,
1773 ) -> fidl::Result<()> {
1774 decoder.debug_check_bounds::<Self>(offset);
1775 let prim = decoder.read_num::<u8>(offset);
1776
1777 *self = Self::from_primitive_allow_unknown(prim);
1778 Ok(())
1779 }
1780 }
1781
1782 impl fidl::encoding::ValueTypeMarker for DeviceGetInfoResponse {
1783 type Borrowed<'a> = &'a Self;
1784 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1785 value
1786 }
1787 }
1788
1789 unsafe impl fidl::encoding::TypeMarker for DeviceGetInfoResponse {
1790 type Owned = Self;
1791
1792 #[inline(always)]
1793 fn inline_align(_context: fidl::encoding::Context) -> usize {
1794 8
1795 }
1796
1797 #[inline(always)]
1798 fn inline_size(_context: fidl::encoding::Context) -> usize {
1799 16
1800 }
1801 }
1802
1803 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceGetInfoResponse, D>
1804 for &DeviceGetInfoResponse
1805 {
1806 #[inline]
1807 unsafe fn encode(
1808 self,
1809 encoder: &mut fidl::encoding::Encoder<'_, D>,
1810 offset: usize,
1811 _depth: fidl::encoding::Depth,
1812 ) -> fidl::Result<()> {
1813 encoder.debug_check_bounds::<DeviceGetInfoResponse>(offset);
1814 fidl::encoding::Encode::<DeviceGetInfoResponse, D>::encode(
1816 (<DeviceInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
1817 encoder,
1818 offset,
1819 _depth,
1820 )
1821 }
1822 }
1823 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DeviceInfo, D>>
1824 fidl::encoding::Encode<DeviceGetInfoResponse, D> for (T0,)
1825 {
1826 #[inline]
1827 unsafe fn encode(
1828 self,
1829 encoder: &mut fidl::encoding::Encoder<'_, D>,
1830 offset: usize,
1831 depth: fidl::encoding::Depth,
1832 ) -> fidl::Result<()> {
1833 encoder.debug_check_bounds::<DeviceGetInfoResponse>(offset);
1834 self.0.encode(encoder, offset + 0, depth)?;
1838 Ok(())
1839 }
1840 }
1841
1842 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceGetInfoResponse {
1843 #[inline(always)]
1844 fn new_empty() -> Self {
1845 Self { info: fidl::new_empty!(DeviceInfo, D) }
1846 }
1847
1848 #[inline]
1849 unsafe fn decode(
1850 &mut self,
1851 decoder: &mut fidl::encoding::Decoder<'_, D>,
1852 offset: usize,
1853 _depth: fidl::encoding::Depth,
1854 ) -> fidl::Result<()> {
1855 decoder.debug_check_bounds::<Self>(offset);
1856 fidl::decode!(DeviceInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
1858 Ok(())
1859 }
1860 }
1861
1862 impl fidl::encoding::ValueTypeMarker for Empty {
1863 type Borrowed<'a> = &'a Self;
1864 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1865 value
1866 }
1867 }
1868
1869 unsafe impl fidl::encoding::TypeMarker for Empty {
1870 type Owned = Self;
1871
1872 #[inline(always)]
1873 fn inline_align(_context: fidl::encoding::Context) -> usize {
1874 1
1875 }
1876
1877 #[inline(always)]
1878 fn inline_size(_context: fidl::encoding::Context) -> usize {
1879 1
1880 }
1881 }
1882
1883 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
1884 #[inline]
1885 unsafe fn encode(
1886 self,
1887 encoder: &mut fidl::encoding::Encoder<'_, D>,
1888 offset: usize,
1889 _depth: fidl::encoding::Depth,
1890 ) -> fidl::Result<()> {
1891 encoder.debug_check_bounds::<Empty>(offset);
1892 encoder.write_num(0u8, offset);
1893 Ok(())
1894 }
1895 }
1896
1897 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
1898 #[inline(always)]
1899 fn new_empty() -> Self {
1900 Self
1901 }
1902
1903 #[inline]
1904 unsafe fn decode(
1905 &mut self,
1906 decoder: &mut fidl::encoding::Decoder<'_, D>,
1907 offset: usize,
1908 _depth: fidl::encoding::Depth,
1909 ) -> fidl::Result<()> {
1910 decoder.debug_check_bounds::<Self>(offset);
1911 match decoder.read_num::<u8>(offset) {
1912 0 => Ok(()),
1913 _ => Err(fidl::Error::Invalid),
1914 }
1915 }
1916 }
1917
1918 impl fidl::encoding::ValueTypeMarker for FrameTypeSupport {
1919 type Borrowed<'a> = &'a Self;
1920 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1921 value
1922 }
1923 }
1924
1925 unsafe impl fidl::encoding::TypeMarker for FrameTypeSupport {
1926 type Owned = Self;
1927
1928 #[inline(always)]
1929 fn inline_align(_context: fidl::encoding::Context) -> usize {
1930 4
1931 }
1932
1933 #[inline(always)]
1934 fn inline_size(_context: fidl::encoding::Context) -> usize {
1935 12
1936 }
1937 }
1938
1939 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FrameTypeSupport, D>
1940 for &FrameTypeSupport
1941 {
1942 #[inline]
1943 unsafe fn encode(
1944 self,
1945 encoder: &mut fidl::encoding::Encoder<'_, D>,
1946 offset: usize,
1947 _depth: fidl::encoding::Depth,
1948 ) -> fidl::Result<()> {
1949 encoder.debug_check_bounds::<FrameTypeSupport>(offset);
1950 fidl::encoding::Encode::<FrameTypeSupport, D>::encode(
1952 (
1953 <FrameType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
1954 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.features),
1955 <TxFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_flags),
1956 ),
1957 encoder,
1958 offset,
1959 _depth,
1960 )
1961 }
1962 }
1963 unsafe impl<
1964 D: fidl::encoding::ResourceDialect,
1965 T0: fidl::encoding::Encode<FrameType, D>,
1966 T1: fidl::encoding::Encode<u32, D>,
1967 T2: fidl::encoding::Encode<TxFlags, D>,
1968 > fidl::encoding::Encode<FrameTypeSupport, D> for (T0, T1, T2)
1969 {
1970 #[inline]
1971 unsafe fn encode(
1972 self,
1973 encoder: &mut fidl::encoding::Encoder<'_, D>,
1974 offset: usize,
1975 depth: fidl::encoding::Depth,
1976 ) -> fidl::Result<()> {
1977 encoder.debug_check_bounds::<FrameTypeSupport>(offset);
1978 unsafe {
1981 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1982 (ptr as *mut u32).write_unaligned(0);
1983 }
1984 self.0.encode(encoder, offset + 0, depth)?;
1986 self.1.encode(encoder, offset + 4, depth)?;
1987 self.2.encode(encoder, offset + 8, depth)?;
1988 Ok(())
1989 }
1990 }
1991
1992 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FrameTypeSupport {
1993 #[inline(always)]
1994 fn new_empty() -> Self {
1995 Self {
1996 type_: fidl::new_empty!(FrameType, D),
1997 features: fidl::new_empty!(u32, D),
1998 supported_flags: fidl::new_empty!(TxFlags, D),
1999 }
2000 }
2001
2002 #[inline]
2003 unsafe fn decode(
2004 &mut self,
2005 decoder: &mut fidl::encoding::Decoder<'_, D>,
2006 offset: usize,
2007 _depth: fidl::encoding::Depth,
2008 ) -> fidl::Result<()> {
2009 decoder.debug_check_bounds::<Self>(offset);
2010 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2012 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2013 let mask = 0xffffff00u32;
2014 let maskedval = padval & mask;
2015 if maskedval != 0 {
2016 return Err(fidl::Error::NonZeroPadding {
2017 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2018 });
2019 }
2020 fidl::decode!(FrameType, D, &mut self.type_, decoder, offset + 0, _depth)?;
2021 fidl::decode!(u32, D, &mut self.features, decoder, offset + 4, _depth)?;
2022 fidl::decode!(TxFlags, D, &mut self.supported_flags, decoder, offset + 8, _depth)?;
2023 Ok(())
2024 }
2025 }
2026
2027 impl fidl::encoding::ValueTypeMarker for MacAddressingAddMulticastAddressRequest {
2028 type Borrowed<'a> = &'a Self;
2029 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2030 value
2031 }
2032 }
2033
2034 unsafe impl fidl::encoding::TypeMarker for MacAddressingAddMulticastAddressRequest {
2035 type Owned = Self;
2036
2037 #[inline(always)]
2038 fn inline_align(_context: fidl::encoding::Context) -> usize {
2039 1
2040 }
2041
2042 #[inline(always)]
2043 fn inline_size(_context: fidl::encoding::Context) -> usize {
2044 6
2045 }
2046 }
2047
2048 unsafe impl<D: fidl::encoding::ResourceDialect>
2049 fidl::encoding::Encode<MacAddressingAddMulticastAddressRequest, D>
2050 for &MacAddressingAddMulticastAddressRequest
2051 {
2052 #[inline]
2053 unsafe fn encode(
2054 self,
2055 encoder: &mut fidl::encoding::Encoder<'_, D>,
2056 offset: usize,
2057 _depth: fidl::encoding::Depth,
2058 ) -> fidl::Result<()> {
2059 encoder.debug_check_bounds::<MacAddressingAddMulticastAddressRequest>(offset);
2060 fidl::encoding::Encode::<MacAddressingAddMulticastAddressRequest, D>::encode(
2062 (
2063 <fidl_fuchsia_net__common::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
2064 ),
2065 encoder, offset, _depth
2066 )
2067 }
2068 }
2069 unsafe impl<
2070 D: fidl::encoding::ResourceDialect,
2071 T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MacAddress, D>,
2072 > fidl::encoding::Encode<MacAddressingAddMulticastAddressRequest, D> for (T0,)
2073 {
2074 #[inline]
2075 unsafe fn encode(
2076 self,
2077 encoder: &mut fidl::encoding::Encoder<'_, D>,
2078 offset: usize,
2079 depth: fidl::encoding::Depth,
2080 ) -> fidl::Result<()> {
2081 encoder.debug_check_bounds::<MacAddressingAddMulticastAddressRequest>(offset);
2082 self.0.encode(encoder, offset + 0, depth)?;
2086 Ok(())
2087 }
2088 }
2089
2090 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2091 for MacAddressingAddMulticastAddressRequest
2092 {
2093 #[inline(always)]
2094 fn new_empty() -> Self {
2095 Self { address: fidl::new_empty!(fidl_fuchsia_net__common::MacAddress, D) }
2096 }
2097
2098 #[inline]
2099 unsafe fn decode(
2100 &mut self,
2101 decoder: &mut fidl::encoding::Decoder<'_, D>,
2102 offset: usize,
2103 _depth: fidl::encoding::Depth,
2104 ) -> fidl::Result<()> {
2105 decoder.debug_check_bounds::<Self>(offset);
2106 fidl::decode!(
2108 fidl_fuchsia_net__common::MacAddress,
2109 D,
2110 &mut self.address,
2111 decoder,
2112 offset + 0,
2113 _depth
2114 )?;
2115 Ok(())
2116 }
2117 }
2118
2119 impl fidl::encoding::ValueTypeMarker for MacAddressingAddMulticastAddressResponse {
2120 type Borrowed<'a> = &'a Self;
2121 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2122 value
2123 }
2124 }
2125
2126 unsafe impl fidl::encoding::TypeMarker for MacAddressingAddMulticastAddressResponse {
2127 type Owned = Self;
2128
2129 #[inline(always)]
2130 fn inline_align(_context: fidl::encoding::Context) -> usize {
2131 4
2132 }
2133
2134 #[inline(always)]
2135 fn inline_size(_context: fidl::encoding::Context) -> usize {
2136 4
2137 }
2138 #[inline(always)]
2139 fn encode_is_copy() -> bool {
2140 true
2141 }
2142
2143 #[inline(always)]
2144 fn decode_is_copy() -> bool {
2145 true
2146 }
2147 }
2148
2149 unsafe impl<D: fidl::encoding::ResourceDialect>
2150 fidl::encoding::Encode<MacAddressingAddMulticastAddressResponse, D>
2151 for &MacAddressingAddMulticastAddressResponse
2152 {
2153 #[inline]
2154 unsafe fn encode(
2155 self,
2156 encoder: &mut fidl::encoding::Encoder<'_, D>,
2157 offset: usize,
2158 _depth: fidl::encoding::Depth,
2159 ) -> fidl::Result<()> {
2160 encoder.debug_check_bounds::<MacAddressingAddMulticastAddressResponse>(offset);
2161 unsafe {
2162 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2164 (buf_ptr as *mut MacAddressingAddMulticastAddressResponse).write_unaligned(
2165 (self as *const MacAddressingAddMulticastAddressResponse).read(),
2166 );
2167 }
2170 Ok(())
2171 }
2172 }
2173 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2174 fidl::encoding::Encode<MacAddressingAddMulticastAddressResponse, D> for (T0,)
2175 {
2176 #[inline]
2177 unsafe fn encode(
2178 self,
2179 encoder: &mut fidl::encoding::Encoder<'_, D>,
2180 offset: usize,
2181 depth: fidl::encoding::Depth,
2182 ) -> fidl::Result<()> {
2183 encoder.debug_check_bounds::<MacAddressingAddMulticastAddressResponse>(offset);
2184 self.0.encode(encoder, offset + 0, depth)?;
2188 Ok(())
2189 }
2190 }
2191
2192 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2193 for MacAddressingAddMulticastAddressResponse
2194 {
2195 #[inline(always)]
2196 fn new_empty() -> Self {
2197 Self { status: fidl::new_empty!(i32, D) }
2198 }
2199
2200 #[inline]
2201 unsafe fn decode(
2202 &mut self,
2203 decoder: &mut fidl::encoding::Decoder<'_, D>,
2204 offset: usize,
2205 _depth: fidl::encoding::Depth,
2206 ) -> fidl::Result<()> {
2207 decoder.debug_check_bounds::<Self>(offset);
2208 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2209 unsafe {
2212 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2213 }
2214 Ok(())
2215 }
2216 }
2217
2218 impl fidl::encoding::ValueTypeMarker for MacAddressingGetUnicastAddressResponse {
2219 type Borrowed<'a> = &'a Self;
2220 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2221 value
2222 }
2223 }
2224
2225 unsafe impl fidl::encoding::TypeMarker for MacAddressingGetUnicastAddressResponse {
2226 type Owned = Self;
2227
2228 #[inline(always)]
2229 fn inline_align(_context: fidl::encoding::Context) -> usize {
2230 1
2231 }
2232
2233 #[inline(always)]
2234 fn inline_size(_context: fidl::encoding::Context) -> usize {
2235 6
2236 }
2237 }
2238
2239 unsafe impl<D: fidl::encoding::ResourceDialect>
2240 fidl::encoding::Encode<MacAddressingGetUnicastAddressResponse, D>
2241 for &MacAddressingGetUnicastAddressResponse
2242 {
2243 #[inline]
2244 unsafe fn encode(
2245 self,
2246 encoder: &mut fidl::encoding::Encoder<'_, D>,
2247 offset: usize,
2248 _depth: fidl::encoding::Depth,
2249 ) -> fidl::Result<()> {
2250 encoder.debug_check_bounds::<MacAddressingGetUnicastAddressResponse>(offset);
2251 fidl::encoding::Encode::<MacAddressingGetUnicastAddressResponse, D>::encode(
2253 (
2254 <fidl_fuchsia_net__common::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
2255 ),
2256 encoder, offset, _depth
2257 )
2258 }
2259 }
2260 unsafe impl<
2261 D: fidl::encoding::ResourceDialect,
2262 T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MacAddress, D>,
2263 > fidl::encoding::Encode<MacAddressingGetUnicastAddressResponse, D> for (T0,)
2264 {
2265 #[inline]
2266 unsafe fn encode(
2267 self,
2268 encoder: &mut fidl::encoding::Encoder<'_, D>,
2269 offset: usize,
2270 depth: fidl::encoding::Depth,
2271 ) -> fidl::Result<()> {
2272 encoder.debug_check_bounds::<MacAddressingGetUnicastAddressResponse>(offset);
2273 self.0.encode(encoder, offset + 0, depth)?;
2277 Ok(())
2278 }
2279 }
2280
2281 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2282 for MacAddressingGetUnicastAddressResponse
2283 {
2284 #[inline(always)]
2285 fn new_empty() -> Self {
2286 Self { address: fidl::new_empty!(fidl_fuchsia_net__common::MacAddress, D) }
2287 }
2288
2289 #[inline]
2290 unsafe fn decode(
2291 &mut self,
2292 decoder: &mut fidl::encoding::Decoder<'_, D>,
2293 offset: usize,
2294 _depth: fidl::encoding::Depth,
2295 ) -> fidl::Result<()> {
2296 decoder.debug_check_bounds::<Self>(offset);
2297 fidl::decode!(
2299 fidl_fuchsia_net__common::MacAddress,
2300 D,
2301 &mut self.address,
2302 decoder,
2303 offset + 0,
2304 _depth
2305 )?;
2306 Ok(())
2307 }
2308 }
2309
2310 impl fidl::encoding::ValueTypeMarker for MacAddressingRemoveMulticastAddressRequest {
2311 type Borrowed<'a> = &'a Self;
2312 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2313 value
2314 }
2315 }
2316
2317 unsafe impl fidl::encoding::TypeMarker for MacAddressingRemoveMulticastAddressRequest {
2318 type Owned = Self;
2319
2320 #[inline(always)]
2321 fn inline_align(_context: fidl::encoding::Context) -> usize {
2322 1
2323 }
2324
2325 #[inline(always)]
2326 fn inline_size(_context: fidl::encoding::Context) -> usize {
2327 6
2328 }
2329 }
2330
2331 unsafe impl<D: fidl::encoding::ResourceDialect>
2332 fidl::encoding::Encode<MacAddressingRemoveMulticastAddressRequest, D>
2333 for &MacAddressingRemoveMulticastAddressRequest
2334 {
2335 #[inline]
2336 unsafe fn encode(
2337 self,
2338 encoder: &mut fidl::encoding::Encoder<'_, D>,
2339 offset: usize,
2340 _depth: fidl::encoding::Depth,
2341 ) -> fidl::Result<()> {
2342 encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressRequest>(offset);
2343 fidl::encoding::Encode::<MacAddressingRemoveMulticastAddressRequest, D>::encode(
2345 (
2346 <fidl_fuchsia_net__common::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.address),
2347 ),
2348 encoder, offset, _depth
2349 )
2350 }
2351 }
2352 unsafe impl<
2353 D: fidl::encoding::ResourceDialect,
2354 T0: fidl::encoding::Encode<fidl_fuchsia_net__common::MacAddress, D>,
2355 > fidl::encoding::Encode<MacAddressingRemoveMulticastAddressRequest, D> for (T0,)
2356 {
2357 #[inline]
2358 unsafe fn encode(
2359 self,
2360 encoder: &mut fidl::encoding::Encoder<'_, D>,
2361 offset: usize,
2362 depth: fidl::encoding::Depth,
2363 ) -> fidl::Result<()> {
2364 encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressRequest>(offset);
2365 self.0.encode(encoder, offset + 0, depth)?;
2369 Ok(())
2370 }
2371 }
2372
2373 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2374 for MacAddressingRemoveMulticastAddressRequest
2375 {
2376 #[inline(always)]
2377 fn new_empty() -> Self {
2378 Self { address: fidl::new_empty!(fidl_fuchsia_net__common::MacAddress, D) }
2379 }
2380
2381 #[inline]
2382 unsafe fn decode(
2383 &mut self,
2384 decoder: &mut fidl::encoding::Decoder<'_, D>,
2385 offset: usize,
2386 _depth: fidl::encoding::Depth,
2387 ) -> fidl::Result<()> {
2388 decoder.debug_check_bounds::<Self>(offset);
2389 fidl::decode!(
2391 fidl_fuchsia_net__common::MacAddress,
2392 D,
2393 &mut self.address,
2394 decoder,
2395 offset + 0,
2396 _depth
2397 )?;
2398 Ok(())
2399 }
2400 }
2401
2402 impl fidl::encoding::ValueTypeMarker for MacAddressingRemoveMulticastAddressResponse {
2403 type Borrowed<'a> = &'a Self;
2404 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2405 value
2406 }
2407 }
2408
2409 unsafe impl fidl::encoding::TypeMarker for MacAddressingRemoveMulticastAddressResponse {
2410 type Owned = Self;
2411
2412 #[inline(always)]
2413 fn inline_align(_context: fidl::encoding::Context) -> usize {
2414 4
2415 }
2416
2417 #[inline(always)]
2418 fn inline_size(_context: fidl::encoding::Context) -> usize {
2419 4
2420 }
2421 #[inline(always)]
2422 fn encode_is_copy() -> bool {
2423 true
2424 }
2425
2426 #[inline(always)]
2427 fn decode_is_copy() -> bool {
2428 true
2429 }
2430 }
2431
2432 unsafe impl<D: fidl::encoding::ResourceDialect>
2433 fidl::encoding::Encode<MacAddressingRemoveMulticastAddressResponse, D>
2434 for &MacAddressingRemoveMulticastAddressResponse
2435 {
2436 #[inline]
2437 unsafe fn encode(
2438 self,
2439 encoder: &mut fidl::encoding::Encoder<'_, D>,
2440 offset: usize,
2441 _depth: fidl::encoding::Depth,
2442 ) -> fidl::Result<()> {
2443 encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressResponse>(offset);
2444 unsafe {
2445 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2447 (buf_ptr as *mut MacAddressingRemoveMulticastAddressResponse).write_unaligned(
2448 (self as *const MacAddressingRemoveMulticastAddressResponse).read(),
2449 );
2450 }
2453 Ok(())
2454 }
2455 }
2456 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2457 fidl::encoding::Encode<MacAddressingRemoveMulticastAddressResponse, D> for (T0,)
2458 {
2459 #[inline]
2460 unsafe fn encode(
2461 self,
2462 encoder: &mut fidl::encoding::Encoder<'_, D>,
2463 offset: usize,
2464 depth: fidl::encoding::Depth,
2465 ) -> fidl::Result<()> {
2466 encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressResponse>(offset);
2467 self.0.encode(encoder, offset + 0, depth)?;
2471 Ok(())
2472 }
2473 }
2474
2475 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2476 for MacAddressingRemoveMulticastAddressResponse
2477 {
2478 #[inline(always)]
2479 fn new_empty() -> Self {
2480 Self { status: fidl::new_empty!(i32, D) }
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 buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2492 unsafe {
2495 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2496 }
2497 Ok(())
2498 }
2499 }
2500
2501 impl fidl::encoding::ValueTypeMarker for MacAddressingSetModeRequest {
2502 type Borrowed<'a> = &'a Self;
2503 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2504 value
2505 }
2506 }
2507
2508 unsafe impl fidl::encoding::TypeMarker for MacAddressingSetModeRequest {
2509 type Owned = Self;
2510
2511 #[inline(always)]
2512 fn inline_align(_context: fidl::encoding::Context) -> usize {
2513 4
2514 }
2515
2516 #[inline(always)]
2517 fn inline_size(_context: fidl::encoding::Context) -> usize {
2518 4
2519 }
2520 }
2521
2522 unsafe impl<D: fidl::encoding::ResourceDialect>
2523 fidl::encoding::Encode<MacAddressingSetModeRequest, D> for &MacAddressingSetModeRequest
2524 {
2525 #[inline]
2526 unsafe fn encode(
2527 self,
2528 encoder: &mut fidl::encoding::Encoder<'_, D>,
2529 offset: usize,
2530 _depth: fidl::encoding::Depth,
2531 ) -> fidl::Result<()> {
2532 encoder.debug_check_bounds::<MacAddressingSetModeRequest>(offset);
2533 fidl::encoding::Encode::<MacAddressingSetModeRequest, D>::encode(
2535 (<MacFilterMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
2536 encoder,
2537 offset,
2538 _depth,
2539 )
2540 }
2541 }
2542 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MacFilterMode, D>>
2543 fidl::encoding::Encode<MacAddressingSetModeRequest, D> for (T0,)
2544 {
2545 #[inline]
2546 unsafe fn encode(
2547 self,
2548 encoder: &mut fidl::encoding::Encoder<'_, D>,
2549 offset: usize,
2550 depth: fidl::encoding::Depth,
2551 ) -> fidl::Result<()> {
2552 encoder.debug_check_bounds::<MacAddressingSetModeRequest>(offset);
2553 self.0.encode(encoder, offset + 0, depth)?;
2557 Ok(())
2558 }
2559 }
2560
2561 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2562 for MacAddressingSetModeRequest
2563 {
2564 #[inline(always)]
2565 fn new_empty() -> Self {
2566 Self { mode: fidl::new_empty!(MacFilterMode, D) }
2567 }
2568
2569 #[inline]
2570 unsafe fn decode(
2571 &mut self,
2572 decoder: &mut fidl::encoding::Decoder<'_, D>,
2573 offset: usize,
2574 _depth: fidl::encoding::Depth,
2575 ) -> fidl::Result<()> {
2576 decoder.debug_check_bounds::<Self>(offset);
2577 fidl::decode!(MacFilterMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
2579 Ok(())
2580 }
2581 }
2582
2583 impl fidl::encoding::ValueTypeMarker for MacAddressingSetModeResponse {
2584 type Borrowed<'a> = &'a Self;
2585 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2586 value
2587 }
2588 }
2589
2590 unsafe impl fidl::encoding::TypeMarker for MacAddressingSetModeResponse {
2591 type Owned = Self;
2592
2593 #[inline(always)]
2594 fn inline_align(_context: fidl::encoding::Context) -> usize {
2595 4
2596 }
2597
2598 #[inline(always)]
2599 fn inline_size(_context: fidl::encoding::Context) -> usize {
2600 4
2601 }
2602 #[inline(always)]
2603 fn encode_is_copy() -> bool {
2604 true
2605 }
2606
2607 #[inline(always)]
2608 fn decode_is_copy() -> bool {
2609 true
2610 }
2611 }
2612
2613 unsafe impl<D: fidl::encoding::ResourceDialect>
2614 fidl::encoding::Encode<MacAddressingSetModeResponse, D> for &MacAddressingSetModeResponse
2615 {
2616 #[inline]
2617 unsafe fn encode(
2618 self,
2619 encoder: &mut fidl::encoding::Encoder<'_, D>,
2620 offset: usize,
2621 _depth: fidl::encoding::Depth,
2622 ) -> fidl::Result<()> {
2623 encoder.debug_check_bounds::<MacAddressingSetModeResponse>(offset);
2624 unsafe {
2625 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2627 (buf_ptr as *mut MacAddressingSetModeResponse)
2628 .write_unaligned((self as *const MacAddressingSetModeResponse).read());
2629 }
2632 Ok(())
2633 }
2634 }
2635 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2636 fidl::encoding::Encode<MacAddressingSetModeResponse, D> for (T0,)
2637 {
2638 #[inline]
2639 unsafe fn encode(
2640 self,
2641 encoder: &mut fidl::encoding::Encoder<'_, D>,
2642 offset: usize,
2643 depth: fidl::encoding::Depth,
2644 ) -> fidl::Result<()> {
2645 encoder.debug_check_bounds::<MacAddressingSetModeResponse>(offset);
2646 self.0.encode(encoder, offset + 0, depth)?;
2650 Ok(())
2651 }
2652 }
2653
2654 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2655 for MacAddressingSetModeResponse
2656 {
2657 #[inline(always)]
2658 fn new_empty() -> Self {
2659 Self { status: fidl::new_empty!(i32, D) }
2660 }
2661
2662 #[inline]
2663 unsafe fn decode(
2664 &mut self,
2665 decoder: &mut fidl::encoding::Decoder<'_, D>,
2666 offset: usize,
2667 _depth: fidl::encoding::Depth,
2668 ) -> fidl::Result<()> {
2669 decoder.debug_check_bounds::<Self>(offset);
2670 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2671 unsafe {
2674 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2675 }
2676 Ok(())
2677 }
2678 }
2679
2680 impl fidl::encoding::ValueTypeMarker for PortGetInfoResponse {
2681 type Borrowed<'a> = &'a Self;
2682 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2683 value
2684 }
2685 }
2686
2687 unsafe impl fidl::encoding::TypeMarker for PortGetInfoResponse {
2688 type Owned = Self;
2689
2690 #[inline(always)]
2691 fn inline_align(_context: fidl::encoding::Context) -> usize {
2692 8
2693 }
2694
2695 #[inline(always)]
2696 fn inline_size(_context: fidl::encoding::Context) -> usize {
2697 16
2698 }
2699 }
2700
2701 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PortGetInfoResponse, D>
2702 for &PortGetInfoResponse
2703 {
2704 #[inline]
2705 unsafe fn encode(
2706 self,
2707 encoder: &mut fidl::encoding::Encoder<'_, D>,
2708 offset: usize,
2709 _depth: fidl::encoding::Depth,
2710 ) -> fidl::Result<()> {
2711 encoder.debug_check_bounds::<PortGetInfoResponse>(offset);
2712 fidl::encoding::Encode::<PortGetInfoResponse, D>::encode(
2714 (<PortInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2715 encoder,
2716 offset,
2717 _depth,
2718 )
2719 }
2720 }
2721 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PortInfo, D>>
2722 fidl::encoding::Encode<PortGetInfoResponse, D> for (T0,)
2723 {
2724 #[inline]
2725 unsafe fn encode(
2726 self,
2727 encoder: &mut fidl::encoding::Encoder<'_, D>,
2728 offset: usize,
2729 depth: fidl::encoding::Depth,
2730 ) -> fidl::Result<()> {
2731 encoder.debug_check_bounds::<PortGetInfoResponse>(offset);
2732 self.0.encode(encoder, offset + 0, depth)?;
2736 Ok(())
2737 }
2738 }
2739
2740 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortGetInfoResponse {
2741 #[inline(always)]
2742 fn new_empty() -> Self {
2743 Self { info: fidl::new_empty!(PortInfo, D) }
2744 }
2745
2746 #[inline]
2747 unsafe fn decode(
2748 &mut self,
2749 decoder: &mut fidl::encoding::Decoder<'_, D>,
2750 offset: usize,
2751 _depth: fidl::encoding::Depth,
2752 ) -> fidl::Result<()> {
2753 decoder.debug_check_bounds::<Self>(offset);
2754 fidl::decode!(PortInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
2756 Ok(())
2757 }
2758 }
2759
2760 impl fidl::encoding::ValueTypeMarker for PortGetStatusResponse {
2761 type Borrowed<'a> = &'a Self;
2762 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2763 value
2764 }
2765 }
2766
2767 unsafe impl fidl::encoding::TypeMarker for PortGetStatusResponse {
2768 type Owned = Self;
2769
2770 #[inline(always)]
2771 fn inline_align(_context: fidl::encoding::Context) -> usize {
2772 8
2773 }
2774
2775 #[inline(always)]
2776 fn inline_size(_context: fidl::encoding::Context) -> usize {
2777 16
2778 }
2779 }
2780
2781 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PortGetStatusResponse, D>
2782 for &PortGetStatusResponse
2783 {
2784 #[inline]
2785 unsafe fn encode(
2786 self,
2787 encoder: &mut fidl::encoding::Encoder<'_, D>,
2788 offset: usize,
2789 _depth: fidl::encoding::Depth,
2790 ) -> fidl::Result<()> {
2791 encoder.debug_check_bounds::<PortGetStatusResponse>(offset);
2792 fidl::encoding::Encode::<PortGetStatusResponse, D>::encode(
2794 (<PortStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2795 encoder,
2796 offset,
2797 _depth,
2798 )
2799 }
2800 }
2801 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PortStatus, D>>
2802 fidl::encoding::Encode<PortGetStatusResponse, D> for (T0,)
2803 {
2804 #[inline]
2805 unsafe fn encode(
2806 self,
2807 encoder: &mut fidl::encoding::Encoder<'_, D>,
2808 offset: usize,
2809 depth: fidl::encoding::Depth,
2810 ) -> fidl::Result<()> {
2811 encoder.debug_check_bounds::<PortGetStatusResponse>(offset);
2812 self.0.encode(encoder, offset + 0, depth)?;
2816 Ok(())
2817 }
2818 }
2819
2820 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortGetStatusResponse {
2821 #[inline(always)]
2822 fn new_empty() -> Self {
2823 Self { status: fidl::new_empty!(PortStatus, D) }
2824 }
2825
2826 #[inline]
2827 unsafe fn decode(
2828 &mut self,
2829 decoder: &mut fidl::encoding::Decoder<'_, D>,
2830 offset: usize,
2831 _depth: fidl::encoding::Depth,
2832 ) -> fidl::Result<()> {
2833 decoder.debug_check_bounds::<Self>(offset);
2834 fidl::decode!(PortStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2836 Ok(())
2837 }
2838 }
2839
2840 impl fidl::encoding::ValueTypeMarker for PortId {
2841 type Borrowed<'a> = &'a Self;
2842 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2843 value
2844 }
2845 }
2846
2847 unsafe impl fidl::encoding::TypeMarker for PortId {
2848 type Owned = Self;
2849
2850 #[inline(always)]
2851 fn inline_align(_context: fidl::encoding::Context) -> usize {
2852 1
2853 }
2854
2855 #[inline(always)]
2856 fn inline_size(_context: fidl::encoding::Context) -> usize {
2857 2
2858 }
2859 #[inline(always)]
2860 fn encode_is_copy() -> bool {
2861 true
2862 }
2863
2864 #[inline(always)]
2865 fn decode_is_copy() -> bool {
2866 true
2867 }
2868 }
2869
2870 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PortId, D> for &PortId {
2871 #[inline]
2872 unsafe fn encode(
2873 self,
2874 encoder: &mut fidl::encoding::Encoder<'_, D>,
2875 offset: usize,
2876 _depth: fidl::encoding::Depth,
2877 ) -> fidl::Result<()> {
2878 encoder.debug_check_bounds::<PortId>(offset);
2879 unsafe {
2880 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2882 (buf_ptr as *mut PortId).write_unaligned((self as *const PortId).read());
2883 }
2886 Ok(())
2887 }
2888 }
2889 unsafe impl<
2890 D: fidl::encoding::ResourceDialect,
2891 T0: fidl::encoding::Encode<u8, D>,
2892 T1: fidl::encoding::Encode<u8, D>,
2893 > fidl::encoding::Encode<PortId, D> for (T0, T1)
2894 {
2895 #[inline]
2896 unsafe fn encode(
2897 self,
2898 encoder: &mut fidl::encoding::Encoder<'_, D>,
2899 offset: usize,
2900 depth: fidl::encoding::Depth,
2901 ) -> fidl::Result<()> {
2902 encoder.debug_check_bounds::<PortId>(offset);
2903 self.0.encode(encoder, offset + 0, depth)?;
2907 self.1.encode(encoder, offset + 1, depth)?;
2908 Ok(())
2909 }
2910 }
2911
2912 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortId {
2913 #[inline(always)]
2914 fn new_empty() -> Self {
2915 Self { base: fidl::new_empty!(u8, D), salt: fidl::new_empty!(u8, D) }
2916 }
2917
2918 #[inline]
2919 unsafe fn decode(
2920 &mut self,
2921 decoder: &mut fidl::encoding::Decoder<'_, D>,
2922 offset: usize,
2923 _depth: fidl::encoding::Depth,
2924 ) -> fidl::Result<()> {
2925 decoder.debug_check_bounds::<Self>(offset);
2926 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2927 unsafe {
2930 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2931 }
2932 Ok(())
2933 }
2934 }
2935
2936 impl fidl::encoding::ValueTypeMarker for PortWatcherWatchResponse {
2937 type Borrowed<'a> = &'a Self;
2938 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2939 value
2940 }
2941 }
2942
2943 unsafe impl fidl::encoding::TypeMarker for PortWatcherWatchResponse {
2944 type Owned = Self;
2945
2946 #[inline(always)]
2947 fn inline_align(_context: fidl::encoding::Context) -> usize {
2948 8
2949 }
2950
2951 #[inline(always)]
2952 fn inline_size(_context: fidl::encoding::Context) -> usize {
2953 16
2954 }
2955 }
2956
2957 unsafe impl<D: fidl::encoding::ResourceDialect>
2958 fidl::encoding::Encode<PortWatcherWatchResponse, D> for &PortWatcherWatchResponse
2959 {
2960 #[inline]
2961 unsafe fn encode(
2962 self,
2963 encoder: &mut fidl::encoding::Encoder<'_, D>,
2964 offset: usize,
2965 _depth: fidl::encoding::Depth,
2966 ) -> fidl::Result<()> {
2967 encoder.debug_check_bounds::<PortWatcherWatchResponse>(offset);
2968 fidl::encoding::Encode::<PortWatcherWatchResponse, D>::encode(
2970 (<DevicePortEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event),),
2971 encoder,
2972 offset,
2973 _depth,
2974 )
2975 }
2976 }
2977 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DevicePortEvent, D>>
2978 fidl::encoding::Encode<PortWatcherWatchResponse, D> for (T0,)
2979 {
2980 #[inline]
2981 unsafe fn encode(
2982 self,
2983 encoder: &mut fidl::encoding::Encoder<'_, D>,
2984 offset: usize,
2985 depth: fidl::encoding::Depth,
2986 ) -> fidl::Result<()> {
2987 encoder.debug_check_bounds::<PortWatcherWatchResponse>(offset);
2988 self.0.encode(encoder, offset + 0, depth)?;
2992 Ok(())
2993 }
2994 }
2995
2996 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2997 for PortWatcherWatchResponse
2998 {
2999 #[inline(always)]
3000 fn new_empty() -> Self {
3001 Self { event: fidl::new_empty!(DevicePortEvent, D) }
3002 }
3003
3004 #[inline]
3005 unsafe fn decode(
3006 &mut self,
3007 decoder: &mut fidl::encoding::Decoder<'_, D>,
3008 offset: usize,
3009 _depth: fidl::encoding::Depth,
3010 ) -> fidl::Result<()> {
3011 decoder.debug_check_bounds::<Self>(offset);
3012 fidl::decode!(DevicePortEvent, D, &mut self.event, decoder, offset + 0, _depth)?;
3014 Ok(())
3015 }
3016 }
3017
3018 impl fidl::encoding::ValueTypeMarker for SessionAttachRequest {
3019 type Borrowed<'a> = &'a Self;
3020 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3021 value
3022 }
3023 }
3024
3025 unsafe impl fidl::encoding::TypeMarker for SessionAttachRequest {
3026 type Owned = Self;
3027
3028 #[inline(always)]
3029 fn inline_align(_context: fidl::encoding::Context) -> usize {
3030 8
3031 }
3032
3033 #[inline(always)]
3034 fn inline_size(_context: fidl::encoding::Context) -> usize {
3035 24
3036 }
3037 }
3038
3039 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SessionAttachRequest, D>
3040 for &SessionAttachRequest
3041 {
3042 #[inline]
3043 unsafe fn encode(
3044 self,
3045 encoder: &mut fidl::encoding::Encoder<'_, D>,
3046 offset: usize,
3047 _depth: fidl::encoding::Depth,
3048 ) -> fidl::Result<()> {
3049 encoder.debug_check_bounds::<SessionAttachRequest>(offset);
3050 fidl::encoding::Encode::<SessionAttachRequest, D>::encode(
3052 (
3053 <PortId as fidl::encoding::ValueTypeMarker>::borrow(&self.port),
3054 <fidl::encoding::Vector<FrameType, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_frames),
3055 ),
3056 encoder, offset, _depth
3057 )
3058 }
3059 }
3060 unsafe impl<
3061 D: fidl::encoding::ResourceDialect,
3062 T0: fidl::encoding::Encode<PortId, D>,
3063 T1: fidl::encoding::Encode<fidl::encoding::Vector<FrameType, 4>, D>,
3064 > fidl::encoding::Encode<SessionAttachRequest, D> for (T0, T1)
3065 {
3066 #[inline]
3067 unsafe fn encode(
3068 self,
3069 encoder: &mut fidl::encoding::Encoder<'_, D>,
3070 offset: usize,
3071 depth: fidl::encoding::Depth,
3072 ) -> fidl::Result<()> {
3073 encoder.debug_check_bounds::<SessionAttachRequest>(offset);
3074 unsafe {
3077 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3078 (ptr as *mut u64).write_unaligned(0);
3079 }
3080 self.0.encode(encoder, offset + 0, depth)?;
3082 self.1.encode(encoder, offset + 8, depth)?;
3083 Ok(())
3084 }
3085 }
3086
3087 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionAttachRequest {
3088 #[inline(always)]
3089 fn new_empty() -> Self {
3090 Self {
3091 port: fidl::new_empty!(PortId, D),
3092 rx_frames: fidl::new_empty!(fidl::encoding::Vector<FrameType, 4>, D),
3093 }
3094 }
3095
3096 #[inline]
3097 unsafe fn decode(
3098 &mut self,
3099 decoder: &mut fidl::encoding::Decoder<'_, D>,
3100 offset: usize,
3101 _depth: fidl::encoding::Depth,
3102 ) -> fidl::Result<()> {
3103 decoder.debug_check_bounds::<Self>(offset);
3104 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3106 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3107 let mask = 0xffffffffffff0000u64;
3108 let maskedval = padval & mask;
3109 if maskedval != 0 {
3110 return Err(fidl::Error::NonZeroPadding {
3111 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3112 });
3113 }
3114 fidl::decode!(PortId, D, &mut self.port, decoder, offset + 0, _depth)?;
3115 fidl::decode!(fidl::encoding::Vector<FrameType, 4>, D, &mut self.rx_frames, decoder, offset + 8, _depth)?;
3116 Ok(())
3117 }
3118 }
3119
3120 impl fidl::encoding::ValueTypeMarker for SessionDetachRequest {
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 SessionDetachRequest {
3128 type Owned = Self;
3129
3130 #[inline(always)]
3131 fn inline_align(_context: fidl::encoding::Context) -> usize {
3132 1
3133 }
3134
3135 #[inline(always)]
3136 fn inline_size(_context: fidl::encoding::Context) -> usize {
3137 2
3138 }
3139 #[inline(always)]
3140 fn encode_is_copy() -> bool {
3141 true
3142 }
3143
3144 #[inline(always)]
3145 fn decode_is_copy() -> bool {
3146 true
3147 }
3148 }
3149
3150 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SessionDetachRequest, D>
3151 for &SessionDetachRequest
3152 {
3153 #[inline]
3154 unsafe fn encode(
3155 self,
3156 encoder: &mut fidl::encoding::Encoder<'_, D>,
3157 offset: usize,
3158 _depth: fidl::encoding::Depth,
3159 ) -> fidl::Result<()> {
3160 encoder.debug_check_bounds::<SessionDetachRequest>(offset);
3161 unsafe {
3162 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3164 (buf_ptr as *mut SessionDetachRequest)
3165 .write_unaligned((self as *const SessionDetachRequest).read());
3166 }
3169 Ok(())
3170 }
3171 }
3172 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PortId, D>>
3173 fidl::encoding::Encode<SessionDetachRequest, D> for (T0,)
3174 {
3175 #[inline]
3176 unsafe fn encode(
3177 self,
3178 encoder: &mut fidl::encoding::Encoder<'_, D>,
3179 offset: usize,
3180 depth: fidl::encoding::Depth,
3181 ) -> fidl::Result<()> {
3182 encoder.debug_check_bounds::<SessionDetachRequest>(offset);
3183 self.0.encode(encoder, offset + 0, depth)?;
3187 Ok(())
3188 }
3189 }
3190
3191 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionDetachRequest {
3192 #[inline(always)]
3193 fn new_empty() -> Self {
3194 Self { port: fidl::new_empty!(PortId, D) }
3195 }
3196
3197 #[inline]
3198 unsafe fn decode(
3199 &mut self,
3200 decoder: &mut fidl::encoding::Decoder<'_, D>,
3201 offset: usize,
3202 _depth: fidl::encoding::Depth,
3203 ) -> fidl::Result<()> {
3204 decoder.debug_check_bounds::<Self>(offset);
3205 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3206 unsafe {
3209 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3210 }
3211 Ok(())
3212 }
3213 }
3214
3215 impl fidl::encoding::ValueTypeMarker for StatusWatcherWatchStatusResponse {
3216 type Borrowed<'a> = &'a Self;
3217 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3218 value
3219 }
3220 }
3221
3222 unsafe impl fidl::encoding::TypeMarker for StatusWatcherWatchStatusResponse {
3223 type Owned = Self;
3224
3225 #[inline(always)]
3226 fn inline_align(_context: fidl::encoding::Context) -> usize {
3227 8
3228 }
3229
3230 #[inline(always)]
3231 fn inline_size(_context: fidl::encoding::Context) -> usize {
3232 16
3233 }
3234 }
3235
3236 unsafe impl<D: fidl::encoding::ResourceDialect>
3237 fidl::encoding::Encode<StatusWatcherWatchStatusResponse, D>
3238 for &StatusWatcherWatchStatusResponse
3239 {
3240 #[inline]
3241 unsafe fn encode(
3242 self,
3243 encoder: &mut fidl::encoding::Encoder<'_, D>,
3244 offset: usize,
3245 _depth: fidl::encoding::Depth,
3246 ) -> fidl::Result<()> {
3247 encoder.debug_check_bounds::<StatusWatcherWatchStatusResponse>(offset);
3248 fidl::encoding::Encode::<StatusWatcherWatchStatusResponse, D>::encode(
3250 (<PortStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.port_status),),
3251 encoder,
3252 offset,
3253 _depth,
3254 )
3255 }
3256 }
3257 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PortStatus, D>>
3258 fidl::encoding::Encode<StatusWatcherWatchStatusResponse, D> for (T0,)
3259 {
3260 #[inline]
3261 unsafe fn encode(
3262 self,
3263 encoder: &mut fidl::encoding::Encoder<'_, D>,
3264 offset: usize,
3265 depth: fidl::encoding::Depth,
3266 ) -> fidl::Result<()> {
3267 encoder.debug_check_bounds::<StatusWatcherWatchStatusResponse>(offset);
3268 self.0.encode(encoder, offset + 0, depth)?;
3272 Ok(())
3273 }
3274 }
3275
3276 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3277 for StatusWatcherWatchStatusResponse
3278 {
3279 #[inline(always)]
3280 fn new_empty() -> Self {
3281 Self { port_status: fidl::new_empty!(PortStatus, D) }
3282 }
3283
3284 #[inline]
3285 unsafe fn decode(
3286 &mut self,
3287 decoder: &mut fidl::encoding::Decoder<'_, D>,
3288 offset: usize,
3289 _depth: fidl::encoding::Depth,
3290 ) -> fidl::Result<()> {
3291 decoder.debug_check_bounds::<Self>(offset);
3292 fidl::decode!(PortStatus, D, &mut self.port_status, decoder, offset + 0, _depth)?;
3294 Ok(())
3295 }
3296 }
3297
3298 impl DeviceBaseInfo {
3299 #[inline(always)]
3300 fn max_ordinal_present(&self) -> u64 {
3301 if let Some(_) = self.tx_accel {
3302 return 11;
3303 }
3304 if let Some(_) = self.rx_accel {
3305 return 10;
3306 }
3307 if let Some(_) = self.max_buffer_parts {
3308 return 9;
3309 }
3310 if let Some(_) = self.min_tx_buffer_tail {
3311 return 8;
3312 }
3313 if let Some(_) = self.min_tx_buffer_head {
3314 return 7;
3315 }
3316 if let Some(_) = self.min_tx_buffer_length {
3317 return 6;
3318 }
3319 if let Some(_) = self.min_rx_buffer_length {
3320 return 5;
3321 }
3322 if let Some(_) = self.max_buffer_length {
3323 return 4;
3324 }
3325 if let Some(_) = self.buffer_alignment {
3326 return 3;
3327 }
3328 if let Some(_) = self.tx_depth {
3329 return 2;
3330 }
3331 if let Some(_) = self.rx_depth {
3332 return 1;
3333 }
3334 0
3335 }
3336 }
3337
3338 impl fidl::encoding::ValueTypeMarker for DeviceBaseInfo {
3339 type Borrowed<'a> = &'a Self;
3340 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3341 value
3342 }
3343 }
3344
3345 unsafe impl fidl::encoding::TypeMarker for DeviceBaseInfo {
3346 type Owned = Self;
3347
3348 #[inline(always)]
3349 fn inline_align(_context: fidl::encoding::Context) -> usize {
3350 8
3351 }
3352
3353 #[inline(always)]
3354 fn inline_size(_context: fidl::encoding::Context) -> usize {
3355 16
3356 }
3357 }
3358
3359 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceBaseInfo, D>
3360 for &DeviceBaseInfo
3361 {
3362 unsafe fn encode(
3363 self,
3364 encoder: &mut fidl::encoding::Encoder<'_, D>,
3365 offset: usize,
3366 mut depth: fidl::encoding::Depth,
3367 ) -> fidl::Result<()> {
3368 encoder.debug_check_bounds::<DeviceBaseInfo>(offset);
3369 let max_ordinal: u64 = self.max_ordinal_present();
3371 encoder.write_num(max_ordinal, offset);
3372 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3373 if max_ordinal == 0 {
3375 return Ok(());
3376 }
3377 depth.increment()?;
3378 let envelope_size = 8;
3379 let bytes_len = max_ordinal as usize * envelope_size;
3380 #[allow(unused_variables)]
3381 let offset = encoder.out_of_line_offset(bytes_len);
3382 let mut _prev_end_offset: usize = 0;
3383 if 1 > max_ordinal {
3384 return Ok(());
3385 }
3386
3387 let cur_offset: usize = (1 - 1) * envelope_size;
3390
3391 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3393
3394 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3399 self.rx_depth.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3400 encoder,
3401 offset + cur_offset,
3402 depth,
3403 )?;
3404
3405 _prev_end_offset = cur_offset + envelope_size;
3406 if 2 > max_ordinal {
3407 return Ok(());
3408 }
3409
3410 let cur_offset: usize = (2 - 1) * envelope_size;
3413
3414 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3416
3417 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3422 self.tx_depth.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3423 encoder,
3424 offset + cur_offset,
3425 depth,
3426 )?;
3427
3428 _prev_end_offset = cur_offset + envelope_size;
3429 if 3 > max_ordinal {
3430 return Ok(());
3431 }
3432
3433 let cur_offset: usize = (3 - 1) * envelope_size;
3436
3437 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3439
3440 fidl::encoding::encode_in_envelope_optional::<u32, D>(
3445 self.buffer_alignment
3446 .as_ref()
3447 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3448 encoder,
3449 offset + cur_offset,
3450 depth,
3451 )?;
3452
3453 _prev_end_offset = cur_offset + envelope_size;
3454 if 4 > max_ordinal {
3455 return Ok(());
3456 }
3457
3458 let cur_offset: usize = (4 - 1) * envelope_size;
3461
3462 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3464
3465 fidl::encoding::encode_in_envelope_optional::<u32, D>(
3470 self.max_buffer_length
3471 .as_ref()
3472 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3473 encoder,
3474 offset + cur_offset,
3475 depth,
3476 )?;
3477
3478 _prev_end_offset = cur_offset + envelope_size;
3479 if 5 > max_ordinal {
3480 return Ok(());
3481 }
3482
3483 let cur_offset: usize = (5 - 1) * envelope_size;
3486
3487 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3489
3490 fidl::encoding::encode_in_envelope_optional::<u32, D>(
3495 self.min_rx_buffer_length
3496 .as_ref()
3497 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3498 encoder,
3499 offset + cur_offset,
3500 depth,
3501 )?;
3502
3503 _prev_end_offset = cur_offset + envelope_size;
3504 if 6 > max_ordinal {
3505 return Ok(());
3506 }
3507
3508 let cur_offset: usize = (6 - 1) * envelope_size;
3511
3512 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3514
3515 fidl::encoding::encode_in_envelope_optional::<u32, D>(
3520 self.min_tx_buffer_length
3521 .as_ref()
3522 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3523 encoder,
3524 offset + cur_offset,
3525 depth,
3526 )?;
3527
3528 _prev_end_offset = cur_offset + envelope_size;
3529 if 7 > max_ordinal {
3530 return Ok(());
3531 }
3532
3533 let cur_offset: usize = (7 - 1) * envelope_size;
3536
3537 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3539
3540 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3545 self.min_tx_buffer_head
3546 .as_ref()
3547 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3548 encoder,
3549 offset + cur_offset,
3550 depth,
3551 )?;
3552
3553 _prev_end_offset = cur_offset + envelope_size;
3554 if 8 > max_ordinal {
3555 return Ok(());
3556 }
3557
3558 let cur_offset: usize = (8 - 1) * envelope_size;
3561
3562 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3564
3565 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3570 self.min_tx_buffer_tail
3571 .as_ref()
3572 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3573 encoder,
3574 offset + cur_offset,
3575 depth,
3576 )?;
3577
3578 _prev_end_offset = cur_offset + envelope_size;
3579 if 9 > max_ordinal {
3580 return Ok(());
3581 }
3582
3583 let cur_offset: usize = (9 - 1) * envelope_size;
3586
3587 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3589
3590 fidl::encoding::encode_in_envelope_optional::<u8, D>(
3595 self.max_buffer_parts.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
3596 encoder,
3597 offset + cur_offset,
3598 depth,
3599 )?;
3600
3601 _prev_end_offset = cur_offset + envelope_size;
3602 if 10 > max_ordinal {
3603 return Ok(());
3604 }
3605
3606 let cur_offset: usize = (10 - 1) * envelope_size;
3609
3610 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3612
3613 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<RxAcceleration, 16>, D>(
3618 self.rx_accel.as_ref().map(<fidl::encoding::Vector<RxAcceleration, 16> as fidl::encoding::ValueTypeMarker>::borrow),
3619 encoder, offset + cur_offset, depth
3620 )?;
3621
3622 _prev_end_offset = cur_offset + envelope_size;
3623 if 11 > max_ordinal {
3624 return Ok(());
3625 }
3626
3627 let cur_offset: usize = (11 - 1) * envelope_size;
3630
3631 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3633
3634 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<TxAcceleration, 16>, D>(
3639 self.tx_accel.as_ref().map(<fidl::encoding::Vector<TxAcceleration, 16> as fidl::encoding::ValueTypeMarker>::borrow),
3640 encoder, offset + cur_offset, depth
3641 )?;
3642
3643 _prev_end_offset = cur_offset + envelope_size;
3644
3645 Ok(())
3646 }
3647 }
3648
3649 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceBaseInfo {
3650 #[inline(always)]
3651 fn new_empty() -> Self {
3652 Self::default()
3653 }
3654
3655 unsafe fn decode(
3656 &mut self,
3657 decoder: &mut fidl::encoding::Decoder<'_, D>,
3658 offset: usize,
3659 mut depth: fidl::encoding::Depth,
3660 ) -> fidl::Result<()> {
3661 decoder.debug_check_bounds::<Self>(offset);
3662 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3663 None => return Err(fidl::Error::NotNullable),
3664 Some(len) => len,
3665 };
3666 if len == 0 {
3668 return Ok(());
3669 };
3670 depth.increment()?;
3671 let envelope_size = 8;
3672 let bytes_len = len * envelope_size;
3673 let offset = decoder.out_of_line_offset(bytes_len)?;
3674 let mut _next_ordinal_to_read = 0;
3676 let mut next_offset = offset;
3677 let end_offset = offset + bytes_len;
3678 _next_ordinal_to_read += 1;
3679 if next_offset >= end_offset {
3680 return Ok(());
3681 }
3682
3683 while _next_ordinal_to_read < 1 {
3685 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3686 _next_ordinal_to_read += 1;
3687 next_offset += envelope_size;
3688 }
3689
3690 let next_out_of_line = decoder.next_out_of_line();
3691 let handles_before = decoder.remaining_handles();
3692 if let Some((inlined, num_bytes, num_handles)) =
3693 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3694 {
3695 let member_inline_size =
3696 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3697 if inlined != (member_inline_size <= 4) {
3698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3699 }
3700 let inner_offset;
3701 let mut inner_depth = depth.clone();
3702 if inlined {
3703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3704 inner_offset = next_offset;
3705 } else {
3706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3707 inner_depth.increment()?;
3708 }
3709 let val_ref = self.rx_depth.get_or_insert_with(|| fidl::new_empty!(u16, D));
3710 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3711 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3712 {
3713 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3714 }
3715 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3716 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3717 }
3718 }
3719
3720 next_offset += envelope_size;
3721 _next_ordinal_to_read += 1;
3722 if next_offset >= end_offset {
3723 return Ok(());
3724 }
3725
3726 while _next_ordinal_to_read < 2 {
3728 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3729 _next_ordinal_to_read += 1;
3730 next_offset += envelope_size;
3731 }
3732
3733 let next_out_of_line = decoder.next_out_of_line();
3734 let handles_before = decoder.remaining_handles();
3735 if let Some((inlined, num_bytes, num_handles)) =
3736 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3737 {
3738 let member_inline_size =
3739 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3740 if inlined != (member_inline_size <= 4) {
3741 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3742 }
3743 let inner_offset;
3744 let mut inner_depth = depth.clone();
3745 if inlined {
3746 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3747 inner_offset = next_offset;
3748 } else {
3749 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3750 inner_depth.increment()?;
3751 }
3752 let val_ref = self.tx_depth.get_or_insert_with(|| fidl::new_empty!(u16, D));
3753 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3754 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3755 {
3756 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3757 }
3758 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3759 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3760 }
3761 }
3762
3763 next_offset += envelope_size;
3764 _next_ordinal_to_read += 1;
3765 if next_offset >= end_offset {
3766 return Ok(());
3767 }
3768
3769 while _next_ordinal_to_read < 3 {
3771 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3772 _next_ordinal_to_read += 1;
3773 next_offset += envelope_size;
3774 }
3775
3776 let next_out_of_line = decoder.next_out_of_line();
3777 let handles_before = decoder.remaining_handles();
3778 if let Some((inlined, num_bytes, num_handles)) =
3779 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3780 {
3781 let member_inline_size =
3782 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3783 if inlined != (member_inline_size <= 4) {
3784 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3785 }
3786 let inner_offset;
3787 let mut inner_depth = depth.clone();
3788 if inlined {
3789 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3790 inner_offset = next_offset;
3791 } else {
3792 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3793 inner_depth.increment()?;
3794 }
3795 let val_ref = self.buffer_alignment.get_or_insert_with(|| fidl::new_empty!(u32, D));
3796 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3797 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3798 {
3799 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3800 }
3801 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3802 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3803 }
3804 }
3805
3806 next_offset += envelope_size;
3807 _next_ordinal_to_read += 1;
3808 if next_offset >= end_offset {
3809 return Ok(());
3810 }
3811
3812 while _next_ordinal_to_read < 4 {
3814 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3815 _next_ordinal_to_read += 1;
3816 next_offset += envelope_size;
3817 }
3818
3819 let next_out_of_line = decoder.next_out_of_line();
3820 let handles_before = decoder.remaining_handles();
3821 if let Some((inlined, num_bytes, num_handles)) =
3822 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3823 {
3824 let member_inline_size =
3825 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3826 if inlined != (member_inline_size <= 4) {
3827 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3828 }
3829 let inner_offset;
3830 let mut inner_depth = depth.clone();
3831 if inlined {
3832 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3833 inner_offset = next_offset;
3834 } else {
3835 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3836 inner_depth.increment()?;
3837 }
3838 let val_ref =
3839 self.max_buffer_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
3840 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3841 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3842 {
3843 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3844 }
3845 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3846 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3847 }
3848 }
3849
3850 next_offset += envelope_size;
3851 _next_ordinal_to_read += 1;
3852 if next_offset >= end_offset {
3853 return Ok(());
3854 }
3855
3856 while _next_ordinal_to_read < 5 {
3858 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3859 _next_ordinal_to_read += 1;
3860 next_offset += envelope_size;
3861 }
3862
3863 let next_out_of_line = decoder.next_out_of_line();
3864 let handles_before = decoder.remaining_handles();
3865 if let Some((inlined, num_bytes, num_handles)) =
3866 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3867 {
3868 let member_inline_size =
3869 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3870 if inlined != (member_inline_size <= 4) {
3871 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3872 }
3873 let inner_offset;
3874 let mut inner_depth = depth.clone();
3875 if inlined {
3876 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3877 inner_offset = next_offset;
3878 } else {
3879 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3880 inner_depth.increment()?;
3881 }
3882 let val_ref =
3883 self.min_rx_buffer_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
3884 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3885 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3886 {
3887 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3888 }
3889 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3890 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3891 }
3892 }
3893
3894 next_offset += envelope_size;
3895 _next_ordinal_to_read += 1;
3896 if next_offset >= end_offset {
3897 return Ok(());
3898 }
3899
3900 while _next_ordinal_to_read < 6 {
3902 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3903 _next_ordinal_to_read += 1;
3904 next_offset += envelope_size;
3905 }
3906
3907 let next_out_of_line = decoder.next_out_of_line();
3908 let handles_before = decoder.remaining_handles();
3909 if let Some((inlined, num_bytes, num_handles)) =
3910 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3911 {
3912 let member_inline_size =
3913 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3914 if inlined != (member_inline_size <= 4) {
3915 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3916 }
3917 let inner_offset;
3918 let mut inner_depth = depth.clone();
3919 if inlined {
3920 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3921 inner_offset = next_offset;
3922 } else {
3923 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3924 inner_depth.increment()?;
3925 }
3926 let val_ref =
3927 self.min_tx_buffer_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
3928 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3929 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3930 {
3931 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3932 }
3933 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3934 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3935 }
3936 }
3937
3938 next_offset += envelope_size;
3939 _next_ordinal_to_read += 1;
3940 if next_offset >= end_offset {
3941 return Ok(());
3942 }
3943
3944 while _next_ordinal_to_read < 7 {
3946 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3947 _next_ordinal_to_read += 1;
3948 next_offset += envelope_size;
3949 }
3950
3951 let next_out_of_line = decoder.next_out_of_line();
3952 let handles_before = decoder.remaining_handles();
3953 if let Some((inlined, num_bytes, num_handles)) =
3954 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3955 {
3956 let member_inline_size =
3957 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3958 if inlined != (member_inline_size <= 4) {
3959 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3960 }
3961 let inner_offset;
3962 let mut inner_depth = depth.clone();
3963 if inlined {
3964 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3965 inner_offset = next_offset;
3966 } else {
3967 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3968 inner_depth.increment()?;
3969 }
3970 let val_ref =
3971 self.min_tx_buffer_head.get_or_insert_with(|| fidl::new_empty!(u16, D));
3972 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3973 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3974 {
3975 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3976 }
3977 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3978 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3979 }
3980 }
3981
3982 next_offset += envelope_size;
3983 _next_ordinal_to_read += 1;
3984 if next_offset >= end_offset {
3985 return Ok(());
3986 }
3987
3988 while _next_ordinal_to_read < 8 {
3990 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3991 _next_ordinal_to_read += 1;
3992 next_offset += envelope_size;
3993 }
3994
3995 let next_out_of_line = decoder.next_out_of_line();
3996 let handles_before = decoder.remaining_handles();
3997 if let Some((inlined, num_bytes, num_handles)) =
3998 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3999 {
4000 let member_inline_size =
4001 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4002 if inlined != (member_inline_size <= 4) {
4003 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4004 }
4005 let inner_offset;
4006 let mut inner_depth = depth.clone();
4007 if inlined {
4008 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4009 inner_offset = next_offset;
4010 } else {
4011 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4012 inner_depth.increment()?;
4013 }
4014 let val_ref =
4015 self.min_tx_buffer_tail.get_or_insert_with(|| fidl::new_empty!(u16, D));
4016 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4017 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4018 {
4019 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4020 }
4021 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4022 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4023 }
4024 }
4025
4026 next_offset += envelope_size;
4027 _next_ordinal_to_read += 1;
4028 if next_offset >= end_offset {
4029 return Ok(());
4030 }
4031
4032 while _next_ordinal_to_read < 9 {
4034 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4035 _next_ordinal_to_read += 1;
4036 next_offset += envelope_size;
4037 }
4038
4039 let next_out_of_line = decoder.next_out_of_line();
4040 let handles_before = decoder.remaining_handles();
4041 if let Some((inlined, num_bytes, num_handles)) =
4042 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4043 {
4044 let member_inline_size =
4045 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4046 if inlined != (member_inline_size <= 4) {
4047 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4048 }
4049 let inner_offset;
4050 let mut inner_depth = depth.clone();
4051 if inlined {
4052 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4053 inner_offset = next_offset;
4054 } else {
4055 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4056 inner_depth.increment()?;
4057 }
4058 let val_ref = self.max_buffer_parts.get_or_insert_with(|| fidl::new_empty!(u8, D));
4059 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4060 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4061 {
4062 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4063 }
4064 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4065 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4066 }
4067 }
4068
4069 next_offset += envelope_size;
4070 _next_ordinal_to_read += 1;
4071 if next_offset >= end_offset {
4072 return Ok(());
4073 }
4074
4075 while _next_ordinal_to_read < 10 {
4077 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4078 _next_ordinal_to_read += 1;
4079 next_offset += envelope_size;
4080 }
4081
4082 let next_out_of_line = decoder.next_out_of_line();
4083 let handles_before = decoder.remaining_handles();
4084 if let Some((inlined, num_bytes, num_handles)) =
4085 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4086 {
4087 let member_inline_size = <fidl::encoding::Vector<RxAcceleration, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4088 if inlined != (member_inline_size <= 4) {
4089 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4090 }
4091 let inner_offset;
4092 let mut inner_depth = depth.clone();
4093 if inlined {
4094 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4095 inner_offset = next_offset;
4096 } else {
4097 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4098 inner_depth.increment()?;
4099 }
4100 let val_ref = self.rx_accel.get_or_insert_with(
4101 || fidl::new_empty!(fidl::encoding::Vector<RxAcceleration, 16>, D),
4102 );
4103 fidl::decode!(fidl::encoding::Vector<RxAcceleration, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
4104 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4105 {
4106 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4107 }
4108 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4109 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4110 }
4111 }
4112
4113 next_offset += envelope_size;
4114 _next_ordinal_to_read += 1;
4115 if next_offset >= end_offset {
4116 return Ok(());
4117 }
4118
4119 while _next_ordinal_to_read < 11 {
4121 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4122 _next_ordinal_to_read += 1;
4123 next_offset += envelope_size;
4124 }
4125
4126 let next_out_of_line = decoder.next_out_of_line();
4127 let handles_before = decoder.remaining_handles();
4128 if let Some((inlined, num_bytes, num_handles)) =
4129 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4130 {
4131 let member_inline_size = <fidl::encoding::Vector<TxAcceleration, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4132 if inlined != (member_inline_size <= 4) {
4133 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4134 }
4135 let inner_offset;
4136 let mut inner_depth = depth.clone();
4137 if inlined {
4138 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4139 inner_offset = next_offset;
4140 } else {
4141 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4142 inner_depth.increment()?;
4143 }
4144 let val_ref = self.tx_accel.get_or_insert_with(
4145 || fidl::new_empty!(fidl::encoding::Vector<TxAcceleration, 16>, D),
4146 );
4147 fidl::decode!(fidl::encoding::Vector<TxAcceleration, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
4148 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4149 {
4150 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4151 }
4152 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4153 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4154 }
4155 }
4156
4157 next_offset += envelope_size;
4158
4159 while next_offset < end_offset {
4161 _next_ordinal_to_read += 1;
4162 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4163 next_offset += envelope_size;
4164 }
4165
4166 Ok(())
4167 }
4168 }
4169
4170 impl DeviceInfo {
4171 #[inline(always)]
4172 fn max_ordinal_present(&self) -> u64 {
4173 if let Some(_) = self.base_info {
4174 return 3;
4175 }
4176 if let Some(_) = self.descriptor_version {
4177 return 2;
4178 }
4179 if let Some(_) = self.min_descriptor_length {
4180 return 1;
4181 }
4182 0
4183 }
4184 }
4185
4186 impl fidl::encoding::ValueTypeMarker for DeviceInfo {
4187 type Borrowed<'a> = &'a Self;
4188 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4189 value
4190 }
4191 }
4192
4193 unsafe impl fidl::encoding::TypeMarker for DeviceInfo {
4194 type Owned = Self;
4195
4196 #[inline(always)]
4197 fn inline_align(_context: fidl::encoding::Context) -> usize {
4198 8
4199 }
4200
4201 #[inline(always)]
4202 fn inline_size(_context: fidl::encoding::Context) -> usize {
4203 16
4204 }
4205 }
4206
4207 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceInfo, D>
4208 for &DeviceInfo
4209 {
4210 unsafe fn encode(
4211 self,
4212 encoder: &mut fidl::encoding::Encoder<'_, D>,
4213 offset: usize,
4214 mut depth: fidl::encoding::Depth,
4215 ) -> fidl::Result<()> {
4216 encoder.debug_check_bounds::<DeviceInfo>(offset);
4217 let max_ordinal: u64 = self.max_ordinal_present();
4219 encoder.write_num(max_ordinal, offset);
4220 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4221 if max_ordinal == 0 {
4223 return Ok(());
4224 }
4225 depth.increment()?;
4226 let envelope_size = 8;
4227 let bytes_len = max_ordinal as usize * envelope_size;
4228 #[allow(unused_variables)]
4229 let offset = encoder.out_of_line_offset(bytes_len);
4230 let mut _prev_end_offset: usize = 0;
4231 if 1 > max_ordinal {
4232 return Ok(());
4233 }
4234
4235 let cur_offset: usize = (1 - 1) * envelope_size;
4238
4239 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4241
4242 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4247 self.min_descriptor_length
4248 .as_ref()
4249 .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4250 encoder,
4251 offset + cur_offset,
4252 depth,
4253 )?;
4254
4255 _prev_end_offset = cur_offset + envelope_size;
4256 if 2 > max_ordinal {
4257 return Ok(());
4258 }
4259
4260 let cur_offset: usize = (2 - 1) * envelope_size;
4263
4264 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4266
4267 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4272 self.descriptor_version
4273 .as_ref()
4274 .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4275 encoder,
4276 offset + cur_offset,
4277 depth,
4278 )?;
4279
4280 _prev_end_offset = cur_offset + envelope_size;
4281 if 3 > max_ordinal {
4282 return Ok(());
4283 }
4284
4285 let cur_offset: usize = (3 - 1) * envelope_size;
4288
4289 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4291
4292 fidl::encoding::encode_in_envelope_optional::<DeviceBaseInfo, D>(
4297 self.base_info
4298 .as_ref()
4299 .map(<DeviceBaseInfo as fidl::encoding::ValueTypeMarker>::borrow),
4300 encoder,
4301 offset + cur_offset,
4302 depth,
4303 )?;
4304
4305 _prev_end_offset = cur_offset + envelope_size;
4306
4307 Ok(())
4308 }
4309 }
4310
4311 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceInfo {
4312 #[inline(always)]
4313 fn new_empty() -> Self {
4314 Self::default()
4315 }
4316
4317 unsafe fn decode(
4318 &mut self,
4319 decoder: &mut fidl::encoding::Decoder<'_, D>,
4320 offset: usize,
4321 mut depth: fidl::encoding::Depth,
4322 ) -> fidl::Result<()> {
4323 decoder.debug_check_bounds::<Self>(offset);
4324 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4325 None => return Err(fidl::Error::NotNullable),
4326 Some(len) => len,
4327 };
4328 if len == 0 {
4330 return Ok(());
4331 };
4332 depth.increment()?;
4333 let envelope_size = 8;
4334 let bytes_len = len * envelope_size;
4335 let offset = decoder.out_of_line_offset(bytes_len)?;
4336 let mut _next_ordinal_to_read = 0;
4338 let mut next_offset = offset;
4339 let end_offset = offset + bytes_len;
4340 _next_ordinal_to_read += 1;
4341 if next_offset >= end_offset {
4342 return Ok(());
4343 }
4344
4345 while _next_ordinal_to_read < 1 {
4347 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4348 _next_ordinal_to_read += 1;
4349 next_offset += envelope_size;
4350 }
4351
4352 let next_out_of_line = decoder.next_out_of_line();
4353 let handles_before = decoder.remaining_handles();
4354 if let Some((inlined, num_bytes, num_handles)) =
4355 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4356 {
4357 let member_inline_size =
4358 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4359 if inlined != (member_inline_size <= 4) {
4360 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4361 }
4362 let inner_offset;
4363 let mut inner_depth = depth.clone();
4364 if inlined {
4365 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4366 inner_offset = next_offset;
4367 } else {
4368 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4369 inner_depth.increment()?;
4370 }
4371 let val_ref =
4372 self.min_descriptor_length.get_or_insert_with(|| fidl::new_empty!(u8, D));
4373 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4374 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4375 {
4376 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4377 }
4378 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4379 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4380 }
4381 }
4382
4383 next_offset += envelope_size;
4384 _next_ordinal_to_read += 1;
4385 if next_offset >= end_offset {
4386 return Ok(());
4387 }
4388
4389 while _next_ordinal_to_read < 2 {
4391 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4392 _next_ordinal_to_read += 1;
4393 next_offset += envelope_size;
4394 }
4395
4396 let next_out_of_line = decoder.next_out_of_line();
4397 let handles_before = decoder.remaining_handles();
4398 if let Some((inlined, num_bytes, num_handles)) =
4399 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4400 {
4401 let member_inline_size =
4402 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4403 if inlined != (member_inline_size <= 4) {
4404 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4405 }
4406 let inner_offset;
4407 let mut inner_depth = depth.clone();
4408 if inlined {
4409 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4410 inner_offset = next_offset;
4411 } else {
4412 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4413 inner_depth.increment()?;
4414 }
4415 let val_ref =
4416 self.descriptor_version.get_or_insert_with(|| fidl::new_empty!(u8, D));
4417 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4418 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4419 {
4420 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4421 }
4422 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4423 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4424 }
4425 }
4426
4427 next_offset += envelope_size;
4428 _next_ordinal_to_read += 1;
4429 if next_offset >= end_offset {
4430 return Ok(());
4431 }
4432
4433 while _next_ordinal_to_read < 3 {
4435 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4436 _next_ordinal_to_read += 1;
4437 next_offset += envelope_size;
4438 }
4439
4440 let next_out_of_line = decoder.next_out_of_line();
4441 let handles_before = decoder.remaining_handles();
4442 if let Some((inlined, num_bytes, num_handles)) =
4443 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4444 {
4445 let member_inline_size =
4446 <DeviceBaseInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4447 if inlined != (member_inline_size <= 4) {
4448 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4449 }
4450 let inner_offset;
4451 let mut inner_depth = depth.clone();
4452 if inlined {
4453 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4454 inner_offset = next_offset;
4455 } else {
4456 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4457 inner_depth.increment()?;
4458 }
4459 let val_ref =
4460 self.base_info.get_or_insert_with(|| fidl::new_empty!(DeviceBaseInfo, D));
4461 fidl::decode!(DeviceBaseInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
4462 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4463 {
4464 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4465 }
4466 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4467 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4468 }
4469 }
4470
4471 next_offset += envelope_size;
4472
4473 while next_offset < end_offset {
4475 _next_ordinal_to_read += 1;
4476 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4477 next_offset += envelope_size;
4478 }
4479
4480 Ok(())
4481 }
4482 }
4483
4484 impl PortBaseInfo {
4485 #[inline(always)]
4486 fn max_ordinal_present(&self) -> u64 {
4487 if let Some(_) = self.tx_types {
4488 return 3;
4489 }
4490 if let Some(_) = self.rx_types {
4491 return 2;
4492 }
4493 if let Some(_) = self.port_class {
4494 return 1;
4495 }
4496 0
4497 }
4498 }
4499
4500 impl fidl::encoding::ValueTypeMarker for PortBaseInfo {
4501 type Borrowed<'a> = &'a Self;
4502 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4503 value
4504 }
4505 }
4506
4507 unsafe impl fidl::encoding::TypeMarker for PortBaseInfo {
4508 type Owned = Self;
4509
4510 #[inline(always)]
4511 fn inline_align(_context: fidl::encoding::Context) -> usize {
4512 8
4513 }
4514
4515 #[inline(always)]
4516 fn inline_size(_context: fidl::encoding::Context) -> usize {
4517 16
4518 }
4519 }
4520
4521 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PortBaseInfo, D>
4522 for &PortBaseInfo
4523 {
4524 unsafe fn encode(
4525 self,
4526 encoder: &mut fidl::encoding::Encoder<'_, D>,
4527 offset: usize,
4528 mut depth: fidl::encoding::Depth,
4529 ) -> fidl::Result<()> {
4530 encoder.debug_check_bounds::<PortBaseInfo>(offset);
4531 let max_ordinal: u64 = self.max_ordinal_present();
4533 encoder.write_num(max_ordinal, offset);
4534 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4535 if max_ordinal == 0 {
4537 return Ok(());
4538 }
4539 depth.increment()?;
4540 let envelope_size = 8;
4541 let bytes_len = max_ordinal as usize * envelope_size;
4542 #[allow(unused_variables)]
4543 let offset = encoder.out_of_line_offset(bytes_len);
4544 let mut _prev_end_offset: usize = 0;
4545 if 1 > max_ordinal {
4546 return Ok(());
4547 }
4548
4549 let cur_offset: usize = (1 - 1) * envelope_size;
4552
4553 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4555
4556 fidl::encoding::encode_in_envelope_optional::<PortClass, D>(
4561 self.port_class
4562 .as_ref()
4563 .map(<PortClass as fidl::encoding::ValueTypeMarker>::borrow),
4564 encoder,
4565 offset + cur_offset,
4566 depth,
4567 )?;
4568
4569 _prev_end_offset = cur_offset + envelope_size;
4570 if 2 > max_ordinal {
4571 return Ok(());
4572 }
4573
4574 let cur_offset: usize = (2 - 1) * envelope_size;
4577
4578 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4580
4581 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<FrameType, 4>, D>(
4586 self.rx_types.as_ref().map(<fidl::encoding::Vector<FrameType, 4> as fidl::encoding::ValueTypeMarker>::borrow),
4587 encoder, offset + cur_offset, depth
4588 )?;
4589
4590 _prev_end_offset = cur_offset + envelope_size;
4591 if 3 > max_ordinal {
4592 return Ok(());
4593 }
4594
4595 let cur_offset: usize = (3 - 1) * envelope_size;
4598
4599 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4601
4602 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<FrameTypeSupport, 4>, D>(
4607 self.tx_types.as_ref().map(<fidl::encoding::Vector<FrameTypeSupport, 4> as fidl::encoding::ValueTypeMarker>::borrow),
4608 encoder, offset + cur_offset, depth
4609 )?;
4610
4611 _prev_end_offset = cur_offset + envelope_size;
4612
4613 Ok(())
4614 }
4615 }
4616
4617 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortBaseInfo {
4618 #[inline(always)]
4619 fn new_empty() -> Self {
4620 Self::default()
4621 }
4622
4623 unsafe fn decode(
4624 &mut self,
4625 decoder: &mut fidl::encoding::Decoder<'_, D>,
4626 offset: usize,
4627 mut depth: fidl::encoding::Depth,
4628 ) -> fidl::Result<()> {
4629 decoder.debug_check_bounds::<Self>(offset);
4630 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4631 None => return Err(fidl::Error::NotNullable),
4632 Some(len) => len,
4633 };
4634 if len == 0 {
4636 return Ok(());
4637 };
4638 depth.increment()?;
4639 let envelope_size = 8;
4640 let bytes_len = len * envelope_size;
4641 let offset = decoder.out_of_line_offset(bytes_len)?;
4642 let mut _next_ordinal_to_read = 0;
4644 let mut next_offset = offset;
4645 let end_offset = offset + bytes_len;
4646 _next_ordinal_to_read += 1;
4647 if next_offset >= end_offset {
4648 return Ok(());
4649 }
4650
4651 while _next_ordinal_to_read < 1 {
4653 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4654 _next_ordinal_to_read += 1;
4655 next_offset += envelope_size;
4656 }
4657
4658 let next_out_of_line = decoder.next_out_of_line();
4659 let handles_before = decoder.remaining_handles();
4660 if let Some((inlined, num_bytes, num_handles)) =
4661 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4662 {
4663 let member_inline_size =
4664 <PortClass as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4665 if inlined != (member_inline_size <= 4) {
4666 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4667 }
4668 let inner_offset;
4669 let mut inner_depth = depth.clone();
4670 if inlined {
4671 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4672 inner_offset = next_offset;
4673 } else {
4674 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4675 inner_depth.increment()?;
4676 }
4677 let val_ref = self.port_class.get_or_insert_with(|| fidl::new_empty!(PortClass, D));
4678 fidl::decode!(PortClass, D, val_ref, decoder, inner_offset, inner_depth)?;
4679 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4680 {
4681 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4682 }
4683 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4684 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4685 }
4686 }
4687
4688 next_offset += envelope_size;
4689 _next_ordinal_to_read += 1;
4690 if next_offset >= end_offset {
4691 return Ok(());
4692 }
4693
4694 while _next_ordinal_to_read < 2 {
4696 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4697 _next_ordinal_to_read += 1;
4698 next_offset += envelope_size;
4699 }
4700
4701 let next_out_of_line = decoder.next_out_of_line();
4702 let handles_before = decoder.remaining_handles();
4703 if let Some((inlined, num_bytes, num_handles)) =
4704 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4705 {
4706 let member_inline_size = <fidl::encoding::Vector<FrameType, 4> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4707 if inlined != (member_inline_size <= 4) {
4708 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4709 }
4710 let inner_offset;
4711 let mut inner_depth = depth.clone();
4712 if inlined {
4713 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4714 inner_offset = next_offset;
4715 } else {
4716 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4717 inner_depth.increment()?;
4718 }
4719 let val_ref = self.rx_types.get_or_insert_with(
4720 || fidl::new_empty!(fidl::encoding::Vector<FrameType, 4>, D),
4721 );
4722 fidl::decode!(fidl::encoding::Vector<FrameType, 4>, D, val_ref, decoder, inner_offset, inner_depth)?;
4723 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4724 {
4725 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4726 }
4727 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4728 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4729 }
4730 }
4731
4732 next_offset += envelope_size;
4733 _next_ordinal_to_read += 1;
4734 if next_offset >= end_offset {
4735 return Ok(());
4736 }
4737
4738 while _next_ordinal_to_read < 3 {
4740 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4741 _next_ordinal_to_read += 1;
4742 next_offset += envelope_size;
4743 }
4744
4745 let next_out_of_line = decoder.next_out_of_line();
4746 let handles_before = decoder.remaining_handles();
4747 if let Some((inlined, num_bytes, num_handles)) =
4748 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4749 {
4750 let member_inline_size = <fidl::encoding::Vector<FrameTypeSupport, 4> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4751 if inlined != (member_inline_size <= 4) {
4752 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4753 }
4754 let inner_offset;
4755 let mut inner_depth = depth.clone();
4756 if inlined {
4757 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4758 inner_offset = next_offset;
4759 } else {
4760 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4761 inner_depth.increment()?;
4762 }
4763 let val_ref = self.tx_types.get_or_insert_with(
4764 || fidl::new_empty!(fidl::encoding::Vector<FrameTypeSupport, 4>, D),
4765 );
4766 fidl::decode!(fidl::encoding::Vector<FrameTypeSupport, 4>, D, val_ref, decoder, inner_offset, inner_depth)?;
4767 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4768 {
4769 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4770 }
4771 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4772 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4773 }
4774 }
4775
4776 next_offset += envelope_size;
4777
4778 while next_offset < end_offset {
4780 _next_ordinal_to_read += 1;
4781 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4782 next_offset += envelope_size;
4783 }
4784
4785 Ok(())
4786 }
4787 }
4788
4789 impl PortGetCountersResponse {
4790 #[inline(always)]
4791 fn max_ordinal_present(&self) -> u64 {
4792 if let Some(_) = self.tx_bytes {
4793 return 4;
4794 }
4795 if let Some(_) = self.tx_frames {
4796 return 3;
4797 }
4798 if let Some(_) = self.rx_bytes {
4799 return 2;
4800 }
4801 if let Some(_) = self.rx_frames {
4802 return 1;
4803 }
4804 0
4805 }
4806 }
4807
4808 impl fidl::encoding::ValueTypeMarker for PortGetCountersResponse {
4809 type Borrowed<'a> = &'a Self;
4810 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4811 value
4812 }
4813 }
4814
4815 unsafe impl fidl::encoding::TypeMarker for PortGetCountersResponse {
4816 type Owned = Self;
4817
4818 #[inline(always)]
4819 fn inline_align(_context: fidl::encoding::Context) -> usize {
4820 8
4821 }
4822
4823 #[inline(always)]
4824 fn inline_size(_context: fidl::encoding::Context) -> usize {
4825 16
4826 }
4827 }
4828
4829 unsafe impl<D: fidl::encoding::ResourceDialect>
4830 fidl::encoding::Encode<PortGetCountersResponse, D> for &PortGetCountersResponse
4831 {
4832 unsafe fn encode(
4833 self,
4834 encoder: &mut fidl::encoding::Encoder<'_, D>,
4835 offset: usize,
4836 mut depth: fidl::encoding::Depth,
4837 ) -> fidl::Result<()> {
4838 encoder.debug_check_bounds::<PortGetCountersResponse>(offset);
4839 let max_ordinal: u64 = self.max_ordinal_present();
4841 encoder.write_num(max_ordinal, offset);
4842 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4843 if max_ordinal == 0 {
4845 return Ok(());
4846 }
4847 depth.increment()?;
4848 let envelope_size = 8;
4849 let bytes_len = max_ordinal as usize * envelope_size;
4850 #[allow(unused_variables)]
4851 let offset = encoder.out_of_line_offset(bytes_len);
4852 let mut _prev_end_offset: usize = 0;
4853 if 1 > max_ordinal {
4854 return Ok(());
4855 }
4856
4857 let cur_offset: usize = (1 - 1) * envelope_size;
4860
4861 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4863
4864 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4869 self.rx_frames.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4870 encoder,
4871 offset + cur_offset,
4872 depth,
4873 )?;
4874
4875 _prev_end_offset = cur_offset + envelope_size;
4876 if 2 > max_ordinal {
4877 return Ok(());
4878 }
4879
4880 let cur_offset: usize = (2 - 1) * envelope_size;
4883
4884 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4886
4887 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4892 self.rx_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4893 encoder,
4894 offset + cur_offset,
4895 depth,
4896 )?;
4897
4898 _prev_end_offset = cur_offset + envelope_size;
4899 if 3 > max_ordinal {
4900 return Ok(());
4901 }
4902
4903 let cur_offset: usize = (3 - 1) * envelope_size;
4906
4907 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4909
4910 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4915 self.tx_frames.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4916 encoder,
4917 offset + cur_offset,
4918 depth,
4919 )?;
4920
4921 _prev_end_offset = cur_offset + envelope_size;
4922 if 4 > max_ordinal {
4923 return Ok(());
4924 }
4925
4926 let cur_offset: usize = (4 - 1) * envelope_size;
4929
4930 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4932
4933 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4938 self.tx_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4939 encoder,
4940 offset + cur_offset,
4941 depth,
4942 )?;
4943
4944 _prev_end_offset = cur_offset + envelope_size;
4945
4946 Ok(())
4947 }
4948 }
4949
4950 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4951 for PortGetCountersResponse
4952 {
4953 #[inline(always)]
4954 fn new_empty() -> Self {
4955 Self::default()
4956 }
4957
4958 unsafe fn decode(
4959 &mut self,
4960 decoder: &mut fidl::encoding::Decoder<'_, D>,
4961 offset: usize,
4962 mut depth: fidl::encoding::Depth,
4963 ) -> fidl::Result<()> {
4964 decoder.debug_check_bounds::<Self>(offset);
4965 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4966 None => return Err(fidl::Error::NotNullable),
4967 Some(len) => len,
4968 };
4969 if len == 0 {
4971 return Ok(());
4972 };
4973 depth.increment()?;
4974 let envelope_size = 8;
4975 let bytes_len = len * envelope_size;
4976 let offset = decoder.out_of_line_offset(bytes_len)?;
4977 let mut _next_ordinal_to_read = 0;
4979 let mut next_offset = offset;
4980 let end_offset = offset + bytes_len;
4981 _next_ordinal_to_read += 1;
4982 if next_offset >= end_offset {
4983 return Ok(());
4984 }
4985
4986 while _next_ordinal_to_read < 1 {
4988 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4989 _next_ordinal_to_read += 1;
4990 next_offset += envelope_size;
4991 }
4992
4993 let next_out_of_line = decoder.next_out_of_line();
4994 let handles_before = decoder.remaining_handles();
4995 if let Some((inlined, num_bytes, num_handles)) =
4996 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4997 {
4998 let member_inline_size =
4999 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5000 if inlined != (member_inline_size <= 4) {
5001 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5002 }
5003 let inner_offset;
5004 let mut inner_depth = depth.clone();
5005 if inlined {
5006 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5007 inner_offset = next_offset;
5008 } else {
5009 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5010 inner_depth.increment()?;
5011 }
5012 let val_ref = self.rx_frames.get_or_insert_with(|| fidl::new_empty!(u64, D));
5013 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5014 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5015 {
5016 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5017 }
5018 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5019 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5020 }
5021 }
5022
5023 next_offset += envelope_size;
5024 _next_ordinal_to_read += 1;
5025 if next_offset >= end_offset {
5026 return Ok(());
5027 }
5028
5029 while _next_ordinal_to_read < 2 {
5031 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5032 _next_ordinal_to_read += 1;
5033 next_offset += envelope_size;
5034 }
5035
5036 let next_out_of_line = decoder.next_out_of_line();
5037 let handles_before = decoder.remaining_handles();
5038 if let Some((inlined, num_bytes, num_handles)) =
5039 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5040 {
5041 let member_inline_size =
5042 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5043 if inlined != (member_inline_size <= 4) {
5044 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5045 }
5046 let inner_offset;
5047 let mut inner_depth = depth.clone();
5048 if inlined {
5049 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5050 inner_offset = next_offset;
5051 } else {
5052 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5053 inner_depth.increment()?;
5054 }
5055 let val_ref = self.rx_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
5056 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5057 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5058 {
5059 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5060 }
5061 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5062 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5063 }
5064 }
5065
5066 next_offset += envelope_size;
5067 _next_ordinal_to_read += 1;
5068 if next_offset >= end_offset {
5069 return Ok(());
5070 }
5071
5072 while _next_ordinal_to_read < 3 {
5074 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5075 _next_ordinal_to_read += 1;
5076 next_offset += envelope_size;
5077 }
5078
5079 let next_out_of_line = decoder.next_out_of_line();
5080 let handles_before = decoder.remaining_handles();
5081 if let Some((inlined, num_bytes, num_handles)) =
5082 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5083 {
5084 let member_inline_size =
5085 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5086 if inlined != (member_inline_size <= 4) {
5087 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5088 }
5089 let inner_offset;
5090 let mut inner_depth = depth.clone();
5091 if inlined {
5092 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5093 inner_offset = next_offset;
5094 } else {
5095 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5096 inner_depth.increment()?;
5097 }
5098 let val_ref = self.tx_frames.get_or_insert_with(|| fidl::new_empty!(u64, D));
5099 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5100 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5101 {
5102 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5103 }
5104 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5105 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5106 }
5107 }
5108
5109 next_offset += envelope_size;
5110 _next_ordinal_to_read += 1;
5111 if next_offset >= end_offset {
5112 return Ok(());
5113 }
5114
5115 while _next_ordinal_to_read < 4 {
5117 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5118 _next_ordinal_to_read += 1;
5119 next_offset += envelope_size;
5120 }
5121
5122 let next_out_of_line = decoder.next_out_of_line();
5123 let handles_before = decoder.remaining_handles();
5124 if let Some((inlined, num_bytes, num_handles)) =
5125 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5126 {
5127 let member_inline_size =
5128 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5129 if inlined != (member_inline_size <= 4) {
5130 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5131 }
5132 let inner_offset;
5133 let mut inner_depth = depth.clone();
5134 if inlined {
5135 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5136 inner_offset = next_offset;
5137 } else {
5138 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5139 inner_depth.increment()?;
5140 }
5141 let val_ref = self.tx_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
5142 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5143 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5144 {
5145 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5146 }
5147 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5148 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5149 }
5150 }
5151
5152 next_offset += envelope_size;
5153
5154 while next_offset < end_offset {
5156 _next_ordinal_to_read += 1;
5157 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5158 next_offset += envelope_size;
5159 }
5160
5161 Ok(())
5162 }
5163 }
5164
5165 impl PortInfo {
5166 #[inline(always)]
5167 fn max_ordinal_present(&self) -> u64 {
5168 if let Some(_) = self.base_info {
5169 return 2;
5170 }
5171 if let Some(_) = self.id {
5172 return 1;
5173 }
5174 0
5175 }
5176 }
5177
5178 impl fidl::encoding::ValueTypeMarker for PortInfo {
5179 type Borrowed<'a> = &'a Self;
5180 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5181 value
5182 }
5183 }
5184
5185 unsafe impl fidl::encoding::TypeMarker for PortInfo {
5186 type Owned = Self;
5187
5188 #[inline(always)]
5189 fn inline_align(_context: fidl::encoding::Context) -> usize {
5190 8
5191 }
5192
5193 #[inline(always)]
5194 fn inline_size(_context: fidl::encoding::Context) -> usize {
5195 16
5196 }
5197 }
5198
5199 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PortInfo, D> for &PortInfo {
5200 unsafe fn encode(
5201 self,
5202 encoder: &mut fidl::encoding::Encoder<'_, D>,
5203 offset: usize,
5204 mut depth: fidl::encoding::Depth,
5205 ) -> fidl::Result<()> {
5206 encoder.debug_check_bounds::<PortInfo>(offset);
5207 let max_ordinal: u64 = self.max_ordinal_present();
5209 encoder.write_num(max_ordinal, offset);
5210 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5211 if max_ordinal == 0 {
5213 return Ok(());
5214 }
5215 depth.increment()?;
5216 let envelope_size = 8;
5217 let bytes_len = max_ordinal as usize * envelope_size;
5218 #[allow(unused_variables)]
5219 let offset = encoder.out_of_line_offset(bytes_len);
5220 let mut _prev_end_offset: usize = 0;
5221 if 1 > max_ordinal {
5222 return Ok(());
5223 }
5224
5225 let cur_offset: usize = (1 - 1) * envelope_size;
5228
5229 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5231
5232 fidl::encoding::encode_in_envelope_optional::<PortId, D>(
5237 self.id.as_ref().map(<PortId as fidl::encoding::ValueTypeMarker>::borrow),
5238 encoder,
5239 offset + cur_offset,
5240 depth,
5241 )?;
5242
5243 _prev_end_offset = cur_offset + envelope_size;
5244 if 2 > max_ordinal {
5245 return Ok(());
5246 }
5247
5248 let cur_offset: usize = (2 - 1) * envelope_size;
5251
5252 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5254
5255 fidl::encoding::encode_in_envelope_optional::<PortBaseInfo, D>(
5260 self.base_info
5261 .as_ref()
5262 .map(<PortBaseInfo as fidl::encoding::ValueTypeMarker>::borrow),
5263 encoder,
5264 offset + cur_offset,
5265 depth,
5266 )?;
5267
5268 _prev_end_offset = cur_offset + envelope_size;
5269
5270 Ok(())
5271 }
5272 }
5273
5274 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortInfo {
5275 #[inline(always)]
5276 fn new_empty() -> Self {
5277 Self::default()
5278 }
5279
5280 unsafe fn decode(
5281 &mut self,
5282 decoder: &mut fidl::encoding::Decoder<'_, D>,
5283 offset: usize,
5284 mut depth: fidl::encoding::Depth,
5285 ) -> fidl::Result<()> {
5286 decoder.debug_check_bounds::<Self>(offset);
5287 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5288 None => return Err(fidl::Error::NotNullable),
5289 Some(len) => len,
5290 };
5291 if len == 0 {
5293 return Ok(());
5294 };
5295 depth.increment()?;
5296 let envelope_size = 8;
5297 let bytes_len = len * envelope_size;
5298 let offset = decoder.out_of_line_offset(bytes_len)?;
5299 let mut _next_ordinal_to_read = 0;
5301 let mut next_offset = offset;
5302 let end_offset = offset + bytes_len;
5303 _next_ordinal_to_read += 1;
5304 if next_offset >= end_offset {
5305 return Ok(());
5306 }
5307
5308 while _next_ordinal_to_read < 1 {
5310 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5311 _next_ordinal_to_read += 1;
5312 next_offset += envelope_size;
5313 }
5314
5315 let next_out_of_line = decoder.next_out_of_line();
5316 let handles_before = decoder.remaining_handles();
5317 if let Some((inlined, num_bytes, num_handles)) =
5318 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5319 {
5320 let member_inline_size =
5321 <PortId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5322 if inlined != (member_inline_size <= 4) {
5323 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5324 }
5325 let inner_offset;
5326 let mut inner_depth = depth.clone();
5327 if inlined {
5328 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5329 inner_offset = next_offset;
5330 } else {
5331 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5332 inner_depth.increment()?;
5333 }
5334 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(PortId, D));
5335 fidl::decode!(PortId, D, val_ref, decoder, inner_offset, inner_depth)?;
5336 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5337 {
5338 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5339 }
5340 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5341 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5342 }
5343 }
5344
5345 next_offset += envelope_size;
5346 _next_ordinal_to_read += 1;
5347 if next_offset >= end_offset {
5348 return Ok(());
5349 }
5350
5351 while _next_ordinal_to_read < 2 {
5353 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5354 _next_ordinal_to_read += 1;
5355 next_offset += envelope_size;
5356 }
5357
5358 let next_out_of_line = decoder.next_out_of_line();
5359 let handles_before = decoder.remaining_handles();
5360 if let Some((inlined, num_bytes, num_handles)) =
5361 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5362 {
5363 let member_inline_size =
5364 <PortBaseInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5365 if inlined != (member_inline_size <= 4) {
5366 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5367 }
5368 let inner_offset;
5369 let mut inner_depth = depth.clone();
5370 if inlined {
5371 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5372 inner_offset = next_offset;
5373 } else {
5374 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5375 inner_depth.increment()?;
5376 }
5377 let val_ref =
5378 self.base_info.get_or_insert_with(|| fidl::new_empty!(PortBaseInfo, D));
5379 fidl::decode!(PortBaseInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5380 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5381 {
5382 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5383 }
5384 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5385 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5386 }
5387 }
5388
5389 next_offset += envelope_size;
5390
5391 while next_offset < end_offset {
5393 _next_ordinal_to_read += 1;
5394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5395 next_offset += envelope_size;
5396 }
5397
5398 Ok(())
5399 }
5400 }
5401
5402 impl PortStatus {
5403 #[inline(always)]
5404 fn max_ordinal_present(&self) -> u64 {
5405 if let Some(_) = self.mtu {
5406 return 2;
5407 }
5408 if let Some(_) = self.flags {
5409 return 1;
5410 }
5411 0
5412 }
5413 }
5414
5415 impl fidl::encoding::ValueTypeMarker for PortStatus {
5416 type Borrowed<'a> = &'a Self;
5417 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5418 value
5419 }
5420 }
5421
5422 unsafe impl fidl::encoding::TypeMarker for PortStatus {
5423 type Owned = Self;
5424
5425 #[inline(always)]
5426 fn inline_align(_context: fidl::encoding::Context) -> usize {
5427 8
5428 }
5429
5430 #[inline(always)]
5431 fn inline_size(_context: fidl::encoding::Context) -> usize {
5432 16
5433 }
5434 }
5435
5436 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PortStatus, D>
5437 for &PortStatus
5438 {
5439 unsafe fn encode(
5440 self,
5441 encoder: &mut fidl::encoding::Encoder<'_, D>,
5442 offset: usize,
5443 mut depth: fidl::encoding::Depth,
5444 ) -> fidl::Result<()> {
5445 encoder.debug_check_bounds::<PortStatus>(offset);
5446 let max_ordinal: u64 = self.max_ordinal_present();
5448 encoder.write_num(max_ordinal, offset);
5449 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5450 if max_ordinal == 0 {
5452 return Ok(());
5453 }
5454 depth.increment()?;
5455 let envelope_size = 8;
5456 let bytes_len = max_ordinal as usize * envelope_size;
5457 #[allow(unused_variables)]
5458 let offset = encoder.out_of_line_offset(bytes_len);
5459 let mut _prev_end_offset: usize = 0;
5460 if 1 > max_ordinal {
5461 return Ok(());
5462 }
5463
5464 let cur_offset: usize = (1 - 1) * envelope_size;
5467
5468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5470
5471 fidl::encoding::encode_in_envelope_optional::<StatusFlags, D>(
5476 self.flags.as_ref().map(<StatusFlags as fidl::encoding::ValueTypeMarker>::borrow),
5477 encoder,
5478 offset + cur_offset,
5479 depth,
5480 )?;
5481
5482 _prev_end_offset = cur_offset + envelope_size;
5483 if 2 > max_ordinal {
5484 return Ok(());
5485 }
5486
5487 let cur_offset: usize = (2 - 1) * envelope_size;
5490
5491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5493
5494 fidl::encoding::encode_in_envelope_optional::<u32, D>(
5499 self.mtu.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5500 encoder,
5501 offset + cur_offset,
5502 depth,
5503 )?;
5504
5505 _prev_end_offset = cur_offset + envelope_size;
5506
5507 Ok(())
5508 }
5509 }
5510
5511 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PortStatus {
5512 #[inline(always)]
5513 fn new_empty() -> Self {
5514 Self::default()
5515 }
5516
5517 unsafe fn decode(
5518 &mut self,
5519 decoder: &mut fidl::encoding::Decoder<'_, D>,
5520 offset: usize,
5521 mut depth: fidl::encoding::Depth,
5522 ) -> fidl::Result<()> {
5523 decoder.debug_check_bounds::<Self>(offset);
5524 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5525 None => return Err(fidl::Error::NotNullable),
5526 Some(len) => len,
5527 };
5528 if len == 0 {
5530 return Ok(());
5531 };
5532 depth.increment()?;
5533 let envelope_size = 8;
5534 let bytes_len = len * envelope_size;
5535 let offset = decoder.out_of_line_offset(bytes_len)?;
5536 let mut _next_ordinal_to_read = 0;
5538 let mut next_offset = offset;
5539 let end_offset = offset + bytes_len;
5540 _next_ordinal_to_read += 1;
5541 if next_offset >= end_offset {
5542 return Ok(());
5543 }
5544
5545 while _next_ordinal_to_read < 1 {
5547 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5548 _next_ordinal_to_read += 1;
5549 next_offset += envelope_size;
5550 }
5551
5552 let next_out_of_line = decoder.next_out_of_line();
5553 let handles_before = decoder.remaining_handles();
5554 if let Some((inlined, num_bytes, num_handles)) =
5555 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5556 {
5557 let member_inline_size =
5558 <StatusFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5559 if inlined != (member_inline_size <= 4) {
5560 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5561 }
5562 let inner_offset;
5563 let mut inner_depth = depth.clone();
5564 if inlined {
5565 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5566 inner_offset = next_offset;
5567 } else {
5568 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5569 inner_depth.increment()?;
5570 }
5571 let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(StatusFlags, D));
5572 fidl::decode!(StatusFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
5573 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5574 {
5575 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5576 }
5577 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5578 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5579 }
5580 }
5581
5582 next_offset += envelope_size;
5583 _next_ordinal_to_read += 1;
5584 if next_offset >= end_offset {
5585 return Ok(());
5586 }
5587
5588 while _next_ordinal_to_read < 2 {
5590 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5591 _next_ordinal_to_read += 1;
5592 next_offset += envelope_size;
5593 }
5594
5595 let next_out_of_line = decoder.next_out_of_line();
5596 let handles_before = decoder.remaining_handles();
5597 if let Some((inlined, num_bytes, num_handles)) =
5598 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5599 {
5600 let member_inline_size =
5601 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5602 if inlined != (member_inline_size <= 4) {
5603 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5604 }
5605 let inner_offset;
5606 let mut inner_depth = depth.clone();
5607 if inlined {
5608 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5609 inner_offset = next_offset;
5610 } else {
5611 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5612 inner_depth.increment()?;
5613 }
5614 let val_ref = self.mtu.get_or_insert_with(|| fidl::new_empty!(u32, D));
5615 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5616 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5617 {
5618 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5619 }
5620 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5621 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5622 }
5623 }
5624
5625 next_offset += envelope_size;
5626
5627 while next_offset < end_offset {
5629 _next_ordinal_to_read += 1;
5630 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5631 next_offset += envelope_size;
5632 }
5633
5634 Ok(())
5635 }
5636 }
5637
5638 impl fidl::encoding::ValueTypeMarker for DevicePortEvent {
5639 type Borrowed<'a> = &'a Self;
5640 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5641 value
5642 }
5643 }
5644
5645 unsafe impl fidl::encoding::TypeMarker for DevicePortEvent {
5646 type Owned = Self;
5647
5648 #[inline(always)]
5649 fn inline_align(_context: fidl::encoding::Context) -> usize {
5650 8
5651 }
5652
5653 #[inline(always)]
5654 fn inline_size(_context: fidl::encoding::Context) -> usize {
5655 16
5656 }
5657 }
5658
5659 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DevicePortEvent, D>
5660 for &DevicePortEvent
5661 {
5662 #[inline]
5663 unsafe fn encode(
5664 self,
5665 encoder: &mut fidl::encoding::Encoder<'_, D>,
5666 offset: usize,
5667 _depth: fidl::encoding::Depth,
5668 ) -> fidl::Result<()> {
5669 encoder.debug_check_bounds::<DevicePortEvent>(offset);
5670 encoder.write_num::<u64>(self.ordinal(), offset);
5671 match self {
5672 DevicePortEvent::Existing(ref val) => {
5673 fidl::encoding::encode_in_envelope::<PortId, D>(
5674 <PortId as fidl::encoding::ValueTypeMarker>::borrow(val),
5675 encoder,
5676 offset + 8,
5677 _depth,
5678 )
5679 }
5680 DevicePortEvent::Added(ref val) => fidl::encoding::encode_in_envelope::<PortId, D>(
5681 <PortId as fidl::encoding::ValueTypeMarker>::borrow(val),
5682 encoder,
5683 offset + 8,
5684 _depth,
5685 ),
5686 DevicePortEvent::Removed(ref val) => {
5687 fidl::encoding::encode_in_envelope::<PortId, D>(
5688 <PortId as fidl::encoding::ValueTypeMarker>::borrow(val),
5689 encoder,
5690 offset + 8,
5691 _depth,
5692 )
5693 }
5694 DevicePortEvent::Idle(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
5695 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
5696 encoder,
5697 offset + 8,
5698 _depth,
5699 ),
5700 }
5701 }
5702 }
5703
5704 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DevicePortEvent {
5705 #[inline(always)]
5706 fn new_empty() -> Self {
5707 Self::Existing(fidl::new_empty!(PortId, D))
5708 }
5709
5710 #[inline]
5711 unsafe fn decode(
5712 &mut self,
5713 decoder: &mut fidl::encoding::Decoder<'_, D>,
5714 offset: usize,
5715 mut depth: fidl::encoding::Depth,
5716 ) -> fidl::Result<()> {
5717 decoder.debug_check_bounds::<Self>(offset);
5718 #[allow(unused_variables)]
5719 let next_out_of_line = decoder.next_out_of_line();
5720 let handles_before = decoder.remaining_handles();
5721 let (ordinal, inlined, num_bytes, num_handles) =
5722 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5723
5724 let member_inline_size = match ordinal {
5725 1 => <PortId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5726 2 => <PortId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5727 3 => <PortId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5728 4 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5729 _ => return Err(fidl::Error::UnknownUnionTag),
5730 };
5731
5732 if inlined != (member_inline_size <= 4) {
5733 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5734 }
5735 let _inner_offset;
5736 if inlined {
5737 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5738 _inner_offset = offset + 8;
5739 } else {
5740 depth.increment()?;
5741 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5742 }
5743 match ordinal {
5744 1 => {
5745 #[allow(irrefutable_let_patterns)]
5746 if let DevicePortEvent::Existing(_) = self {
5747 } else {
5749 *self = DevicePortEvent::Existing(fidl::new_empty!(PortId, D));
5751 }
5752 #[allow(irrefutable_let_patterns)]
5753 if let DevicePortEvent::Existing(ref mut val) = self {
5754 fidl::decode!(PortId, D, val, decoder, _inner_offset, depth)?;
5755 } else {
5756 unreachable!()
5757 }
5758 }
5759 2 => {
5760 #[allow(irrefutable_let_patterns)]
5761 if let DevicePortEvent::Added(_) = self {
5762 } else {
5764 *self = DevicePortEvent::Added(fidl::new_empty!(PortId, D));
5766 }
5767 #[allow(irrefutable_let_patterns)]
5768 if let DevicePortEvent::Added(ref mut val) = self {
5769 fidl::decode!(PortId, D, val, decoder, _inner_offset, depth)?;
5770 } else {
5771 unreachable!()
5772 }
5773 }
5774 3 => {
5775 #[allow(irrefutable_let_patterns)]
5776 if let DevicePortEvent::Removed(_) = self {
5777 } else {
5779 *self = DevicePortEvent::Removed(fidl::new_empty!(PortId, D));
5781 }
5782 #[allow(irrefutable_let_patterns)]
5783 if let DevicePortEvent::Removed(ref mut val) = self {
5784 fidl::decode!(PortId, D, val, decoder, _inner_offset, depth)?;
5785 } else {
5786 unreachable!()
5787 }
5788 }
5789 4 => {
5790 #[allow(irrefutable_let_patterns)]
5791 if let DevicePortEvent::Idle(_) = self {
5792 } else {
5794 *self = DevicePortEvent::Idle(fidl::new_empty!(Empty, D));
5796 }
5797 #[allow(irrefutable_let_patterns)]
5798 if let DevicePortEvent::Idle(ref mut val) = self {
5799 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
5800 } else {
5801 unreachable!()
5802 }
5803 }
5804 ordinal => panic!("unexpected ordinal {:?}", ordinal),
5805 }
5806 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5807 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5808 }
5809 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5810 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5811 }
5812 Ok(())
5813 }
5814 }
5815}