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 CapabilityInfo = u16;
16
17pub type WlanSoftmacHardwareCapability = u32;
18
19pub const MAX_BANDS: u8 = 16;
22
23pub const MAX_SUPPORTED_MAC_ROLES: u8 = 16;
26
27pub const MAX_SUPPORTED_PHY_TYPES: u8 = 64;
30
31pub const WLAN_MAC_MAX_EXT_RATES: u32 = 255;
32
33pub const WLAN_MAC_MAX_SUPP_RATES: u32 = 8;
40
41pub const WLAN_TX_RESULT_MAX_ENTRY: u32 = 8;
42
43pub const WLAN_TX_VECTOR_IDX_INVALID: u16 = 0;
44
45#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
46pub enum BssType {
47 Unknown,
48 Infrastructure,
49 Independent,
50 Mesh,
51 Personal,
52 #[doc(hidden)]
53 __SourceBreaking {
54 unknown_ordinal: u32,
55 },
56}
57
58#[macro_export]
60macro_rules! BssTypeUnknown {
61 () => {
62 _
63 };
64}
65
66impl BssType {
67 #[inline]
68 pub fn from_primitive(prim: u32) -> Option<Self> {
69 match prim {
70 0 => Some(Self::Unknown),
71 1 => Some(Self::Infrastructure),
72 2 => Some(Self::Independent),
73 3 => Some(Self::Mesh),
74 4 => Some(Self::Personal),
75 _ => None,
76 }
77 }
78
79 #[inline]
80 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
81 match prim {
82 0 => Self::Unknown,
83 1 => Self::Infrastructure,
84 2 => Self::Independent,
85 3 => Self::Mesh,
86 4 => Self::Personal,
87 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
88 }
89 }
90
91 #[inline]
92 pub fn unknown() -> Self {
93 Self::__SourceBreaking { unknown_ordinal: 0x0 }
94 }
95
96 #[inline]
97 pub const fn into_primitive(self) -> u32 {
98 match self {
99 Self::Unknown => 0,
100 Self::Infrastructure => 1,
101 Self::Independent => 2,
102 Self::Mesh => 3,
103 Self::Personal => 4,
104 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
105 }
106 }
107
108 #[inline]
109 pub fn is_unknown(&self) -> bool {
110 match self {
111 Self::__SourceBreaking { unknown_ordinal: _ } => true,
112 _ => false,
113 }
114 }
115}
116
117#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
118pub enum ChannelBandwidth {
119 Cbw20,
120 Cbw40,
121 Cbw40Below,
122 Cbw80,
123 Cbw160,
124 Cbw80P80,
125 #[doc(hidden)]
126 __SourceBreaking {
127 unknown_ordinal: u32,
128 },
129}
130
131#[macro_export]
133macro_rules! ChannelBandwidthUnknown {
134 () => {
135 _
136 };
137}
138
139impl ChannelBandwidth {
140 #[inline]
141 pub fn from_primitive(prim: u32) -> Option<Self> {
142 match prim {
143 1 => Some(Self::Cbw20),
144 2 => Some(Self::Cbw40),
145 3 => Some(Self::Cbw40Below),
146 4 => Some(Self::Cbw80),
147 5 => Some(Self::Cbw160),
148 6 => Some(Self::Cbw80P80),
149 _ => None,
150 }
151 }
152
153 #[inline]
154 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
155 match prim {
156 1 => Self::Cbw20,
157 2 => Self::Cbw40,
158 3 => Self::Cbw40Below,
159 4 => Self::Cbw80,
160 5 => Self::Cbw160,
161 6 => Self::Cbw80P80,
162 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
163 }
164 }
165
166 #[inline]
167 pub fn unknown() -> Self {
168 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
169 }
170
171 #[inline]
172 pub const fn into_primitive(self) -> u32 {
173 match self {
174 Self::Cbw20 => 1,
175 Self::Cbw40 => 2,
176 Self::Cbw40Below => 3,
177 Self::Cbw80 => 4,
178 Self::Cbw160 => 5,
179 Self::Cbw80P80 => 6,
180 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
181 }
182 }
183
184 #[inline]
185 pub fn is_unknown(&self) -> bool {
186 match self {
187 Self::__SourceBreaking { unknown_ordinal: _ } => true,
188 _ => false,
189 }
190 }
191}
192
193#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
195#[repr(u8)]
196pub enum DataPlaneType {
197 EthernetDevice = 1,
198 GenericNetworkDevice = 2,
199}
200
201impl DataPlaneType {
202 #[inline]
203 pub fn from_primitive(prim: u8) -> Option<Self> {
204 match prim {
205 1 => Some(Self::EthernetDevice),
206 2 => Some(Self::GenericNetworkDevice),
207 _ => None,
208 }
209 }
210
211 #[inline]
212 pub const fn into_primitive(self) -> u8 {
213 self as u8
214 }
215}
216
217#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
220#[repr(u8)]
221pub enum GuardInterval {
222 LongGi = 1,
223 ShortGi = 2,
224}
225
226impl GuardInterval {
227 #[inline]
228 pub fn from_primitive(prim: u8) -> Option<Self> {
229 match prim {
230 1 => Some(Self::LongGi),
231 2 => Some(Self::ShortGi),
232 _ => None,
233 }
234 }
235
236 #[inline]
237 pub const fn into_primitive(self) -> u8 {
238 self as u8
239 }
240}
241
242#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
244#[repr(u8)]
245pub enum MacImplementationType {
246 Softmac = 1,
247 Fullmac = 2,
248}
249
250impl MacImplementationType {
251 #[inline]
252 pub fn from_primitive(prim: u8) -> Option<Self> {
253 match prim {
254 1 => Some(Self::Softmac),
255 2 => Some(Self::Fullmac),
256 _ => None,
257 }
258 }
259
260 #[inline]
261 pub const fn into_primitive(self) -> u8 {
262 self as u8
263 }
264}
265
266#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
267#[repr(u32)]
268pub enum PowerSaveType {
269 PsModeUltraLowPower = 0,
270 PsModeLowPower = 1,
271 PsModeBalanced = 2,
272 PsModePerformance = 3,
273}
274
275impl PowerSaveType {
276 #[inline]
277 pub fn from_primitive(prim: u32) -> Option<Self> {
278 match prim {
279 0 => Some(Self::PsModeUltraLowPower),
280 1 => Some(Self::PsModeLowPower),
281 2 => Some(Self::PsModeBalanced),
282 3 => Some(Self::PsModePerformance),
283 _ => None,
284 }
285 }
286
287 #[inline]
288 pub const fn into_primitive(self) -> u32 {
289 self as u32
290 }
291}
292
293#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
294#[repr(u32)]
295pub enum RequestStatus {
296 Acknowledged = 0,
297 RejectedNotSupported = 1,
298 RejectedIncompatibleMode = 2,
299 RejectedAlreadyInUse = 3,
300 RejectedDuplicateRequest = 4,
301}
302
303impl RequestStatus {
304 #[inline]
305 pub fn from_primitive(prim: u32) -> Option<Self> {
306 match prim {
307 0 => Some(Self::Acknowledged),
308 1 => Some(Self::RejectedNotSupported),
309 2 => Some(Self::RejectedIncompatibleMode),
310 3 => Some(Self::RejectedAlreadyInUse),
311 4 => Some(Self::RejectedDuplicateRequest),
312 _ => None,
313 }
314 }
315
316 #[inline]
317 pub const fn into_primitive(self) -> u32 {
318 self as u32
319 }
320}
321
322#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
323#[repr(u32)]
324pub enum ScanType {
325 Active = 1,
326 Passive = 2,
327}
328
329impl ScanType {
330 #[inline]
331 pub fn from_primitive(prim: u32) -> Option<Self> {
332 match prim {
333 1 => Some(Self::Active),
334 2 => Some(Self::Passive),
335 _ => None,
336 }
337 }
338
339 #[inline]
340 pub const fn into_primitive(self) -> u32 {
341 self as u32
342 }
343}
344
345#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
346pub enum WlanBand {
347 TwoGhz,
348 FiveGhz,
349 #[doc(hidden)]
350 __SourceBreaking {
351 unknown_ordinal: u8,
352 },
353}
354
355#[macro_export]
357macro_rules! WlanBandUnknown {
358 () => {
359 _
360 };
361}
362
363impl WlanBand {
364 #[inline]
365 pub fn from_primitive(prim: u8) -> Option<Self> {
366 match prim {
367 0 => Some(Self::TwoGhz),
368 1 => Some(Self::FiveGhz),
369 _ => None,
370 }
371 }
372
373 #[inline]
374 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
375 match prim {
376 0 => Self::TwoGhz,
377 1 => Self::FiveGhz,
378 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
379 }
380 }
381
382 #[inline]
383 pub fn unknown() -> Self {
384 Self::__SourceBreaking { unknown_ordinal: 0xff }
385 }
386
387 #[inline]
388 pub const fn into_primitive(self) -> u8 {
389 match self {
390 Self::TwoGhz => 0,
391 Self::FiveGhz => 1,
392 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
393 }
394 }
395
396 #[inline]
397 pub fn is_unknown(&self) -> bool {
398 match self {
399 Self::__SourceBreaking { unknown_ordinal: _ } => true,
400 _ => false,
401 }
402 }
403}
404
405#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
406pub enum WlanKeyType {
407 Pairwise,
408 Group,
409 Igtk,
410 Peer,
411 #[doc(hidden)]
412 __SourceBreaking {
413 unknown_ordinal: u8,
414 },
415}
416
417#[macro_export]
419macro_rules! WlanKeyTypeUnknown {
420 () => {
421 _
422 };
423}
424
425impl WlanKeyType {
426 #[inline]
427 pub fn from_primitive(prim: u8) -> Option<Self> {
428 match prim {
429 1 => Some(Self::Pairwise),
430 2 => Some(Self::Group),
431 3 => Some(Self::Igtk),
432 4 => Some(Self::Peer),
433 _ => None,
434 }
435 }
436
437 #[inline]
438 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
439 match prim {
440 1 => Self::Pairwise,
441 2 => Self::Group,
442 3 => Self::Igtk,
443 4 => Self::Peer,
444 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
445 }
446 }
447
448 #[inline]
449 pub fn unknown() -> Self {
450 Self::__SourceBreaking { unknown_ordinal: 0xff }
451 }
452
453 #[inline]
454 pub const fn into_primitive(self) -> u8 {
455 match self {
456 Self::Pairwise => 1,
457 Self::Group => 2,
458 Self::Igtk => 3,
459 Self::Peer => 4,
460 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
461 }
462 }
463
464 #[inline]
465 pub fn is_unknown(&self) -> bool {
466 match self {
467 Self::__SourceBreaking { unknown_ordinal: _ } => true,
468 _ => false,
469 }
470 }
471}
472
473#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
474pub enum WlanMacRole {
475 Client,
476 Ap,
477 Mesh,
478 #[doc(hidden)]
479 __SourceBreaking {
480 unknown_ordinal: u32,
481 },
482}
483
484#[macro_export]
486macro_rules! WlanMacRoleUnknown {
487 () => {
488 _
489 };
490}
491
492impl WlanMacRole {
493 #[inline]
494 pub fn from_primitive(prim: u32) -> Option<Self> {
495 match prim {
496 1 => Some(Self::Client),
497 2 => Some(Self::Ap),
498 3 => Some(Self::Mesh),
499 _ => None,
500 }
501 }
502
503 #[inline]
504 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
505 match prim {
506 1 => Self::Client,
507 2 => Self::Ap,
508 3 => Self::Mesh,
509 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
510 }
511 }
512
513 #[inline]
514 pub fn unknown() -> Self {
515 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
516 }
517
518 #[inline]
519 pub const fn into_primitive(self) -> u32 {
520 match self {
521 Self::Client => 1,
522 Self::Ap => 2,
523 Self::Mesh => 3,
524 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
525 }
526 }
527
528 #[inline]
529 pub fn is_unknown(&self) -> bool {
530 match self {
531 Self::__SourceBreaking { unknown_ordinal: _ } => true,
532 _ => false,
533 }
534 }
535}
536
537#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
540pub enum WlanPhyType {
541 Dsss,
545 Hr,
550 Ofdm,
554 Erp,
559 Ht,
563 Dmg,
566 Vht,
570 Tvht,
574 S1G,
577 Cdmg,
580 Cmmg,
583 He,
586 #[doc(hidden)]
587 __SourceBreaking { unknown_ordinal: u32 },
588}
589
590#[macro_export]
592macro_rules! WlanPhyTypeUnknown {
593 () => {
594 _
595 };
596}
597
598impl WlanPhyType {
599 #[inline]
600 pub fn from_primitive(prim: u32) -> Option<Self> {
601 match prim {
602 1 => Some(Self::Dsss),
603 2 => Some(Self::Hr),
604 3 => Some(Self::Ofdm),
605 4 => Some(Self::Erp),
606 5 => Some(Self::Ht),
607 6 => Some(Self::Dmg),
608 7 => Some(Self::Vht),
609 8 => Some(Self::Tvht),
610 9 => Some(Self::S1G),
611 10 => Some(Self::Cdmg),
612 11 => Some(Self::Cmmg),
613 12 => Some(Self::He),
614 _ => None,
615 }
616 }
617
618 #[inline]
619 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
620 match prim {
621 1 => Self::Dsss,
622 2 => Self::Hr,
623 3 => Self::Ofdm,
624 4 => Self::Erp,
625 5 => Self::Ht,
626 6 => Self::Dmg,
627 7 => Self::Vht,
628 8 => Self::Tvht,
629 9 => Self::S1G,
630 10 => Self::Cdmg,
631 11 => Self::Cmmg,
632 12 => Self::He,
633 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
634 }
635 }
636
637 #[inline]
638 pub fn unknown() -> Self {
639 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
640 }
641
642 #[inline]
643 pub const fn into_primitive(self) -> u32 {
644 match self {
645 Self::Dsss => 1,
646 Self::Hr => 2,
647 Self::Ofdm => 3,
648 Self::Erp => 4,
649 Self::Ht => 5,
650 Self::Dmg => 6,
651 Self::Vht => 7,
652 Self::Tvht => 8,
653 Self::S1G => 9,
654 Self::Cdmg => 10,
655 Self::Cmmg => 11,
656 Self::He => 12,
657 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
658 }
659 }
660
661 #[inline]
662 pub fn is_unknown(&self) -> bool {
663 match self {
664 Self::__SourceBreaking { unknown_ordinal: _ } => true,
665 _ => false,
666 }
667 }
668}
669
670#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
671#[repr(u8)]
672pub enum WlanProtection {
673 None = 0,
674 Rx = 1,
675 Tx = 2,
676 RxTx = 3,
677}
678
679impl WlanProtection {
680 #[inline]
681 pub fn from_primitive(prim: u8) -> Option<Self> {
682 match prim {
683 0 => Some(Self::None),
684 1 => Some(Self::Rx),
685 2 => Some(Self::Tx),
686 3 => Some(Self::RxTx),
687 _ => None,
688 }
689 }
690
691 #[inline]
692 pub const fn into_primitive(self) -> u8 {
693 self as u8
694 }
695}
696
697#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
698#[repr(u32)]
699pub enum WlanSoftmacHardwareCapabilityBit {
700 ShortPreamble = 32,
702 SpectrumMgmt = 256,
704 Qos = 512,
705 ShortSlotTime = 1024,
707 RadioMsmt = 4096,
709 SimultaneousClientAp = 65536,
710}
711
712impl WlanSoftmacHardwareCapabilityBit {
713 #[inline]
714 pub fn from_primitive(prim: u32) -> Option<Self> {
715 match prim {
716 32 => Some(Self::ShortPreamble),
717 256 => Some(Self::SpectrumMgmt),
718 512 => Some(Self::Qos),
719 1024 => Some(Self::ShortSlotTime),
720 4096 => Some(Self::RadioMsmt),
721 65536 => Some(Self::SimultaneousClientAp),
722 _ => None,
723 }
724 }
725
726 #[inline]
727 pub const fn into_primitive(self) -> u32 {
728 self as u32
729 }
730}
731
732#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
734pub enum WlanTxResultCode {
735 Failed,
737 Success,
739 #[doc(hidden)]
740 __SourceBreaking { unknown_ordinal: u8 },
741}
742
743#[macro_export]
745macro_rules! WlanTxResultCodeUnknown {
746 () => {
747 _
748 };
749}
750
751impl WlanTxResultCode {
752 #[inline]
753 pub fn from_primitive(prim: u8) -> Option<Self> {
754 match prim {
755 0 => Some(Self::Failed),
756 1 => Some(Self::Success),
757 _ => None,
758 }
759 }
760
761 #[inline]
762 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
763 match prim {
764 0 => Self::Failed,
765 1 => Self::Success,
766 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
767 }
768 }
769
770 #[inline]
771 pub fn unknown() -> Self {
772 Self::__SourceBreaking { unknown_ordinal: 0xff }
773 }
774
775 #[inline]
776 pub const fn into_primitive(self) -> u8 {
777 match self {
778 Self::Failed => 0,
779 Self::Success => 1,
780 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
781 }
782 }
783
784 #[inline]
785 pub fn is_unknown(&self) -> bool {
786 match self {
787 Self::__SourceBreaking { unknown_ordinal: _ } => true,
788 _ => false,
789 }
790 }
791}
792
793#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
804pub struct BssDescription {
805 pub bssid: [u8; 6],
806 pub bss_type: BssType,
807 pub beacon_period: u16,
808 pub capability_info: u16,
809 pub ies: Vec<u8>,
812 pub channel: WlanChannel,
814 pub rssi_dbm: i8,
816 pub snr_db: i8,
818}
819
820impl fidl::Persistable for BssDescription {}
821
822#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
826pub struct DataPlaneExtension {
827 pub data_plane_type: DataPlaneType,
828}
829
830impl fidl::Persistable for DataPlaneExtension {}
831
832#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
836pub struct DeviceExtension {
837 pub is_synthetic: bool,
841 pub mac_implementation_type: MacImplementationType,
843 pub tx_status_report_supported: bool,
845}
846
847impl fidl::Persistable for DeviceExtension {}
848
849#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
853pub struct DfsFeature {
854 pub supported: bool,
859}
860
861impl fidl::Persistable for DfsFeature {}
862
863#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
866pub struct DiscoverySupport {
867 pub scan_offload: ScanOffloadExtension,
868 pub probe_response_offload: ProbeResponseOffloadExtension,
869}
870
871impl fidl::Persistable for DiscoverySupport {}
872
873#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
876pub struct MacSublayerSupport {
877 pub rate_selection_offload: RateSelectionOffloadExtension,
878 pub data_plane: DataPlaneExtension,
879 pub device: DeviceExtension,
880}
881
882impl fidl::Persistable for MacSublayerSupport {}
883
884#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
888pub struct MfpFeature {
889 pub supported: bool,
890}
891
892impl fidl::Persistable for MfpFeature {}
893
894#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
898pub struct ProbeResponseOffloadExtension {
899 pub supported: bool,
901}
902
903impl fidl::Persistable for ProbeResponseOffloadExtension {}
904
905#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
909pub struct RateSelectionOffloadExtension {
910 pub supported: bool,
912}
913
914impl fidl::Persistable for RateSelectionOffloadExtension {}
915
916#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
920pub struct SaeFeature {
921 pub driver_handler_supported: bool,
923 pub sme_handler_supported: bool,
925}
926
927impl fidl::Persistable for SaeFeature {}
928
929#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
933pub struct ScanOffloadExtension {
934 pub supported: bool,
936 pub scan_cancel_supported: bool,
937}
938
939impl fidl::Persistable for ScanOffloadExtension {}
940
941#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
944pub struct SecuritySupport {
945 pub sae: SaeFeature,
946 pub mfp: MfpFeature,
947}
948
949impl fidl::Persistable for SecuritySupport {}
950
951#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
954pub struct SpectrumManagementSupport {
955 pub dfs: DfsFeature,
956}
957
958impl fidl::Persistable for SpectrumManagementSupport {}
959
960#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
961pub struct WlanChannel {
962 pub primary: u8,
963 pub cbw: ChannelBandwidth,
964 pub secondary80: u8,
965}
966
967impl fidl::Persistable for WlanChannel {}
968
969#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
972pub struct WlanTxResult {
973 pub tx_result_entry: [WlanTxResultEntry; 8],
976 pub peer_addr: [u8; 6],
978 pub result_code: WlanTxResultCode,
979}
980
981impl fidl::Persistable for WlanTxResult {}
982
983#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
986#[repr(C)]
987pub struct WlanTxResultEntry {
988 pub tx_vector_idx: u16,
989 pub attempts: u8,
992}
993
994impl fidl::Persistable for WlanTxResultEntry {}
995
996#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
998pub struct WlanWmmAccessCategoryParameters {
999 pub ecw_min: u8,
1003 pub ecw_max: u8,
1007 pub aifsn: u8,
1009 pub txop_limit: u16,
1011 pub acm: bool,
1013}
1014
1015impl fidl::Persistable for WlanWmmAccessCategoryParameters {}
1016
1017#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1018pub struct WlanWmmParameters {
1019 pub apsd: bool,
1020 pub ac_be_params: WlanWmmAccessCategoryParameters,
1021 pub ac_bk_params: WlanWmmAccessCategoryParameters,
1022 pub ac_vi_params: WlanWmmAccessCategoryParameters,
1023 pub ac_vo_params: WlanWmmAccessCategoryParameters,
1024}
1025
1026impl fidl::Persistable for WlanWmmParameters {}
1027
1028#[derive(Clone, Debug, Default, PartialEq)]
1029pub struct JoinBssRequest {
1030 pub bssid: Option<[u8; 6]>,
1031 pub bss_type: Option<BssType>,
1032 pub remote: Option<bool>,
1033 pub beacon_period: Option<u16>,
1034 #[doc(hidden)]
1035 pub __source_breaking: fidl::marker::SourceBreaking,
1036}
1037
1038impl fidl::Persistable for JoinBssRequest {}
1039
1040#[derive(Clone, Debug, Default, PartialEq)]
1041pub struct WlanKeyConfig {
1042 pub protection: Option<WlanProtection>,
1044 pub cipher_oui: Option<[u8; 3]>,
1048 pub cipher_type: Option<fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType>,
1051 pub key_type: Option<WlanKeyType>,
1054 pub peer_addr: Option<[u8; 6]>,
1058 pub key_idx: Option<u8>,
1066 pub key: Option<Vec<u8>>,
1069 pub rsc: Option<u64>,
1073 #[doc(hidden)]
1074 pub __source_breaking: fidl::marker::SourceBreaking,
1075}
1076
1077impl fidl::Persistable for WlanKeyConfig {}
1078
1079mod internal {
1080 use super::*;
1081 unsafe impl fidl::encoding::TypeMarker for BssType {
1082 type Owned = Self;
1083
1084 #[inline(always)]
1085 fn inline_align(_context: fidl::encoding::Context) -> usize {
1086 std::mem::align_of::<u32>()
1087 }
1088
1089 #[inline(always)]
1090 fn inline_size(_context: fidl::encoding::Context) -> usize {
1091 std::mem::size_of::<u32>()
1092 }
1093
1094 #[inline(always)]
1095 fn encode_is_copy() -> bool {
1096 false
1097 }
1098
1099 #[inline(always)]
1100 fn decode_is_copy() -> bool {
1101 false
1102 }
1103 }
1104
1105 impl fidl::encoding::ValueTypeMarker for BssType {
1106 type Borrowed<'a> = Self;
1107 #[inline(always)]
1108 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1109 *value
1110 }
1111 }
1112
1113 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BssType {
1114 #[inline]
1115 unsafe fn encode(
1116 self,
1117 encoder: &mut fidl::encoding::Encoder<'_, D>,
1118 offset: usize,
1119 _depth: fidl::encoding::Depth,
1120 ) -> fidl::Result<()> {
1121 encoder.debug_check_bounds::<Self>(offset);
1122 encoder.write_num(self.into_primitive(), offset);
1123 Ok(())
1124 }
1125 }
1126
1127 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BssType {
1128 #[inline(always)]
1129 fn new_empty() -> Self {
1130 Self::unknown()
1131 }
1132
1133 #[inline]
1134 unsafe fn decode(
1135 &mut self,
1136 decoder: &mut fidl::encoding::Decoder<'_, D>,
1137 offset: usize,
1138 _depth: fidl::encoding::Depth,
1139 ) -> fidl::Result<()> {
1140 decoder.debug_check_bounds::<Self>(offset);
1141 let prim = decoder.read_num::<u32>(offset);
1142
1143 *self = Self::from_primitive_allow_unknown(prim);
1144 Ok(())
1145 }
1146 }
1147 unsafe impl fidl::encoding::TypeMarker for ChannelBandwidth {
1148 type Owned = Self;
1149
1150 #[inline(always)]
1151 fn inline_align(_context: fidl::encoding::Context) -> usize {
1152 std::mem::align_of::<u32>()
1153 }
1154
1155 #[inline(always)]
1156 fn inline_size(_context: fidl::encoding::Context) -> usize {
1157 std::mem::size_of::<u32>()
1158 }
1159
1160 #[inline(always)]
1161 fn encode_is_copy() -> bool {
1162 false
1163 }
1164
1165 #[inline(always)]
1166 fn decode_is_copy() -> bool {
1167 false
1168 }
1169 }
1170
1171 impl fidl::encoding::ValueTypeMarker for ChannelBandwidth {
1172 type Borrowed<'a> = Self;
1173 #[inline(always)]
1174 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1175 *value
1176 }
1177 }
1178
1179 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1180 for ChannelBandwidth
1181 {
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 encoder.write_num(self.into_primitive(), offset);
1191 Ok(())
1192 }
1193 }
1194
1195 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelBandwidth {
1196 #[inline(always)]
1197 fn new_empty() -> Self {
1198 Self::unknown()
1199 }
1200
1201 #[inline]
1202 unsafe fn decode(
1203 &mut self,
1204 decoder: &mut fidl::encoding::Decoder<'_, D>,
1205 offset: usize,
1206 _depth: fidl::encoding::Depth,
1207 ) -> fidl::Result<()> {
1208 decoder.debug_check_bounds::<Self>(offset);
1209 let prim = decoder.read_num::<u32>(offset);
1210
1211 *self = Self::from_primitive_allow_unknown(prim);
1212 Ok(())
1213 }
1214 }
1215 unsafe impl fidl::encoding::TypeMarker for DataPlaneType {
1216 type Owned = Self;
1217
1218 #[inline(always)]
1219 fn inline_align(_context: fidl::encoding::Context) -> usize {
1220 std::mem::align_of::<u8>()
1221 }
1222
1223 #[inline(always)]
1224 fn inline_size(_context: fidl::encoding::Context) -> usize {
1225 std::mem::size_of::<u8>()
1226 }
1227
1228 #[inline(always)]
1229 fn encode_is_copy() -> bool {
1230 true
1231 }
1232
1233 #[inline(always)]
1234 fn decode_is_copy() -> bool {
1235 false
1236 }
1237 }
1238
1239 impl fidl::encoding::ValueTypeMarker for DataPlaneType {
1240 type Borrowed<'a> = Self;
1241 #[inline(always)]
1242 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1243 *value
1244 }
1245 }
1246
1247 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DataPlaneType {
1248 #[inline]
1249 unsafe fn encode(
1250 self,
1251 encoder: &mut fidl::encoding::Encoder<'_, D>,
1252 offset: usize,
1253 _depth: fidl::encoding::Depth,
1254 ) -> fidl::Result<()> {
1255 encoder.debug_check_bounds::<Self>(offset);
1256 encoder.write_num(self.into_primitive(), offset);
1257 Ok(())
1258 }
1259 }
1260
1261 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataPlaneType {
1262 #[inline(always)]
1263 fn new_empty() -> Self {
1264 Self::EthernetDevice
1265 }
1266
1267 #[inline]
1268 unsafe fn decode(
1269 &mut self,
1270 decoder: &mut fidl::encoding::Decoder<'_, D>,
1271 offset: usize,
1272 _depth: fidl::encoding::Depth,
1273 ) -> fidl::Result<()> {
1274 decoder.debug_check_bounds::<Self>(offset);
1275 let prim = decoder.read_num::<u8>(offset);
1276
1277 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1278 Ok(())
1279 }
1280 }
1281 unsafe impl fidl::encoding::TypeMarker for GuardInterval {
1282 type Owned = Self;
1283
1284 #[inline(always)]
1285 fn inline_align(_context: fidl::encoding::Context) -> usize {
1286 std::mem::align_of::<u8>()
1287 }
1288
1289 #[inline(always)]
1290 fn inline_size(_context: fidl::encoding::Context) -> usize {
1291 std::mem::size_of::<u8>()
1292 }
1293
1294 #[inline(always)]
1295 fn encode_is_copy() -> bool {
1296 true
1297 }
1298
1299 #[inline(always)]
1300 fn decode_is_copy() -> bool {
1301 false
1302 }
1303 }
1304
1305 impl fidl::encoding::ValueTypeMarker for GuardInterval {
1306 type Borrowed<'a> = Self;
1307 #[inline(always)]
1308 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1309 *value
1310 }
1311 }
1312
1313 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GuardInterval {
1314 #[inline]
1315 unsafe fn encode(
1316 self,
1317 encoder: &mut fidl::encoding::Encoder<'_, D>,
1318 offset: usize,
1319 _depth: fidl::encoding::Depth,
1320 ) -> fidl::Result<()> {
1321 encoder.debug_check_bounds::<Self>(offset);
1322 encoder.write_num(self.into_primitive(), offset);
1323 Ok(())
1324 }
1325 }
1326
1327 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GuardInterval {
1328 #[inline(always)]
1329 fn new_empty() -> Self {
1330 Self::LongGi
1331 }
1332
1333 #[inline]
1334 unsafe fn decode(
1335 &mut self,
1336 decoder: &mut fidl::encoding::Decoder<'_, D>,
1337 offset: usize,
1338 _depth: fidl::encoding::Depth,
1339 ) -> fidl::Result<()> {
1340 decoder.debug_check_bounds::<Self>(offset);
1341 let prim = decoder.read_num::<u8>(offset);
1342
1343 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1344 Ok(())
1345 }
1346 }
1347 unsafe impl fidl::encoding::TypeMarker for MacImplementationType {
1348 type Owned = Self;
1349
1350 #[inline(always)]
1351 fn inline_align(_context: fidl::encoding::Context) -> usize {
1352 std::mem::align_of::<u8>()
1353 }
1354
1355 #[inline(always)]
1356 fn inline_size(_context: fidl::encoding::Context) -> usize {
1357 std::mem::size_of::<u8>()
1358 }
1359
1360 #[inline(always)]
1361 fn encode_is_copy() -> bool {
1362 true
1363 }
1364
1365 #[inline(always)]
1366 fn decode_is_copy() -> bool {
1367 false
1368 }
1369 }
1370
1371 impl fidl::encoding::ValueTypeMarker for MacImplementationType {
1372 type Borrowed<'a> = Self;
1373 #[inline(always)]
1374 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1375 *value
1376 }
1377 }
1378
1379 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1380 for MacImplementationType
1381 {
1382 #[inline]
1383 unsafe fn encode(
1384 self,
1385 encoder: &mut fidl::encoding::Encoder<'_, D>,
1386 offset: usize,
1387 _depth: fidl::encoding::Depth,
1388 ) -> fidl::Result<()> {
1389 encoder.debug_check_bounds::<Self>(offset);
1390 encoder.write_num(self.into_primitive(), offset);
1391 Ok(())
1392 }
1393 }
1394
1395 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacImplementationType {
1396 #[inline(always)]
1397 fn new_empty() -> Self {
1398 Self::Softmac
1399 }
1400
1401 #[inline]
1402 unsafe fn decode(
1403 &mut self,
1404 decoder: &mut fidl::encoding::Decoder<'_, D>,
1405 offset: usize,
1406 _depth: fidl::encoding::Depth,
1407 ) -> fidl::Result<()> {
1408 decoder.debug_check_bounds::<Self>(offset);
1409 let prim = decoder.read_num::<u8>(offset);
1410
1411 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1412 Ok(())
1413 }
1414 }
1415 unsafe impl fidl::encoding::TypeMarker for PowerSaveType {
1416 type Owned = Self;
1417
1418 #[inline(always)]
1419 fn inline_align(_context: fidl::encoding::Context) -> usize {
1420 std::mem::align_of::<u32>()
1421 }
1422
1423 #[inline(always)]
1424 fn inline_size(_context: fidl::encoding::Context) -> usize {
1425 std::mem::size_of::<u32>()
1426 }
1427
1428 #[inline(always)]
1429 fn encode_is_copy() -> bool {
1430 true
1431 }
1432
1433 #[inline(always)]
1434 fn decode_is_copy() -> bool {
1435 false
1436 }
1437 }
1438
1439 impl fidl::encoding::ValueTypeMarker for PowerSaveType {
1440 type Borrowed<'a> = Self;
1441 #[inline(always)]
1442 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1443 *value
1444 }
1445 }
1446
1447 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PowerSaveType {
1448 #[inline]
1449 unsafe fn encode(
1450 self,
1451 encoder: &mut fidl::encoding::Encoder<'_, D>,
1452 offset: usize,
1453 _depth: fidl::encoding::Depth,
1454 ) -> fidl::Result<()> {
1455 encoder.debug_check_bounds::<Self>(offset);
1456 encoder.write_num(self.into_primitive(), offset);
1457 Ok(())
1458 }
1459 }
1460
1461 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PowerSaveType {
1462 #[inline(always)]
1463 fn new_empty() -> Self {
1464 Self::PsModeUltraLowPower
1465 }
1466
1467 #[inline]
1468 unsafe fn decode(
1469 &mut self,
1470 decoder: &mut fidl::encoding::Decoder<'_, D>,
1471 offset: usize,
1472 _depth: fidl::encoding::Depth,
1473 ) -> fidl::Result<()> {
1474 decoder.debug_check_bounds::<Self>(offset);
1475 let prim = decoder.read_num::<u32>(offset);
1476
1477 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1478 Ok(())
1479 }
1480 }
1481 unsafe impl fidl::encoding::TypeMarker for RequestStatus {
1482 type Owned = Self;
1483
1484 #[inline(always)]
1485 fn inline_align(_context: fidl::encoding::Context) -> usize {
1486 std::mem::align_of::<u32>()
1487 }
1488
1489 #[inline(always)]
1490 fn inline_size(_context: fidl::encoding::Context) -> usize {
1491 std::mem::size_of::<u32>()
1492 }
1493
1494 #[inline(always)]
1495 fn encode_is_copy() -> bool {
1496 true
1497 }
1498
1499 #[inline(always)]
1500 fn decode_is_copy() -> bool {
1501 false
1502 }
1503 }
1504
1505 impl fidl::encoding::ValueTypeMarker for RequestStatus {
1506 type Borrowed<'a> = Self;
1507 #[inline(always)]
1508 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1509 *value
1510 }
1511 }
1512
1513 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RequestStatus {
1514 #[inline]
1515 unsafe fn encode(
1516 self,
1517 encoder: &mut fidl::encoding::Encoder<'_, D>,
1518 offset: usize,
1519 _depth: fidl::encoding::Depth,
1520 ) -> fidl::Result<()> {
1521 encoder.debug_check_bounds::<Self>(offset);
1522 encoder.write_num(self.into_primitive(), offset);
1523 Ok(())
1524 }
1525 }
1526
1527 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RequestStatus {
1528 #[inline(always)]
1529 fn new_empty() -> Self {
1530 Self::Acknowledged
1531 }
1532
1533 #[inline]
1534 unsafe fn decode(
1535 &mut self,
1536 decoder: &mut fidl::encoding::Decoder<'_, D>,
1537 offset: usize,
1538 _depth: fidl::encoding::Depth,
1539 ) -> fidl::Result<()> {
1540 decoder.debug_check_bounds::<Self>(offset);
1541 let prim = decoder.read_num::<u32>(offset);
1542
1543 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1544 Ok(())
1545 }
1546 }
1547 unsafe impl fidl::encoding::TypeMarker for ScanType {
1548 type Owned = Self;
1549
1550 #[inline(always)]
1551 fn inline_align(_context: fidl::encoding::Context) -> usize {
1552 std::mem::align_of::<u32>()
1553 }
1554
1555 #[inline(always)]
1556 fn inline_size(_context: fidl::encoding::Context) -> usize {
1557 std::mem::size_of::<u32>()
1558 }
1559
1560 #[inline(always)]
1561 fn encode_is_copy() -> bool {
1562 true
1563 }
1564
1565 #[inline(always)]
1566 fn decode_is_copy() -> bool {
1567 false
1568 }
1569 }
1570
1571 impl fidl::encoding::ValueTypeMarker for ScanType {
1572 type Borrowed<'a> = Self;
1573 #[inline(always)]
1574 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1575 *value
1576 }
1577 }
1578
1579 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanType {
1580 #[inline]
1581 unsafe fn encode(
1582 self,
1583 encoder: &mut fidl::encoding::Encoder<'_, D>,
1584 offset: usize,
1585 _depth: fidl::encoding::Depth,
1586 ) -> fidl::Result<()> {
1587 encoder.debug_check_bounds::<Self>(offset);
1588 encoder.write_num(self.into_primitive(), offset);
1589 Ok(())
1590 }
1591 }
1592
1593 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanType {
1594 #[inline(always)]
1595 fn new_empty() -> Self {
1596 Self::Active
1597 }
1598
1599 #[inline]
1600 unsafe fn decode(
1601 &mut self,
1602 decoder: &mut fidl::encoding::Decoder<'_, D>,
1603 offset: usize,
1604 _depth: fidl::encoding::Depth,
1605 ) -> fidl::Result<()> {
1606 decoder.debug_check_bounds::<Self>(offset);
1607 let prim = decoder.read_num::<u32>(offset);
1608
1609 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1610 Ok(())
1611 }
1612 }
1613 unsafe impl fidl::encoding::TypeMarker for WlanBand {
1614 type Owned = Self;
1615
1616 #[inline(always)]
1617 fn inline_align(_context: fidl::encoding::Context) -> usize {
1618 std::mem::align_of::<u8>()
1619 }
1620
1621 #[inline(always)]
1622 fn inline_size(_context: fidl::encoding::Context) -> usize {
1623 std::mem::size_of::<u8>()
1624 }
1625
1626 #[inline(always)]
1627 fn encode_is_copy() -> bool {
1628 false
1629 }
1630
1631 #[inline(always)]
1632 fn decode_is_copy() -> bool {
1633 false
1634 }
1635 }
1636
1637 impl fidl::encoding::ValueTypeMarker for WlanBand {
1638 type Borrowed<'a> = Self;
1639 #[inline(always)]
1640 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1641 *value
1642 }
1643 }
1644
1645 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanBand {
1646 #[inline]
1647 unsafe fn encode(
1648 self,
1649 encoder: &mut fidl::encoding::Encoder<'_, D>,
1650 offset: usize,
1651 _depth: fidl::encoding::Depth,
1652 ) -> fidl::Result<()> {
1653 encoder.debug_check_bounds::<Self>(offset);
1654 encoder.write_num(self.into_primitive(), offset);
1655 Ok(())
1656 }
1657 }
1658
1659 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanBand {
1660 #[inline(always)]
1661 fn new_empty() -> Self {
1662 Self::unknown()
1663 }
1664
1665 #[inline]
1666 unsafe fn decode(
1667 &mut self,
1668 decoder: &mut fidl::encoding::Decoder<'_, D>,
1669 offset: usize,
1670 _depth: fidl::encoding::Depth,
1671 ) -> fidl::Result<()> {
1672 decoder.debug_check_bounds::<Self>(offset);
1673 let prim = decoder.read_num::<u8>(offset);
1674
1675 *self = Self::from_primitive_allow_unknown(prim);
1676 Ok(())
1677 }
1678 }
1679 unsafe impl fidl::encoding::TypeMarker for WlanKeyType {
1680 type Owned = Self;
1681
1682 #[inline(always)]
1683 fn inline_align(_context: fidl::encoding::Context) -> usize {
1684 std::mem::align_of::<u8>()
1685 }
1686
1687 #[inline(always)]
1688 fn inline_size(_context: fidl::encoding::Context) -> usize {
1689 std::mem::size_of::<u8>()
1690 }
1691
1692 #[inline(always)]
1693 fn encode_is_copy() -> bool {
1694 false
1695 }
1696
1697 #[inline(always)]
1698 fn decode_is_copy() -> bool {
1699 false
1700 }
1701 }
1702
1703 impl fidl::encoding::ValueTypeMarker for WlanKeyType {
1704 type Borrowed<'a> = Self;
1705 #[inline(always)]
1706 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1707 *value
1708 }
1709 }
1710
1711 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanKeyType {
1712 #[inline]
1713 unsafe fn encode(
1714 self,
1715 encoder: &mut fidl::encoding::Encoder<'_, D>,
1716 offset: usize,
1717 _depth: fidl::encoding::Depth,
1718 ) -> fidl::Result<()> {
1719 encoder.debug_check_bounds::<Self>(offset);
1720 encoder.write_num(self.into_primitive(), offset);
1721 Ok(())
1722 }
1723 }
1724
1725 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyType {
1726 #[inline(always)]
1727 fn new_empty() -> Self {
1728 Self::unknown()
1729 }
1730
1731 #[inline]
1732 unsafe fn decode(
1733 &mut self,
1734 decoder: &mut fidl::encoding::Decoder<'_, D>,
1735 offset: usize,
1736 _depth: fidl::encoding::Depth,
1737 ) -> fidl::Result<()> {
1738 decoder.debug_check_bounds::<Self>(offset);
1739 let prim = decoder.read_num::<u8>(offset);
1740
1741 *self = Self::from_primitive_allow_unknown(prim);
1742 Ok(())
1743 }
1744 }
1745 unsafe impl fidl::encoding::TypeMarker for WlanMacRole {
1746 type Owned = Self;
1747
1748 #[inline(always)]
1749 fn inline_align(_context: fidl::encoding::Context) -> usize {
1750 std::mem::align_of::<u32>()
1751 }
1752
1753 #[inline(always)]
1754 fn inline_size(_context: fidl::encoding::Context) -> usize {
1755 std::mem::size_of::<u32>()
1756 }
1757
1758 #[inline(always)]
1759 fn encode_is_copy() -> bool {
1760 false
1761 }
1762
1763 #[inline(always)]
1764 fn decode_is_copy() -> bool {
1765 false
1766 }
1767 }
1768
1769 impl fidl::encoding::ValueTypeMarker for WlanMacRole {
1770 type Borrowed<'a> = Self;
1771 #[inline(always)]
1772 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1773 *value
1774 }
1775 }
1776
1777 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanMacRole {
1778 #[inline]
1779 unsafe fn encode(
1780 self,
1781 encoder: &mut fidl::encoding::Encoder<'_, D>,
1782 offset: usize,
1783 _depth: fidl::encoding::Depth,
1784 ) -> fidl::Result<()> {
1785 encoder.debug_check_bounds::<Self>(offset);
1786 encoder.write_num(self.into_primitive(), offset);
1787 Ok(())
1788 }
1789 }
1790
1791 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanMacRole {
1792 #[inline(always)]
1793 fn new_empty() -> Self {
1794 Self::unknown()
1795 }
1796
1797 #[inline]
1798 unsafe fn decode(
1799 &mut self,
1800 decoder: &mut fidl::encoding::Decoder<'_, D>,
1801 offset: usize,
1802 _depth: fidl::encoding::Depth,
1803 ) -> fidl::Result<()> {
1804 decoder.debug_check_bounds::<Self>(offset);
1805 let prim = decoder.read_num::<u32>(offset);
1806
1807 *self = Self::from_primitive_allow_unknown(prim);
1808 Ok(())
1809 }
1810 }
1811 unsafe impl fidl::encoding::TypeMarker for WlanPhyType {
1812 type Owned = Self;
1813
1814 #[inline(always)]
1815 fn inline_align(_context: fidl::encoding::Context) -> usize {
1816 std::mem::align_of::<u32>()
1817 }
1818
1819 #[inline(always)]
1820 fn inline_size(_context: fidl::encoding::Context) -> usize {
1821 std::mem::size_of::<u32>()
1822 }
1823
1824 #[inline(always)]
1825 fn encode_is_copy() -> bool {
1826 false
1827 }
1828
1829 #[inline(always)]
1830 fn decode_is_copy() -> bool {
1831 false
1832 }
1833 }
1834
1835 impl fidl::encoding::ValueTypeMarker for WlanPhyType {
1836 type Borrowed<'a> = Self;
1837 #[inline(always)]
1838 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1839 *value
1840 }
1841 }
1842
1843 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanPhyType {
1844 #[inline]
1845 unsafe fn encode(
1846 self,
1847 encoder: &mut fidl::encoding::Encoder<'_, D>,
1848 offset: usize,
1849 _depth: fidl::encoding::Depth,
1850 ) -> fidl::Result<()> {
1851 encoder.debug_check_bounds::<Self>(offset);
1852 encoder.write_num(self.into_primitive(), offset);
1853 Ok(())
1854 }
1855 }
1856
1857 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanPhyType {
1858 #[inline(always)]
1859 fn new_empty() -> Self {
1860 Self::unknown()
1861 }
1862
1863 #[inline]
1864 unsafe fn decode(
1865 &mut self,
1866 decoder: &mut fidl::encoding::Decoder<'_, D>,
1867 offset: usize,
1868 _depth: fidl::encoding::Depth,
1869 ) -> fidl::Result<()> {
1870 decoder.debug_check_bounds::<Self>(offset);
1871 let prim = decoder.read_num::<u32>(offset);
1872
1873 *self = Self::from_primitive_allow_unknown(prim);
1874 Ok(())
1875 }
1876 }
1877 unsafe impl fidl::encoding::TypeMarker for WlanProtection {
1878 type Owned = Self;
1879
1880 #[inline(always)]
1881 fn inline_align(_context: fidl::encoding::Context) -> usize {
1882 std::mem::align_of::<u8>()
1883 }
1884
1885 #[inline(always)]
1886 fn inline_size(_context: fidl::encoding::Context) -> usize {
1887 std::mem::size_of::<u8>()
1888 }
1889
1890 #[inline(always)]
1891 fn encode_is_copy() -> bool {
1892 true
1893 }
1894
1895 #[inline(always)]
1896 fn decode_is_copy() -> bool {
1897 false
1898 }
1899 }
1900
1901 impl fidl::encoding::ValueTypeMarker for WlanProtection {
1902 type Borrowed<'a> = Self;
1903 #[inline(always)]
1904 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1905 *value
1906 }
1907 }
1908
1909 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
1910 #[inline]
1911 unsafe fn encode(
1912 self,
1913 encoder: &mut fidl::encoding::Encoder<'_, D>,
1914 offset: usize,
1915 _depth: fidl::encoding::Depth,
1916 ) -> fidl::Result<()> {
1917 encoder.debug_check_bounds::<Self>(offset);
1918 encoder.write_num(self.into_primitive(), offset);
1919 Ok(())
1920 }
1921 }
1922
1923 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
1924 #[inline(always)]
1925 fn new_empty() -> Self {
1926 Self::None
1927 }
1928
1929 #[inline]
1930 unsafe fn decode(
1931 &mut self,
1932 decoder: &mut fidl::encoding::Decoder<'_, D>,
1933 offset: usize,
1934 _depth: fidl::encoding::Depth,
1935 ) -> fidl::Result<()> {
1936 decoder.debug_check_bounds::<Self>(offset);
1937 let prim = decoder.read_num::<u8>(offset);
1938
1939 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1940 Ok(())
1941 }
1942 }
1943 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacHardwareCapabilityBit {
1944 type Owned = Self;
1945
1946 #[inline(always)]
1947 fn inline_align(_context: fidl::encoding::Context) -> usize {
1948 std::mem::align_of::<u32>()
1949 }
1950
1951 #[inline(always)]
1952 fn inline_size(_context: fidl::encoding::Context) -> usize {
1953 std::mem::size_of::<u32>()
1954 }
1955
1956 #[inline(always)]
1957 fn encode_is_copy() -> bool {
1958 true
1959 }
1960
1961 #[inline(always)]
1962 fn decode_is_copy() -> bool {
1963 false
1964 }
1965 }
1966
1967 impl fidl::encoding::ValueTypeMarker for WlanSoftmacHardwareCapabilityBit {
1968 type Borrowed<'a> = Self;
1969 #[inline(always)]
1970 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1971 *value
1972 }
1973 }
1974
1975 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1976 for WlanSoftmacHardwareCapabilityBit
1977 {
1978 #[inline]
1979 unsafe fn encode(
1980 self,
1981 encoder: &mut fidl::encoding::Encoder<'_, D>,
1982 offset: usize,
1983 _depth: fidl::encoding::Depth,
1984 ) -> fidl::Result<()> {
1985 encoder.debug_check_bounds::<Self>(offset);
1986 encoder.write_num(self.into_primitive(), offset);
1987 Ok(())
1988 }
1989 }
1990
1991 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1992 for WlanSoftmacHardwareCapabilityBit
1993 {
1994 #[inline(always)]
1995 fn new_empty() -> Self {
1996 Self::ShortPreamble
1997 }
1998
1999 #[inline]
2000 unsafe fn decode(
2001 &mut self,
2002 decoder: &mut fidl::encoding::Decoder<'_, D>,
2003 offset: usize,
2004 _depth: fidl::encoding::Depth,
2005 ) -> fidl::Result<()> {
2006 decoder.debug_check_bounds::<Self>(offset);
2007 let prim = decoder.read_num::<u32>(offset);
2008
2009 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2010 Ok(())
2011 }
2012 }
2013 unsafe impl fidl::encoding::TypeMarker for WlanTxResultCode {
2014 type Owned = Self;
2015
2016 #[inline(always)]
2017 fn inline_align(_context: fidl::encoding::Context) -> usize {
2018 std::mem::align_of::<u8>()
2019 }
2020
2021 #[inline(always)]
2022 fn inline_size(_context: fidl::encoding::Context) -> usize {
2023 std::mem::size_of::<u8>()
2024 }
2025
2026 #[inline(always)]
2027 fn encode_is_copy() -> bool {
2028 false
2029 }
2030
2031 #[inline(always)]
2032 fn decode_is_copy() -> bool {
2033 false
2034 }
2035 }
2036
2037 impl fidl::encoding::ValueTypeMarker for WlanTxResultCode {
2038 type Borrowed<'a> = Self;
2039 #[inline(always)]
2040 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2041 *value
2042 }
2043 }
2044
2045 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2046 for WlanTxResultCode
2047 {
2048 #[inline]
2049 unsafe fn encode(
2050 self,
2051 encoder: &mut fidl::encoding::Encoder<'_, D>,
2052 offset: usize,
2053 _depth: fidl::encoding::Depth,
2054 ) -> fidl::Result<()> {
2055 encoder.debug_check_bounds::<Self>(offset);
2056 encoder.write_num(self.into_primitive(), offset);
2057 Ok(())
2058 }
2059 }
2060
2061 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResultCode {
2062 #[inline(always)]
2063 fn new_empty() -> Self {
2064 Self::unknown()
2065 }
2066
2067 #[inline]
2068 unsafe fn decode(
2069 &mut self,
2070 decoder: &mut fidl::encoding::Decoder<'_, D>,
2071 offset: usize,
2072 _depth: fidl::encoding::Depth,
2073 ) -> fidl::Result<()> {
2074 decoder.debug_check_bounds::<Self>(offset);
2075 let prim = decoder.read_num::<u8>(offset);
2076
2077 *self = Self::from_primitive_allow_unknown(prim);
2078 Ok(())
2079 }
2080 }
2081
2082 impl fidl::encoding::ValueTypeMarker for BssDescription {
2083 type Borrowed<'a> = &'a Self;
2084 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2085 value
2086 }
2087 }
2088
2089 unsafe impl fidl::encoding::TypeMarker for BssDescription {
2090 type Owned = Self;
2091
2092 #[inline(always)]
2093 fn inline_align(_context: fidl::encoding::Context) -> usize {
2094 8
2095 }
2096
2097 #[inline(always)]
2098 fn inline_size(_context: fidl::encoding::Context) -> usize {
2099 48
2100 }
2101 }
2102
2103 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BssDescription, D>
2104 for &BssDescription
2105 {
2106 #[inline]
2107 unsafe fn encode(
2108 self,
2109 encoder: &mut fidl::encoding::Encoder<'_, D>,
2110 offset: usize,
2111 _depth: fidl::encoding::Depth,
2112 ) -> fidl::Result<()> {
2113 encoder.debug_check_bounds::<BssDescription>(offset);
2114 fidl::encoding::Encode::<BssDescription, D>::encode(
2116 (
2117 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.bssid),
2118 <BssType as fidl::encoding::ValueTypeMarker>::borrow(&self.bss_type),
2119 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.beacon_period),
2120 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_info),
2121 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.ies),
2122 <WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
2123 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
2124 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_db),
2125 ),
2126 encoder, offset, _depth
2127 )
2128 }
2129 }
2130 unsafe impl<
2131 D: fidl::encoding::ResourceDialect,
2132 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
2133 T1: fidl::encoding::Encode<BssType, D>,
2134 T2: fidl::encoding::Encode<u16, D>,
2135 T3: fidl::encoding::Encode<u16, D>,
2136 T4: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2137 T5: fidl::encoding::Encode<WlanChannel, D>,
2138 T6: fidl::encoding::Encode<i8, D>,
2139 T7: fidl::encoding::Encode<i8, D>,
2140 > fidl::encoding::Encode<BssDescription, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
2141 {
2142 #[inline]
2143 unsafe fn encode(
2144 self,
2145 encoder: &mut fidl::encoding::Encoder<'_, D>,
2146 offset: usize,
2147 depth: fidl::encoding::Depth,
2148 ) -> fidl::Result<()> {
2149 encoder.debug_check_bounds::<BssDescription>(offset);
2150 unsafe {
2153 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2154 (ptr as *mut u64).write_unaligned(0);
2155 }
2156 unsafe {
2157 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2158 (ptr as *mut u64).write_unaligned(0);
2159 }
2160 self.0.encode(encoder, offset + 0, depth)?;
2162 self.1.encode(encoder, offset + 8, depth)?;
2163 self.2.encode(encoder, offset + 12, depth)?;
2164 self.3.encode(encoder, offset + 14, depth)?;
2165 self.4.encode(encoder, offset + 16, depth)?;
2166 self.5.encode(encoder, offset + 32, depth)?;
2167 self.6.encode(encoder, offset + 44, depth)?;
2168 self.7.encode(encoder, offset + 45, depth)?;
2169 Ok(())
2170 }
2171 }
2172
2173 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BssDescription {
2174 #[inline(always)]
2175 fn new_empty() -> Self {
2176 Self {
2177 bssid: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
2178 bss_type: fidl::new_empty!(BssType, D),
2179 beacon_period: fidl::new_empty!(u16, D),
2180 capability_info: fidl::new_empty!(u16, D),
2181 ies: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2182 channel: fidl::new_empty!(WlanChannel, D),
2183 rssi_dbm: fidl::new_empty!(i8, D),
2184 snr_db: fidl::new_empty!(i8, D),
2185 }
2186 }
2187
2188 #[inline]
2189 unsafe fn decode(
2190 &mut self,
2191 decoder: &mut fidl::encoding::Decoder<'_, D>,
2192 offset: usize,
2193 _depth: fidl::encoding::Depth,
2194 ) -> fidl::Result<()> {
2195 decoder.debug_check_bounds::<Self>(offset);
2196 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2198 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2199 let mask = 0xffff000000000000u64;
2200 let maskedval = padval & mask;
2201 if maskedval != 0 {
2202 return Err(fidl::Error::NonZeroPadding {
2203 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2204 });
2205 }
2206 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
2207 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2208 let mask = 0xffff000000000000u64;
2209 let maskedval = padval & mask;
2210 if maskedval != 0 {
2211 return Err(fidl::Error::NonZeroPadding {
2212 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
2213 });
2214 }
2215 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.bssid, decoder, offset + 0, _depth)?;
2216 fidl::decode!(BssType, D, &mut self.bss_type, decoder, offset + 8, _depth)?;
2217 fidl::decode!(u16, D, &mut self.beacon_period, decoder, offset + 12, _depth)?;
2218 fidl::decode!(u16, D, &mut self.capability_info, decoder, offset + 14, _depth)?;
2219 fidl::decode!(
2220 fidl::encoding::UnboundedVector<u8>,
2221 D,
2222 &mut self.ies,
2223 decoder,
2224 offset + 16,
2225 _depth
2226 )?;
2227 fidl::decode!(WlanChannel, D, &mut self.channel, decoder, offset + 32, _depth)?;
2228 fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 44, _depth)?;
2229 fidl::decode!(i8, D, &mut self.snr_db, decoder, offset + 45, _depth)?;
2230 Ok(())
2231 }
2232 }
2233
2234 impl fidl::encoding::ValueTypeMarker for DataPlaneExtension {
2235 type Borrowed<'a> = &'a Self;
2236 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2237 value
2238 }
2239 }
2240
2241 unsafe impl fidl::encoding::TypeMarker for DataPlaneExtension {
2242 type Owned = Self;
2243
2244 #[inline(always)]
2245 fn inline_align(_context: fidl::encoding::Context) -> usize {
2246 1
2247 }
2248
2249 #[inline(always)]
2250 fn inline_size(_context: fidl::encoding::Context) -> usize {
2251 1
2252 }
2253 }
2254
2255 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DataPlaneExtension, D>
2256 for &DataPlaneExtension
2257 {
2258 #[inline]
2259 unsafe fn encode(
2260 self,
2261 encoder: &mut fidl::encoding::Encoder<'_, D>,
2262 offset: usize,
2263 _depth: fidl::encoding::Depth,
2264 ) -> fidl::Result<()> {
2265 encoder.debug_check_bounds::<DataPlaneExtension>(offset);
2266 fidl::encoding::Encode::<DataPlaneExtension, D>::encode(
2268 (<DataPlaneType as fidl::encoding::ValueTypeMarker>::borrow(&self.data_plane_type),),
2269 encoder,
2270 offset,
2271 _depth,
2272 )
2273 }
2274 }
2275 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DataPlaneType, D>>
2276 fidl::encoding::Encode<DataPlaneExtension, D> for (T0,)
2277 {
2278 #[inline]
2279 unsafe fn encode(
2280 self,
2281 encoder: &mut fidl::encoding::Encoder<'_, D>,
2282 offset: usize,
2283 depth: fidl::encoding::Depth,
2284 ) -> fidl::Result<()> {
2285 encoder.debug_check_bounds::<DataPlaneExtension>(offset);
2286 self.0.encode(encoder, offset + 0, depth)?;
2290 Ok(())
2291 }
2292 }
2293
2294 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataPlaneExtension {
2295 #[inline(always)]
2296 fn new_empty() -> Self {
2297 Self { data_plane_type: fidl::new_empty!(DataPlaneType, D) }
2298 }
2299
2300 #[inline]
2301 unsafe fn decode(
2302 &mut self,
2303 decoder: &mut fidl::encoding::Decoder<'_, D>,
2304 offset: usize,
2305 _depth: fidl::encoding::Depth,
2306 ) -> fidl::Result<()> {
2307 decoder.debug_check_bounds::<Self>(offset);
2308 fidl::decode!(
2310 DataPlaneType,
2311 D,
2312 &mut self.data_plane_type,
2313 decoder,
2314 offset + 0,
2315 _depth
2316 )?;
2317 Ok(())
2318 }
2319 }
2320
2321 impl fidl::encoding::ValueTypeMarker for DeviceExtension {
2322 type Borrowed<'a> = &'a Self;
2323 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2324 value
2325 }
2326 }
2327
2328 unsafe impl fidl::encoding::TypeMarker for DeviceExtension {
2329 type Owned = Self;
2330
2331 #[inline(always)]
2332 fn inline_align(_context: fidl::encoding::Context) -> usize {
2333 1
2334 }
2335
2336 #[inline(always)]
2337 fn inline_size(_context: fidl::encoding::Context) -> usize {
2338 3
2339 }
2340 }
2341
2342 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceExtension, D>
2343 for &DeviceExtension
2344 {
2345 #[inline]
2346 unsafe fn encode(
2347 self,
2348 encoder: &mut fidl::encoding::Encoder<'_, D>,
2349 offset: usize,
2350 _depth: fidl::encoding::Depth,
2351 ) -> fidl::Result<()> {
2352 encoder.debug_check_bounds::<DeviceExtension>(offset);
2353 fidl::encoding::Encode::<DeviceExtension, D>::encode(
2355 (
2356 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_synthetic),
2357 <MacImplementationType as fidl::encoding::ValueTypeMarker>::borrow(
2358 &self.mac_implementation_type,
2359 ),
2360 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2361 &self.tx_status_report_supported,
2362 ),
2363 ),
2364 encoder,
2365 offset,
2366 _depth,
2367 )
2368 }
2369 }
2370 unsafe impl<
2371 D: fidl::encoding::ResourceDialect,
2372 T0: fidl::encoding::Encode<bool, D>,
2373 T1: fidl::encoding::Encode<MacImplementationType, D>,
2374 T2: fidl::encoding::Encode<bool, D>,
2375 > fidl::encoding::Encode<DeviceExtension, D> for (T0, T1, T2)
2376 {
2377 #[inline]
2378 unsafe fn encode(
2379 self,
2380 encoder: &mut fidl::encoding::Encoder<'_, D>,
2381 offset: usize,
2382 depth: fidl::encoding::Depth,
2383 ) -> fidl::Result<()> {
2384 encoder.debug_check_bounds::<DeviceExtension>(offset);
2385 self.0.encode(encoder, offset + 0, depth)?;
2389 self.1.encode(encoder, offset + 1, depth)?;
2390 self.2.encode(encoder, offset + 2, depth)?;
2391 Ok(())
2392 }
2393 }
2394
2395 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceExtension {
2396 #[inline(always)]
2397 fn new_empty() -> Self {
2398 Self {
2399 is_synthetic: fidl::new_empty!(bool, D),
2400 mac_implementation_type: fidl::new_empty!(MacImplementationType, D),
2401 tx_status_report_supported: fidl::new_empty!(bool, D),
2402 }
2403 }
2404
2405 #[inline]
2406 unsafe fn decode(
2407 &mut self,
2408 decoder: &mut fidl::encoding::Decoder<'_, D>,
2409 offset: usize,
2410 _depth: fidl::encoding::Depth,
2411 ) -> fidl::Result<()> {
2412 decoder.debug_check_bounds::<Self>(offset);
2413 fidl::decode!(bool, D, &mut self.is_synthetic, decoder, offset + 0, _depth)?;
2415 fidl::decode!(
2416 MacImplementationType,
2417 D,
2418 &mut self.mac_implementation_type,
2419 decoder,
2420 offset + 1,
2421 _depth
2422 )?;
2423 fidl::decode!(
2424 bool,
2425 D,
2426 &mut self.tx_status_report_supported,
2427 decoder,
2428 offset + 2,
2429 _depth
2430 )?;
2431 Ok(())
2432 }
2433 }
2434
2435 impl fidl::encoding::ValueTypeMarker for DfsFeature {
2436 type Borrowed<'a> = &'a Self;
2437 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2438 value
2439 }
2440 }
2441
2442 unsafe impl fidl::encoding::TypeMarker for DfsFeature {
2443 type Owned = Self;
2444
2445 #[inline(always)]
2446 fn inline_align(_context: fidl::encoding::Context) -> usize {
2447 1
2448 }
2449
2450 #[inline(always)]
2451 fn inline_size(_context: fidl::encoding::Context) -> usize {
2452 1
2453 }
2454 }
2455
2456 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DfsFeature, D>
2457 for &DfsFeature
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::<DfsFeature>(offset);
2467 fidl::encoding::Encode::<DfsFeature, D>::encode(
2469 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2470 encoder,
2471 offset,
2472 _depth,
2473 )
2474 }
2475 }
2476 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2477 fidl::encoding::Encode<DfsFeature, D> for (T0,)
2478 {
2479 #[inline]
2480 unsafe fn encode(
2481 self,
2482 encoder: &mut fidl::encoding::Encoder<'_, D>,
2483 offset: usize,
2484 depth: fidl::encoding::Depth,
2485 ) -> fidl::Result<()> {
2486 encoder.debug_check_bounds::<DfsFeature>(offset);
2487 self.0.encode(encoder, offset + 0, depth)?;
2491 Ok(())
2492 }
2493 }
2494
2495 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DfsFeature {
2496 #[inline(always)]
2497 fn new_empty() -> Self {
2498 Self { supported: fidl::new_empty!(bool, D) }
2499 }
2500
2501 #[inline]
2502 unsafe fn decode(
2503 &mut self,
2504 decoder: &mut fidl::encoding::Decoder<'_, D>,
2505 offset: usize,
2506 _depth: fidl::encoding::Depth,
2507 ) -> fidl::Result<()> {
2508 decoder.debug_check_bounds::<Self>(offset);
2509 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2511 Ok(())
2512 }
2513 }
2514
2515 impl fidl::encoding::ValueTypeMarker for DiscoverySupport {
2516 type Borrowed<'a> = &'a Self;
2517 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2518 value
2519 }
2520 }
2521
2522 unsafe impl fidl::encoding::TypeMarker for DiscoverySupport {
2523 type Owned = Self;
2524
2525 #[inline(always)]
2526 fn inline_align(_context: fidl::encoding::Context) -> usize {
2527 1
2528 }
2529
2530 #[inline(always)]
2531 fn inline_size(_context: fidl::encoding::Context) -> usize {
2532 3
2533 }
2534 }
2535
2536 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoverySupport, D>
2537 for &DiscoverySupport
2538 {
2539 #[inline]
2540 unsafe fn encode(
2541 self,
2542 encoder: &mut fidl::encoding::Encoder<'_, D>,
2543 offset: usize,
2544 _depth: fidl::encoding::Depth,
2545 ) -> fidl::Result<()> {
2546 encoder.debug_check_bounds::<DiscoverySupport>(offset);
2547 fidl::encoding::Encode::<DiscoverySupport, D>::encode(
2549 (
2550 <ScanOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2551 &self.scan_offload,
2552 ),
2553 <ProbeResponseOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2554 &self.probe_response_offload,
2555 ),
2556 ),
2557 encoder,
2558 offset,
2559 _depth,
2560 )
2561 }
2562 }
2563 unsafe impl<
2564 D: fidl::encoding::ResourceDialect,
2565 T0: fidl::encoding::Encode<ScanOffloadExtension, D>,
2566 T1: fidl::encoding::Encode<ProbeResponseOffloadExtension, D>,
2567 > fidl::encoding::Encode<DiscoverySupport, D> for (T0, T1)
2568 {
2569 #[inline]
2570 unsafe fn encode(
2571 self,
2572 encoder: &mut fidl::encoding::Encoder<'_, D>,
2573 offset: usize,
2574 depth: fidl::encoding::Depth,
2575 ) -> fidl::Result<()> {
2576 encoder.debug_check_bounds::<DiscoverySupport>(offset);
2577 self.0.encode(encoder, offset + 0, depth)?;
2581 self.1.encode(encoder, offset + 2, depth)?;
2582 Ok(())
2583 }
2584 }
2585
2586 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoverySupport {
2587 #[inline(always)]
2588 fn new_empty() -> Self {
2589 Self {
2590 scan_offload: fidl::new_empty!(ScanOffloadExtension, D),
2591 probe_response_offload: fidl::new_empty!(ProbeResponseOffloadExtension, D),
2592 }
2593 }
2594
2595 #[inline]
2596 unsafe fn decode(
2597 &mut self,
2598 decoder: &mut fidl::encoding::Decoder<'_, D>,
2599 offset: usize,
2600 _depth: fidl::encoding::Depth,
2601 ) -> fidl::Result<()> {
2602 decoder.debug_check_bounds::<Self>(offset);
2603 fidl::decode!(
2605 ScanOffloadExtension,
2606 D,
2607 &mut self.scan_offload,
2608 decoder,
2609 offset + 0,
2610 _depth
2611 )?;
2612 fidl::decode!(
2613 ProbeResponseOffloadExtension,
2614 D,
2615 &mut self.probe_response_offload,
2616 decoder,
2617 offset + 2,
2618 _depth
2619 )?;
2620 Ok(())
2621 }
2622 }
2623
2624 impl fidl::encoding::ValueTypeMarker for MacSublayerSupport {
2625 type Borrowed<'a> = &'a Self;
2626 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2627 value
2628 }
2629 }
2630
2631 unsafe impl fidl::encoding::TypeMarker for MacSublayerSupport {
2632 type Owned = Self;
2633
2634 #[inline(always)]
2635 fn inline_align(_context: fidl::encoding::Context) -> usize {
2636 1
2637 }
2638
2639 #[inline(always)]
2640 fn inline_size(_context: fidl::encoding::Context) -> usize {
2641 5
2642 }
2643 }
2644
2645 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MacSublayerSupport, D>
2646 for &MacSublayerSupport
2647 {
2648 #[inline]
2649 unsafe fn encode(
2650 self,
2651 encoder: &mut fidl::encoding::Encoder<'_, D>,
2652 offset: usize,
2653 _depth: fidl::encoding::Depth,
2654 ) -> fidl::Result<()> {
2655 encoder.debug_check_bounds::<MacSublayerSupport>(offset);
2656 fidl::encoding::Encode::<MacSublayerSupport, D>::encode(
2658 (
2659 <RateSelectionOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2660 &self.rate_selection_offload,
2661 ),
2662 <DataPlaneExtension as fidl::encoding::ValueTypeMarker>::borrow(
2663 &self.data_plane,
2664 ),
2665 <DeviceExtension as fidl::encoding::ValueTypeMarker>::borrow(&self.device),
2666 ),
2667 encoder,
2668 offset,
2669 _depth,
2670 )
2671 }
2672 }
2673 unsafe impl<
2674 D: fidl::encoding::ResourceDialect,
2675 T0: fidl::encoding::Encode<RateSelectionOffloadExtension, D>,
2676 T1: fidl::encoding::Encode<DataPlaneExtension, D>,
2677 T2: fidl::encoding::Encode<DeviceExtension, D>,
2678 > fidl::encoding::Encode<MacSublayerSupport, D> for (T0, T1, T2)
2679 {
2680 #[inline]
2681 unsafe fn encode(
2682 self,
2683 encoder: &mut fidl::encoding::Encoder<'_, D>,
2684 offset: usize,
2685 depth: fidl::encoding::Depth,
2686 ) -> fidl::Result<()> {
2687 encoder.debug_check_bounds::<MacSublayerSupport>(offset);
2688 self.0.encode(encoder, offset + 0, depth)?;
2692 self.1.encode(encoder, offset + 1, depth)?;
2693 self.2.encode(encoder, offset + 2, depth)?;
2694 Ok(())
2695 }
2696 }
2697
2698 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacSublayerSupport {
2699 #[inline(always)]
2700 fn new_empty() -> Self {
2701 Self {
2702 rate_selection_offload: fidl::new_empty!(RateSelectionOffloadExtension, D),
2703 data_plane: fidl::new_empty!(DataPlaneExtension, D),
2704 device: fidl::new_empty!(DeviceExtension, D),
2705 }
2706 }
2707
2708 #[inline]
2709 unsafe fn decode(
2710 &mut self,
2711 decoder: &mut fidl::encoding::Decoder<'_, D>,
2712 offset: usize,
2713 _depth: fidl::encoding::Depth,
2714 ) -> fidl::Result<()> {
2715 decoder.debug_check_bounds::<Self>(offset);
2716 fidl::decode!(
2718 RateSelectionOffloadExtension,
2719 D,
2720 &mut self.rate_selection_offload,
2721 decoder,
2722 offset + 0,
2723 _depth
2724 )?;
2725 fidl::decode!(
2726 DataPlaneExtension,
2727 D,
2728 &mut self.data_plane,
2729 decoder,
2730 offset + 1,
2731 _depth
2732 )?;
2733 fidl::decode!(DeviceExtension, D, &mut self.device, decoder, offset + 2, _depth)?;
2734 Ok(())
2735 }
2736 }
2737
2738 impl fidl::encoding::ValueTypeMarker for MfpFeature {
2739 type Borrowed<'a> = &'a Self;
2740 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2741 value
2742 }
2743 }
2744
2745 unsafe impl fidl::encoding::TypeMarker for MfpFeature {
2746 type Owned = Self;
2747
2748 #[inline(always)]
2749 fn inline_align(_context: fidl::encoding::Context) -> usize {
2750 1
2751 }
2752
2753 #[inline(always)]
2754 fn inline_size(_context: fidl::encoding::Context) -> usize {
2755 1
2756 }
2757 }
2758
2759 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MfpFeature, D>
2760 for &MfpFeature
2761 {
2762 #[inline]
2763 unsafe fn encode(
2764 self,
2765 encoder: &mut fidl::encoding::Encoder<'_, D>,
2766 offset: usize,
2767 _depth: fidl::encoding::Depth,
2768 ) -> fidl::Result<()> {
2769 encoder.debug_check_bounds::<MfpFeature>(offset);
2770 fidl::encoding::Encode::<MfpFeature, D>::encode(
2772 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2773 encoder,
2774 offset,
2775 _depth,
2776 )
2777 }
2778 }
2779 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2780 fidl::encoding::Encode<MfpFeature, D> for (T0,)
2781 {
2782 #[inline]
2783 unsafe fn encode(
2784 self,
2785 encoder: &mut fidl::encoding::Encoder<'_, D>,
2786 offset: usize,
2787 depth: fidl::encoding::Depth,
2788 ) -> fidl::Result<()> {
2789 encoder.debug_check_bounds::<MfpFeature>(offset);
2790 self.0.encode(encoder, offset + 0, depth)?;
2794 Ok(())
2795 }
2796 }
2797
2798 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MfpFeature {
2799 #[inline(always)]
2800 fn new_empty() -> Self {
2801 Self { supported: fidl::new_empty!(bool, D) }
2802 }
2803
2804 #[inline]
2805 unsafe fn decode(
2806 &mut self,
2807 decoder: &mut fidl::encoding::Decoder<'_, D>,
2808 offset: usize,
2809 _depth: fidl::encoding::Depth,
2810 ) -> fidl::Result<()> {
2811 decoder.debug_check_bounds::<Self>(offset);
2812 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2814 Ok(())
2815 }
2816 }
2817
2818 impl fidl::encoding::ValueTypeMarker for ProbeResponseOffloadExtension {
2819 type Borrowed<'a> = &'a Self;
2820 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2821 value
2822 }
2823 }
2824
2825 unsafe impl fidl::encoding::TypeMarker for ProbeResponseOffloadExtension {
2826 type Owned = Self;
2827
2828 #[inline(always)]
2829 fn inline_align(_context: fidl::encoding::Context) -> usize {
2830 1
2831 }
2832
2833 #[inline(always)]
2834 fn inline_size(_context: fidl::encoding::Context) -> usize {
2835 1
2836 }
2837 }
2838
2839 unsafe impl<D: fidl::encoding::ResourceDialect>
2840 fidl::encoding::Encode<ProbeResponseOffloadExtension, D>
2841 for &ProbeResponseOffloadExtension
2842 {
2843 #[inline]
2844 unsafe fn encode(
2845 self,
2846 encoder: &mut fidl::encoding::Encoder<'_, D>,
2847 offset: usize,
2848 _depth: fidl::encoding::Depth,
2849 ) -> fidl::Result<()> {
2850 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
2851 fidl::encoding::Encode::<ProbeResponseOffloadExtension, D>::encode(
2853 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2854 encoder,
2855 offset,
2856 _depth,
2857 )
2858 }
2859 }
2860 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2861 fidl::encoding::Encode<ProbeResponseOffloadExtension, D> for (T0,)
2862 {
2863 #[inline]
2864 unsafe fn encode(
2865 self,
2866 encoder: &mut fidl::encoding::Encoder<'_, D>,
2867 offset: usize,
2868 depth: fidl::encoding::Depth,
2869 ) -> fidl::Result<()> {
2870 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
2871 self.0.encode(encoder, offset + 0, depth)?;
2875 Ok(())
2876 }
2877 }
2878
2879 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2880 for ProbeResponseOffloadExtension
2881 {
2882 #[inline(always)]
2883 fn new_empty() -> Self {
2884 Self { supported: fidl::new_empty!(bool, D) }
2885 }
2886
2887 #[inline]
2888 unsafe fn decode(
2889 &mut self,
2890 decoder: &mut fidl::encoding::Decoder<'_, D>,
2891 offset: usize,
2892 _depth: fidl::encoding::Depth,
2893 ) -> fidl::Result<()> {
2894 decoder.debug_check_bounds::<Self>(offset);
2895 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2897 Ok(())
2898 }
2899 }
2900
2901 impl fidl::encoding::ValueTypeMarker for RateSelectionOffloadExtension {
2902 type Borrowed<'a> = &'a Self;
2903 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2904 value
2905 }
2906 }
2907
2908 unsafe impl fidl::encoding::TypeMarker for RateSelectionOffloadExtension {
2909 type Owned = Self;
2910
2911 #[inline(always)]
2912 fn inline_align(_context: fidl::encoding::Context) -> usize {
2913 1
2914 }
2915
2916 #[inline(always)]
2917 fn inline_size(_context: fidl::encoding::Context) -> usize {
2918 1
2919 }
2920 }
2921
2922 unsafe impl<D: fidl::encoding::ResourceDialect>
2923 fidl::encoding::Encode<RateSelectionOffloadExtension, D>
2924 for &RateSelectionOffloadExtension
2925 {
2926 #[inline]
2927 unsafe fn encode(
2928 self,
2929 encoder: &mut fidl::encoding::Encoder<'_, D>,
2930 offset: usize,
2931 _depth: fidl::encoding::Depth,
2932 ) -> fidl::Result<()> {
2933 encoder.debug_check_bounds::<RateSelectionOffloadExtension>(offset);
2934 fidl::encoding::Encode::<RateSelectionOffloadExtension, D>::encode(
2936 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2937 encoder,
2938 offset,
2939 _depth,
2940 )
2941 }
2942 }
2943 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2944 fidl::encoding::Encode<RateSelectionOffloadExtension, D> for (T0,)
2945 {
2946 #[inline]
2947 unsafe fn encode(
2948 self,
2949 encoder: &mut fidl::encoding::Encoder<'_, D>,
2950 offset: usize,
2951 depth: fidl::encoding::Depth,
2952 ) -> fidl::Result<()> {
2953 encoder.debug_check_bounds::<RateSelectionOffloadExtension>(offset);
2954 self.0.encode(encoder, offset + 0, depth)?;
2958 Ok(())
2959 }
2960 }
2961
2962 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2963 for RateSelectionOffloadExtension
2964 {
2965 #[inline(always)]
2966 fn new_empty() -> Self {
2967 Self { supported: fidl::new_empty!(bool, D) }
2968 }
2969
2970 #[inline]
2971 unsafe fn decode(
2972 &mut self,
2973 decoder: &mut fidl::encoding::Decoder<'_, D>,
2974 offset: usize,
2975 _depth: fidl::encoding::Depth,
2976 ) -> fidl::Result<()> {
2977 decoder.debug_check_bounds::<Self>(offset);
2978 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2980 Ok(())
2981 }
2982 }
2983
2984 impl fidl::encoding::ValueTypeMarker for SaeFeature {
2985 type Borrowed<'a> = &'a Self;
2986 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2987 value
2988 }
2989 }
2990
2991 unsafe impl fidl::encoding::TypeMarker for SaeFeature {
2992 type Owned = Self;
2993
2994 #[inline(always)]
2995 fn inline_align(_context: fidl::encoding::Context) -> usize {
2996 1
2997 }
2998
2999 #[inline(always)]
3000 fn inline_size(_context: fidl::encoding::Context) -> usize {
3001 2
3002 }
3003 }
3004
3005 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SaeFeature, D>
3006 for &SaeFeature
3007 {
3008 #[inline]
3009 unsafe fn encode(
3010 self,
3011 encoder: &mut fidl::encoding::Encoder<'_, D>,
3012 offset: usize,
3013 _depth: fidl::encoding::Depth,
3014 ) -> fidl::Result<()> {
3015 encoder.debug_check_bounds::<SaeFeature>(offset);
3016 fidl::encoding::Encode::<SaeFeature, D>::encode(
3018 (
3019 <bool as fidl::encoding::ValueTypeMarker>::borrow(
3020 &self.driver_handler_supported,
3021 ),
3022 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.sme_handler_supported),
3023 ),
3024 encoder,
3025 offset,
3026 _depth,
3027 )
3028 }
3029 }
3030 unsafe impl<
3031 D: fidl::encoding::ResourceDialect,
3032 T0: fidl::encoding::Encode<bool, D>,
3033 T1: fidl::encoding::Encode<bool, D>,
3034 > fidl::encoding::Encode<SaeFeature, D> for (T0, T1)
3035 {
3036 #[inline]
3037 unsafe fn encode(
3038 self,
3039 encoder: &mut fidl::encoding::Encoder<'_, D>,
3040 offset: usize,
3041 depth: fidl::encoding::Depth,
3042 ) -> fidl::Result<()> {
3043 encoder.debug_check_bounds::<SaeFeature>(offset);
3044 self.0.encode(encoder, offset + 0, depth)?;
3048 self.1.encode(encoder, offset + 1, depth)?;
3049 Ok(())
3050 }
3051 }
3052
3053 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SaeFeature {
3054 #[inline(always)]
3055 fn new_empty() -> Self {
3056 Self {
3057 driver_handler_supported: fidl::new_empty!(bool, D),
3058 sme_handler_supported: fidl::new_empty!(bool, D),
3059 }
3060 }
3061
3062 #[inline]
3063 unsafe fn decode(
3064 &mut self,
3065 decoder: &mut fidl::encoding::Decoder<'_, D>,
3066 offset: usize,
3067 _depth: fidl::encoding::Depth,
3068 ) -> fidl::Result<()> {
3069 decoder.debug_check_bounds::<Self>(offset);
3070 fidl::decode!(
3072 bool,
3073 D,
3074 &mut self.driver_handler_supported,
3075 decoder,
3076 offset + 0,
3077 _depth
3078 )?;
3079 fidl::decode!(bool, D, &mut self.sme_handler_supported, decoder, offset + 1, _depth)?;
3080 Ok(())
3081 }
3082 }
3083
3084 impl fidl::encoding::ValueTypeMarker for ScanOffloadExtension {
3085 type Borrowed<'a> = &'a Self;
3086 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3087 value
3088 }
3089 }
3090
3091 unsafe impl fidl::encoding::TypeMarker for ScanOffloadExtension {
3092 type Owned = Self;
3093
3094 #[inline(always)]
3095 fn inline_align(_context: fidl::encoding::Context) -> usize {
3096 1
3097 }
3098
3099 #[inline(always)]
3100 fn inline_size(_context: fidl::encoding::Context) -> usize {
3101 2
3102 }
3103 }
3104
3105 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanOffloadExtension, D>
3106 for &ScanOffloadExtension
3107 {
3108 #[inline]
3109 unsafe fn encode(
3110 self,
3111 encoder: &mut fidl::encoding::Encoder<'_, D>,
3112 offset: usize,
3113 _depth: fidl::encoding::Depth,
3114 ) -> fidl::Result<()> {
3115 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
3116 fidl::encoding::Encode::<ScanOffloadExtension, D>::encode(
3118 (
3119 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),
3120 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_cancel_supported),
3121 ),
3122 encoder,
3123 offset,
3124 _depth,
3125 )
3126 }
3127 }
3128 unsafe impl<
3129 D: fidl::encoding::ResourceDialect,
3130 T0: fidl::encoding::Encode<bool, D>,
3131 T1: fidl::encoding::Encode<bool, D>,
3132 > fidl::encoding::Encode<ScanOffloadExtension, D> for (T0, T1)
3133 {
3134 #[inline]
3135 unsafe fn encode(
3136 self,
3137 encoder: &mut fidl::encoding::Encoder<'_, D>,
3138 offset: usize,
3139 depth: fidl::encoding::Depth,
3140 ) -> fidl::Result<()> {
3141 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
3142 self.0.encode(encoder, offset + 0, depth)?;
3146 self.1.encode(encoder, offset + 1, depth)?;
3147 Ok(())
3148 }
3149 }
3150
3151 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanOffloadExtension {
3152 #[inline(always)]
3153 fn new_empty() -> Self {
3154 Self {
3155 supported: fidl::new_empty!(bool, D),
3156 scan_cancel_supported: fidl::new_empty!(bool, D),
3157 }
3158 }
3159
3160 #[inline]
3161 unsafe fn decode(
3162 &mut self,
3163 decoder: &mut fidl::encoding::Decoder<'_, D>,
3164 offset: usize,
3165 _depth: fidl::encoding::Depth,
3166 ) -> fidl::Result<()> {
3167 decoder.debug_check_bounds::<Self>(offset);
3168 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
3170 fidl::decode!(bool, D, &mut self.scan_cancel_supported, decoder, offset + 1, _depth)?;
3171 Ok(())
3172 }
3173 }
3174
3175 impl fidl::encoding::ValueTypeMarker for SecuritySupport {
3176 type Borrowed<'a> = &'a Self;
3177 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3178 value
3179 }
3180 }
3181
3182 unsafe impl fidl::encoding::TypeMarker for SecuritySupport {
3183 type Owned = Self;
3184
3185 #[inline(always)]
3186 fn inline_align(_context: fidl::encoding::Context) -> usize {
3187 1
3188 }
3189
3190 #[inline(always)]
3191 fn inline_size(_context: fidl::encoding::Context) -> usize {
3192 3
3193 }
3194 }
3195
3196 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecuritySupport, D>
3197 for &SecuritySupport
3198 {
3199 #[inline]
3200 unsafe fn encode(
3201 self,
3202 encoder: &mut fidl::encoding::Encoder<'_, D>,
3203 offset: usize,
3204 _depth: fidl::encoding::Depth,
3205 ) -> fidl::Result<()> {
3206 encoder.debug_check_bounds::<SecuritySupport>(offset);
3207 fidl::encoding::Encode::<SecuritySupport, D>::encode(
3209 (
3210 <SaeFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.sae),
3211 <MfpFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.mfp),
3212 ),
3213 encoder,
3214 offset,
3215 _depth,
3216 )
3217 }
3218 }
3219 unsafe impl<
3220 D: fidl::encoding::ResourceDialect,
3221 T0: fidl::encoding::Encode<SaeFeature, D>,
3222 T1: fidl::encoding::Encode<MfpFeature, D>,
3223 > fidl::encoding::Encode<SecuritySupport, D> for (T0, T1)
3224 {
3225 #[inline]
3226 unsafe fn encode(
3227 self,
3228 encoder: &mut fidl::encoding::Encoder<'_, D>,
3229 offset: usize,
3230 depth: fidl::encoding::Depth,
3231 ) -> fidl::Result<()> {
3232 encoder.debug_check_bounds::<SecuritySupport>(offset);
3233 self.0.encode(encoder, offset + 0, depth)?;
3237 self.1.encode(encoder, offset + 2, depth)?;
3238 Ok(())
3239 }
3240 }
3241
3242 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecuritySupport {
3243 #[inline(always)]
3244 fn new_empty() -> Self {
3245 Self { sae: fidl::new_empty!(SaeFeature, D), mfp: fidl::new_empty!(MfpFeature, D) }
3246 }
3247
3248 #[inline]
3249 unsafe fn decode(
3250 &mut self,
3251 decoder: &mut fidl::encoding::Decoder<'_, D>,
3252 offset: usize,
3253 _depth: fidl::encoding::Depth,
3254 ) -> fidl::Result<()> {
3255 decoder.debug_check_bounds::<Self>(offset);
3256 fidl::decode!(SaeFeature, D, &mut self.sae, decoder, offset + 0, _depth)?;
3258 fidl::decode!(MfpFeature, D, &mut self.mfp, decoder, offset + 2, _depth)?;
3259 Ok(())
3260 }
3261 }
3262
3263 impl fidl::encoding::ValueTypeMarker for SpectrumManagementSupport {
3264 type Borrowed<'a> = &'a Self;
3265 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3266 value
3267 }
3268 }
3269
3270 unsafe impl fidl::encoding::TypeMarker for SpectrumManagementSupport {
3271 type Owned = Self;
3272
3273 #[inline(always)]
3274 fn inline_align(_context: fidl::encoding::Context) -> usize {
3275 1
3276 }
3277
3278 #[inline(always)]
3279 fn inline_size(_context: fidl::encoding::Context) -> usize {
3280 1
3281 }
3282 }
3283
3284 unsafe impl<D: fidl::encoding::ResourceDialect>
3285 fidl::encoding::Encode<SpectrumManagementSupport, D> for &SpectrumManagementSupport
3286 {
3287 #[inline]
3288 unsafe fn encode(
3289 self,
3290 encoder: &mut fidl::encoding::Encoder<'_, D>,
3291 offset: usize,
3292 _depth: fidl::encoding::Depth,
3293 ) -> fidl::Result<()> {
3294 encoder.debug_check_bounds::<SpectrumManagementSupport>(offset);
3295 fidl::encoding::Encode::<SpectrumManagementSupport, D>::encode(
3297 (<DfsFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.dfs),),
3298 encoder,
3299 offset,
3300 _depth,
3301 )
3302 }
3303 }
3304 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DfsFeature, D>>
3305 fidl::encoding::Encode<SpectrumManagementSupport, D> for (T0,)
3306 {
3307 #[inline]
3308 unsafe fn encode(
3309 self,
3310 encoder: &mut fidl::encoding::Encoder<'_, D>,
3311 offset: usize,
3312 depth: fidl::encoding::Depth,
3313 ) -> fidl::Result<()> {
3314 encoder.debug_check_bounds::<SpectrumManagementSupport>(offset);
3315 self.0.encode(encoder, offset + 0, depth)?;
3319 Ok(())
3320 }
3321 }
3322
3323 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3324 for SpectrumManagementSupport
3325 {
3326 #[inline(always)]
3327 fn new_empty() -> Self {
3328 Self { dfs: fidl::new_empty!(DfsFeature, D) }
3329 }
3330
3331 #[inline]
3332 unsafe fn decode(
3333 &mut self,
3334 decoder: &mut fidl::encoding::Decoder<'_, D>,
3335 offset: usize,
3336 _depth: fidl::encoding::Depth,
3337 ) -> fidl::Result<()> {
3338 decoder.debug_check_bounds::<Self>(offset);
3339 fidl::decode!(DfsFeature, D, &mut self.dfs, decoder, offset + 0, _depth)?;
3341 Ok(())
3342 }
3343 }
3344
3345 impl fidl::encoding::ValueTypeMarker for WlanChannel {
3346 type Borrowed<'a> = &'a Self;
3347 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3348 value
3349 }
3350 }
3351
3352 unsafe impl fidl::encoding::TypeMarker for WlanChannel {
3353 type Owned = Self;
3354
3355 #[inline(always)]
3356 fn inline_align(_context: fidl::encoding::Context) -> usize {
3357 4
3358 }
3359
3360 #[inline(always)]
3361 fn inline_size(_context: fidl::encoding::Context) -> usize {
3362 12
3363 }
3364 }
3365
3366 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanChannel, D>
3367 for &WlanChannel
3368 {
3369 #[inline]
3370 unsafe fn encode(
3371 self,
3372 encoder: &mut fidl::encoding::Encoder<'_, D>,
3373 offset: usize,
3374 _depth: fidl::encoding::Depth,
3375 ) -> fidl::Result<()> {
3376 encoder.debug_check_bounds::<WlanChannel>(offset);
3377 fidl::encoding::Encode::<WlanChannel, D>::encode(
3379 (
3380 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary),
3381 <ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.cbw),
3382 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary80),
3383 ),
3384 encoder,
3385 offset,
3386 _depth,
3387 )
3388 }
3389 }
3390 unsafe impl<
3391 D: fidl::encoding::ResourceDialect,
3392 T0: fidl::encoding::Encode<u8, D>,
3393 T1: fidl::encoding::Encode<ChannelBandwidth, D>,
3394 T2: fidl::encoding::Encode<u8, D>,
3395 > fidl::encoding::Encode<WlanChannel, D> for (T0, T1, T2)
3396 {
3397 #[inline]
3398 unsafe fn encode(
3399 self,
3400 encoder: &mut fidl::encoding::Encoder<'_, D>,
3401 offset: usize,
3402 depth: fidl::encoding::Depth,
3403 ) -> fidl::Result<()> {
3404 encoder.debug_check_bounds::<WlanChannel>(offset);
3405 unsafe {
3408 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3409 (ptr as *mut u32).write_unaligned(0);
3410 }
3411 unsafe {
3412 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3413 (ptr as *mut u32).write_unaligned(0);
3414 }
3415 self.0.encode(encoder, offset + 0, depth)?;
3417 self.1.encode(encoder, offset + 4, depth)?;
3418 self.2.encode(encoder, offset + 8, depth)?;
3419 Ok(())
3420 }
3421 }
3422
3423 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanChannel {
3424 #[inline(always)]
3425 fn new_empty() -> Self {
3426 Self {
3427 primary: fidl::new_empty!(u8, D),
3428 cbw: fidl::new_empty!(ChannelBandwidth, D),
3429 secondary80: fidl::new_empty!(u8, D),
3430 }
3431 }
3432
3433 #[inline]
3434 unsafe fn decode(
3435 &mut self,
3436 decoder: &mut fidl::encoding::Decoder<'_, D>,
3437 offset: usize,
3438 _depth: fidl::encoding::Depth,
3439 ) -> fidl::Result<()> {
3440 decoder.debug_check_bounds::<Self>(offset);
3441 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3443 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3444 let mask = 0xffffff00u32;
3445 let maskedval = padval & mask;
3446 if maskedval != 0 {
3447 return Err(fidl::Error::NonZeroPadding {
3448 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3449 });
3450 }
3451 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3452 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3453 let mask = 0xffffff00u32;
3454 let maskedval = padval & mask;
3455 if maskedval != 0 {
3456 return Err(fidl::Error::NonZeroPadding {
3457 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3458 });
3459 }
3460 fidl::decode!(u8, D, &mut self.primary, decoder, offset + 0, _depth)?;
3461 fidl::decode!(ChannelBandwidth, D, &mut self.cbw, decoder, offset + 4, _depth)?;
3462 fidl::decode!(u8, D, &mut self.secondary80, decoder, offset + 8, _depth)?;
3463 Ok(())
3464 }
3465 }
3466
3467 impl fidl::encoding::ValueTypeMarker for WlanTxResult {
3468 type Borrowed<'a> = &'a Self;
3469 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3470 value
3471 }
3472 }
3473
3474 unsafe impl fidl::encoding::TypeMarker for WlanTxResult {
3475 type Owned = Self;
3476
3477 #[inline(always)]
3478 fn inline_align(_context: fidl::encoding::Context) -> usize {
3479 2
3480 }
3481
3482 #[inline(always)]
3483 fn inline_size(_context: fidl::encoding::Context) -> usize {
3484 40
3485 }
3486 }
3487
3488 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxResult, D>
3489 for &WlanTxResult
3490 {
3491 #[inline]
3492 unsafe fn encode(
3493 self,
3494 encoder: &mut fidl::encoding::Encoder<'_, D>,
3495 offset: usize,
3496 _depth: fidl::encoding::Depth,
3497 ) -> fidl::Result<()> {
3498 encoder.debug_check_bounds::<WlanTxResult>(offset);
3499 fidl::encoding::Encode::<WlanTxResult, D>::encode(
3501 (
3502 <fidl::encoding::Array<WlanTxResultEntry, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result_entry),
3503 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_addr),
3504 <WlanTxResultCode as fidl::encoding::ValueTypeMarker>::borrow(&self.result_code),
3505 ),
3506 encoder, offset, _depth
3507 )
3508 }
3509 }
3510 unsafe impl<
3511 D: fidl::encoding::ResourceDialect,
3512 T0: fidl::encoding::Encode<fidl::encoding::Array<WlanTxResultEntry, 8>, D>,
3513 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
3514 T2: fidl::encoding::Encode<WlanTxResultCode, D>,
3515 > fidl::encoding::Encode<WlanTxResult, D> for (T0, T1, T2)
3516 {
3517 #[inline]
3518 unsafe fn encode(
3519 self,
3520 encoder: &mut fidl::encoding::Encoder<'_, D>,
3521 offset: usize,
3522 depth: fidl::encoding::Depth,
3523 ) -> fidl::Result<()> {
3524 encoder.debug_check_bounds::<WlanTxResult>(offset);
3525 unsafe {
3528 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(38);
3529 (ptr as *mut u16).write_unaligned(0);
3530 }
3531 self.0.encode(encoder, offset + 0, depth)?;
3533 self.1.encode(encoder, offset + 32, depth)?;
3534 self.2.encode(encoder, offset + 38, depth)?;
3535 Ok(())
3536 }
3537 }
3538
3539 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResult {
3540 #[inline(always)]
3541 fn new_empty() -> Self {
3542 Self {
3543 tx_result_entry: fidl::new_empty!(fidl::encoding::Array<WlanTxResultEntry, 8>, D),
3544 peer_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
3545 result_code: fidl::new_empty!(WlanTxResultCode, D),
3546 }
3547 }
3548
3549 #[inline]
3550 unsafe fn decode(
3551 &mut self,
3552 decoder: &mut fidl::encoding::Decoder<'_, D>,
3553 offset: usize,
3554 _depth: fidl::encoding::Depth,
3555 ) -> fidl::Result<()> {
3556 decoder.debug_check_bounds::<Self>(offset);
3557 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(38) };
3559 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3560 let mask = 0xff00u16;
3561 let maskedval = padval & mask;
3562 if maskedval != 0 {
3563 return Err(fidl::Error::NonZeroPadding {
3564 padding_start: offset + 38 + ((mask as u64).trailing_zeros() / 8) as usize,
3565 });
3566 }
3567 fidl::decode!(fidl::encoding::Array<WlanTxResultEntry, 8>, D, &mut self.tx_result_entry, decoder, offset + 0, _depth)?;
3568 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.peer_addr, decoder, offset + 32, _depth)?;
3569 fidl::decode!(
3570 WlanTxResultCode,
3571 D,
3572 &mut self.result_code,
3573 decoder,
3574 offset + 38,
3575 _depth
3576 )?;
3577 Ok(())
3578 }
3579 }
3580
3581 impl fidl::encoding::ValueTypeMarker for WlanTxResultEntry {
3582 type Borrowed<'a> = &'a Self;
3583 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3584 value
3585 }
3586 }
3587
3588 unsafe impl fidl::encoding::TypeMarker for WlanTxResultEntry {
3589 type Owned = Self;
3590
3591 #[inline(always)]
3592 fn inline_align(_context: fidl::encoding::Context) -> usize {
3593 2
3594 }
3595
3596 #[inline(always)]
3597 fn inline_size(_context: fidl::encoding::Context) -> usize {
3598 4
3599 }
3600 }
3601
3602 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxResultEntry, D>
3603 for &WlanTxResultEntry
3604 {
3605 #[inline]
3606 unsafe fn encode(
3607 self,
3608 encoder: &mut fidl::encoding::Encoder<'_, D>,
3609 offset: usize,
3610 _depth: fidl::encoding::Depth,
3611 ) -> fidl::Result<()> {
3612 encoder.debug_check_bounds::<WlanTxResultEntry>(offset);
3613 unsafe {
3614 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3616 (buf_ptr as *mut WlanTxResultEntry)
3617 .write_unaligned((self as *const WlanTxResultEntry).read());
3618 let padding_ptr = buf_ptr.offset(2) as *mut u16;
3621 let padding_mask = 0xff00u16;
3622 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3623 }
3624 Ok(())
3625 }
3626 }
3627 unsafe impl<
3628 D: fidl::encoding::ResourceDialect,
3629 T0: fidl::encoding::Encode<u16, D>,
3630 T1: fidl::encoding::Encode<u8, D>,
3631 > fidl::encoding::Encode<WlanTxResultEntry, D> for (T0, T1)
3632 {
3633 #[inline]
3634 unsafe fn encode(
3635 self,
3636 encoder: &mut fidl::encoding::Encoder<'_, D>,
3637 offset: usize,
3638 depth: fidl::encoding::Depth,
3639 ) -> fidl::Result<()> {
3640 encoder.debug_check_bounds::<WlanTxResultEntry>(offset);
3641 unsafe {
3644 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
3645 (ptr as *mut u16).write_unaligned(0);
3646 }
3647 self.0.encode(encoder, offset + 0, depth)?;
3649 self.1.encode(encoder, offset + 2, depth)?;
3650 Ok(())
3651 }
3652 }
3653
3654 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResultEntry {
3655 #[inline(always)]
3656 fn new_empty() -> Self {
3657 Self { tx_vector_idx: fidl::new_empty!(u16, D), attempts: fidl::new_empty!(u8, D) }
3658 }
3659
3660 #[inline]
3661 unsafe fn decode(
3662 &mut self,
3663 decoder: &mut fidl::encoding::Decoder<'_, D>,
3664 offset: usize,
3665 _depth: fidl::encoding::Depth,
3666 ) -> fidl::Result<()> {
3667 decoder.debug_check_bounds::<Self>(offset);
3668 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3669 let ptr = unsafe { buf_ptr.offset(2) };
3671 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3672 let mask = 0xff00u16;
3673 let maskedval = padval & mask;
3674 if maskedval != 0 {
3675 return Err(fidl::Error::NonZeroPadding {
3676 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
3677 });
3678 }
3679 unsafe {
3681 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3682 }
3683 Ok(())
3684 }
3685 }
3686
3687 impl fidl::encoding::ValueTypeMarker for WlanWmmAccessCategoryParameters {
3688 type Borrowed<'a> = &'a Self;
3689 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3690 value
3691 }
3692 }
3693
3694 unsafe impl fidl::encoding::TypeMarker for WlanWmmAccessCategoryParameters {
3695 type Owned = Self;
3696
3697 #[inline(always)]
3698 fn inline_align(_context: fidl::encoding::Context) -> usize {
3699 2
3700 }
3701
3702 #[inline(always)]
3703 fn inline_size(_context: fidl::encoding::Context) -> usize {
3704 8
3705 }
3706 }
3707
3708 unsafe impl<D: fidl::encoding::ResourceDialect>
3709 fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>
3710 for &WlanWmmAccessCategoryParameters
3711 {
3712 #[inline]
3713 unsafe fn encode(
3714 self,
3715 encoder: &mut fidl::encoding::Encoder<'_, D>,
3716 offset: usize,
3717 _depth: fidl::encoding::Depth,
3718 ) -> fidl::Result<()> {
3719 encoder.debug_check_bounds::<WlanWmmAccessCategoryParameters>(offset);
3720 fidl::encoding::Encode::<WlanWmmAccessCategoryParameters, D>::encode(
3722 (
3723 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_min),
3724 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_max),
3725 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.aifsn),
3726 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.txop_limit),
3727 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.acm),
3728 ),
3729 encoder,
3730 offset,
3731 _depth,
3732 )
3733 }
3734 }
3735 unsafe impl<
3736 D: fidl::encoding::ResourceDialect,
3737 T0: fidl::encoding::Encode<u8, D>,
3738 T1: fidl::encoding::Encode<u8, D>,
3739 T2: fidl::encoding::Encode<u8, D>,
3740 T3: fidl::encoding::Encode<u16, D>,
3741 T4: fidl::encoding::Encode<bool, D>,
3742 > fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D> for (T0, T1, T2, T3, T4)
3743 {
3744 #[inline]
3745 unsafe fn encode(
3746 self,
3747 encoder: &mut fidl::encoding::Encoder<'_, D>,
3748 offset: usize,
3749 depth: fidl::encoding::Depth,
3750 ) -> fidl::Result<()> {
3751 encoder.debug_check_bounds::<WlanWmmAccessCategoryParameters>(offset);
3752 unsafe {
3755 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
3756 (ptr as *mut u16).write_unaligned(0);
3757 }
3758 unsafe {
3759 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(6);
3760 (ptr as *mut u16).write_unaligned(0);
3761 }
3762 self.0.encode(encoder, offset + 0, depth)?;
3764 self.1.encode(encoder, offset + 1, depth)?;
3765 self.2.encode(encoder, offset + 2, depth)?;
3766 self.3.encode(encoder, offset + 4, depth)?;
3767 self.4.encode(encoder, offset + 6, depth)?;
3768 Ok(())
3769 }
3770 }
3771
3772 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3773 for WlanWmmAccessCategoryParameters
3774 {
3775 #[inline(always)]
3776 fn new_empty() -> Self {
3777 Self {
3778 ecw_min: fidl::new_empty!(u8, D),
3779 ecw_max: fidl::new_empty!(u8, D),
3780 aifsn: fidl::new_empty!(u8, D),
3781 txop_limit: fidl::new_empty!(u16, D),
3782 acm: fidl::new_empty!(bool, D),
3783 }
3784 }
3785
3786 #[inline]
3787 unsafe fn decode(
3788 &mut self,
3789 decoder: &mut fidl::encoding::Decoder<'_, D>,
3790 offset: usize,
3791 _depth: fidl::encoding::Depth,
3792 ) -> fidl::Result<()> {
3793 decoder.debug_check_bounds::<Self>(offset);
3794 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(2) };
3796 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3797 let mask = 0xff00u16;
3798 let maskedval = padval & mask;
3799 if maskedval != 0 {
3800 return Err(fidl::Error::NonZeroPadding {
3801 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
3802 });
3803 }
3804 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(6) };
3805 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3806 let mask = 0xff00u16;
3807 let maskedval = padval & mask;
3808 if maskedval != 0 {
3809 return Err(fidl::Error::NonZeroPadding {
3810 padding_start: offset + 6 + ((mask as u64).trailing_zeros() / 8) as usize,
3811 });
3812 }
3813 fidl::decode!(u8, D, &mut self.ecw_min, decoder, offset + 0, _depth)?;
3814 fidl::decode!(u8, D, &mut self.ecw_max, decoder, offset + 1, _depth)?;
3815 fidl::decode!(u8, D, &mut self.aifsn, decoder, offset + 2, _depth)?;
3816 fidl::decode!(u16, D, &mut self.txop_limit, decoder, offset + 4, _depth)?;
3817 fidl::decode!(bool, D, &mut self.acm, decoder, offset + 6, _depth)?;
3818 Ok(())
3819 }
3820 }
3821
3822 impl fidl::encoding::ValueTypeMarker for WlanWmmParameters {
3823 type Borrowed<'a> = &'a Self;
3824 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3825 value
3826 }
3827 }
3828
3829 unsafe impl fidl::encoding::TypeMarker for WlanWmmParameters {
3830 type Owned = Self;
3831
3832 #[inline(always)]
3833 fn inline_align(_context: fidl::encoding::Context) -> usize {
3834 2
3835 }
3836
3837 #[inline(always)]
3838 fn inline_size(_context: fidl::encoding::Context) -> usize {
3839 34
3840 }
3841 }
3842
3843 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanWmmParameters, D>
3844 for &WlanWmmParameters
3845 {
3846 #[inline]
3847 unsafe fn encode(
3848 self,
3849 encoder: &mut fidl::encoding::Encoder<'_, D>,
3850 offset: usize,
3851 _depth: fidl::encoding::Depth,
3852 ) -> fidl::Result<()> {
3853 encoder.debug_check_bounds::<WlanWmmParameters>(offset);
3854 fidl::encoding::Encode::<WlanWmmParameters, D>::encode(
3856 (
3857 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.apsd),
3858 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3859 &self.ac_be_params,
3860 ),
3861 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3862 &self.ac_bk_params,
3863 ),
3864 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3865 &self.ac_vi_params,
3866 ),
3867 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3868 &self.ac_vo_params,
3869 ),
3870 ),
3871 encoder,
3872 offset,
3873 _depth,
3874 )
3875 }
3876 }
3877 unsafe impl<
3878 D: fidl::encoding::ResourceDialect,
3879 T0: fidl::encoding::Encode<bool, D>,
3880 T1: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3881 T2: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3882 T3: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3883 T4: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3884 > fidl::encoding::Encode<WlanWmmParameters, D> for (T0, T1, T2, T3, T4)
3885 {
3886 #[inline]
3887 unsafe fn encode(
3888 self,
3889 encoder: &mut fidl::encoding::Encoder<'_, D>,
3890 offset: usize,
3891 depth: fidl::encoding::Depth,
3892 ) -> fidl::Result<()> {
3893 encoder.debug_check_bounds::<WlanWmmParameters>(offset);
3894 unsafe {
3897 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3898 (ptr as *mut u16).write_unaligned(0);
3899 }
3900 self.0.encode(encoder, offset + 0, depth)?;
3902 self.1.encode(encoder, offset + 2, depth)?;
3903 self.2.encode(encoder, offset + 10, depth)?;
3904 self.3.encode(encoder, offset + 18, depth)?;
3905 self.4.encode(encoder, offset + 26, depth)?;
3906 Ok(())
3907 }
3908 }
3909
3910 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanWmmParameters {
3911 #[inline(always)]
3912 fn new_empty() -> Self {
3913 Self {
3914 apsd: fidl::new_empty!(bool, D),
3915 ac_be_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3916 ac_bk_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3917 ac_vi_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3918 ac_vo_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3919 }
3920 }
3921
3922 #[inline]
3923 unsafe fn decode(
3924 &mut self,
3925 decoder: &mut fidl::encoding::Decoder<'_, D>,
3926 offset: usize,
3927 _depth: fidl::encoding::Depth,
3928 ) -> fidl::Result<()> {
3929 decoder.debug_check_bounds::<Self>(offset);
3930 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3932 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3933 let mask = 0xff00u16;
3934 let maskedval = padval & mask;
3935 if maskedval != 0 {
3936 return Err(fidl::Error::NonZeroPadding {
3937 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3938 });
3939 }
3940 fidl::decode!(bool, D, &mut self.apsd, decoder, offset + 0, _depth)?;
3941 fidl::decode!(
3942 WlanWmmAccessCategoryParameters,
3943 D,
3944 &mut self.ac_be_params,
3945 decoder,
3946 offset + 2,
3947 _depth
3948 )?;
3949 fidl::decode!(
3950 WlanWmmAccessCategoryParameters,
3951 D,
3952 &mut self.ac_bk_params,
3953 decoder,
3954 offset + 10,
3955 _depth
3956 )?;
3957 fidl::decode!(
3958 WlanWmmAccessCategoryParameters,
3959 D,
3960 &mut self.ac_vi_params,
3961 decoder,
3962 offset + 18,
3963 _depth
3964 )?;
3965 fidl::decode!(
3966 WlanWmmAccessCategoryParameters,
3967 D,
3968 &mut self.ac_vo_params,
3969 decoder,
3970 offset + 26,
3971 _depth
3972 )?;
3973 Ok(())
3974 }
3975 }
3976
3977 impl JoinBssRequest {
3978 #[inline(always)]
3979 fn max_ordinal_present(&self) -> u64 {
3980 if let Some(_) = self.beacon_period {
3981 return 4;
3982 }
3983 if let Some(_) = self.remote {
3984 return 3;
3985 }
3986 if let Some(_) = self.bss_type {
3987 return 2;
3988 }
3989 if let Some(_) = self.bssid {
3990 return 1;
3991 }
3992 0
3993 }
3994 }
3995
3996 impl fidl::encoding::ValueTypeMarker for JoinBssRequest {
3997 type Borrowed<'a> = &'a Self;
3998 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3999 value
4000 }
4001 }
4002
4003 unsafe impl fidl::encoding::TypeMarker for JoinBssRequest {
4004 type Owned = Self;
4005
4006 #[inline(always)]
4007 fn inline_align(_context: fidl::encoding::Context) -> usize {
4008 8
4009 }
4010
4011 #[inline(always)]
4012 fn inline_size(_context: fidl::encoding::Context) -> usize {
4013 16
4014 }
4015 }
4016
4017 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JoinBssRequest, D>
4018 for &JoinBssRequest
4019 {
4020 unsafe fn encode(
4021 self,
4022 encoder: &mut fidl::encoding::Encoder<'_, D>,
4023 offset: usize,
4024 mut depth: fidl::encoding::Depth,
4025 ) -> fidl::Result<()> {
4026 encoder.debug_check_bounds::<JoinBssRequest>(offset);
4027 let max_ordinal: u64 = self.max_ordinal_present();
4029 encoder.write_num(max_ordinal, offset);
4030 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4031 if max_ordinal == 0 {
4033 return Ok(());
4034 }
4035 depth.increment()?;
4036 let envelope_size = 8;
4037 let bytes_len = max_ordinal as usize * envelope_size;
4038 #[allow(unused_variables)]
4039 let offset = encoder.out_of_line_offset(bytes_len);
4040 let mut _prev_end_offset: usize = 0;
4041 if 1 > max_ordinal {
4042 return Ok(());
4043 }
4044
4045 let cur_offset: usize = (1 - 1) * envelope_size;
4048
4049 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4051
4052 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4057 self.bssid
4058 .as_ref()
4059 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4060 encoder,
4061 offset + cur_offset,
4062 depth,
4063 )?;
4064
4065 _prev_end_offset = cur_offset + envelope_size;
4066 if 2 > max_ordinal {
4067 return Ok(());
4068 }
4069
4070 let cur_offset: usize = (2 - 1) * envelope_size;
4073
4074 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4076
4077 fidl::encoding::encode_in_envelope_optional::<BssType, D>(
4082 self.bss_type.as_ref().map(<BssType as fidl::encoding::ValueTypeMarker>::borrow),
4083 encoder,
4084 offset + cur_offset,
4085 depth,
4086 )?;
4087
4088 _prev_end_offset = cur_offset + envelope_size;
4089 if 3 > max_ordinal {
4090 return Ok(());
4091 }
4092
4093 let cur_offset: usize = (3 - 1) * envelope_size;
4096
4097 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4099
4100 fidl::encoding::encode_in_envelope_optional::<bool, D>(
4105 self.remote.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4106 encoder,
4107 offset + cur_offset,
4108 depth,
4109 )?;
4110
4111 _prev_end_offset = cur_offset + envelope_size;
4112 if 4 > max_ordinal {
4113 return Ok(());
4114 }
4115
4116 let cur_offset: usize = (4 - 1) * envelope_size;
4119
4120 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4122
4123 fidl::encoding::encode_in_envelope_optional::<u16, D>(
4128 self.beacon_period.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
4129 encoder,
4130 offset + cur_offset,
4131 depth,
4132 )?;
4133
4134 _prev_end_offset = cur_offset + envelope_size;
4135
4136 Ok(())
4137 }
4138 }
4139
4140 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JoinBssRequest {
4141 #[inline(always)]
4142 fn new_empty() -> Self {
4143 Self::default()
4144 }
4145
4146 unsafe fn decode(
4147 &mut self,
4148 decoder: &mut fidl::encoding::Decoder<'_, D>,
4149 offset: usize,
4150 mut depth: fidl::encoding::Depth,
4151 ) -> fidl::Result<()> {
4152 decoder.debug_check_bounds::<Self>(offset);
4153 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4154 None => return Err(fidl::Error::NotNullable),
4155 Some(len) => len,
4156 };
4157 if len == 0 {
4159 return Ok(());
4160 };
4161 depth.increment()?;
4162 let envelope_size = 8;
4163 let bytes_len = len * envelope_size;
4164 let offset = decoder.out_of_line_offset(bytes_len)?;
4165 let mut _next_ordinal_to_read = 0;
4167 let mut next_offset = offset;
4168 let end_offset = offset + bytes_len;
4169 _next_ordinal_to_read += 1;
4170 if next_offset >= end_offset {
4171 return Ok(());
4172 }
4173
4174 while _next_ordinal_to_read < 1 {
4176 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4177 _next_ordinal_to_read += 1;
4178 next_offset += envelope_size;
4179 }
4180
4181 let next_out_of_line = decoder.next_out_of_line();
4182 let handles_before = decoder.remaining_handles();
4183 if let Some((inlined, num_bytes, num_handles)) =
4184 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4185 {
4186 let member_inline_size =
4187 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4188 decoder.context,
4189 );
4190 if inlined != (member_inline_size <= 4) {
4191 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4192 }
4193 let inner_offset;
4194 let mut inner_depth = depth.clone();
4195 if inlined {
4196 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4197 inner_offset = next_offset;
4198 } else {
4199 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4200 inner_depth.increment()?;
4201 }
4202 let val_ref = self
4203 .bssid
4204 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4205 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4206 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4207 {
4208 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4209 }
4210 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4211 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4212 }
4213 }
4214
4215 next_offset += envelope_size;
4216 _next_ordinal_to_read += 1;
4217 if next_offset >= end_offset {
4218 return Ok(());
4219 }
4220
4221 while _next_ordinal_to_read < 2 {
4223 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4224 _next_ordinal_to_read += 1;
4225 next_offset += envelope_size;
4226 }
4227
4228 let next_out_of_line = decoder.next_out_of_line();
4229 let handles_before = decoder.remaining_handles();
4230 if let Some((inlined, num_bytes, num_handles)) =
4231 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4232 {
4233 let member_inline_size =
4234 <BssType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4235 if inlined != (member_inline_size <= 4) {
4236 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4237 }
4238 let inner_offset;
4239 let mut inner_depth = depth.clone();
4240 if inlined {
4241 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4242 inner_offset = next_offset;
4243 } else {
4244 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4245 inner_depth.increment()?;
4246 }
4247 let val_ref = self.bss_type.get_or_insert_with(|| fidl::new_empty!(BssType, D));
4248 fidl::decode!(BssType, D, val_ref, decoder, inner_offset, inner_depth)?;
4249 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4250 {
4251 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4252 }
4253 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4254 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4255 }
4256 }
4257
4258 next_offset += envelope_size;
4259 _next_ordinal_to_read += 1;
4260 if next_offset >= end_offset {
4261 return Ok(());
4262 }
4263
4264 while _next_ordinal_to_read < 3 {
4266 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4267 _next_ordinal_to_read += 1;
4268 next_offset += envelope_size;
4269 }
4270
4271 let next_out_of_line = decoder.next_out_of_line();
4272 let handles_before = decoder.remaining_handles();
4273 if let Some((inlined, num_bytes, num_handles)) =
4274 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4275 {
4276 let member_inline_size =
4277 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4278 if inlined != (member_inline_size <= 4) {
4279 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4280 }
4281 let inner_offset;
4282 let mut inner_depth = depth.clone();
4283 if inlined {
4284 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4285 inner_offset = next_offset;
4286 } else {
4287 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4288 inner_depth.increment()?;
4289 }
4290 let val_ref = self.remote.get_or_insert_with(|| fidl::new_empty!(bool, D));
4291 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4292 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4293 {
4294 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4295 }
4296 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4297 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4298 }
4299 }
4300
4301 next_offset += envelope_size;
4302 _next_ordinal_to_read += 1;
4303 if next_offset >= end_offset {
4304 return Ok(());
4305 }
4306
4307 while _next_ordinal_to_read < 4 {
4309 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4310 _next_ordinal_to_read += 1;
4311 next_offset += envelope_size;
4312 }
4313
4314 let next_out_of_line = decoder.next_out_of_line();
4315 let handles_before = decoder.remaining_handles();
4316 if let Some((inlined, num_bytes, num_handles)) =
4317 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4318 {
4319 let member_inline_size =
4320 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4321 if inlined != (member_inline_size <= 4) {
4322 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4323 }
4324 let inner_offset;
4325 let mut inner_depth = depth.clone();
4326 if inlined {
4327 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4328 inner_offset = next_offset;
4329 } else {
4330 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4331 inner_depth.increment()?;
4332 }
4333 let val_ref = self.beacon_period.get_or_insert_with(|| fidl::new_empty!(u16, D));
4334 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4335 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4336 {
4337 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4338 }
4339 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4340 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4341 }
4342 }
4343
4344 next_offset += envelope_size;
4345
4346 while next_offset < end_offset {
4348 _next_ordinal_to_read += 1;
4349 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4350 next_offset += envelope_size;
4351 }
4352
4353 Ok(())
4354 }
4355 }
4356
4357 impl WlanKeyConfig {
4358 #[inline(always)]
4359 fn max_ordinal_present(&self) -> u64 {
4360 if let Some(_) = self.rsc {
4361 return 8;
4362 }
4363 if let Some(_) = self.key {
4364 return 7;
4365 }
4366 if let Some(_) = self.key_idx {
4367 return 6;
4368 }
4369 if let Some(_) = self.peer_addr {
4370 return 5;
4371 }
4372 if let Some(_) = self.key_type {
4373 return 4;
4374 }
4375 if let Some(_) = self.cipher_type {
4376 return 3;
4377 }
4378 if let Some(_) = self.cipher_oui {
4379 return 2;
4380 }
4381 if let Some(_) = self.protection {
4382 return 1;
4383 }
4384 0
4385 }
4386 }
4387
4388 impl fidl::encoding::ValueTypeMarker for WlanKeyConfig {
4389 type Borrowed<'a> = &'a Self;
4390 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4391 value
4392 }
4393 }
4394
4395 unsafe impl fidl::encoding::TypeMarker for WlanKeyConfig {
4396 type Owned = Self;
4397
4398 #[inline(always)]
4399 fn inline_align(_context: fidl::encoding::Context) -> usize {
4400 8
4401 }
4402
4403 #[inline(always)]
4404 fn inline_size(_context: fidl::encoding::Context) -> usize {
4405 16
4406 }
4407 }
4408
4409 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfig, D>
4410 for &WlanKeyConfig
4411 {
4412 unsafe fn encode(
4413 self,
4414 encoder: &mut fidl::encoding::Encoder<'_, D>,
4415 offset: usize,
4416 mut depth: fidl::encoding::Depth,
4417 ) -> fidl::Result<()> {
4418 encoder.debug_check_bounds::<WlanKeyConfig>(offset);
4419 let max_ordinal: u64 = self.max_ordinal_present();
4421 encoder.write_num(max_ordinal, offset);
4422 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4423 if max_ordinal == 0 {
4425 return Ok(());
4426 }
4427 depth.increment()?;
4428 let envelope_size = 8;
4429 let bytes_len = max_ordinal as usize * envelope_size;
4430 #[allow(unused_variables)]
4431 let offset = encoder.out_of_line_offset(bytes_len);
4432 let mut _prev_end_offset: usize = 0;
4433 if 1 > max_ordinal {
4434 return Ok(());
4435 }
4436
4437 let cur_offset: usize = (1 - 1) * envelope_size;
4440
4441 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4443
4444 fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4449 self.protection
4450 .as_ref()
4451 .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4452 encoder,
4453 offset + cur_offset,
4454 depth,
4455 )?;
4456
4457 _prev_end_offset = cur_offset + envelope_size;
4458 if 2 > max_ordinal {
4459 return Ok(());
4460 }
4461
4462 let cur_offset: usize = (2 - 1) * envelope_size;
4465
4466 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4468
4469 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4474 self.cipher_oui
4475 .as_ref()
4476 .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4477 encoder,
4478 offset + cur_offset,
4479 depth,
4480 )?;
4481
4482 _prev_end_offset = cur_offset + envelope_size;
4483 if 3 > max_ordinal {
4484 return Ok(());
4485 }
4486
4487 let cur_offset: usize = (3 - 1) * envelope_size;
4490
4491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4493
4494 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType, D>(
4499 self.cipher_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType as fidl::encoding::ValueTypeMarker>::borrow),
4500 encoder, offset + cur_offset, depth
4501 )?;
4502
4503 _prev_end_offset = cur_offset + envelope_size;
4504 if 4 > max_ordinal {
4505 return Ok(());
4506 }
4507
4508 let cur_offset: usize = (4 - 1) * envelope_size;
4511
4512 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4514
4515 fidl::encoding::encode_in_envelope_optional::<WlanKeyType, D>(
4520 self.key_type
4521 .as_ref()
4522 .map(<WlanKeyType as fidl::encoding::ValueTypeMarker>::borrow),
4523 encoder,
4524 offset + cur_offset,
4525 depth,
4526 )?;
4527
4528 _prev_end_offset = cur_offset + envelope_size;
4529 if 5 > max_ordinal {
4530 return Ok(());
4531 }
4532
4533 let cur_offset: usize = (5 - 1) * envelope_size;
4536
4537 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4539
4540 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4545 self.peer_addr
4546 .as_ref()
4547 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4548 encoder,
4549 offset + cur_offset,
4550 depth,
4551 )?;
4552
4553 _prev_end_offset = cur_offset + envelope_size;
4554 if 6 > max_ordinal {
4555 return Ok(());
4556 }
4557
4558 let cur_offset: usize = (6 - 1) * envelope_size;
4561
4562 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4564
4565 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4570 self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4571 encoder,
4572 offset + cur_offset,
4573 depth,
4574 )?;
4575
4576 _prev_end_offset = cur_offset + envelope_size;
4577 if 7 > max_ordinal {
4578 return Ok(());
4579 }
4580
4581 let cur_offset: usize = (7 - 1) * envelope_size;
4584
4585 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4587
4588 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4593 self.key.as_ref().map(
4594 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4595 ),
4596 encoder,
4597 offset + cur_offset,
4598 depth,
4599 )?;
4600
4601 _prev_end_offset = cur_offset + envelope_size;
4602 if 8 > max_ordinal {
4603 return Ok(());
4604 }
4605
4606 let cur_offset: usize = (8 - 1) * envelope_size;
4609
4610 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4612
4613 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4618 self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4619 encoder,
4620 offset + cur_offset,
4621 depth,
4622 )?;
4623
4624 _prev_end_offset = cur_offset + envelope_size;
4625
4626 Ok(())
4627 }
4628 }
4629
4630 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfig {
4631 #[inline(always)]
4632 fn new_empty() -> Self {
4633 Self::default()
4634 }
4635
4636 unsafe fn decode(
4637 &mut self,
4638 decoder: &mut fidl::encoding::Decoder<'_, D>,
4639 offset: usize,
4640 mut depth: fidl::encoding::Depth,
4641 ) -> fidl::Result<()> {
4642 decoder.debug_check_bounds::<Self>(offset);
4643 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4644 None => return Err(fidl::Error::NotNullable),
4645 Some(len) => len,
4646 };
4647 if len == 0 {
4649 return Ok(());
4650 };
4651 depth.increment()?;
4652 let envelope_size = 8;
4653 let bytes_len = len * envelope_size;
4654 let offset = decoder.out_of_line_offset(bytes_len)?;
4655 let mut _next_ordinal_to_read = 0;
4657 let mut next_offset = offset;
4658 let end_offset = offset + bytes_len;
4659 _next_ordinal_to_read += 1;
4660 if next_offset >= end_offset {
4661 return Ok(());
4662 }
4663
4664 while _next_ordinal_to_read < 1 {
4666 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4667 _next_ordinal_to_read += 1;
4668 next_offset += envelope_size;
4669 }
4670
4671 let next_out_of_line = decoder.next_out_of_line();
4672 let handles_before = decoder.remaining_handles();
4673 if let Some((inlined, num_bytes, num_handles)) =
4674 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4675 {
4676 let member_inline_size =
4677 <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4678 if inlined != (member_inline_size <= 4) {
4679 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4680 }
4681 let inner_offset;
4682 let mut inner_depth = depth.clone();
4683 if inlined {
4684 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4685 inner_offset = next_offset;
4686 } else {
4687 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4688 inner_depth.increment()?;
4689 }
4690 let val_ref =
4691 self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4692 fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4693 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4694 {
4695 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4696 }
4697 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4698 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4699 }
4700 }
4701
4702 next_offset += envelope_size;
4703 _next_ordinal_to_read += 1;
4704 if next_offset >= end_offset {
4705 return Ok(());
4706 }
4707
4708 while _next_ordinal_to_read < 2 {
4710 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4711 _next_ordinal_to_read += 1;
4712 next_offset += envelope_size;
4713 }
4714
4715 let next_out_of_line = decoder.next_out_of_line();
4716 let handles_before = decoder.remaining_handles();
4717 if let Some((inlined, num_bytes, num_handles)) =
4718 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4719 {
4720 let member_inline_size =
4721 <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
4722 decoder.context,
4723 );
4724 if inlined != (member_inline_size <= 4) {
4725 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4726 }
4727 let inner_offset;
4728 let mut inner_depth = depth.clone();
4729 if inlined {
4730 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4731 inner_offset = next_offset;
4732 } else {
4733 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4734 inner_depth.increment()?;
4735 }
4736 let val_ref = self
4737 .cipher_oui
4738 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
4739 fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
4740 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4741 {
4742 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4743 }
4744 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4745 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4746 }
4747 }
4748
4749 next_offset += envelope_size;
4750 _next_ordinal_to_read += 1;
4751 if next_offset >= end_offset {
4752 return Ok(());
4753 }
4754
4755 while _next_ordinal_to_read < 3 {
4757 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4758 _next_ordinal_to_read += 1;
4759 next_offset += envelope_size;
4760 }
4761
4762 let next_out_of_line = decoder.next_out_of_line();
4763 let handles_before = decoder.remaining_handles();
4764 if let Some((inlined, num_bytes, num_handles)) =
4765 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4766 {
4767 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4768 if inlined != (member_inline_size <= 4) {
4769 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4770 }
4771 let inner_offset;
4772 let mut inner_depth = depth.clone();
4773 if inlined {
4774 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4775 inner_offset = next_offset;
4776 } else {
4777 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4778 inner_depth.increment()?;
4779 }
4780 let val_ref = self.cipher_type.get_or_insert_with(|| {
4781 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType, D)
4782 });
4783 fidl::decode!(
4784 fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType,
4785 D,
4786 val_ref,
4787 decoder,
4788 inner_offset,
4789 inner_depth
4790 )?;
4791 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4792 {
4793 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4794 }
4795 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4796 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4797 }
4798 }
4799
4800 next_offset += envelope_size;
4801 _next_ordinal_to_read += 1;
4802 if next_offset >= end_offset {
4803 return Ok(());
4804 }
4805
4806 while _next_ordinal_to_read < 4 {
4808 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4809 _next_ordinal_to_read += 1;
4810 next_offset += envelope_size;
4811 }
4812
4813 let next_out_of_line = decoder.next_out_of_line();
4814 let handles_before = decoder.remaining_handles();
4815 if let Some((inlined, num_bytes, num_handles)) =
4816 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4817 {
4818 let member_inline_size =
4819 <WlanKeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4820 if inlined != (member_inline_size <= 4) {
4821 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4822 }
4823 let inner_offset;
4824 let mut inner_depth = depth.clone();
4825 if inlined {
4826 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4827 inner_offset = next_offset;
4828 } else {
4829 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4830 inner_depth.increment()?;
4831 }
4832 let val_ref = self.key_type.get_or_insert_with(|| fidl::new_empty!(WlanKeyType, D));
4833 fidl::decode!(WlanKeyType, D, val_ref, decoder, inner_offset, inner_depth)?;
4834 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4835 {
4836 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4837 }
4838 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4839 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4840 }
4841 }
4842
4843 next_offset += envelope_size;
4844 _next_ordinal_to_read += 1;
4845 if next_offset >= end_offset {
4846 return Ok(());
4847 }
4848
4849 while _next_ordinal_to_read < 5 {
4851 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4852 _next_ordinal_to_read += 1;
4853 next_offset += envelope_size;
4854 }
4855
4856 let next_out_of_line = decoder.next_out_of_line();
4857 let handles_before = decoder.remaining_handles();
4858 if let Some((inlined, num_bytes, num_handles)) =
4859 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4860 {
4861 let member_inline_size =
4862 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4863 decoder.context,
4864 );
4865 if inlined != (member_inline_size <= 4) {
4866 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4867 }
4868 let inner_offset;
4869 let mut inner_depth = depth.clone();
4870 if inlined {
4871 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4872 inner_offset = next_offset;
4873 } else {
4874 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4875 inner_depth.increment()?;
4876 }
4877 let val_ref = self
4878 .peer_addr
4879 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4880 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4881 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4882 {
4883 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4884 }
4885 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4886 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4887 }
4888 }
4889
4890 next_offset += envelope_size;
4891 _next_ordinal_to_read += 1;
4892 if next_offset >= end_offset {
4893 return Ok(());
4894 }
4895
4896 while _next_ordinal_to_read < 6 {
4898 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4899 _next_ordinal_to_read += 1;
4900 next_offset += envelope_size;
4901 }
4902
4903 let next_out_of_line = decoder.next_out_of_line();
4904 let handles_before = decoder.remaining_handles();
4905 if let Some((inlined, num_bytes, num_handles)) =
4906 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4907 {
4908 let member_inline_size =
4909 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4910 if inlined != (member_inline_size <= 4) {
4911 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4912 }
4913 let inner_offset;
4914 let mut inner_depth = depth.clone();
4915 if inlined {
4916 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4917 inner_offset = next_offset;
4918 } else {
4919 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4920 inner_depth.increment()?;
4921 }
4922 let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
4923 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4924 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4925 {
4926 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4927 }
4928 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4929 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4930 }
4931 }
4932
4933 next_offset += envelope_size;
4934 _next_ordinal_to_read += 1;
4935 if next_offset >= end_offset {
4936 return Ok(());
4937 }
4938
4939 while _next_ordinal_to_read < 7 {
4941 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4942 _next_ordinal_to_read += 1;
4943 next_offset += envelope_size;
4944 }
4945
4946 let next_out_of_line = decoder.next_out_of_line();
4947 let handles_before = decoder.remaining_handles();
4948 if let Some((inlined, num_bytes, num_handles)) =
4949 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4950 {
4951 let member_inline_size =
4952 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
4953 decoder.context,
4954 );
4955 if inlined != (member_inline_size <= 4) {
4956 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4957 }
4958 let inner_offset;
4959 let mut inner_depth = depth.clone();
4960 if inlined {
4961 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4962 inner_offset = next_offset;
4963 } else {
4964 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4965 inner_depth.increment()?;
4966 }
4967 let val_ref = self
4968 .key
4969 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
4970 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
4971 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4972 {
4973 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4974 }
4975 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4976 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4977 }
4978 }
4979
4980 next_offset += envelope_size;
4981 _next_ordinal_to_read += 1;
4982 if next_offset >= end_offset {
4983 return Ok(());
4984 }
4985
4986 while _next_ordinal_to_read < 8 {
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.rsc.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
5025 while next_offset < end_offset {
5027 _next_ordinal_to_read += 1;
5028 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5029 next_offset += envelope_size;
5030 }
5031
5032 Ok(())
5033 }
5034 }
5035}